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

View File

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

View File

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

View File

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