[WIP] Фикс переменных, правка стилей
This commit is contained in:
@@ -14,21 +14,22 @@
|
||||
.text.flex.font-bold(
|
||||
:style="{opacity: changeOpacity(day)}"
|
||||
) {{day.format("ddd")}}
|
||||
.schedule-body.flex.w-full(v-for="schedule in serialized", :key="schedule.id")
|
||||
.edit.flex.items-center.justify-center.h-11.w-11
|
||||
.flex.icon-edit
|
||||
.name-employee.flex.justify-center.items-center.cursor-pointer
|
||||
span {{trimOwnerName(schedule.last_name, schedule.first_name, schedule.patronymic)}}
|
||||
.cell.flex.flex-col.items-center.justify-center.w-11.h-11.cursor-pointer(
|
||||
v-for="day in result",
|
||||
:key="day",
|
||||
:id="schedule.id + day",
|
||||
@click="choiceCell(day, schedule.id)",
|
||||
:class="selectTime(day, schedule.id)",
|
||||
:style="{backgroundColor: day.format('YYYY-MM-DD') === choiceDay(day, schedule.id) ? choiceColor(day) : ''}"
|
||||
)
|
||||
.flex {{day.format("YYYY-MM-DD") === choiceDay(day, schedule.id) ? choiceWorks(day) : ''}}
|
||||
.schedule-body.flex.w-full(v-if="clearEmployee")
|
||||
.flex.w-full.flex-col(:style="{overflowY: 'scroll', maxHeight: '351px'}")
|
||||
.schedule-body.flex.w-full(v-for="schedule in serialized", :key="schedule.id")
|
||||
.edit.flex.items-center.justify-center.h-11.w-11
|
||||
.flex.icon-edit
|
||||
.name-employee.flex.justify-center.items-center.cursor-pointer
|
||||
span {{trimOwnerName(schedule.last_name, schedule.first_name, schedule.patronymic)}}
|
||||
.cell.flex.flex-col.items-center.justify-center.w-11.h-11.cursor-pointer(
|
||||
v-for="day in result",
|
||||
:key="day",
|
||||
:id="schedule.id + day",
|
||||
@click="choiceCell(day, schedule.id)",
|
||||
:class="selectTime(day, schedule.id)",
|
||||
:style="{backgroundColor: choiceDay(day, schedule.id) ? choiceColor(day) : ''}"
|
||||
)
|
||||
.flex {{choiceDay(day, schedule.id) ? choiceWorks(day) : ''}}
|
||||
.schedule-body.flex.w-full(v-if="clearEmployee", :style="{height: '44px'}")
|
||||
.edit.flex.items-center.justify-center.h-11.w-11(:style="{borderBottom: 'none'}")
|
||||
.flex.icon-edit(v-if="currentEmployee.label")
|
||||
//- base-button(
|
||||
@@ -151,7 +152,8 @@ export default {
|
||||
this.dateInterval.id = id;
|
||||
} else if (time.isAfter(this.dateInterval.start)) {
|
||||
this.dateInterval.end = formatTime;
|
||||
this.$emit("new-date", this.dateInterval);
|
||||
if (this.currentEmployee.label)
|
||||
this.$emit("new-date", this.dateInterval);
|
||||
} else this.dateInterval.start = formatTime;
|
||||
},
|
||||
selectTime(day, id) {
|
||||
@@ -185,12 +187,16 @@ export default {
|
||||
choiceWorks(day) {
|
||||
let currentDay = day.format("YYYY-MM-DD");
|
||||
let res = this.scheduleList.find((e) => e.date === currentDay).status;
|
||||
// if (this.activeButton) {
|
||||
// return this.buttons.find((e) => e.work === this.activeButton?.text[1])
|
||||
// ?.text[1];
|
||||
// }
|
||||
return this.buttons.find((e) => e.work === res).text[1];
|
||||
},
|
||||
choiceColor(day) {
|
||||
let currentDay = day.format("YYYY-MM-DD");
|
||||
let res = this.scheduleList.find((e) => e.date === currentDay).status;
|
||||
return this.buttons.find((e) => e.work === res).color;
|
||||
if (res) return this.buttons.find((e) => e.work === res).color;
|
||||
},
|
||||
changeDays() {
|
||||
this.days = moment().daysInMonth();
|
||||
@@ -280,15 +286,15 @@ export default {
|
||||
.status
|
||||
background-color: var(--bg-color-status)
|
||||
|
||||
.status::before
|
||||
.status::after
|
||||
content: var(--text-status)
|
||||
|
||||
.from-date
|
||||
background: limegreen
|
||||
background-color: limegreen !important
|
||||
|
||||
.to-date
|
||||
background: red
|
||||
background-color: red !important
|
||||
|
||||
.middle-dates
|
||||
background: yellow
|
||||
background-color: yellow !important
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user