|
|
|
@ -425,18 +425,22 @@ export default { |
|
|
|
|
let startId = idArr.shift() |
|
|
|
|
|
|
|
|
|
let findOut = null |
|
|
|
|
let testObj = null |
|
|
|
|
for(let i=0; i<list.length; i++) { |
|
|
|
|
if(list[i].id == startId) { |
|
|
|
|
findOut = this.cxk(idArr, list[i]) |
|
|
|
|
testObj = list[i] |
|
|
|
|
findOut = this.cxk(idArr, list[i], testObj) |
|
|
|
|
// item.operationIData.push(findOut) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log('testObj') |
|
|
|
|
console.log(testObj) |
|
|
|
|
this.operationIData.push(findOut) |
|
|
|
|
for (let a=0;a<this.operationIData.length;a++){ |
|
|
|
|
console.log(a+1) |
|
|
|
|
this.operationIData[a].nub = 'aaa' |
|
|
|
|
} |
|
|
|
|
console.log(this.operationIData) |
|
|
|
|
// for (let a=0;a<this.operationIData.length;a++){ |
|
|
|
|
// console.log(a+1) |
|
|
|
|
// this.operationIData[a].nub = 'aaa' |
|
|
|
|
// } |
|
|
|
|
// console.log(this.operationIData) |
|
|
|
|
// console.log(item.operationIData) |
|
|
|
|
// this.$nextTick(() => { |
|
|
|
|
// 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){ |
|
|
|
|