From 50386d622c68c3984e77c9243ce945cec0df27fd Mon Sep 17 00:00:00 2001 From: calvin Date: Wed, 19 Jul 2023 18:46:46 +0800 Subject: [PATCH] worked out the issue (#14588) --- .../preference/components/use-alert-group.ts | 3 +-- .../projects/preference/components/use-tenant.ts | 3 +-- .../node/fields/use-environment-name.ts | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dolphinscheduler-ui/src/views/projects/preference/components/use-alert-group.ts b/dolphinscheduler-ui/src/views/projects/preference/components/use-alert-group.ts index cbe469dbf0..323c3374f4 100644 --- a/dolphinscheduler-ui/src/views/projects/preference/components/use-alert-group.ts +++ b/dolphinscheduler-ui/src/views/projects/preference/components/use-alert-group.ts @@ -42,7 +42,6 @@ export function useAlertGroup(): IJsonItem { field: 'alertGroups', span: 12, name: t('project.workflow.alarm_group'), - options: options, - value: 'default' + options: options } } diff --git a/dolphinscheduler-ui/src/views/projects/preference/components/use-tenant.ts b/dolphinscheduler-ui/src/views/projects/preference/components/use-tenant.ts index 1bc2fac997..01f6b3b9a8 100644 --- a/dolphinscheduler-ui/src/views/projects/preference/components/use-tenant.ts +++ b/dolphinscheduler-ui/src/views/projects/preference/components/use-tenant.ts @@ -42,7 +42,6 @@ export function useTenant(): IJsonItem { field: 'tenant', span: 12, name: t('project.workflow.tenant_code'), - options: options, - value: 'default' + options: options } } diff --git a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-environment-name.ts b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-environment-name.ts index 36795b2e0e..22326fed9d 100644 --- a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-environment-name.ts +++ b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-environment-name.ts @@ -68,8 +68,20 @@ export function useEnvironmentName( options.value = environmentList.filter((option: IEnvironmentNameOption) => filterByWorkerGroup(option) ) - model.environmentCode = - options.value.length === 0 ? null : options.value[0].value + if (model?.environmentCode) { + if (options.value) { + let elementExists = + options.value.find( + (item) => item.value === model.environmentCode + ) !== undefined + if (!elementExists) { + model.environmentCode = null + } + } + } else { + model.environmentCode = + options.value.length === 0 ? null : options.value[0].value + } } )