refactor(@vben/web-antd): remove store mocks and fix staff type checks
This commit is contained in:
@@ -40,12 +40,14 @@ const templateRows: Array<{
|
||||
|
||||
/** 将 HH:mm 字符串转换为时间组件值。 */
|
||||
function toPickerValue(time: string) {
|
||||
if (!time) return null;
|
||||
if (!time) return undefined;
|
||||
return dayjs(`2000-01-01 ${time}`);
|
||||
}
|
||||
|
||||
/** 将时间组件值转换为 HH:mm 字符串。 */
|
||||
function toTimeText(value: Dayjs | null) {
|
||||
function toTimeText(value: Dayjs | null | string | undefined) {
|
||||
if (!value) return '';
|
||||
if (typeof value === 'string') return value;
|
||||
return value ? value.format('HH:mm') : '';
|
||||
}
|
||||
|
||||
@@ -53,7 +55,7 @@ function toTimeText(value: Dayjs | null) {
|
||||
function handleTemplateTimeChange(payload: {
|
||||
field: 'endTime' | 'startTime';
|
||||
shiftType: Exclude<ShiftType, 'off'>;
|
||||
value: Dayjs | null;
|
||||
value: Dayjs | null | string;
|
||||
}) {
|
||||
props.onSetTemplateTime({
|
||||
shiftType: payload.shiftType,
|
||||
|
||||
Reference in New Issue
Block a user