Сделала колонку, добавила данные в server.js

This commit is contained in:
Daria Golova
2022-10-20 14:09:30 +03:00
parent 96b071294d
commit f210053d9d
5 changed files with 129 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
calendar-schedule(
:current-date="currentDate"
:time-information="timeInformation"
:column-information="columnInformation"
@previous-date="switchPreviousDate"
@next-date="switchNextDate"
@selected-layout="changeCalendarLayout"
@@ -24,6 +25,15 @@ export default {
dayEndTime: "18:00",
},
eventsData: [],
columnInformation: {
owners: [
"Захарова А.О.",
"Константинопольская Ю.В.",
"Коломойцев И.К.",
"Ситников А.Г.",
null,
],
},
};
},
methods: {
@@ -40,7 +50,7 @@ export default {
this.eventsData = res.results;
},
fetchEventsData() {
fetch("http://45.84.227.122:8080/registry/event/")
fetch("/registry/event/")
.then((res) => res.json())
.then((res) => this.saveEventsData(res));
},

View File

@@ -1,6 +1,12 @@
<template lang="pug">
.calendar-background-wrapper.flex.flex-col
.header.flex.items-center.justify-between.py-2.px-6
calendar-column(
v-for="(owner, index) in columnInformation.owners"
:key="owner"
:column-information="owner"
:style="calculateColumnPosition(index)"
)
.header
.body.flex.flex-col
.line-wrapper
.line.flex.items-center(
@@ -20,19 +26,23 @@
<script>
import * as moment from "moment/moment";
import CalendarColumn from "./CalendarColumn.vue";
export default {
name: "CalendarBackground",
components: { CalendarColumn },
props: {
hoursArray: Array,
currentTime: String,
currentDate: Object,
dayStartTime: Number,
dayEndTime: Number,
columnInformation: Object,
},
data() {
return {
isShownIndicator: true,
pixelsPerHour: 62,
columnWidth: 470,
};
},
computed: {
@@ -67,6 +77,11 @@ export default {
}
return result;
},
calculateColumnPosition(elemIndex) {
return {
left: `${elemIndex * this.columnWidth}px`,
};
},
},
watch: {
currentDate: function () {
@@ -80,6 +95,7 @@ export default {
<style lang="sass" scoped>
.calendar-background-wrapper
width: 100%
position: relative
.header
height: 48px

View File

@@ -0,0 +1,49 @@
<template lang="pug">
.calendar-column-wrapper.flex.flex-col(@click="output")
.header.flex.items-center.justify-between.py-2.px-6
.flex.items-center
img.avatar-wrapper.mr-2(src="@/assets/images/team-member.svg" alt="Team member")
span.owner-name.font-medium.text-base.mr-6 {{ columnInformation }}
img.icon-wrapper.cursor-pointer(src="@/assets/icons/lock.svg")
base-doc-ok-button
.body
</template>
<script>
import BaseDocOkButton from "@/components/base/buttons/BaseDocOkButton.vue";
export default {
name: "CalendarColumn",
components: { BaseDocOkButton },
props: {
columnInformation: String,
elementKey: String,
},
methods: {
output(event) {
console.log(event.target.id);
},
},
};
</script>
<style lang="sass" scoped>
.calendar-column-wrapper
position: absolute
width: 470px
border-right: 1px solid var(--border-light-grey-color)
height: calc(100% - 54px)
.header
height: 48px
.avatar-wrapper
width: 32px
height: 32px
.icon-wrapper
width: 24px
height: 24px
.owner-name
color: var(--font-dark-blue-color)
</style>

View File

@@ -20,6 +20,7 @@
:current-date="currentDate"
:day-start-time="validateStartTime"
:day-end-time="validateEndTime"
:column-information="columnInformation"
)
</template>
@@ -30,7 +31,11 @@ import CalendarBackground from "./CalendarBackground.vue";
import CalendarClockColumn from "./CalendarClockColumn.vue";
export default {
name: "CalendarSchedule",
components: { CalendarHeader, CalendarBackground, CalendarClockColumn },
components: {
CalendarHeader,
CalendarBackground,
CalendarClockColumn,
},
props: {
currentDate: {
type: Object,
@@ -44,6 +49,12 @@ export default {
return {};
},
},
columnInformation: {
type: Object,
default() {
return {};
},
},
},
data() {
return {