WIP Подстроила индикатор и размеры под owners <=3

This commit is contained in:
Daria Golova
2022-10-27 20:06:37 +03:00
parent 614ec74338
commit 546818ed85
4 changed files with 43 additions and 32 deletions

View File

@@ -515,8 +515,8 @@ export function clientsServer() {
results: [ results: [
{ {
id: "6faa6bb6-1de6-422c-a401-1b35cd455303", id: "6faa6bb6-1de6-422c-a401-1b35cd455303",
start: "2022-10-25T11:15:49Z", start: "2022-10-27T11:15:49Z",
end: "2022-10-25T12:00:53Z", end: "2022-10-27T12:00:53Z",
kind: "call", kind: "call",
subkind: null, subkind: null,
description: "", description: "",
@@ -558,8 +558,8 @@ export function clientsServer() {
}, },
{ {
id: "6faa6bb6-1de6-422c-a401-1b35cd455303", id: "6faa6bb6-1de6-422c-a401-1b35cd455303",
start: "2022-10-25T13:00:49Z", start: "2022-10-27T13:00:49Z",
end: "2022-10-25T13:30:53Z", end: "2022-10-27T13:30:53Z",
kind: "call", kind: "call",
subkind: null, subkind: null,
description: "", description: "",
@@ -601,8 +601,8 @@ export function clientsServer() {
}, },
{ {
id: "2faa7bb2-2de6-422c-a401-1b35cd455223", id: "2faa7bb2-2de6-422c-a401-1b35cd455223",
start: "2022-10-25T15:00:00Z", start: "2022-10-27T15:00:00Z",
end: "2022-10-25T16:10:00Z", end: "2022-10-27T16:10:00Z",
kind: "call", kind: "call",
subkind: null, subkind: null,
description: "", description: "",
@@ -687,8 +687,8 @@ export function clientsServer() {
}, },
{ {
id: "2faa5ff2-2de6-422c-a401-1b35cd455223", id: "2faa5ff2-2de6-422c-a401-1b35cd455223",
start: "2022-10-26T20:10:00Z", start: "2022-10-27T20:10:00Z",
end: "2022-10-26T21:00:00Z", end: "2022-10-27T21:00:00Z",
kind: "call", kind: "call",
subkind: null, subkind: null,
description: "", description: "",

View File

@@ -25,8 +25,8 @@ export default {
calendarLayout: "", calendarLayout: "",
currentDate: moment(), currentDate: moment(),
timeInformation: { timeInformation: {
dayStartTime: "0:00", dayStartTime: "8:00",
dayEndTime: "22:00", dayEndTime: "24:00",
}, },
eventsData: [], eventsData: [],
teamData: [], teamData: [],

View File

@@ -1,5 +1,5 @@
<template lang="pug"> <template lang="pug">
.calendar-clock-column.flex.flex-col.items-end.gap-y-43.pb-45px.px-3 .calendar-clock-column.flex.flex-col.items-end.gap-y-43.pb-5.px-3
span.text-base( span.text-base(
v-for="hour in timeCoil" v-for="hour in timeCoil"
:key="hour" :key="hour"
@@ -59,4 +59,5 @@ export default {
width: 80px width: 80px
height: 100% height: 100%
color: var(--font-dark-blue-color) color: var(--font-dark-blue-color)
background-color: var(--default-white)
</style> </style>

View File

@@ -1,7 +1,6 @@
<template lang="pug"> <template lang="pug">
.schedule.ml-2( .schedule.ml-2(
:style="scheduleWidth" :style="scheduleWidth"
ref="shedule"
) )
calendar-header( calendar-header(
:current-date="currentDate" :current-date="currentDate"
@@ -11,7 +10,7 @@
@selected-layout="selectedLayout" @selected-layout="selectedLayout"
) )
.schedule-body .schedule-body
.column-wrapper.flex.ml-20.absolute(:style="columnWrapperWidth") .column-wrapper.flex.ml-20.relative(:style="columnWrapperWidth")
calendar-column( calendar-column(
v-for="(owner, index) in filteredOwners" v-for="(owner, index) in filteredOwners"
:key="owner.id" :key="owner.id"
@@ -29,7 +28,15 @@
:is-current-date="isCurrentDate" :is-current-date="isCurrentDate"
:day-end-time="validateEndTime" :day-end-time="validateEndTime"
) )
.flex .time-circle-indicator.left-74px(
v-if="isShownIndicator"
:style="circleIndicatorLocation"
)
span.time-line-indicator.block.left-20(
v-if="isShownIndicator"
:style="lineIndicatorLocation"
)
.flex(:class="calendarBackgroundWidth")
calendar-background( calendar-background(
:current-date="currentDate" :current-date="currentDate"
:time-coil="timeCoil" :time-coil="timeCoil"
@@ -39,14 +46,6 @@
:day-end-time="validateEndTime" :day-end-time="validateEndTime"
:owners-count="ownersCount" :owners-count="ownersCount"
) )
.time-circle-indicator.left-74px(
v-if="isShownIndicator"
:style="circleIndicatorLocation"
)
span.time-line-indicator.block.left-20(
v-if="isShownIndicator"
:style="lineIndicatorLocation"
)
</template> </template>
<script> <script>
@@ -113,19 +112,20 @@ export default {
return this.verifyTime(this.timeInformation.dayEndTime); return this.verifyTime(this.timeInformation.dayEndTime);
}, },
lineIndicatorLocation() { lineIndicatorLocation() {
if (this.ownersCount > 3 && this.timeCoil.length - 1 > 13) { if (this.ownersCount > 3) {
return { return {
width: `${this.ownersCount * this.defaultColumnWidth}px`, width: `${this.defaultColumnWidth * this.ownersCount}px`,
top: `${this.calculateIndicatorLocation()}px`, top: `${this.calculateIndicatorLocation()}px`,
}; };
} }
return { return {
width: "calc(100% - 80px)",
top: `${this.calculateIndicatorLocation()}px`, top: `${this.calculateIndicatorLocation()}px`,
}; };
}, },
circleIndicatorLocation() { circleIndicatorLocation() {
return { return {
top: `${this.calculateIndicatorLocation() - 6}px`, top: `${this.calculateIndicatorLocation() + 6}px`,
}; };
}, },
pixelsPerMinute() { pixelsPerMinute() {
@@ -133,8 +133,7 @@ export default {
}, },
scheduleHeight() { scheduleHeight() {
return ( return (
(this.validateEndTime - this.validateStartTime) * this.pixelsPerHour + (this.validateEndTime - this.validateStartTime) * this.pixelsPerHour
this.columnHeaderHeight
); );
}, },
scheduleWidth() { scheduleWidth() {
@@ -182,26 +181,37 @@ export default {
start.slice(0, 10) === this.currentDate.format("YYYY-MM-DD") start.slice(0, 10) === this.currentDate.format("YYYY-MM-DD")
); );
}, },
columnHeight() {
return (
(this.timeCoil.length - 1) * this.pixelsPerHour +
this.columnHeaderHeight
);
},
columnWidth() { columnWidth() {
if (this.ownersCount > 3) { if (this.ownersCount > 3) {
console.log(this.defaultColumnWidth * this.ownersCount);
return { return {
height: `${this.columnHeight}px`,
width: `${this.defaultColumnWidth}px`, width: `${this.defaultColumnWidth}px`,
}; };
} }
return { return {
height: `${this.columnHeight}px`,
width: `calc(100% / ${this.ownersCount})`, width: `calc(100% / ${this.ownersCount})`,
}; };
}, },
columnWrapperWidth() { columnWrapperWidth() {
if (this.ownersCount > 3) { if (this.ownersCount > 3) {
console.log(this.defaultColumnWidth * this.ownersCount);
return { return {
width: `${this.defaultColumnWidth * this.ownersCount}px`, width: `${this.defaultColumnWidth * this.ownersCount}px`,
}; };
} }
return { return {
width: "100%", width: "calc(100% - 80px)",
};
},
calendarBackgroundWidth() {
return {
"w-full": this.ownersCount <= 3,
}; };
}, },
}, },
@@ -337,9 +347,9 @@ export default {
height: calc(100vh - 56px - 8px) height: calc(100vh - 56px - 8px)
.time-line-indicator .time-line-indicator
width: calc(100% - 80px)
border-top: 1px solid var(--bg-event-red-color) border-top: 1px solid var(--bg-event-red-color)
position: absolute position: absolute
z-index: 4
.time-circle-indicator .time-circle-indicator
width: 12px width: 12px
@@ -347,6 +357,7 @@ export default {
background-color: var(--bg-event-red-color) background-color: var(--bg-event-red-color)
border-radius: 50% border-radius: 50%
position: absolute position: absolute
z-index: 5
.column-wrapper .column-wrapper
height: 48px height: 48px
@@ -355,7 +366,6 @@ export default {
.time-coil-wrapper .time-coil-wrapper
position: sticky position: sticky
z-index: 5 z-index: 5
background-color: var(--default-white)
.schedule-body .schedule-body
width: 100% width: 100%