|
|
|
@ -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<list.length; i++) { |
|
|
|
|
if(list[i].id == startId) { |
|
|
|
|
findOut = this.cxk(idArr, list[i]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
item.operationIName = findOut |
|
|
|
|
console.log(findOut) |
|
|
|
|
// this.$nextTick(() => { |
|
|
|
|
// 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){ |
|
|
|
|
|
|
|
|
|