fix(脑图): 修复切换模块和进入节点多选节点的缺陷
This commit is contained in:
parent
279384539d
commit
fcadf129e1
|
@ -105,6 +105,7 @@
|
||||||
import MsMinderEditor from '@/components/pure/ms-minder-editor/minderEditor.vue';
|
import MsMinderEditor from '@/components/pure/ms-minder-editor/minderEditor.vue';
|
||||||
import type { MinderJson, MinderJsonNode, MinderJsonNodeData } from '@/components/pure/ms-minder-editor/props';
|
import type { MinderJson, MinderJsonNode, MinderJsonNodeData } from '@/components/pure/ms-minder-editor/props';
|
||||||
import {
|
import {
|
||||||
|
clearSelectedNodes,
|
||||||
createNode,
|
createNode,
|
||||||
expendNodeAndChildren,
|
expendNodeAndChildren,
|
||||||
handleRenderNode,
|
handleRenderNode,
|
||||||
|
@ -219,6 +220,7 @@
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
importJson.value.treePath = [];
|
importJson.value.treePath = [];
|
||||||
|
clearSelectedNodes();
|
||||||
window.minder.importJson(importJson.value);
|
window.minder.importJson(importJson.value);
|
||||||
if (props.moduleId !== 'all') {
|
if (props.moduleId !== 'all') {
|
||||||
// 携带具体的模块 ID 加载时,进入该模块内
|
// 携带具体的模块 ID 加载时,进入该模块内
|
||||||
|
|
|
@ -77,7 +77,11 @@
|
||||||
import MsButton from '@/components/pure/ms-button/index.vue';
|
import MsButton from '@/components/pure/ms-button/index.vue';
|
||||||
import MsMinderEditor from '@/components/pure/ms-minder-editor/minderEditor.vue';
|
import MsMinderEditor from '@/components/pure/ms-minder-editor/minderEditor.vue';
|
||||||
import type { MinderJson, MinderJsonNode, MinderJsonNodeData } from '@/components/pure/ms-minder-editor/props';
|
import type { MinderJson, MinderJsonNode, MinderJsonNodeData } from '@/components/pure/ms-minder-editor/props';
|
||||||
import { expendNodeAndChildren, setPriorityView } from '@/components/pure/ms-minder-editor/script/tool/utils';
|
import {
|
||||||
|
clearSelectedNodes,
|
||||||
|
expendNodeAndChildren,
|
||||||
|
setPriorityView,
|
||||||
|
} from '@/components/pure/ms-minder-editor/script/tool/utils';
|
||||||
import { MsFileItem } from '@/components/pure/ms-upload/types';
|
import { MsFileItem } from '@/components/pure/ms-upload/types';
|
||||||
import attachment from './attachment.vue';
|
import attachment from './attachment.vue';
|
||||||
import baseInfo from './basInfo.vue';
|
import baseInfo from './basInfo.vue';
|
||||||
|
@ -207,11 +211,7 @@
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
importJson.value.treePath = [];
|
importJson.value.treePath = [];
|
||||||
const currentSelectedNodes: MinderJsonNode[] = window.minder.getSelectedNodes();
|
clearSelectedNodes();
|
||||||
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 加载时,进入该模块内
|
||||||
|
|
|
@ -166,6 +166,7 @@
|
||||||
import MsMinderEditor from '@/components/pure/ms-minder-editor/minderEditor.vue';
|
import MsMinderEditor from '@/components/pure/ms-minder-editor/minderEditor.vue';
|
||||||
import type { MinderJson, MinderJsonNode, MinderJsonNodeData } from '@/components/pure/ms-minder-editor/props';
|
import type { MinderJson, MinderJsonNode, MinderJsonNodeData } from '@/components/pure/ms-minder-editor/props';
|
||||||
import {
|
import {
|
||||||
|
clearSelectedNodes,
|
||||||
createNode,
|
createNode,
|
||||||
expendNodeAndChildren,
|
expendNodeAndChildren,
|
||||||
handleRenderNode,
|
handleRenderNode,
|
||||||
|
@ -284,6 +285,7 @@
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
importJson.value.treePath = [];
|
importJson.value.treePath = [];
|
||||||
|
clearSelectedNodes();
|
||||||
window.minder.importJson(importJson.value);
|
window.minder.importJson(importJson.value);
|
||||||
if (props.activeModule !== 'all') {
|
if (props.activeModule !== 'all') {
|
||||||
// 携带具体的模块 ID 加载时,进入该模块内
|
// 携带具体的模块 ID 加载时,进入该模块内
|
||||||
|
|
|
@ -232,3 +232,11 @@ export function renderSubNodes(parentNode: MinderJsonNode, children?: MinderJson
|
||||||
}) || []
|
}) || []
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清空选中状态
|
||||||
|
export function clearSelectedNodes() {
|
||||||
|
const currentSelectedNodes: MinderJsonNode[] = window.minder.getSelectedNodes();
|
||||||
|
if (currentSelectedNodes && currentSelectedNodes.length > 0) {
|
||||||
|
window.minder.toggleSelect(currentSelectedNodes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue