From 72f45e61e447714d9cf4262c750f5d99197f016e Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Tue, 4 Jan 2022 15:08:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E5=88=86=E7=82=B9=E5=8E=9F=E6=9C=89?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=9D=E7=95=99=E4=B8=8D=E5=8A=A8,?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=96=B0=E5=A2=9E=E5=BE=80=E4=B8=8A=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0,=E5=8F=AF=E9=87=8D=E5=A4=8D=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Transaction.vue | 74 +++++++++------------------------------ 1 file changed, 17 insertions(+), 57 deletions(-) diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index fc16267..68068dc 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -451,53 +451,13 @@ export default { } } } - let tableData = this.tableData - this.tableData = [] this.anewPosttingDatas(list) - for (var j=0;j { // 勾选树节点 - item.operationIds = item.id - if (item.id) { + // item.operationIds = item.id + if (item.operationIds) { this.$nextTick(() => { - this.$refs[`tree-${index}`].setCheckedKeys([item.id]); + this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); }) } }) @@ -506,6 +466,11 @@ export default { anewPosttingDatas(judgmentRuleList){ let length = judgmentRuleList.length; let tempArr = []; + if(this.tableData.length > 0){ + tempArr.push({ruleOperation: 0}); + }else{ + tempArr = [] + } judgmentRuleList.forEach((item, index) => { let obj = { ...item, @@ -513,9 +478,11 @@ export default { isDisabled: false, // 已禁用 isSave: false // 已保存 }; + obj.operationIds = item.id if(item.type == undefined || item.type == ''){ - item.operationIds = item.id - item.type = null + obj.type = null + }else{ + obj.type = item.type } //题目类型(1选择 2判断 3填空 4问答 5指标结果) if (item.type == 1 || item.type == 2) { @@ -549,8 +516,10 @@ export default { tempArr.push({ruleOperation: 0}); } } - this.tableData = tempArr; }); + for(var i=0;i { - // 勾选树节点 - if (item.operationIds) { - operationIds.push(item.operationIds) - } - }); - this.$nextTick(() => { - this.$refs.tree.setCheckedKeys(operationIds); - }) + this.$refs.tree.setCheckedKeys([]); }, addRule() { // 新增规则 this.changeArr.splice(0, this.changeArr.length)