From bb2d4d18e9670e1444525d7313870d4a334cd445 Mon Sep 17 00:00:00 2001 From: Devosend Date: Thu, 28 Apr 2022 15:53:26 +0800 Subject: [PATCH] [Fix][UI] Hide the version control button in workflow instance (#9825) --- .../projects/workflow/components/dag/index.tsx | 1 + .../workflow/definition/components/use-table.ts | 15 +++++++++------ .../definition/components/version-modal.tsx | 8 ++++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/index.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/index.tsx index 31f98be5d2..7bf4e55451 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/index.tsx +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/index.tsx @@ -328,6 +328,7 @@ export default defineComponent({ /> {!!props.definition && ( { + const createColumns = (variables: any, isInstance: boolean) => { variables.columns = [ { title: '#', @@ -79,12 +79,15 @@ export function useTable( { title: t('project.workflow.create_time'), key: 'operateTime' - }, - { + } + ] as TableColumns + + if (!isInstance) { + variables.columns.push({ title: t('project.workflow.operation'), key: 'operation', className: styles.operation, - render: (_row) => { + render: (_row: any) => { return h(NSpace, null, { default: () => [ h( @@ -154,8 +157,8 @@ export function useTable( ] }) } - } - ] as TableColumns + }) + } } const getTableData = (row: any) => { diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/version-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/version-modal.tsx index 3db070c41b..c1b19d534c 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/version-modal.tsx +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/version-modal.tsx @@ -26,6 +26,10 @@ import styles from '../index.module.scss' import type { IDefinitionData } from '../types' const props = { + isInstance: { + type: Boolean as PropType, + default: false + }, show: { type: Boolean as PropType, default: false @@ -67,13 +71,13 @@ export default defineComponent({ watch( () => props.show, () => { - createColumns(variables) + createColumns(variables, props.isInstance) requestData() } ) watch(useI18n().locale, () => { - createColumns(variables) + createColumns(variables, props.isInstance) }) return {