fix(form): daterange默认值

This commit is contained in:
roymondchen 2026-01-07 18:33:13 +08:00
parent cfaaaad66e
commit 5f57d620da

View File

@ -43,6 +43,7 @@ interface DefaultItem {
type: string;
filter: string;
multiple: boolean;
names?: string[];
}
const isTableSelect = (type?: string | TypeFunction) =>
@ -174,7 +175,10 @@ export const createValues = function (
return value;
};
const getDefaultValue = function (mForm: FormState | undefined, { defaultValue, type, filter, multiple }: DefaultItem) {
const getDefaultValue = function (
mForm: FormState | undefined,
{ defaultValue, type, filter, multiple, names }: DefaultItem,
) {
if (typeof defaultValue === 'function') {
return defaultValue(mForm);
}
@ -200,6 +204,10 @@ const getDefaultValue = function (mForm: FormState | undefined, { defaultValue,
return [];
}
if (type === 'daterange' && !names) {
return [];
}
return '';
};