Изменила нейминг переменных
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
)
|
||||
.line-wrapper
|
||||
.line.flex.items-center(
|
||||
v-for="hour in hoursArray"
|
||||
v-for="hour in timeCoil"
|
||||
:key="hour"
|
||||
)
|
||||
.middle-line
|
||||
@@ -29,7 +29,7 @@ export default {
|
||||
name: "CalendarBackground",
|
||||
components: { CalendarColumn },
|
||||
props: {
|
||||
hoursArray: Array,
|
||||
timeCoil: Array,
|
||||
eventsData: Array,
|
||||
currentDate: Object,
|
||||
sidebarWidth: String,
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
};
|
||||
},
|
||||
backgroundHeight() {
|
||||
return (this.hoursArray.length - 1) * this.pixelsPerHour + 48;
|
||||
return (this.timeCoil.length - 1) * this.pixelsPerHour + 48;
|
||||
},
|
||||
horizontalScrollPresence() {
|
||||
return {
|
||||
@@ -74,11 +74,11 @@ export default {
|
||||
};
|
||||
this.eventsData.forEach(({ employees }) => {
|
||||
let findedElement = employees.find((elem) => elem.role === "owner");
|
||||
let emptyObjectPresence = this.findObjectInArray(
|
||||
let emptyDataPresence = this.findObjectInArray(
|
||||
filteredArray,
|
||||
ownerAbsence
|
||||
);
|
||||
if (!findedElement && !emptyObjectPresence) {
|
||||
if (!findedElement && !emptyDataPresence) {
|
||||
filteredArray.push(ownerAbsence);
|
||||
}
|
||||
if (findedElement) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template lang="pug">
|
||||
.calendar-clock-column.flex.flex-col.items-end.gap-y-43.pt-9.pb-45px.px-3
|
||||
span.text-base(
|
||||
v-for="hour in hoursArray"
|
||||
v-for="hour in timeCoil"
|
||||
:key="hour"
|
||||
:class="currentHourStyle(hour)"
|
||||
) {{ hour }}
|
||||
@@ -11,7 +11,7 @@
|
||||
export default {
|
||||
name: "CalendarClockColumn",
|
||||
props: {
|
||||
hoursArray: Array,
|
||||
timeCoil: Array,
|
||||
currentTime: String,
|
||||
currentDate: Object,
|
||||
dayEndTime: Number,
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
)
|
||||
div
|
||||
calendar-clock-column(
|
||||
:hours-array="hoursArray"
|
||||
:timeCoil="timeCoil"
|
||||
:current-time="currentTime"
|
||||
:is-current-date="isCurrentDate"
|
||||
:day-end-time="validateEndTime"
|
||||
)
|
||||
calendar-background(
|
||||
:current-date="currentDate"
|
||||
:hours-array="hoursArray"
|
||||
:time-coil="timeCoil"
|
||||
:events-data="eventsData"
|
||||
:sidebar-width="sidebarWidth"
|
||||
)
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
currentTime: "",
|
||||
hoursArray: [],
|
||||
timeCoil: [],
|
||||
timer: null,
|
||||
isCurrentDate: true,
|
||||
isShownIndicator: true,
|
||||
@@ -140,7 +140,7 @@ export default {
|
||||
) {
|
||||
this.timer = setInterval(() => {
|
||||
this.changeCurrentTime();
|
||||
this.changeHoursArray();
|
||||
this.changeTimeCoil();
|
||||
}, 5000);
|
||||
}
|
||||
},
|
||||
@@ -151,20 +151,20 @@ export default {
|
||||
changeCurrentTime() {
|
||||
this.currentTime = moment().format("HH:mm:ss");
|
||||
},
|
||||
hoursArrayInitialization() {
|
||||
this.hoursArray = [];
|
||||
timeCoilInitialization() {
|
||||
this.timeCoil = [];
|
||||
for (let i = this.validateStartTime; i <= this.validateEndTime; i++) {
|
||||
if (
|
||||
i === this.hours &&
|
||||
this.hours !== this.validateEndTime &&
|
||||
this.isCurrentDate
|
||||
) {
|
||||
this.hoursArray.push(this.hoursMinutes);
|
||||
} else this.hoursArray.push(`${i}:00`);
|
||||
this.timeCoil.push(this.hoursMinutes);
|
||||
} else this.timeCoil.push(`${i}:00`);
|
||||
}
|
||||
},
|
||||
changeHoursArray() {
|
||||
this.hoursArray = this.hoursArray.map((elem) => {
|
||||
changeTimeCoil() {
|
||||
this.timeCoil = this.timeCoil.map((elem) => {
|
||||
if (this.convertTime(elem, 0, -3) === this.hours) {
|
||||
return this.hoursMinutes;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ export default {
|
||||
this.timer
|
||||
) {
|
||||
this.stopTimer();
|
||||
this.hoursArrayInitialization();
|
||||
this.timeCoilInitialization();
|
||||
}
|
||||
},
|
||||
currentDate: function () {
|
||||
@@ -216,18 +216,18 @@ export default {
|
||||
this.isShownIndicator = this.isCurrentDate;
|
||||
if (this.timer) {
|
||||
this.stopTimer();
|
||||
this.hoursArrayInitialization();
|
||||
this.timeCoilInitialization();
|
||||
}
|
||||
if (this.isCurrentDate) {
|
||||
this.changeCurrentTime();
|
||||
this.hoursArrayInitialization();
|
||||
this.timeCoilInitialization();
|
||||
this.startTimer();
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.changeCurrentTime();
|
||||
this.hoursArrayInitialization();
|
||||
this.timeCoilInitialization();
|
||||
this.startTimer();
|
||||
},
|
||||
beforeUnmount() {
|
||||
|
||||
Reference in New Issue
Block a user