По двойному клику подтягиваются время, исполнитель
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
span.owner-name.font-medium.text-base.mr-6 {{ ownerName }}
|
||||
img.icon-wrapper.cursor-pointer(src="@/assets/icons/lock.svg")
|
||||
column-header-checkbox
|
||||
.body.pl-1
|
||||
.body.pl-1.h-full(@dblclick="clickOnBackground")
|
||||
transition-group(name="card")
|
||||
calendar-event-card(
|
||||
v-for="event, index in dayEvents",
|
||||
@@ -49,6 +49,13 @@ export default {
|
||||
changeFormWasClosed: Boolean,
|
||||
scheduleBodyRef: Node,
|
||||
url: String,
|
||||
openFormCreateEvent: Function,
|
||||
currentDate: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -104,6 +111,25 @@ export default {
|
||||
transmitDeleteEvent(eventData) {
|
||||
this.$emit("delete-event", eventData);
|
||||
},
|
||||
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);
|
||||
if (minuts < 10) minuts = "0" + minuts;
|
||||
if (hours < 10) hours = "0" + hours;
|
||||
this.$emit("selected-event", {
|
||||
employees: [
|
||||
{
|
||||
employee: this.ownerData,
|
||||
role: "owner",
|
||||
},
|
||||
],
|
||||
start: `${this.currentDate.format(
|
||||
"YYYY-MM-DD"
|
||||
)}T${hours}:${minuts}:00Z`,
|
||||
end: `${this.currentDate.format("YYYY-MM-DD")}T${hours}:${minuts}:00Z`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
.card.flex.px-2(
|
||||
:class="{'py-6px flex-col': longCard}",
|
||||
:style="cardHeight",
|
||||
@click="openDescriptionCard"
|
||||
@click="openDescriptionCard",
|
||||
@dblclick.stop
|
||||
)
|
||||
.header.flex.justify-between.items-center(:class="{'items-start': longCard}")
|
||||
.header-text
|
||||
|
||||
@@ -226,7 +226,7 @@ export default {
|
||||
id: id,
|
||||
label: this.trimOwnerName(last_name, first_name, patronymic),
|
||||
},
|
||||
id: rest.id,
|
||||
id: rest?.id || null,
|
||||
role: rest?.role || this.EMPLOYEE_TYPE,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,7 +30,9 @@
|
||||
@selected-event="transmitEventData",
|
||||
@reset-change-form="transmitResetChangeForm",
|
||||
@delete-event="transmitDeleteEvent",
|
||||
:schedule-body-ref="$refs.scheduleBody"
|
||||
:schedule-body-ref="$refs.scheduleBody",
|
||||
:open-form-create-event="openFormCreateEvent",
|
||||
:current-date="currentDate"
|
||||
)
|
||||
.flex.w-full.relative
|
||||
.time-coil-wrapper.left-0.-mt-12.pt-9
|
||||
@@ -52,7 +54,6 @@
|
||||
calendar-background(
|
||||
:time-coil="timeCoil",
|
||||
:owners-count="ownersCount"
|
||||
@dblclick="openFormCreateEvent"
|
||||
)
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user