fix(脑图): 未规划节点不允许剪切、删除、复制、粘贴
This commit is contained in:
parent
5fe953a8d7
commit
550a8fe96e
|
@ -16,6 +16,7 @@
|
|||
:can-show-enter-node="canShowEnterNode"
|
||||
:insert-sibling-menus="insertSiblingMenus"
|
||||
:insert-son-menus="insertSonMenus"
|
||||
:can-show-more-menu-node-operation="canShowMoreMenuNodeOperation()"
|
||||
:can-show-paste-menu="!stopPaste()"
|
||||
:can-show-more-menu="canShowMoreMenu()"
|
||||
:can-show-priority-menu="canShowPriorityMenu()"
|
||||
|
@ -147,6 +148,7 @@
|
|||
handleContentChange,
|
||||
replaceableTags,
|
||||
priorityDisableCheck,
|
||||
canShowMoreMenuNodeOperation,
|
||||
} = useMinderBaseApi({ hasEditPermission });
|
||||
const importJson = ref<MinderJson>({
|
||||
root: {} as MinderJsonNode,
|
||||
|
|
|
@ -640,6 +640,24 @@ export default function useMinderBaseApi({ hasEditPermission }: { hasEditPermiss
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可展示更多菜单节点操作(复制、剪切、粘贴、删除)
|
||||
*/
|
||||
function canShowMoreMenuNodeOperation() {
|
||||
if (window.minder) {
|
||||
const node: MinderJsonNode = window.minder.getSelectedNode();
|
||||
if (node?.data?.id === 'NONE') {
|
||||
// 虚拟根节点不展示节点操作
|
||||
return false;
|
||||
}
|
||||
if (node?.data?.resource?.includes(moduleTag) && node?.data?.id === 'root') {
|
||||
// 根模块节点不展示节点操作
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 脑图命令执行前拦截
|
||||
* @param event 命令执行事件
|
||||
|
@ -732,5 +750,6 @@ export default function useMinderBaseApi({ hasEditPermission }: { hasEditPermiss
|
|||
handleContentChange,
|
||||
replaceableTags,
|
||||
priorityDisableCheck,
|
||||
canShowMoreMenuNodeOperation,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue