From 8440baa5e836d35dcebd22ef20b8d24c5e811d9e Mon Sep 17 00:00:00 2001 From: labbomb <739955946@qq.com> Date: Tue, 12 Apr 2022 17:41:46 +0800 Subject: [PATCH] [Bug][UI Next]Fix global variable validation condition for save button in workflow definition. (#9454) --- .../workflow/components/dag/dag-save-modal.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx index d96379b336..94b9280075 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx @@ -114,16 +114,19 @@ export default defineComponent({ globalParams: { validator() { const props = new Set() + + const keys = formValue.value.globalParams.map(item => item.key) + const keysSet = new Set(keys) + if (keysSet.size !== keys.length) { + return new Error(t('project.dag.prop_repeat')) + } + for (const param of formValue.value.globalParams) { const prop = param.value if (!prop) { return new Error(t('project.dag.prop_empty')) } - if (props.has(prop)) { - return new Error(t('project.dag.prop_repeat')) - } - props.add(prop) } }