fix(record-picker): get label from value

This commit is contained in:
chenos 2023-02-22 18:10:40 +08:00
parent a19a18b1f7
commit 4a7b32b5e7
2 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,10 @@ export const getDatePickerLabels = (props): string => {
}; };
export const getLabelFormatValue = (labelUiSchema: ISchema, value: any): string => { export const getLabelFormatValue = (labelUiSchema: ISchema, value: any): string => {
if (Array.isArray(labelUiSchema?.enum) && value) {
const opt: any = labelUiSchema.enum.find((option: any) => option.value === value);
return opt?.label;
}
switch (labelUiSchema?.['x-component']) { switch (labelUiSchema?.['x-component']) {
case 'DatePicker': case 'DatePicker':
return getDatePickerLabels({ ...labelUiSchema?.['x-component-props'], value }); return getDatePickerLabels({ ...labelUiSchema?.['x-component-props'], value });

View File

@ -32,8 +32,9 @@ export default class extends Migration {
const repository = db.getRepository('applicationPlugins'); const repository = db.getRepository('applicationPlugins');
await repository.destroy({ await repository.destroy({
filter: { filter: {
'name.$in': ['math-formula-field', 'excel-formula-field'], name: ['math-formula-field', 'excel-formula-field'],
}, },
transaction,
}); });
}); });
} }