(null);
@@ -85,8 +82,8 @@ function addPeriod() {
}
const newPeriod: WorkingHourPeriod = {
- start: startTime.value.format('HH:mm'),
- end: endTime.value.format('HH:mm'),
+ start: startTime.value,
+ end: endTime.value,
};
// 校验:结束时间必须晚于开始时间
@@ -132,22 +129,22 @@ function addPeriod() {
message.success('时间段已添加');
}
- startTime.value = null;
- endTime.value = null;
+ startTime.value = '';
+ endTime.value = '';
}
// 编辑时间段
function editPeriod(index: number) {
const period = periods.value[index];
- startTime.value = dayjs(period.start, 'HH:mm');
- endTime.value = dayjs(period.end, 'HH:mm');
+ startTime.value = period.start;
+ endTime.value = period.end;
editingIndex.value = index;
}
// 取消编辑
function cancelEdit() {
- startTime.value = null;
- endTime.value = null;
+ startTime.value = '';
+ endTime.value = '';
editingIndex.value = null;
}
@@ -229,20 +226,18 @@ function getDuration(period: WorkingHourPeriod): string {
-
至
-