diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index 118d474..07b58c6 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -425,18 +425,22 @@ export default { let startId = idArr.shift() let findOut = null + let testObj = null for(let i=0; i { // this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); @@ -454,14 +458,17 @@ export default { // console.log(err); }); }, - cxk(arr, obj) { + cxk(arr, obj, needObj) { if(arr.length === 0) { return obj } + // console.log('arr') + // console.log(arr) this.operationIData.push(obj) let findIt = arr.shift() let tmp = obj.children.find(item => item.id == findIt) - return this.cxk(arr, tmp) + needObj.children = obj.children.filter(item => item.id == findIt) + return this.cxk(arr, tmp, needObj.children[0]) }, //计算此节点的距离思路1.计算出当前节点据顶部的高度+当前节点在树的位置的高度-盒子高度的一半 scrollToDepTree(deptCode){