From 4b02103b502e42a5459e20161ae5889d46895e76 Mon Sep 17 00:00:00 2001 From: gezhengqiang Date: Wed, 6 Mar 2024 17:56:22 +0800 Subject: [PATCH] fix(client): fix tag set bug --- .../VariableItem/WidgetSchema.tsx | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/web_console_v2/client/src/views/WorkflowTemplates/TemplateConfig/JobComposeDrawer/VariableList/VariableItem/WidgetSchema.tsx b/web_console_v2/client/src/views/WorkflowTemplates/TemplateConfig/JobComposeDrawer/VariableList/VariableItem/WidgetSchema.tsx index c72ad8bf3..73cdebcc5 100644 --- a/web_console_v2/client/src/views/WorkflowTemplates/TemplateConfig/JobComposeDrawer/VariableList/VariableItem/WidgetSchema.tsx +++ b/web_console_v2/client/src/views/WorkflowTemplates/TemplateConfig/JobComposeDrawer/VariableList/VariableItem/WidgetSchema.tsx @@ -403,23 +403,15 @@ const WidgetSchema: FC = ({ form, path, value, isCheck }) => { function onTypeChange(type: VariableValueType) { setValueType(type); - const variables = form.getFieldValue('variables'); - - set(variables, `[${variableIdx[0]}].value_type`, type); - - form.setFieldsValue({ - variables, - }); + const result = { variables: form.getFieldValue('variables') }; + set(result, `[${variableIdx[0]}].value_type`, type); + form.setFieldsValue(result); } function onTagChange(tag: string) { - const variables = form.getFieldValue('variables'); - - set(variables, `[${variableIdx[0]}].tag`, tag); - - form.setFieldsValue({ - variables, - }); + const result = { variables: form.getFieldValue('variables') }; + set(result, `[${variableIdx[0]}].tag`, tag); + form.setFieldsValue(result); } function onComponentChange(val: VariableComponent) {