mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-01-18 10:38:12 +00:00
fix(form): daterange默认值
This commit is contained in:
parent
cfaaaad66e
commit
5f57d620da
@ -43,6 +43,7 @@ interface DefaultItem {
|
|||||||
type: string;
|
type: string;
|
||||||
filter: string;
|
filter: string;
|
||||||
multiple: boolean;
|
multiple: boolean;
|
||||||
|
names?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const isTableSelect = (type?: string | TypeFunction) =>
|
const isTableSelect = (type?: string | TypeFunction) =>
|
||||||
@ -174,7 +175,10 @@ export const createValues = function (
|
|||||||
return value;
|
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') {
|
if (typeof defaultValue === 'function') {
|
||||||
return defaultValue(mForm);
|
return defaultValue(mForm);
|
||||||
}
|
}
|
||||||
@ -200,6 +204,10 @@ const getDefaultValue = function (mForm: FormState | undefined, { defaultValue,
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === 'daterange' && !names) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user