From 198e8be2e861d5cddceffe4382573ed65356c355 Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Thu, 23 Dec 2021 16:15:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E5=88=86=E7=82=B9=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Transaction.vue | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) 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)