WIP Стянула записи приемов с бэка

This commit is contained in:
Daria Golova
2023-09-19 13:31:05 +03:00
parent fc6c5e61fb
commit 48e2571c77
14 changed files with 176 additions and 213 deletions

View File

@@ -23,6 +23,7 @@ export const wrapperMixin = {
timeCoil: [],
timer: null,
pixelsPerHour: 76,
isCurrent: true,
};
},
computed: {
@@ -66,7 +67,6 @@ export const wrapperMixin = {
methods: {
changeCurrentTime() {
this.currentTime = moment().format("HH:mm:ss");
console.log(this.currentTime);
},
changeTimeCoil() {
this.timeCoil = this.timeCoil.map((elem) => {
@@ -104,6 +104,30 @@ export const wrapperMixin = {
}
return result;
},
timeCoilInitialization() {
this.timeCoil = [];
for (let i = this.validateStartTime; i < this.validateEndTime; i++) {
if (
i === this.hours &&
this.hours !== this.validateEndTime &&
this.isCurrent
) {
this.timeCoil.push(this.hoursMinutes);
} else this.timeCoil.push(`${i}:00`);
}
},
},
watch: {
currentTime() {
if (
this.hours === this.validateEndTime &&
this.minutes > 0 &&
this.timer
) {
this.stopTimer();
this.timeCoilInitialization();
}
},
},
beforeUnmount() {
this.stopTimer();