WIP Стянула записи приемов с бэка
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user