Commit ddc798b2 authored by ibuler's avatar ibuler

[Bugfix] 修复节点搜索的问题

parent dce09d39
...@@ -206,10 +206,11 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -206,10 +206,11 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
if (!children) { if (!children) {
return []; return [];
} }
let all_children = [];
children.forEach((n) => { children.forEach((n) => {
return [...children, ...this.recurseChildren(n)]; all_children = [...children, ...this.recurseChildren(n)];
}); });
return []; return all_children;
} }
filter() { filter() {
...@@ -221,6 +222,9 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -221,6 +222,9 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
const nodes = zTreeObj.transformToArray(zTreeObj.getNodes()); const nodes = zTreeObj.transformToArray(zTreeObj.getNodes());
if (!_keywords) { if (!_keywords) {
zTreeObj.showNodes(nodes); zTreeObj.showNodes(nodes);
zTreeObj.expandAll(false);
const root = zTreeObj.getNodes()[0];
zTreeObj.expandNode(root);
return null; return null;
} }
let shouldShow = []; let shouldShow = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment