|
@@ -655,7 +655,7 @@ export default {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
//找到父节点并展开
|
|
|
- const targetData = this.getTargetData(e.IndexCode, this.classifyList);
|
|
|
+ const targetData = this.getTargetData(e.ClassifyId, this.classifyList);
|
|
|
if (targetData) {
|
|
|
//一级节点
|
|
|
const { topParentNodeId, UniqueCode } = targetData;
|
|
@@ -670,11 +670,14 @@ export default {
|
|
|
let width = tree.offsetWidth;
|
|
|
let label_width =
|
|
|
width > 500 ? "auto" : width <= 500 ? 90 : 0.7 * width;
|
|
|
- targetData.NodeWidth = label_width;
|
|
|
- this.select_node = UniqueCode;
|
|
|
- this.$refs.treeRef.setCurrentNode(targetData);
|
|
|
- const node = this.$refs.treeRef.getCurrentNode();
|
|
|
- this.resetNodeStyle(node);
|
|
|
+ // targetData.NodeWidth = label_width;
|
|
|
+ this.select_node = `${e.ClassifyId}_${e.BaseFromSmmIndexId}_${e.IndexCode}`;
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
+ const node = this.$refs.treeRef.getNode(this.select_node);
|
|
|
+ this.resetNodeStyle(node);
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
//this.handleScrollLeftWrap()
|
|
|
});
|
|
@@ -686,11 +689,11 @@ export default {
|
|
|
scrollTop: top - 200,
|
|
|
});
|
|
|
},
|
|
|
- getTargetData(code, arr) {
|
|
|
+ getTargetData(ClassifyId, arr) {
|
|
|
for (const item of arr) {
|
|
|
- if (item.BaseFromSmmIndexCode === code) return item;
|
|
|
+ if (item.ClassifyId === ClassifyId) return item;
|
|
|
if (item.Children && item.Children.length) {
|
|
|
- const _item = this.getTargetData(code, item.Children);
|
|
|
+ const _item = this.getTargetData(ClassifyId, item.Children);
|
|
|
if (_item) return _item;
|
|
|
}
|
|
|
}
|