Настроила отображение колонок и подложки
This commit is contained in:
@@ -63,5 +63,5 @@ export default {
|
|||||||
|
|
||||||
<style lang="sass" scoped>
|
<style lang="sass" scoped>
|
||||||
.calendar-container
|
.calendar-container
|
||||||
width: 100%
|
width: calc(100% - 80px)
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.calendar-background-wrapper.flex.flex-col
|
.calendar-background-wrapper.flex.flex-col(
|
||||||
|
ref="backgroundWrapper"
|
||||||
|
)
|
||||||
calendar-column(
|
calendar-column(
|
||||||
v-for="(owner, index) in columnInformation.owners"
|
v-for="(owner, index) in columnInformation.owners"
|
||||||
:key="owner"
|
:key="owner"
|
||||||
:column-information="owner"
|
:column-information="owner"
|
||||||
:style="calculateColumnPosition(index)"
|
:style="calculateColumnPosition(index)"
|
||||||
)
|
)
|
||||||
.header
|
.header(:style="backgroundExtendedWidth")
|
||||||
.body.flex.flex-col
|
.body.flex.flex-col(:style="backgroundExtendedWidth")
|
||||||
.line-wrapper
|
.line-wrapper
|
||||||
.line.flex.items-center(
|
.line.flex.items-center(
|
||||||
v-for="hour in hoursArray"
|
v-for="hour in hoursArray"
|
||||||
@@ -42,7 +44,9 @@ export default {
|
|||||||
return {
|
return {
|
||||||
isShownIndicator: true,
|
isShownIndicator: true,
|
||||||
pixelsPerHour: 62,
|
pixelsPerHour: 62,
|
||||||
columnWidth: 470,
|
backgroundWidth: 0,
|
||||||
|
columnWidth: 0,
|
||||||
|
defaultColumnWidth: 470,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -62,6 +66,19 @@ export default {
|
|||||||
pixelsPerMinute() {
|
pixelsPerMinute() {
|
||||||
return this.pixelsPerHour / 60;
|
return this.pixelsPerHour / 60;
|
||||||
},
|
},
|
||||||
|
ownersArrayLength() {
|
||||||
|
return this.columnInformation.owners.length;
|
||||||
|
},
|
||||||
|
backgroundExtendedWidth() {
|
||||||
|
if (this.ownersArrayLength > 3) {
|
||||||
|
return {
|
||||||
|
width: `${this.defaultColumnWidth * this.ownersArrayLength}px`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
width: "auto",
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
calculateIndicatorLocation() {
|
calculateIndicatorLocation() {
|
||||||
@@ -78,9 +95,20 @@ export default {
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
calculateColumnPosition(elemIndex) {
|
calculateColumnPosition(elemIndex) {
|
||||||
|
if (this.ownersArrayLength < 4) {
|
||||||
|
this.columnWidth = this.backgroundWidth / this.ownersArrayLength;
|
||||||
return {
|
return {
|
||||||
|
width: `${this.columnWidth}px`,
|
||||||
left: `${elemIndex * this.columnWidth}px`,
|
left: `${elemIndex * this.columnWidth}px`,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
width: `${this.defaultColumnWidth}px`,
|
||||||
|
left: `${elemIndex * this.defaultColumnWidth}px`,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
calculateBackgroundWidth() {
|
||||||
|
this.backgroundWidth = this.$refs.backgroundWrapper.clientWidth;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -89,6 +117,9 @@ export default {
|
|||||||
this.currentDate.format("DD.MM.YYYY") === moment().format("DD.MM.YYYY");
|
this.currentDate.format("DD.MM.YYYY") === moment().format("DD.MM.YYYY");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.calculateBackgroundWidth();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -96,6 +127,7 @@ export default {
|
|||||||
.calendar-background-wrapper
|
.calendar-background-wrapper
|
||||||
width: 100%
|
width: 100%
|
||||||
position: relative
|
position: relative
|
||||||
|
overflow-x: scroll
|
||||||
|
|
||||||
.header
|
.header
|
||||||
height: 48px
|
height: 48px
|
||||||
@@ -120,6 +152,7 @@ export default {
|
|||||||
width: 100%
|
width: 100%
|
||||||
border-top: 1px solid var(--time-indicator-color)
|
border-top: 1px solid var(--time-indicator-color)
|
||||||
position: absolute
|
position: absolute
|
||||||
|
z-index: 10
|
||||||
|
|
||||||
.time-circle-indicator
|
.time-circle-indicator
|
||||||
width: 12px
|
width: 12px
|
||||||
@@ -127,4 +160,5 @@ export default {
|
|||||||
background-color: var(--time-indicator-color)
|
background-color: var(--time-indicator-color)
|
||||||
border-radius: 50%
|
border-radius: 50%
|
||||||
position: absolute
|
position: absolute
|
||||||
|
z-index: 10
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.calendar-column-wrapper.flex.flex-col(@click="output")
|
.calendar-column-wrapper.flex.flex-col
|
||||||
.header.flex.items-center.justify-between.py-2.px-6
|
.header.flex.items-center.justify-between.py-2.px-6
|
||||||
.flex.items-center
|
.flex.items-center
|
||||||
img.avatar-wrapper.mr-2(src="@/assets/images/team-member.svg" alt="Team member")
|
img.avatar-wrapper.mr-2(src="@/assets/images/team-member.svg" alt="Team member")
|
||||||
@@ -18,18 +18,12 @@ export default {
|
|||||||
columnInformation: String,
|
columnInformation: String,
|
||||||
elementKey: String,
|
elementKey: String,
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
output(event) {
|
|
||||||
console.log(event.target.id);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="sass" scoped>
|
<style lang="sass" scoped>
|
||||||
.calendar-column-wrapper
|
.calendar-column-wrapper
|
||||||
position: absolute
|
position: absolute
|
||||||
width: 470px
|
|
||||||
border-right: 1px solid var(--border-light-grey-color)
|
border-right: 1px solid var(--border-light-grey-color)
|
||||||
height: calc(100% - 54px)
|
height: calc(100% - 54px)
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
@selected-layout="selectedLayout"
|
@selected-layout="selectedLayout"
|
||||||
)
|
)
|
||||||
.schedule-body.flex
|
.schedule-body.flex
|
||||||
|
div
|
||||||
calendar-clock-column(
|
calendar-clock-column(
|
||||||
:hours-array="hoursArray"
|
:hours-array="hoursArray"
|
||||||
:current-time="currentTime"
|
:current-time="currentTime"
|
||||||
@@ -177,4 +178,5 @@ export default {
|
|||||||
<style lang="sass" scoped>
|
<style lang="sass" scoped>
|
||||||
.schedule
|
.schedule
|
||||||
background-color: var(--default-white)
|
background-color: var(--default-white)
|
||||||
|
width: calc(100% - 8px)
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user