From 005ce8856bb568600baee8c4e7aeb903d041dc86 Mon Sep 17 00:00:00 2001 From: zhujiyan <17812234322@163.com> Date: Thu, 4 Jul 2024 18:15:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=AD=9B=E9=80=89=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/govern/device/planData/index.vue | 26 +++++----------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/views/govern/device/planData/index.vue b/src/views/govern/device/planData/index.vue index 39520e6..56787bc 100644 --- a/src/views/govern/device/planData/index.vue +++ b/src/views/govern/device/planData/index.vue @@ -693,32 +693,16 @@ const initSearchFormIndexAndCount = (list: any) => { watch( () => searchForm.value.index, (val: any, oldval: any) => { - // countData.value = [] if (val) { initSearchFormIndexAndCount(val) if (val == 0) { countData.value = [] } - } - }, - { - deep: true, - immediate: true - } -) -watch( - () => countData.value, - (val: any, oldval: any) => { - if (val) { - if (val.length != searchForm.value.index.length) { - val.map((item: any, index: any) => { - searchForm.value.index.map((vv: any) => { - if (item.index != vv) { - val.splice(index, 1) - } - }) - }) - } + countData.value.map((item:any,key:any)=>{ + if(val.findIndex((vv:any)=>{return vv==item.index})==-1){ + countData.value.splice(key,1) + } + }) } }, {