Skip to content

Commit 9d7a383

Browse files
authored
fix: The dropdown data of subsequent nodes in the form cannot be displayed back (#3131)
1 parent 8f7d917 commit 9d7a383

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

ui/src/workflow/nodes/form-node/index.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@ class FormNode extends AppNode {
77
get_node_field_list() {
88
const result = []
99
const fields = this.props.model.properties?.config?.fields || []
10-
let otherFields = []
10+
1111
try {
12-
otherFields = this.props.model.properties.node_data.form_field_list.map((item: any) => ({
13-
label: typeof item.label == 'string' ? item.label : item.label.label,
14-
value: item.field
15-
}))
12+
this.props.model.properties.node_data.form_field_list.forEach((item: any) => {
13+
if (!fields.some((f: any) => f.value === item.field)) {
14+
fields.push({
15+
value: item.field,
16+
label: typeof item.label == 'string' ? item.label : item.label.label
17+
})
18+
}
19+
})
1620
} catch (e) {}
1721
result.push({
1822
value: this.props.model.id,
1923
label: this.props.model.properties.stepName,
2024
type: this.props.model.type,
21-
children: [...fields, ...otherFields]
25+
children: fields
2226
})
2327
return result
2428
}

0 commit comments

Comments
 (0)