From 5b8e82b8351f7f4809ee2ed0dce8acc7b47596fb Mon Sep 17 00:00:00 2001 From: pengwei Date: Thu, 6 Nov 2025 14:45:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=BB=B4=E6=9D=83=E7=9D=A3=E5=AF=9F?= =?UTF-8?q?=E3=80=81=E5=AE=A1=E8=AE=A1=E7=9B=91=E7=9D=A3=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=97=AE=E9=A2=98=E6=B6=88=E8=B4=B9=EF=BC=88?= =?UTF-8?q?1=E3=80=81=E7=BB=B4=E6=9D=83=E7=9D=A3=E5=8A=9E=EF=BC=9A?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=A1=88=E4=BB=B6=E7=B1=BB=E5=9E=8B=EF=BC=8C?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=97=A0=E9=9C=80=E4=BD=BF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E7=BB=B4=E6=9D=83=E6=A1=88=E4=BB=B6=E3=80=82=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=202=E3=80=81?= =?UTF-8?q?=E7=BB=B4=E6=9D=83=E5=88=97=E8=A1=A8=EF=BC=9A=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=BB=B4=E6=9D=83=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD=E3=80=82?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=203=E3=80=81=E5=B7=A6=E5=8F=B3=E6=8B=89=E5=8A=A8=E7=9A=84?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E8=BD=B4=E5=8A=A0=E5=AE=BD=EF=BC=9B=E5=AE=A1?= =?UTF-8?q?=E8=AE=A1=E7=9B=91=E7=9D=A3=E5=8F=B0=E8=B4=A6-=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6=E4=B8=8E=E9=99=84=E4=BB=B6=E5=8E=8B=E7=BC=A9=E5=8C=85?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E6=97=A0=E6=B3=95=E5=AF=B9=E5=BA=94=E3=80=82?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=204=E3=80=81=E7=A7=BB=E5=8A=A8=E7=9D=A3=E5=AF=9F=EF=BC=9A?= =?UTF-8?q?=E7=9D=A3=E5=AF=9F=E9=97=AE=E9=A2=98=E7=BC=96=E8=BE=91=EF=BC=9A?= =?UTF-8?q?=E6=B6=89=E5=8F=8A=E5=8D=95=E4=BD=8D=E3=80=81=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E5=B1=95=E7=A4=BA=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=97=A0=E6=B3=95=E4=BF=AE=E6=94=B9=E3=80=82?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=205=E3=80=81=E4=BA=BA=E5=91=98=E6=8A=BD=E6=A3=80-=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E6=8A=BD=E6=A3=80=E4=BA=BA=E5=91=98=EF=BC=9A=E8=A1=A5?= =?UTF-8?q?=E5=85=851=E4=BD=8D=E4=BA=BA=E5=91=98=E5=90=8E=E5=8E=9F?= =?UTF-8?q?=E5=90=8D=E5=8D=9520=E4=BA=BA=E5=91=98=E4=B8=8D=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E3=80=82=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=206=E3=80=81=E6=8A=BD=E6=A3=80=E4=BA=BA?= =?UTF-8?q?=E5=91=98=EF=BC=9A=E6=97=A0=E6=B3=95=E5=AF=BC=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=95=B0=E6=8D=AE=E5=BA=93=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E3=80=82=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/rightsComfort/rights.ts | 7 + .../mobileSupervise/police-sampling.vue | 48 ++++- src/views/books/Audit.vue | 6 + src/views/rightsComfort/Rights.vue | 175 ++++++++++++++---- 4 files changed, 190 insertions(+), 46 deletions(-) diff --git a/src/api/rightsComfort/rights.ts b/src/api/rightsComfort/rights.ts index faa850a..eae41a1 100644 --- a/src/api/rightsComfort/rights.ts +++ b/src/api/rightsComfort/rights.ts @@ -9,6 +9,13 @@ export function listRights(query) { } +export function getInfringerData(id){ + return request.get({ + url:`/rights/getInfringerData/${id}` + }) +} + + export function delRights(id){ return request.del({ url:`/rights/${id}` diff --git a/src/components/mobileSupervise/police-sampling.vue b/src/components/mobileSupervise/police-sampling.vue index 03a5687..f1f0f65 100644 --- a/src/components/mobileSupervise/police-sampling.vue +++ b/src/components/mobileSupervise/police-sampling.vue @@ -173,10 +173,7 @@ const query = ref({ departBranch: true }); -watch(() => props.departId, (val) => { - query.value.departId = val; - getList() -}) + const total = ref(0); const ableRef =ref(null) const treeData = catchSotre.getDepartsAll(); @@ -186,7 +183,6 @@ function getList() { loading.value = true listPolice(query.value).then((data) => { polices.value = data.records; - console.log('polices',polices) setCheckFun(data.records) total.value = data.total; loading.value = false @@ -195,11 +191,11 @@ function getList() { const setCheckFun =(row)=>{ - console.log('checkPolices.value',checkPolices.value) row.forEach((s)=>{ let data =checkPolices.value.find(x=> x.empNo === s.empNo ) + if(data){ nextTick(()=>{ ableRef.value.toggleRowSelection(s, true); @@ -212,7 +208,12 @@ const setCheckFun =(row)=>{ const checkPolices = ref([]); const checkPolicesMap =ref([]) function selectionChange(selectionRows) { - + if(checkPolicesMap.value['key-0']){ + //判断data中有无select的数据 + const {intersection, filteredSource} = processIntersection( checkPolicesMap.value['key-0'],selectionRows,'empNo') + checkPolicesMap.value['key-0']=filteredSource; + checkPolicesMap.value['key'+query.value.current] = intersection; + } if( checkPolicesMap.value['key'+query.value.current]){ let data = checkPolicesMap.value['key'+query.value.current]; @@ -227,6 +228,22 @@ function selectionChange(selectionRows) { } +/** + * 获取两个对象数组的交集,并从源数组中剔除交集数据 + * @param {Array} sourceArr 源数组(需要剔除交集的数组) + * @param {Array} targetArr 目标数组 + * @param {String} key 比较的键名(默认'id') + * @returns {Object} { intersection: 交集数组, filteredSource: 剔除后的源数组 } + */ +const processIntersection = (sourceArr, targetArr, key = 'id') => { + //获取交集数据 + const targetKeys = new Set(targetArr.map(item => item[key])); + const intersection = sourceArr.filter(item => targetKeys.has(item[key])); + // 剔除交集数据 + const filteredSource = sourceArr.filter(item => !targetKeys.has(item[key])); + return { intersection, filteredSource }; +} + const getCheckData = (data,selectionRows) =>{ selectionRows.forEach(item => { @@ -263,8 +280,23 @@ function submit() { emit('update:modelValue', checkPolices.value) show.value = false } -watch(()=>props.modelValue,()=>{ +watch(() => props.departId, (val) => { + query.value.departId = val; + getList() +}) +watch(() => show.value, (val) => { + if(val){ + setCheckFun(polices.value) + } +}) +watch(()=>props.modelValue,(val)=>{ checkPolices.value=props.modelValue + if(val){ + checkPolicesMap.value['key-0']=getCheckData(val,props.modelValue); + if(polices.value){ + setCheckFun(polices.value) + } + } },{deep:true,immediate:true}) diff --git a/src/views/books/Audit.vue b/src/views/books/Audit.vue index 5f23db9..3ba63a1 100644 --- a/src/views/books/Audit.vue +++ b/src/views/books/Audit.vue @@ -329,6 +329,12 @@ function reset() { getList(); function handleExport() { + if(query.value.discoveryTime == null){ + delete query.value.discoveryTime; + } + if(query.value.crtTime== null){ + delete query.value.crtTime; + } window.open( `${BASE_PATH}/negative/books/export/audit?` + new URLSearchParams(query.value).toString() diff --git a/src/views/rightsComfort/Rights.vue b/src/views/rightsComfort/Rights.vue index d5e88cc..741aaa7 100644 --- a/src/views/rightsComfort/Rights.vue +++ b/src/views/rightsComfort/Rights.vue @@ -30,10 +30,25 @@ + + + + + + + + + + + + + +
+ 数据导出