fix(data-vi): number becomes string after precision transformation (#4092)

This commit is contained in:
YANG QIA 2024-04-18 20:07:26 +08:00 committed by GitHub
parent 78ea107edb
commit 2d9ed8d1ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 4 deletions

View File

@ -20,7 +20,6 @@ export const useFieldSelectProps = (fields: FieldOption[]) =>
if (!value) { if (!value) {
typeField.setState({ typeField.setState({
value: null, value: null,
disabled: true,
}); });
} }
const fieldProps = selectedFields.find((field) => field.value === value); const fieldProps = selectedFields.find((field) => field.value === value);
@ -41,13 +40,11 @@ export const useFieldSelectProps = (fields: FieldOption[]) =>
if (supports.includes(key)) { if (supports.includes(key)) {
typeField.setState({ typeField.setState({
value: key, value: key,
disabled: true,
}); });
return; return;
} }
typeField.setState({ typeField.setState({
value: null, value: null,
disabled: false,
}); });
}, },
}; };

View File

@ -160,7 +160,7 @@ const transformers: {
{ label: '1.000', value: 3 }, { label: '1.000', value: 3 },
], ],
}, },
fn: (val: number, precision: number) => val.toFixed(precision), fn: (val: number, precision: number) => Number(val.toFixed(precision)),
}, },
Separator: { Separator: {
schema: { schema: {