Merge branch 'UC-216' into 'master'

Отменила часть изменений

See merge request andrusyakka/urban-couscous!286
This commit is contained in:
Daria Golova
2023-03-30 09:15:27 +00:00
4 changed files with 47 additions and 78 deletions

View File

@@ -1,38 +0,0 @@
<template lang="pug">
base-input.w-full(v-bind="$props", v-model="value")
.flex.items-center
q-icon(name="app:calendar" class="cursor-pointer" size="18px")
q-popup-proxy(cover transition-show="scale" transition-hide="scale")
q-date(v-model="value")
div(class="row items-center justify-end")
q-btn(v-close-popup label="Close" color="primary" flat)
</template>
<script>
import BaseInput from "@/components/base/BaseInput.vue";
import * as moment from "moment/moment";
export default {
name: "BaseInputDate",
components: { BaseInput },
props: {
modelValue: {
type: Date,
default: () => new Date(),
},
},
emits: ["update:modelValue"],
computed: {
value: {
get() {
return moment(this.modelValue).format("D MMMM YYYY");
},
set(value) {
this.$emit("update:modelValue", value ? new Date(value) : null);
},
},
},
};
</script>
<style lang="sass" scoped></style>

View File

@@ -13,7 +13,7 @@
img.icon-wrapper.cursor-pointer(src="@/assets/icons/lock.svg")
column-header-checkbox
.body(@dblclick="clickOnBackground")
.nonworking-time(:style="nonworkingStartTime")
//.nonworking-time(:style="nonworkingStartTime")
transition-group(name="card")
calendar-event-card(
v-for="event, index in dayEvents",
@@ -26,14 +26,14 @@
@delete-event="transmitDeleteEvent",
:schedule-body-ref="scheduleBodyRef",
)
.nonworking-time.absolute(:style="nonworkingEndTime")
//.nonworking-time.absolute(:style="nonworkingEndTime")
</template>
<script>
import ColumnHeaderCheckbox from "./CalendarColumnHeaderCheckbox.vue";
import BaseAvatar from "@/components/base/BaseAvatar";
import CalendarEventCard from "./CalendarEventCard.vue";
import * as moment from "moment/moment";
//import * as moment from "moment/moment";
import TheNotificationProvider from "@/components/Notifications/TheNotificationProvider";
import { addNotification } from "@/components/Notifications/notificationContext";
export default {
@@ -67,13 +67,13 @@ export default {
};
},
computed: {
workingShift() {
/*workingShift() {
if (!this.ownerData.id) return null;
let start = this.ownerData.start_time;
let end = this.ownerData.end_time;
return {
start: start.split(":"),
end: end.split(":"),
start: start?.split(":"),
end: end?.split(":"),
fulltime: `${start} - ${end}`,
};
},
@@ -111,7 +111,7 @@ export default {
bottom: 0,
height: `${position}px`,
};
},
},*/
ownerName() {
if (this.ownerData.id) {
let checkedFirstName =
@@ -172,7 +172,7 @@ export default {
addErrorNotification(title, message) {
addNotification(title, title, message, "error", 5000);
},
clickOnBackground(e) {
/*clickOnBackground(e) {
let res = String((e.offsetY / this.pixelsPerHour).toFixed(2)).split(".");
let hours = parseInt(res[0]) + this.dayStartTime;
let minuts = Math.round(res[1] * 0.6);
@@ -203,7 +203,7 @@ export default {
)}T${hours}:${minuts}:00`,
end: `${this.currentDate.format("YYYY-MM-DD")}T${hours}:${minuts}:00`,
});
},
},*/
},
};
</script>

View File

@@ -1,59 +1,69 @@
<template lang="pug">
.calendar-header-wrapper.flex.items-center.justify-between.py-4.pl-4.pr-6
.flex.items-center
//q-btn.mr-4(
color="blue-grey-1",
q-btn.mr-4(
color="secondary",
round,
size="14px",
dense,
icon="arrow_back_ios_new"
text-color="primary",
@click="previousHandler"
//)
q-icon(name="arrow_back_ios", right)
//q-btn.mr-4(
color="blue-grey-1",
)
q-btn.mr-4(
color="secondary",
icon="arrow_forward_ios",
round,
size="14px",
text-color="primary",
dense,
@click="nextHandler"
//)
//.text.flex.items-center
)
.text.flex.items-center
span.font-medium.text-base {{ dateString }}
span.today.font-bold.text-xxs(v-if="isCurrentDate") Сегодня
q-btn(
//q-btn(
color="blue-grey-1",
round,
size="14px",
text-color="primary",
@click="previousHandler"
icon="arrow_back_ios_new"
)
base-input-date.mx-4(v-model="convertedDate", outlined, disabled)
q-btn(
//)
//.text.flex.items-center.mx-4
span.font-medium.text-base {{ dateString }}
span.today.font-bold.text-xxs(v-if="isCurrentDate") Сегодня
//q-btn(
color="blue-grey-1",
icon="arrow_forward_ios",
round,
size="14px",
text-color="primary",
@click="nextHandler"
)
//)
//.flex.gap-x-4.ml-5.border-2.border-green-600.bg-lime-200.items-center
.w-120.h-10.flex.items-center {{ date }}
base-date-picker(v-model="date")
calendar-layout-switch(@selected="changeSelectedLayout")
</template>
<script>
import CalendarLayoutSwitch from "./CalendarLayoutSwitch.vue";
import BaseInputDate from "@/components/base/BaseInputDate.vue";
//import BaseDatePicker from "@/components/base/BaseDatePicker.vue";
export default {
name: "CalendarHeader",
components: { CalendarLayoutSwitch, BaseInputDate },
components: { CalendarLayoutSwitch },
props: {
currentDate: Object,
isCurrentDate: Boolean,
},
/*data() {
return {
date: new Date(),
};
},*/
computed: {
/*dateString() {
dateString() {
let newStr = this.currentDate.format("D MMMM YYYY");
return newStr
.split(" ")
@@ -62,9 +72,6 @@ export default {
return elem;
})
.join(" ");
},*/
convertedDate() {
return new Date(this.currentDate);
},
},
methods: {
@@ -72,10 +79,10 @@ export default {
this.$emit("selected-layout", option);
},
previousHandler() {
//this.$emit("previous-date");
this.$emit("previous-date");
},
nextHandler() {
//this.$emit("next-date");
this.$emit("next-date");
},
},
};
@@ -106,8 +113,8 @@ export default {
.bg-blue-grey-1
background: var(--bg-light-grey) !important
.text-primary
color: var(--font-dark-blue-color-0) !important
//.text-primary
// color: var(--font-dark-blue-color-0) !important
.q-btn--round
width: 32px !important

View File

@@ -168,14 +168,14 @@ export default {
let filteredArray = [];
this.schedulesData.forEach((elem) => {
filteredArray.push({
id: elem.employee.id,
last_name: elem.employee.last_name,
first_name: elem.employee.first_name,
patronymic: elem.employee.patronymic,
color: elem.employee.color,
photo: elem.employee.photo,
end_time: elem.end_time.slice(0, elem.end_time.length - 3),
start_time: elem.start_time.slice(0, elem.start_time.length - 3),
id: elem.employee?.id,
last_name: elem.employee?.last_name,
first_name: elem.employee?.first_name,
patronymic: elem.employee?.patronymic,
color: elem.employee?.color,
photo: elem.employee?.photo,
end_time: elem.end_time?.slice(0, elem.end_time.length - 3),
start_time: elem.start_time?.slice(0, elem.start_time.length - 3),
});
});
return filteredArray;