[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-wrapper.relative.flex.flex-col.px-6.py-6.h-full.w-full.gap-y-5
|
||||||
schedule-header(
|
schedule-header(
|
||||||
:start-month="startMonth",
|
:start-month="startMonth",
|
||||||
|
:times-shift="timesShift",
|
||||||
@switch-previous-month="switchPreviousMonth",
|
@switch-previous-month="switchPreviousMonth",
|
||||||
@switch-next-month="switchNextMonth"
|
@switch-next-month="switchNextMonth"
|
||||||
)
|
)
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
:buttons="buttons",
|
:buttons="buttons",
|
||||||
:clear-employee="clearEmployee",
|
:clear-employee="clearEmployee",
|
||||||
:times="times",
|
:times="times",
|
||||||
:create-schedules="postCreateSchedules"
|
:create-schedules="postCreateSchedules",
|
||||||
)
|
)
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@ export default {
|
|||||||
endTime: "",
|
endTime: "",
|
||||||
},
|
},
|
||||||
times: { start_time: "", end_time: "" },
|
times: { start_time: "", end_time: "" },
|
||||||
|
timesShift: { start_time: "", end_time: "" },
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
class: "button-work",
|
class: "button-work",
|
||||||
@@ -217,6 +219,19 @@ export default {
|
|||||||
switchNextMonth() {
|
switchNextMonth() {
|
||||||
this.startMonth = this.startMonth.clone().add(1, "M");
|
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: {
|
watch: {
|
||||||
startMonth() {
|
startMonth() {
|
||||||
@@ -225,6 +240,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchSchedules();
|
this.fetchSchedules();
|
||||||
|
this.houres();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -19,10 +19,16 @@
|
|||||||
.time-wrapper.flex.justify-center
|
.time-wrapper.flex.justify-center
|
||||||
.flex.flex-col.py-14px.px-4.gap-y-14px.items-center
|
.flex.flex-col.py-14px.px-4.gap-y-14px.items-center
|
||||||
.text-xxs.opacity-40.font-bold Начало
|
.text-xxs.opacity-40.font-bold Начало
|
||||||
base-input-time.item-input.text-base.select(:width-input="40")
|
base-input-time.item-input.text-base.select(
|
||||||
|
:width-input="40",
|
||||||
|
v-model:value="timesShift.start_time"
|
||||||
|
)
|
||||||
.flex.flex-col.py-14px.px-4.gap-y-14px.items-center
|
.flex.flex-col.py-14px.px-4.gap-y-14px.items-center
|
||||||
.text-xxs.opacity-40.font-bold Конец
|
.text-xxs.opacity-40.font-bold Конец
|
||||||
base-input-time.item-input.text-base.select(:width-input="40")
|
base-input-time.item-input.text-base.select(
|
||||||
|
:width-input="40",
|
||||||
|
v-model:value="timesShift.end_time"
|
||||||
|
)
|
||||||
.flex.justify-center
|
.flex.justify-center
|
||||||
base-button.font-semibold(:size="40") Сохранить
|
base-button.font-semibold(:size="40") Сохранить
|
||||||
</template>
|
</template>
|
||||||
@@ -36,7 +42,7 @@ import BaseButton from "@/components/base/BaseButton.vue";
|
|||||||
export default {
|
export default {
|
||||||
name: "FormChangeShift",
|
name: "FormChangeShift",
|
||||||
components: { BaseCustomSelect, BaseInputDate, BaseInputTime, BaseButton },
|
components: { BaseCustomSelect, BaseInputDate, BaseInputTime, BaseButton },
|
||||||
props: { closeForm: Function },
|
props: { closeForm: Function, timesShift: Object },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentEmployee: { label: "", id: null },
|
currentEmployee: { label: "", id: null },
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.flex.flex-col.gap-y-5
|
.flex.flex-col.gap-y-5
|
||||||
.flex.justify-center.pl-8.pr-20.font-bold.text-xl Планировщик смен
|
.flex.justify-center.pl-8.pr-20.font-bold.text-xl Планировщик смен
|
||||||
form-change-shift(v-if="showForm", :close-form="closeForm")
|
transition(name="form")
|
||||||
|
form-change-shift(
|
||||||
|
v-if="showForm",
|
||||||
|
:close-form="closeForm",
|
||||||
|
:times-shift="timesShift"
|
||||||
|
)
|
||||||
.flex
|
.flex
|
||||||
.calendar-header-wrapper.flex.items-center.justify-between.py-3.pl-5.pr-6
|
.calendar-header-wrapper.flex.items-center.justify-between.py-3.pl-5.pr-6
|
||||||
.flex
|
.flex
|
||||||
@@ -22,9 +27,8 @@
|
|||||||
:size="32"
|
:size="32"
|
||||||
)
|
)
|
||||||
.text.flex.items-center
|
.text.flex.items-center
|
||||||
span.text.font-medium.text-base {{ dateString }}
|
.text.font-medium.text-base {{ dateString }}
|
||||||
span.today.font-bold.text-xxs.ml-2(v-if="isCurrentMonth") Текущий
|
.opacity-50.font-bold.text-xxs.ml-2(v-if="isCurrentMonth") Текущий
|
||||||
//.flex.text-xl Жмых Олег Анатольевич
|
|
||||||
base-button.font-semibold(:size="40", @click="openForm") Замена смен
|
base-button.font-semibold(:size="40", @click="openForm") Замена смен
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -37,6 +41,7 @@ export default {
|
|||||||
components: { BaseButton, FormChangeShift },
|
components: { BaseButton, FormChangeShift },
|
||||||
props: {
|
props: {
|
||||||
startMonth: Object,
|
startMonth: Object,
|
||||||
|
timesShift: Object,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -99,6 +104,22 @@ export default {
|
|||||||
.text
|
.text
|
||||||
color: var(--font-dark-blue-color)
|
color: var(--font-dark-blue-color)
|
||||||
|
|
||||||
.today
|
.form-enter-from
|
||||||
opacity: 0.5
|
opacity: 0
|
||||||
|
transform: translateY(300px)
|
||||||
|
pointer-events: none
|
||||||
|
|
||||||
|
.form-enter-active
|
||||||
|
transition: 0.5s ease
|
||||||
|
|
||||||
|
.form-leave-to
|
||||||
|
opacity: 0
|
||||||
|
transform: translateY(300px)
|
||||||
|
pointer-events: none
|
||||||
|
|
||||||
|
.form-leave-active
|
||||||
|
transition: 0.5s ease
|
||||||
|
|
||||||
|
.form-move
|
||||||
|
transition: 0.5s ease
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user