diff --git a/dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-context-menu.tsx b/dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-context-menu.tsx index 1621af578388..6e0bcd0b5d71 100644 --- a/dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-context-menu.tsx +++ b/dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-context-menu.tsx @@ -39,6 +39,10 @@ const props = { type: Boolean as PropType, default: false }, + copyDisplay: { + type: Boolean as PropType, + default: false + }, taskInstance: { type: Object as PropType, require: true @@ -195,26 +199,22 @@ export default defineComponent({ )} {this.menuDisplay && ( - <> - - {t('project.node.edit')} - - - {t('project.node.copy')} - - - {t('project.node.delete')} - - + + {t('project.node.edit')} + + )} + {this.copyDisplay && ( + + {t('project.node.copy')} + + )} + {this.menuDisplay && ( + + {t('project.node.delete')} + )} {this.taskInstance && ( <> diff --git a/dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx b/dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx index 54511d9ff614..95926c0ff292 100644 --- a/dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx +++ b/dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx @@ -155,6 +155,12 @@ export default defineComponent({ } }) + const copyDisplay = computed( + () => + menuDisplay.value || + (route.name === 'workflow-definition-create' && !props.readonly) + ) + const taskInstance = computed(() => { if (nodeVariables.menuCell) { const taskCode = Number(nodeVariables.menuCell!.id) @@ -401,6 +407,7 @@ export default defineComponent({ startDisplay={startDisplay.value} executeTaskDisplay={executeTaskDisplay.value} menuDisplay={menuDisplay.value} + copyDisplay={copyDisplay.value} taskInstance={taskInstance.value} cell={nodeVariables.menuCell as Cell} visible={nodeVariables.menuVisible}