From a575427774a2d4c60e55f6318b1132081c375375 Mon Sep 17 00:00:00 2001 From: JiangSheng Date: Mon, 10 Nov 2025 17:20:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B7=A5=E5=86=B5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/treeCaseTable/loadCaseTable.vue | 52 ++++++------------- 1 file changed, 17 insertions(+), 35 deletions(-) diff --git a/src/components/common/treeCaseTable/loadCaseTable.vue b/src/components/common/treeCaseTable/loadCaseTable.vue index 9236836..af7c831 100644 --- a/src/components/common/treeCaseTable/loadCaseTable.vue +++ b/src/components/common/treeCaseTable/loadCaseTable.vue @@ -11,9 +11,9 @@ > @@ -535,42 +535,24 @@ const editTableRowFun = (row: any) => { displayModalFun(row.nodeType, 'edit', row); }; const checkboxChangeFun = () => { - // const checkRowData = loadcaseTableRef.value?.getCheckboxRecordsFun(true) || []; - // canAddChildFun(checkRowData, NODE_TYPE.CATEGORY); - // canAddChildFun(checkRowData, NODE_TYPE.TASK); - // canAddChildFun(checkRowData, NODE_TYPE.PERFORMANCE); + const checkRowData = loadcaseTableRef.value?.getCheckboxRecordsFun(true) || []; + canAddChildFun(checkRowData, NODE_TYPE.CATEGORY); + canAddChildFun(checkRowData, NODE_TYPE.TASK); + canAddChildFun(checkRowData, NODE_TYPE.PERFORMANCE); }; -// const canAddChildFun = (checkRowData: any, nodeType: string) => { -// if (!nodeType) { -// return true; -// } -// let canAdd = true; -// if (checkRowData.length === 0) { -// canAdd = canAddChild({ nodeType: NODE_TYPE.ROOT }, nodeType); -// } else if (checkRowData.length === 1) { -// canAdd = canAddChild(checkRowData[0], nodeType); -// } else { -// canAdd = false; -// } -// addNodeDisabled.value[nodeType] = !canAdd; -// }; -const canAddChildFun = (nodeType?: string) => { - // return false; +const canAddChildFun = (checkRowData: any, nodeType: string) => { if (!nodeType) { return true; } - // const canAdd = true; - // const checkRowData = getVxeRef()?.getCheckboxRecords(true); - // const checkRowData = getVxeRef()?.getCheckboxRecords(true) || []; - // if (checkRowData.length === 0) { - // canAdd = canAddChild({ nodeType: NODE_TYPE.ROOT }, nodeType); - // } else if (checkRowData.length === 1) { - // canAdd = canAddChild(checkRowData[0], nodeType); - // } else { - // canAdd = false; - // } - // return !canAdd; - + let canAdd = true; + if (checkRowData.length === 0) { + canAdd = canAddChild({ nodeType: NODE_TYPE.ROOT }, nodeType); + } else if (checkRowData.length === 1) { + canAdd = canAddChild(checkRowData[0], nodeType); + } else { + canAdd = false; + } + addNodeDisabled.value[nodeType] = !canAdd; }; defineExpose({