From 6b9999eac70b7941c4af39f53ce7ac662eb61bff Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Thu, 6 Jan 2022 17:40:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B6=E8=A1=8C=E5=88=A4=E5=88=86=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Transaction.vue | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index 50db958..08e2657 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -64,7 +64,7 @@ header-align="center" show-checkbox ref="tree" - node-key="id" + node-key="operationIds" :props="defaultProps"> @@ -96,7 +96,7 @@ :data="treeData" :props="defaultProps" default-expand-all - node-key="id" + node-key="operationIds" show-checkbox @check-change="(data, checked, indeterminate) => { handleCheckChange(data, checked, indeterminate, scope.row, scope.$index); @@ -481,7 +481,7 @@ export default { isDisabled: false, // 已禁用 isSave: false // 已保存 }; - obj.operationIds = item.id + obj.operationIds = item.operationIds if(item.type == undefined || item.type == ''){ obj.type = null }else{ @@ -536,8 +536,6 @@ export default { isSave: true // 已保存 }; //题目类型(1选择 2判断 3填空 4问答 5指标结果) - console.log(item) - console.log(obj) if (item.type == 1 || item.type == 2) { obj.subjectId = Number(item.emptyOne); obj.value1 = +item.emptyTwo; @@ -583,8 +581,13 @@ export default { }); }, handleCheckChange(data, checked, indeterminate, row, index) { // 处理勾选 + if (checked && data.isNode === 1) { - // this.tableData[index].operationIds = data.id; // 操作id串 + console.log(data) + if (!data.type){ + this.getSubjectData(data.subjectId, index); + } + this.tableData[index].operationIds = data.operationIds; // 操作id串 // row.value1 = ""; // row.value2 = ""; // row.value3 = ""; @@ -638,10 +641,13 @@ export default { item.showCheckbox = true; } if (item.children && item.children.length) { - item.id = `${parentId},${item.id}`; - item.children = this.toTreeId(item.children, item.id); + // item.id = `${parentId},${item.id}`; + item.operationIds = `${parentId},${item.id}`; + + item.children = this.toTreeId(item.children, item.operationIds); } else { - item.id = `${parentId},${item.id}`; + // item.id = `${parentId},${item.id}`; + item.operationIds = `${parentId},${item.id}`; } result.push(item); });