This commit is contained in:
lcw
2025-12-27 22:09:13 +08:00
parent 3fb06e3847
commit 953cb9943d
6 changed files with 107 additions and 15 deletions

View File

@ -1,5 +1,6 @@
import request from "@/utils/request";
const api = "/mosty-api/mosty-base";
const fzapi = "/mosty-api/mosty-gsxt";
/*
* 登录
* return promise 实例对象
@ -154,3 +155,11 @@ export const deleteSysDictItem = (data) => {
data
});
};
// 方正字典
export const fzdict = (params) => {
return request({
url: fzapi + "/xsaj/dict/selectList",
method: "GET",
params
});
}

View File

@ -217,4 +217,17 @@ export const sjzlQryp = (id) => {
method: "get",
})
}
export const xsajSelectPage = (params) => {
return request({
url: api + `/asj/xsaj/selectPage`,
method: "get",
params
})
}
export const xsajDictSelectList = (params) => {
return request({
url: api + ``,
method: "get",
params
})
}

View File

@ -52,13 +52,14 @@ import installFilter from "@/filters";
import mitt from "mitt";
import { resetForm } from "@/utils/validate";
import { getDict, setCascader } from '@/utils/dict';
import { getDict, setCascader, getFzDict } from '@/utils/dict';
import axios from "axios";
// import fzui from 'fzui-fengqun-vue'
//挂载全局方法
app.config.globalProperties.resetForm = resetForm;
app.config.globalProperties.$dict = getDict; //字典公共函数
app.config.globalProperties.$fzdict = getFzDict; //字典公共函数
app.config.globalProperties.$message = ELMessage; //element提示组件
app.config.globalProperties.$set = setCascader; //设置级联选择器回显
app.config.globalProperties.mittBus = new mitt(); //配置事件总线

View File

@ -117,3 +117,4 @@ export function IdCard(IdCard, type) {
}
return user
}

View File

@ -1,5 +1,5 @@
import { ref, toRefs, isRef } from 'vue';
import { getSysDictByCode } from '@/api/sysDict' //引入封装数字字典接口
import { getSysDictByCode, fzdict } from '@/api/sysDict' //引入封装数字字典接口
import { getLocalDic } from "@/utils/localDic/index.js"
/**
@ -24,11 +24,11 @@ export function getDict(...args) {
return (() => {
args.forEach((d, index) => {
res.value[d] = [];
// 本地字典拦截,如果本地字典存在,则使用本地字典,否则使用远程字典
if (isLocalDict(d) && getLocalDic(d)) {
res.value[d] = getLocalDic(d)
} else {
getSysDictByCode({
dictCode: d
}).then(result => {
@ -53,7 +53,42 @@ export function getDict(...args) {
return toRefs(res.value);
})()
}
export function getFzDict(...args) {
const res = ref({});
return (() => {
args.forEach((d, index) => {
res.value[d] = [];
// 本地字典拦截,如果本地字典存在,则使用本地字典,否则使用远程字典
if (isLocalDict(d) && getLocalDic(d)) {
res.value[d] = getLocalDic(d);
} else {
fzdict({
dictLabel: d
}).then(result => {
result = result || {};
// result.itemList = Array.isArray(result.itemList) ? result.itemList : [];
// result.itemList.forEach(p => {
// p.label = p.itemName;
// p.value = p.itemValue;
// p.id = p.itemValue;
// p.elTagType = p.dictType;
// if (p?.itemList && p.itemList?.length > 0) {
// getChildren(p);
// }
// p.children = p.itemList;
// });
// console.log(res.value);
res.value[d] = result
});
}
});
// 使用toRefs确保返回的是响应式对象
return toRefs(res.value);
})()
}
export function getChildren(item) {
item.label = item.zdmc
item.value = item.dm
@ -177,3 +212,4 @@ export function getMultiDictVal(values, dict) {
}).join(',');
}

View File

@ -104,11 +104,12 @@ import LineEcharts from "@/views/home/echarts/moreLineEcharts.vue";
import MyTable from "@/components/aboutTable/DarkTable.vue";
import Pages from "@/components/aboutTable/Pages.vue";
import { useRoute, useRouter } from 'vue-router';
import {tbJqGetPageList } from '@/api/yj.js'
import {tbJqGetPageList,xsajSelectPage } from '@/api/yj.js'
const router = useRouter();
import { nextTick, onMounted, reactive, getCurrentInstance, ref, watch } from 'vue';
const { proxy } = getCurrentInstance();
const { JQLB } = proxy.$dict("JQLB"); //获取字典数据
const {GA_D_XSAJXALBDM} = proxy.$fzdict("GA_D_XSAJXALBDM"); //获取字典数据
const readonly_lx = ref(false)
const readonly_ry = ref(false)
const readonly_dd = ref(false)
@ -195,10 +196,11 @@ const list = reactive([
pageSize: 6,
},
tableColumn: [
{ label: "案件编号", prop: "ajbh", showOverflowTooltip: true },
{ label: "案件内容", prop: "ajnr", showOverflowTooltip: true },
{ label: "案件类型", prop: "ajlx", showOverflowTooltip: true },
{ label: "案件时间", prop: "ajsj", showOverflowTooltip: true },
{ label: "案件编号", prop: "asjbh", showOverflowTooltip: true },
{ label: "案件标题", prop: "ajmc", showOverflowTooltip: true },
{ label: "简要案情", prop: "jyaq", showOverflowTooltip: true },
{ label: "案件类型", prop: "ajxlbDmbcms", showOverflowTooltip: true },
{ label: "案件时间", prop: "asjfssjAsjfskssj", showOverflowTooltip: true },
],
},
{
@ -243,11 +245,20 @@ watch(() => JQLB.value, (val) => {
deep: true, immediate: true
})
onMounted(() => {
// getCount(); //获取统计数据
tabHeightFn()
getJqList() //警情列表
getAjList()//案件列表
});
// 获取字典
const getxsajDictSelectList = () => {
xsajDictSelectList().then(res => {
console.log(res);
})
}
const getCount = () => {
// 获取处置状态统计
qcckPost({}, '/mosty-gsxt/qbcj/getXscjTjByXslx').then(res => {
@ -275,12 +286,13 @@ const changeNo = (e, type) => {
break;
case '案件':
list[2].pageConfiger.page = e;
getAjList()
break;
case '风险隐患':
list[3].pageConfiger.page = e;
break;
}
getJqList()
// getJqList()
}
const changeSize = (e, type) => {
switch (type) {
@ -293,6 +305,7 @@ const changeSize = (e, type) => {
break;
case '案件':
list[2].pageConfiger.pageSize = e;
getAjList()
break;
case '风险隐患':
list[3].pageConfiger.pageSize = e;
@ -316,6 +329,26 @@ const getJqList = () => {
obj.data_hstj.list = [{ label: '总数', val: [0, res.total, 0, 0] }];
})
}
const getAjList = () => {
let params = {
pageCurrent: list[2].pageConfiger.page,
pageSize: list[2].pageConfiger.pageSize,
}
console.log("执行");
xsajSelectPage(params).then(res => {
list[2].tableList = res.records || [];
list[2].pageConfiger.total = res.total;
// //模拟的统计警情接口
// obj.data_lxtj.list = [{ label: '总数', val: [0, res.total, 0, 0] }];
// obj.data_hstj.list = [{ label: '总数', val: [0, res.total, 0, 0] }];
})
}
// xsajSelectPage(promes).then(res => {
// list[2].tableList = res.records || [];
// list[2].pageConfiger.total = res.total;
// })
@ -420,7 +453,6 @@ const onSearch = () => {
})
} else {
ElMessage.warning('请选择查询条件')
}