From c9053761bd5df6060736d216169a7c8c1a25e597 Mon Sep 17 00:00:00 2001 From: calvin Date: Tue, 13 Dec 2022 18:15:00 +0800 Subject: [PATCH] [Fix-13160][UI] Ironed out the issue with failing to save the correct settings of dependent tasks. (#13179) --- .../views/projects/task/components/node/format-data.ts | 10 +++++++--- .../src/views/projects/task/components/node/types.ts | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-ui/src/views/projects/task/components/node/format-data.ts b/dolphinscheduler-ui/src/views/projects/task/components/node/format-data.ts index eb8f6ca089..c8aecc2b64 100644 --- a/dolphinscheduler-ui/src/views/projects/task/components/node/format-data.ts +++ b/dolphinscheduler-ui/src/views/projects/task/components/node/format-data.ts @@ -22,7 +22,9 @@ import type { ITaskParams, ISqoopTargetParams, ISqoopSourceParams, - ILocalParam + ILocalParam, + IDependTask, + RelationType } from './types' export function formatParams(data: INodeData): { @@ -625,9 +627,11 @@ export function formatModel(data: ITaskData) { } if (data.taskParams?.dependence) { - params.dependTaskList = data.taskParams?.dependence.dependTaskList || [] - params.relation = data.taskParams?.dependence.relation + const dependence: { relation?: RelationType, dependTaskList?: IDependTask[] } = JSON.parse(JSON.stringify(data.taskParams.dependence)) + params.dependTaskList = dependence.dependTaskList || [] + params.relation = dependence.relation } + if (data.taskParams?.ruleInputParameter) { params.check_type = data.taskParams.ruleInputParameter.check_type params.comparison_execute_sql = diff --git a/dolphinscheduler-ui/src/views/projects/task/components/node/types.ts b/dolphinscheduler-ui/src/views/projects/task/components/node/types.ts index b525d1c60e..8a0057816c 100644 --- a/dolphinscheduler-ui/src/views/projects/task/components/node/types.ts +++ b/dolphinscheduler-ui/src/views/projects/task/components/node/types.ts @@ -33,9 +33,10 @@ export type { export type { IResource, ProgramType, IMainJar } from '@/store/project/types' export type { ITaskState } from '@/common/types' +export type RelationType = 'AND' | 'OR' + type SourceType = 'MYSQL' | 'HDFS' | 'HIVE' type ModelType = 'import' | 'export' -type RelationType = 'AND' | 'OR' type ITaskType = TaskType type IDateType = 'hour' | 'day' | 'week' | 'month'