fix(脑图): 脑图初始化性能优化

This commit is contained in:
baiqi 2024-08-14 15:51:11 +08:00 committed by 刘瑞斌
parent d2be7d6be7
commit 7d78a171fd
4 changed files with 4 additions and 4 deletions

View File

@ -221,7 +221,6 @@
};
importJson.value.treePath = [];
clearSelectedNodes();
window.minder.importJson(importJson.value);
if (props.moduleId !== 'all') {
// ID
nextTick(() => {
@ -580,6 +579,7 @@
}
//
expendNodeAndChildren(node);
node.layout();
} else if (data?.resource?.includes(moduleTag) && data.count > 0 && data.isLoaded !== true) {
//
await initNodeCases(node);

View File

@ -212,7 +212,6 @@
};
importJson.value.treePath = [];
clearSelectedNodes();
window.minder.importJson(importJson.value);
if (props.moduleId !== 'all') {
// ID
nextTick(() => {
@ -603,6 +602,7 @@
}
//
expendNodeAndChildren(node);
node.layout();
} else if (data?.resource?.includes(moduleTag) && data.count > 0 && data.isLoaded !== true) {
//
await initNodeCases(node);
@ -726,6 +726,7 @@
function customBatchExpand(node: MinderJsonNode) {
if (node.data?.resource?.includes(caseTag)) {
expendNodeAndChildren(node);
node.layout();
}
}

View File

@ -287,7 +287,6 @@
};
importJson.value.treePath = [];
clearSelectedNodes();
window.minder.importJson(importJson.value);
if (props.activeModule !== 'all') {
// ID
nextTick(() => {
@ -798,6 +797,7 @@
}
//
expendNodeAndChildren(node);
node.layout();
} else if (data?.resource?.includes(moduleTag) && data.count > 0 && data.isLoaded !== true) {
//
if (data.id !== 'NONE') {

View File

@ -184,7 +184,6 @@ export function expendNodeAndChildren(node: MinderJsonNode) {
if (node.children?.length) {
node.expand();
node.renderTree();
node.layout();
node.children?.forEach((child) => expendNodeAndChildren(child));
}
}