diff --git a/src/api/sysDict.js b/src/api/sysDict.js index e4f0f29..08b2f25 100644 --- a/src/api/sysDict.js +++ b/src/api/sysDict.js @@ -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 + }); +} diff --git a/src/api/yj.js b/src/api/yj.js index 9fdebdc..14655a2 100644 --- a/src/api/yj.js +++ b/src/api/yj.js @@ -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 + }) +} diff --git a/src/main.js b/src/main.js index 7661697..a68612d 100644 --- a/src/main.js +++ b/src/main.js @@ -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(); //配置事件总线 diff --git a/src/plugins/utils/dict.js b/src/plugins/utils/dict.js index 4668f7f..67f576b 100644 --- a/src/plugins/utils/dict.js +++ b/src/plugins/utils/dict.js @@ -61,9 +61,9 @@ export function setCascader(id, array, childDeptList = 'childDeptList', fun) { } /** * 当type=1时获取出生日期,type=2时获取性别,type=3时获取年龄 all - * @param {*} IdCard - * @param {*} type - * @returns + * @param {*} IdCard + * @param {*} type + * @returns */ export function IdCard(IdCard, type) { let user = { @@ -117,3 +117,4 @@ export function IdCard(IdCard, type) { } return user } + diff --git a/src/utils/dict.js b/src/utils/dict.js index 3cec759..6830574 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -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(','); } + diff --git a/src/views/backOfficeSystem/JudgmentHome/ResearchHome/index.vue b/src/views/backOfficeSystem/JudgmentHome/ResearchHome/index.vue index 669ead5..c0630c3 100644 --- a/src/views/backOfficeSystem/JudgmentHome/ResearchHome/index.vue +++ b/src/views/backOfficeSystem/JudgmentHome/ResearchHome/index.vue @@ -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('请选择查询条件') } @@ -602,7 +634,7 @@ const tabHeightFn = () => { ::v-deep .el-table .el-table__cell { padding: 0; - + } ::v-deep .el-table th.el-table__cell>.cell {