From ec22a93db6e0a2fc0e096d7988bd1adb8413af1a Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Mon, 29 Nov 2021 18:42:00 +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 | 73 ++++++++++++++------------------------- 1 file changed, 25 insertions(+), 48 deletions(-) diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index e0c5420..6f11e78 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -369,10 +369,6 @@ export default { token: atob(decodeURI(this.$route.query.token)) }); this.getTreeData(); - if (this.$route.query.lcId) { - this.lcId = this.$route.query.lcId; - this.getInfoData(this.$route.query.lcId); - } if (this.$route.query.systemId) { this.formData.lcJudgmentPoint.systemId = this.$route.query.systemId; } @@ -389,54 +385,31 @@ export default { this.anewPosttingData(judgmentRuleList) this.tableData.forEach(async (item, index) => { // 勾选树节点 - console.log(item.operationIds) if (item.operationIds) { - this.$nextTick(() => { this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); - let currentNode = this.$refs[`tree-${index}`].getNode([item]); - let parentLevel - let nodeCount = 1//当前树展开节点的数量 - let nodeIndex = 1//当前选中节点在当前树的位置 - let dataIndex; //后台返回当前选中节点的父节点是当前的第几位 - for ( let i=0; i0){ + let children = this.treeData[i].children + for (var j=0;j0) { + let childrens = children[i].children } } - currentNodeOrgCode = currentNode.children.operationIds } - while ( parentLevel>0)//包含一级节点,因为一级节点有多个,如果是一级节点有一个,那这个判断就是while ( 1!=parentLevel) - let dom = document.querySelector("#divTree") - let dom1 = document.querySelector("#depTree") - //一个节点的高度是26px,这个值能否从对象中获取,等我把这个功能做好再考虑吧 - let nodeHight =26 - dom1.style.height = (nodeCount * nodeHight) + "px" - let contHeight=(nodeIndex * nodeHight)+topHeight-300//总高度,盒子高度的一半 - dom.scrollTo(0, contHeight) } + // let currentNode = this.$refs[`tree-${index}`].getNode([item]); + // while ( parentLevel>0)//包含一级节点,因为一级节点有多个,如果是一级节点有一个,那这个判断就是while ( 1!=parentLevel) + // let dom = document.querySelector("#divTree") + // let dom1 = document.querySelector("#depTree") + // //一个节点的高度是26px,这个值能否从对象中获取,等我把这个功能做好再考虑吧 + // let nodeHight =26 + // dom1.style.height = (nodeCount * nodeHight) + "px" + // let contHeight=(nodeIndex * nodeHight)+topHeight-300//总高度,盒子高度的一半 + // dom.scrollTo(0, contHeight) // this.scrollToDepTree(item.operationIds) - }); + }) } // 根据题目id,获取题目信息 if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { @@ -514,6 +487,7 @@ export default { handleCheckChange(data, checked, indeterminate, row, index) { // 处理勾选 if (checked && data.isNode === 1) { this.tableData[index].operationIds = data.id; // 操作id串 + // for () row.value1 = ""; row.value2 = ""; row.value3 = ""; @@ -527,16 +501,19 @@ export default { row.type = ""; this.currentNodeData = {}; this.$refs[`tree-${index}`].setCheckedNodes([data]); - } } }, getTreeData() { // 获取树结构数据 this.$get(this.api.getLcRecord).then(res => { - if (res.status === 200 && res.list) { - if (res.list.length) { + console.log(res) + if (res.status == 200 && res.list.length>0) { + if (res.list.length>0) { this.treeData = this.toTreeId(res.list, res.list[0].parentId); - // console.log(this.treeData) + if (this.$route.query.lcId) { + this.lcId = this.$route.query.lcId; + this.getInfoData(this.$route.query.lcId); + } } } else { this.$message.warning(res.message);