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); } } };