fix(脑图): 脑图初始化性能优化
This commit is contained in:
parent
d2be7d6be7
commit
7d78a171fd
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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') {
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue