diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index 009c705..8d35ca3 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -62,7 +62,9 @@ :data="treeData" @check="currentChecked" header-align="center" - show-checkbox node-key="id" + show-checkbox + ref="tree" + node-key="id" :props="defaultProps"> @@ -479,10 +481,12 @@ export default { isDisabled: false, // 已禁用 isSave: false // 已保存 }; - if(item.type == undefined){ + if(item.type == undefined || item.type == ''){ item.operationIds = item.id item.type = null } + console.log(item.operationIds) + console.log(item.type) //题目类型(1选择 2判断 3填空 4问答 5指标结果) if (item.type == 1 || item.type == 2) { obj.subjectId = Number(item.emptyOne); @@ -747,7 +751,19 @@ export default { } }, addRules(){ - this.configVisible = true + this.configVisible = true; + + console.log(this.formData.lcJudgmentRuleList) + let operationIds = [] + this.tableData.forEach(async (item, index) => { + // 勾选树节点 + if (item.operationIds) { + operationIds.push(item.operationIds) + } + }); + this.$nextTick(() => { + this.$refs.tree.setCheckedKeys(operationIds); + }) }, addRule() { // 新增规则 this.changeArr.splice(0, this.changeArr.length)