fix(data-vi): transform values of multiple selection fields to labels (#4398)

This commit is contained in:
YANG QIA 2024-05-19 15:23:42 +08:00 committed by GitHub
parent 0626b8301d
commit afa9f3faa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,6 +90,9 @@ export const processData = (selectedFields: FieldOption[], data: any[], scope: a
if (!options || !Array.isArray(options)) {
return value;
}
if (Array.isArray(value)) {
return value.map((v) => parseEnum(field, v));
}
const option = options.find((option) => option.value === value);
return Schema.compile(option?.label || value, scope);
};
@ -104,6 +107,7 @@ export const processData = (selectedFields: FieldOption[], data: any[], scope: a
switch (field.interface) {
case 'select':
case 'radioGroup':
case 'multipleSelect':
processed[key] = parseEnum(field, value);
break;
default: