|
|
@ -31,7 +31,11 @@ import Modal from '@/components/modal' |
|
|
|
import Detail from './detail' |
|
|
|
import Detail from './detail' |
|
|
|
import { formatModel } from './format-data' |
|
|
|
import { formatModel } from './format-data' |
|
|
|
import type { ITaskData, ITaskType } from './types' |
|
|
|
import type { ITaskData, ITaskType } from './types' |
|
|
|
import { HistoryOutlined, ProfileOutlined } from '@vicons/antd' |
|
|
|
import { |
|
|
|
|
|
|
|
HistoryOutlined, |
|
|
|
|
|
|
|
ProfileOutlined, |
|
|
|
|
|
|
|
QuestionCircleTwotone |
|
|
|
|
|
|
|
} from '@vicons/antd' |
|
|
|
import { NIcon } from 'naive-ui' |
|
|
|
import { NIcon } from 'naive-ui' |
|
|
|
import { Router, useRouter } from 'vue-router' |
|
|
|
import { Router, useRouter } from 'vue-router' |
|
|
|
import { IWorkflowTaskInstance } from '@/views/projects/workflow/components/dag/types' |
|
|
|
import { IWorkflowTaskInstance } from '@/views/projects/workflow/components/dag/types' |
|
|
@ -70,7 +74,7 @@ const NodeDetailModal = defineComponent({ |
|
|
|
props, |
|
|
|
props, |
|
|
|
emits: ['cancel', 'submit', 'viewLog'], |
|
|
|
emits: ['cancel', 'submit', 'viewLog'], |
|
|
|
setup(props, { emit }) { |
|
|
|
setup(props, { emit }) { |
|
|
|
const { t } = useI18n() |
|
|
|
const { t, locale } = useI18n() |
|
|
|
const router: Router = useRouter() |
|
|
|
const router: Router = useRouter() |
|
|
|
const renderIcon = (icon: any) => { |
|
|
|
const renderIcon = (icon: any) => { |
|
|
|
return () => h(NIcon, null, { default: () => h(icon) }) |
|
|
|
return () => h(NIcon, null, { default: () => h(icon) }) |
|
|
@ -93,11 +97,28 @@ const NodeDetailModal = defineComponent({ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const initHeaderLinks = (processInstance: any) => { |
|
|
|
const initHeaderLinks = ( |
|
|
|
|
|
|
|
processInstance: any, |
|
|
|
|
|
|
|
taskType: ITaskType | undefined |
|
|
|
|
|
|
|
) => { |
|
|
|
headerLinks.value = [ |
|
|
|
headerLinks.value = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
text: t('project.node.instructions'), |
|
|
|
|
|
|
|
show: taskType ? true : false, |
|
|
|
|
|
|
|
action: () => { |
|
|
|
|
|
|
|
const helpUrl = |
|
|
|
|
|
|
|
'https://dolphinscheduler.apache.org/' + |
|
|
|
|
|
|
|
locale.value.toLowerCase().replace('_', '-') + |
|
|
|
|
|
|
|
'/docs/latest/user_doc/guide/task/' + |
|
|
|
|
|
|
|
taskType?.toLowerCase() + |
|
|
|
|
|
|
|
'.html' |
|
|
|
|
|
|
|
window.open(helpUrl) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
icon: renderIcon(QuestionCircleTwotone) |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
text: t('project.node.view_history'), |
|
|
|
text: t('project.node.view_history'), |
|
|
|
show: true, |
|
|
|
show: props.taskInstance ? true : false, |
|
|
|
action: () => { |
|
|
|
action: () => { |
|
|
|
router.push({ |
|
|
|
router.push({ |
|
|
|
name: 'task-instance', |
|
|
|
name: 'task-instance', |
|
|
@ -135,9 +156,8 @@ const NodeDetailModal = defineComponent({ |
|
|
|
() => [props.show, props.data], |
|
|
|
() => [props.show, props.data], |
|
|
|
async () => { |
|
|
|
async () => { |
|
|
|
if (!props.show) return |
|
|
|
if (!props.show) return |
|
|
|
if (props.processInstance) { |
|
|
|
|
|
|
|
initHeaderLinks(props.processInstance) |
|
|
|
initHeaderLinks(props.processInstance, props.data.taskType) |
|
|
|
} |
|
|
|
|
|
|
|
await nextTick() |
|
|
|
await nextTick() |
|
|
|
detailRef.value.value.setValues(formatModel(props.data)) |
|
|
|
detailRef.value.value.setValues(formatModel(props.data)) |
|
|
|
} |
|
|
|
} |
|
|
|