|
|
@ -233,20 +233,21 @@ export default { |
|
|
|
return { |
|
|
|
label: category.cnName, |
|
|
|
cnName: category.cnName, |
|
|
|
code: category.code, |
|
|
|
id: category.id, |
|
|
|
arrangeType: category.arrangeType, |
|
|
|
isType: category.isType, |
|
|
|
fondsId: item.fondsId, |
|
|
|
fondName: item.fondName, |
|
|
|
fondsNo: item.fondsNo, |
|
|
|
children: this.transformChildren(category.children, item.fondsId, item.fondName, item.fondsNo) |
|
|
|
children: this.transformChildren(category.children, category.code, item.fondsId, item.fondName, item.fondsNo) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 递归函数,用于处理数据的子节点 |
|
|
|
transformChildren(children, fondsId, fondName, fondsNo) { |
|
|
|
transformChildren(children, code, fondsId, fondName, fondsNo) { |
|
|
|
return children.map(child => { |
|
|
|
return { |
|
|
|
label: child.cnName, |
|
|
@ -254,7 +255,7 @@ export default { |
|
|
|
id: child.id, |
|
|
|
isType: child.isType, |
|
|
|
pid: child.pid, |
|
|
|
code: child.code, |
|
|
|
code: child.code || code, |
|
|
|
arrangeType: child.arrangeType, |
|
|
|
fondsId: fondsId, |
|
|
|
fondName: fondName, |
|
|
@ -305,6 +306,7 @@ export default { |
|
|
|
if (currentKey && currentKey.id) { |
|
|
|
this.$nextTick(() => { |
|
|
|
// 选中节点的门类详情 |
|
|
|
console.log('444') |
|
|
|
this.handleNodeClick(currentKey) |
|
|
|
}) |
|
|
|
} |
|
|
@ -316,10 +318,17 @@ export default { |
|
|
|
return node.isType !== 1 |
|
|
|
}) |
|
|
|
this.expandAllChildren(this.$refs.categroyTree.getNode(this.crud.data[0]), currentKey) |
|
|
|
console.log('currentKey', currentKey) |
|
|
|
} else { |
|
|
|
currentKey = this.crud.data[0] |
|
|
|
this.expandAllChildren(this.$refs.categroyTree.getNode(this.crud.data[0]), currentKey) |
|
|
|
} |
|
|
|
|
|
|
|
if (currentKey && currentKey.id) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.handleNodeClick(currentKey) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleNodeClick(val) { |
|
|
|
localStorage.removeItem('savePrevFromData') |
|
|
|