fix: The dropdown data of subsequent nodes in the form cannot be displayed back (#3131)
Some checks failed
sync2gitee / repo-sync (push) Has been cancelled
Typos Check / Spell Check with Typos (push) Has been cancelled

This commit is contained in:
shaohuzhang1 2025-05-22 14:36:10 +08:00 committed by GitHub
parent 8f7d91798b
commit 9d7a383348
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}