[WIP] Добавил отображение текущего времни в расписаниии и анимацию на окошко замены смен
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
.schedule-wrapper.relative.flex.flex-col.px-6.py-6.h-full.w-full.gap-y-5
|
||||
schedule-header(
|
||||
:start-month="startMonth",
|
||||
:times-shift="timesShift",
|
||||
@switch-previous-month="switchPreviousMonth",
|
||||
@switch-next-month="switchNextMonth"
|
||||
)
|
||||
@@ -24,7 +25,7 @@
|
||||
:buttons="buttons",
|
||||
:clear-employee="clearEmployee",
|
||||
:times="times",
|
||||
:create-schedules="postCreateSchedules"
|
||||
:create-schedules="postCreateSchedules",
|
||||
)
|
||||
</template>
|
||||
|
||||
@@ -50,6 +51,7 @@ export default {
|
||||
endTime: "",
|
||||
},
|
||||
times: { start_time: "", end_time: "" },
|
||||
timesShift: { start_time: "", end_time: "" },
|
||||
buttons: [
|
||||
{
|
||||
class: "button-work",
|
||||
@@ -217,6 +219,19 @@ export default {
|
||||
switchNextMonth() {
|
||||
this.startMonth = this.startMonth.clone().add(1, "M");
|
||||
},
|
||||
houres() {
|
||||
let now = new Date();
|
||||
let hour = now.getHours();
|
||||
let minute = now.getMinutes();
|
||||
let localDatetime =
|
||||
(hour < 10 ? "0" + hour.toString() : hour) +
|
||||
":" +
|
||||
(minute < 10 ? "0" + minute.toString() : minute);
|
||||
this.times.start_time = localDatetime;
|
||||
this.times.end_time = localDatetime;
|
||||
this.timesShift.start_time = localDatetime;
|
||||
this.timesShift.end_time = localDatetime;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
startMonth() {
|
||||
@@ -225,6 +240,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.fetchSchedules();
|
||||
this.houres();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user