chore: leave表单

This commit is contained in:
dap
2024-12-16 16:48:18 +08:00
parent 5e5f4fbb97
commit bdfb757219
3 changed files with 52 additions and 26 deletions

View File

@@ -110,10 +110,20 @@ export const modalSchema: FormSchemaGetter = () => [
label: '开始时间',
fieldName: 'dateRange',
component: 'RangePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
componentProps(model) {
return {
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
onChange: (dates: [string, string]) => {
if (!dates) {
model.leaveDays = null;
return;
}
const [start, end] = dates;
const leaveDays = dayjs(end).diff(dayjs(start), 'day') + 1;
model.leaveDays = leaveDays;
},
};
},
rules: 'required',
},