fix: date field does not show time configuration

This commit is contained in:
chenos 2021-03-26 16:09:51 +08:00
parent bfa998e478
commit d8d4ef177a

View File

@ -33,6 +33,13 @@ export function fields2properties(fields = [], options: any = {}) {
title: field.title,
required: field.required,
};
if (field.dateFormat) {
set(data, 'x-component-props.format', field.dateFormat);
}
if (field.showTime) {
set(data, 'x-component-props.showTime', true);
field.timeFormat && set(data, 'x-component-props.format', `${field.dateFormat} ${field.timeFormat}`);
}
if (field.createOnly && mode !== 'create') {
set(data, 'x-component-props.disabled', true);
}