From 934dd5840184db0228bd2a9bc9f00ea9c8099ac7 Mon Sep 17 00:00:00 2001 From: liushilong <2224574157@qq.com> Date: Wed, 27 Mar 2024 16:32:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=A8=E9=80=89=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/final/comp/CustomTabelModal.vue | 64 ++++++++++++++++--- src/views/final/comp/RepeatTaskTableModal.vue | 2 +- .../aside/comp/modals/CustomFilterModal.vue | 4 +- 3 files changed, 57 insertions(+), 13 deletions(-) diff --git a/src/views/final/comp/CustomTabelModal.vue b/src/views/final/comp/CustomTabelModal.vue index 4cbbcdc..a52c9f9 100644 --- a/src/views/final/comp/CustomTabelModal.vue +++ b/src/views/final/comp/CustomTabelModal.vue @@ -198,13 +198,27 @@ const selectIds = ref([]); function onCheckAllChange(value) { const ids: string[] = []; - for (const item of offList.value) { if (!item.fix) { item.checked = value; ids.push(item.id); } } + if (value) { + offList.value.map((v) => { + if (!v.checked) { + onList.value.push(v); + } + }); + } else { + onList.value = []; + fixLeftList.value = []; + offList.value.map((v) => { + if (v.fix) { + fixLeftList.value.push(v); + } + }); + } selectIds.value = value ? ids : []; } @@ -310,6 +324,20 @@ function removeHandler(id: string, type: "fix" | "unfix") { fixLeftList.value[index].checked = false; } } + +const indeterminate = computed(() => { + let baseNum = 0; + offList.value.map((v) => { + if (v.fix) { + baseNum += 1; + } + }); + return ( + onList.value.length + fixLeftList.value.length - baseNum > 0 && + offList.value.length - baseNum > + onList.value.length + fixLeftList.value.length - baseNum + ); +});
-
+
@@ -380,7 +409,7 @@ function removeHandler(id: string, type: "fix" | "unfix") { :bordered="false" >
@@ -402,7 +431,7 @@ function removeHandler(id: string, type: "fix" | "unfix") { :class="{ fix: item.fix }" class="cursor-move draggable-item" > - + {{ item.name }} - + {{ item.name }}