fix(脑图): 切换模块和进入节点多选节点问题修复

This commit is contained in:
baiqi 2024-08-02 13:40:27 +08:00 committed by 刘瑞斌
parent a3a0064b2f
commit f76a8cbd7a
2 changed files with 10 additions and 0 deletions

View File

@ -207,6 +207,11 @@
}, },
}; };
importJson.value.treePath = []; importJson.value.treePath = [];
const currentSelectedNodes: MinderJsonNode[] = window.minder.getSelectedNodes();
if (currentSelectedNodes && currentSelectedNodes.length > 0) {
//
window.minder.toggleSelect(currentSelectedNodes);
}
window.minder.importJson(importJson.value); window.minder.importJson(importJson.value);
if (props.moduleId !== 'all') { if (props.moduleId !== 'all') {
// ID // ID

View File

@ -177,6 +177,11 @@
*/ */
async function switchNode(node?: MinderJsonNode | MinderJsonNodeData, index?: number) { async function switchNode(node?: MinderJsonNode | MinderJsonNodeData, index?: number) {
if (!props.minderKey || index === currentTreePath.value.length - 1) return; if (!props.minderKey || index === currentTreePath.value.length - 1) return;
const currentSelectedNodes: MinderJsonNode[] = window.minder.getSelectedNodes();
if (currentSelectedNodes && currentSelectedNodes.length > 0) {
//
window.minder.toggleSelect(currentSelectedNodes);
}
if (minderStore.minderUnsaved) { if (minderStore.minderUnsaved) {
// //
replaceNodeInTree( replaceNodeInTree(