From 3ba47a3a2cd69df2d846b61c2eb6e75ed7743c94 Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Wed, 26 Jan 2022 10:17:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Transaction.vue | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index bdd3ed5..676d303 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -416,9 +416,23 @@ export default { this.tableData.forEach(async (item, index) => { // 勾选树节点 if (item.operationIds) { - this.$nextTick(() => { - this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); - }) + let list = this.treeData + let idstr = item.operationIds + let idArr = idstr.split(',') + idArr.shift() + let startId = idArr.shift() + + let findOut = null + for(let i=0; i { + // this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); + // }) } // 根据题目id,获取题目信息 if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { @@ -432,6 +446,17 @@ export default { // console.log(err); }); }, + cxk(arr, obj) { + if(arr.length === 0) { + return obj + } + let nameArr = [] + nameArr.push(obj) + console.log(nameArr) + let findIt = arr.shift() + let tmp = obj.children.find(item => item.id == findIt) + return this.cxk(arr, tmp) + }, //计算此节点的距离思路1.计算出当前节点据顶部的高度+当前节点在树的位置的高度-盒子高度的一半 scrollToDepTree(deptCode){