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)