From 94a6398b28176c78052a9b8aa299f8e17e04b97f Mon Sep 17 00:00:00 2001 From: liushilong <2224574157@qq.com> Date: Thu, 28 Mar 2024 15:08:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=80=90=E4=BB=BB=E5=8A=A1=E5=AE=A1?= =?UTF-8?q?=E6=89=B9--=E8=87=AA=E5=AE=9A=E4=B9=89=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E3=80=91=E7=82=B9=E5=87=BB=E5=85=A8=E9=80=89?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E5=85=A8=E9=83=A8=E6=95=B0=E6=8D=AE=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=8F=96=E6=B6=88=E5=88=97=E8=A1=A8=E4=BB=BB=E6=84=8F?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=95=B0=E6=8D=AE=E5=8B=BE=E9=80=89=EF=BC=8C?= =?UTF-8?q?=E6=AD=A4=E6=97=B6=E4=B8=8A=E9=9D=A2=E5=85=A8=E9=80=89=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E7=8A=B6=E6=80=81=E6=9C=AA=E5=88=87=E6=8D=A2=E4=B8=BA?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81=E4=BB=8D?= =?UTF-8?q?=E4=B8=BA=E5=85=A8=E9=83=A8=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/final/comp/CustomFilterModalVue.vue | 5 ++- src/views/task/aside/ListItem.vue | 2 -- src/views/task/content/Content.vue | 3 -- src/views/task/modal/CustomFieldModal.vue | 36 ++++++++++++------- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/views/final/comp/CustomFilterModalVue.vue b/src/views/final/comp/CustomFilterModalVue.vue index 5728f0e..4164c8e 100644 --- a/src/views/final/comp/CustomFilterModalVue.vue +++ b/src/views/final/comp/CustomFilterModalVue.vue @@ -137,13 +137,16 @@ function onCheckAllChange(value) { } selectIds.value = value ? ids : []; + + } function onCheckChange(checked: any, item: any) { const index = selectIds.value.indexOf(item.id); item.checked = checked; - + let currentIndex = offList.value.findIndex(v=>v.id == item.id) + offList.value[currentIndex].checked = item.checked; if (index === -1 && checked) selectIds.value.push(item.id); else selectIds.value.splice(index, 1); } diff --git a/src/views/task/aside/ListItem.vue b/src/views/task/aside/ListItem.vue index 9c6184f..e4c2bc1 100644 --- a/src/views/task/aside/ListItem.vue +++ b/src/views/task/aside/ListItem.vue @@ -18,8 +18,6 @@ const props = defineProps({ default: () => [], }, }) -console.log(props.showFieldList) -console.log(props.listItem) const svgName = computed(() => { return props.selected ? 'task-select' : 'task' }) diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index 5901360..0f1f006 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -288,9 +288,6 @@ watch( async (newValue, oldValue) => { const packageid = taskStore.getPackageid const taskId = taskStore.getActiveId - console.log(packageid) - console.log(taskId) - if (isEmpty(taskId)) return taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid) diff --git a/src/views/task/modal/CustomFieldModal.vue b/src/views/task/modal/CustomFieldModal.vue index a6f0996..3fa4ca0 100644 --- a/src/views/task/modal/CustomFieldModal.vue +++ b/src/views/task/modal/CustomFieldModal.vue @@ -94,7 +94,15 @@ function generateDefaultList() { } const show = ref(false); -const checkAll = ref(false); +const checkAll = computed(()=>{ + let baseNum = 0; + offList.value.map((v) => { + if (v.fix) { + baseNum += 1; + } + }); + return onList.value.length == offList.value.length-baseNum +}); function showModal() { show.value = true; @@ -140,7 +148,6 @@ function onCheckAllChange(value) { for (const item of offShowList.value) { if (!item.fix) { item.checked = value; - ids.push(item.id); } } selectIds.value = value ? ids : []; @@ -150,7 +157,7 @@ function onCheckAllChange(value) { onList.value.push(v); } }); - onShowList.value = cloneDeep(onList.value) + onShowList.value = cloneDeep(onList.value); } else { onList.value = []; onShowList.value = []; @@ -159,12 +166,14 @@ function onCheckAllChange(value) { function onCheckChange(checked: any, item: any) { const index = selectIds.value.indexOf(item.id); - item.checked = checked; - let currentIndex = offList.value.findIndex(v=>v.id == item.id) - offList.value[currentIndex].checked = item.checked; - if (index === -1 && checked) selectIds.value.push(item.id); - else selectIds.value.splice(index, 1); + let currentIndex = offList.value.findIndex((v) => v.id == item.id); + offList.value[currentIndex].checked = checked; + if (index === -1 && checked) { + selectIds.value.push(item.id); + } else { + selectIds.value.splice(index, 1); + } } const showIds = computed(() => { @@ -207,6 +216,7 @@ watch( index--; } } + console.log(onShowList.value, list, "onShowList"); } } ); @@ -245,7 +255,7 @@ function removeHandler(id: string) { index = offList.value.findIndex((v) => v.id == id); offList.value[index].checked = false; - offShowList.value = cloneDeep(offList.value) + offShowList.value = cloneDeep(offList.value); } const getData = async (type = "") => { const userStore = useUser(); @@ -314,7 +324,7 @@ const indeterminate = computed(() => { baseNum += 1; } }); - return onList.value.length > 0 && offList.value.length - baseNum > onList.value.length; + return onShowList.value.length > 0 && offShowList.value.length - baseNum > onShowList.value.length; }); const queryData = (value, type) => { if (value) { @@ -326,11 +336,11 @@ const queryData = (value, type) => { } } else { // getData(type); - if(type == "off") { + if (type == "off") { offShowList.value = cloneDeep(offList.value); - }else{ + } else { onShowList.value = cloneDeep(onList.value); - fixShowList.value = cloneDeep(fixList.value) + fixShowList.value = cloneDeep(fixList.value); } } };