From 704077d0662ac7dfef1fde37335f7f093d0fdf63 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:35:36 +0800 Subject: [PATCH] fix: Workflow application node parameter saving cannot be reflected back (#3019) --- .../workflow/nodes/application-node/index.vue | 65 +++++++++---------- 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/ui/src/workflow/nodes/application-node/index.vue b/ui/src/workflow/nodes/application-node/index.vue index e700826f4..4fc9fba54 100644 --- a/ui/src/workflow/nodes/application-node/index.vue +++ b/ui/src/workflow/nodes/application-node/index.vue @@ -238,49 +238,42 @@ const update_field = () => { const new_user_input_field_list = cloneDeep( ok.data.work_flow.nodes[0].properties.user_input_field_list ) - const merge_api_input_field_list = - new_api_input_field_list || - [].map((item: any) => { - const find_field = old_api_input_field_list.find( - (old_item: any) => old_item.variable == item.variable - ) - if (find_field) { - return { - ...item, - value: find_field.value, - label: - typeof item.label === 'object' && item.label != null - ? item.label.label - : item.label - } - } else { - return item + + const merge_api_input_field_list = (new_api_input_field_list || []).map((item: any) => { + const find_field = old_api_input_field_list.find( + (old_item: any) => old_item.variable == item.variable + ) + if (find_field) { + return { + ...item, + value: find_field.value, + label: + typeof item.label === 'object' && item.label != null ? item.label.label : item.label } - }) + } else { + return item + } + }) set( props.nodeModel.properties.node_data, 'api_input_field_list', merge_api_input_field_list ) - const merge_user_input_field_list = - new_user_input_field_list || - [].map((item: any) => { - const find_field = old_user_input_field_list.find( - (old_item: any) => old_item.field == item.field - ) - if (find_field) { - return { - ...item, - value: find_field.value, - label: - typeof item.label === 'object' && item.label != null - ? item.label.label - : item.label - } - } else { - return item + const merge_user_input_field_list = (new_user_input_field_list || []).map((item: any) => { + const find_field = old_user_input_field_list.find( + (old_item: any) => old_item.field == item.field + ) + if (find_field) { + return { + ...item, + value: find_field.value, + label: + typeof item.label === 'object' && item.label != null ? item.label.label : item.label } - }) + } else { + return item + } + }) set( props.nodeModel.properties.node_data, 'user_input_field_list',