From 9d7a3833483ebe1a1b1bec767ae7f09d55b51244 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Thu, 22 May 2025 14:36:10 +0800 Subject: [PATCH] fix: The dropdown data of subsequent nodes in the form cannot be displayed back (#3131) --- ui/src/workflow/nodes/form-node/index.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ui/src/workflow/nodes/form-node/index.ts b/ui/src/workflow/nodes/form-node/index.ts index bc0da59aa..6be4ee98d 100644 --- a/ui/src/workflow/nodes/form-node/index.ts +++ b/ui/src/workflow/nodes/form-node/index.ts @@ -7,18 +7,22 @@ class FormNode extends AppNode { get_node_field_list() { const result = [] const fields = this.props.model.properties?.config?.fields || [] - let otherFields = [] + try { - otherFields = this.props.model.properties.node_data.form_field_list.map((item: any) => ({ - label: typeof item.label == 'string' ? item.label : item.label.label, - value: item.field - })) + this.props.model.properties.node_data.form_field_list.forEach((item: any) => { + if (!fields.some((f: any) => f.value === item.field)) { + fields.push({ + value: item.field, + label: typeof item.label == 'string' ? item.label : item.label.label + }) + } + }) } catch (e) {} result.push({ value: this.props.model.id, label: this.props.model.properties.stepName, type: this.props.model.type, - children: [...fields, ...otherFields] + children: fields }) return result }