Merge branch 'ASTRA-113' into 'master'

WIP Добавила даты в стор

See merge request andrusyakka/urban-couscous!410
This commit is contained in:
Daria Golova
2023-06-08 14:04:18 +00:00
5 changed files with 133 additions and 32 deletions

View File

@@ -191,18 +191,20 @@ export default {
border-bottom: 1px solid var(--border-light-grey-color) border-bottom: 1px solid var(--border-light-grey-color)
.week-item .week-item
color: var(--font-grey-color) color: var(--font-grey-color)
.week-item:nth-last-child(-n+2) &:nth-last-child(-n+2)
color: var(--border-red-color) color: var(--border-red-color)
.date-active .date-active
color: var(--default-white), color: var(--default-white),
background-color: var(--btn-blue-color) background-color: var(--btn-blue-color)
.date-active:hover &:hover
opacity: 0.5 opacity: 0.5
.date-other .date-other
color: var(--font-grey-color) color: var(--font-grey-color)
&:hover
background-color: var(--border-light-grey-color)
.date-month .date-month
color: var(--font-black-color) color: var(--font-black-color)
.date-other:hover, .date-month:hover &:hover
background-color: var(--border-light-grey-color) background-color: var(--border-light-grey-color)
.date-today:hover, .date-range:hover .date-today:hover, .date-range:hover
background-color: var(--btn-blue-color-2) background-color: var(--btn-blue-color-2)

View File

@@ -0,0 +1,45 @@
<template lang="pug">
.calendar-column-wrapper.flex.flex-col
.header.flex.flex-col.items-center.justify-center.top-0
span.font-bold.text-base.color-black 24 мая
span.text-smm.color-grey Понедельник
</template>
<script>
import { mapState } from "vuex";
export default {
name: "CalendarColumn",
props: {},
data() {
return {};
},
computed: {
...mapState({
today: (state) => state.calendar.currentDate,
}),
},
methods: {},
};
</script>
<style lang="sass" scoped>
.calendar-column-wrapper
border-right: 1px solid var(--border-light-grey-color)
width: 380px
.header
height: 60px
position: sticky
z-index: 5
background-color: var(--default-white)
.body
position: relative
z-index: 3
.color-black
color: var(--font-dark-blue-color)
.color-grey
color: var(--font-grey-color)
</style>

View File

@@ -63,8 +63,9 @@
<script> <script>
import BaseInput from "@/components/base/BaseInput"; import BaseInput from "@/components/base/BaseInput";
import * as moment from "moment/moment"; //import * as moment from "moment/moment";
import BaseCalendar from "@/components/base/BaseCalendar"; import BaseCalendar from "@/components/base/BaseCalendar";
import { mapState, mapActions } from "vuex";
export default { export default {
name: "CalendarHeader", name: "CalendarHeader",
components: { BaseInput, BaseCalendar }, components: { BaseInput, BaseCalendar },
@@ -82,8 +83,8 @@ export default {
}, },
], ],
date: { date: {
from: moment(), from: null,
to: moment().clone().add(6, "day"), to: null,
}, },
calendarVisibility: false, calendarVisibility: false,
}; };
@@ -94,6 +95,12 @@ export default {
"D MMMM YYYY" "D MMMM YYYY"
)} - ${this.date?.to?.format("D MMMM YYYY")}`; )} - ${this.date?.to?.format("D MMMM YYYY")}`;
}, },
...mapState({
selectedDates: (state) => state.calendar.selectedDates,
}),
...mapActions({
changeSelectedDates: "changeSelectedDates",
}),
}, },
methods: { methods: {
previousWeek() { previousWeek() {
@@ -105,6 +112,32 @@ export default {
this.date.to = this.date.to.clone().add(1, "week"); this.date.to = this.date.to.clone().add(1, "week");
}, },
}, },
/*watch: {
selectedDates: {
immediate: true,
deep: true,
handler(val) {
console.log("в сторе", val);
},
},
date: {
immediate: true,
deep: true,
handler(val) {
console.log("в компоненте", val);
},
},
calendarVisibility(val) {
console.log(val, this.changeSelectedDates);
if (val === false) this.changeSelectedDates(this.date);
},
},*/
mounted() {
this.date = {
from: this.selectedDates.from.clone(),
to: this.selectedDates.to.clone(),
};
},
}; };
</script> </script>

View File

@@ -1,32 +1,32 @@
<template lang="pug"> <template lang="pug">
.schedule.flex-1.flex.gap-y-1.flex-col( .schedule.flex-1.flex.flex-col(
:style="{width: openSidebar ? 'calc(100vw - 320px)' : 'calc(100vw - 160px)'}" :style="{width: openSidebar ? 'calc(100vw - 320px)' : 'calc(100vw - 160px)'}"
) )
calendar-header.w-full calendar-header.w-full.mb-1
.schedule-body.rounded.h-full.bg-white.w-full .schedule-body.h-full.bg-white.w-full
.w-full(:style="{height: '60px'}") .column-wrapper.flex.ml-20(:style="{width: '3040px'}")
.flex.w-full.relative calendar-column
.flex.w-full.relative.margin
.time-coil-wrapper.left-0.-mt-12 .time-coil-wrapper.left-0.-mt-12
calendar-clock-column(:time-coil="timeCoil") calendar-clock-column(:time-coil="timeCoil")
calendar-background calendar-background
// q-scroll-area.rounded( .w-full.h-3.bg-white.footer
:horizontal-thumb-style="thumbStyle",
:horizontal-bar-style="barStyle",
visible
style="height: 100%; max-width: 100%"
//)
.flex.bg-red-700.background(:style="{width: '3040px', height: '400px'}")
.bar-conteiner.w-full.rounded.bg-white.h-8.absolute.bottom-0
</template> </template>
<script> <script>
import CalendarHeader from "@/pages/newCalendar/components/CalendarHeader"; import CalendarHeader from "@/pages/newCalendar/components/CalendarHeader";
import CalendarBackground from "@/pages/newCalendar/components/CalendarBackground.vue"; import CalendarBackground from "@/pages/newCalendar/components/CalendarBackground.vue";
import CalendarClockColumn from "@/pages/newCalendar/components/CalendarClockColumn.vue"; import CalendarClockColumn from "@/pages/newCalendar/components/CalendarClockColumn.vue";
import CalendarColumn from "@/pages/newCalendar/components/CalendarColumn.vue";
import { mapState } from "vuex"; import { mapState } from "vuex";
export default { export default {
name: "CalendarWrapper", name: "CalendarWrapper",
components: { CalendarHeader, CalendarBackground, CalendarClockColumn }, components: {
CalendarHeader,
CalendarBackground,
CalendarClockColumn,
CalendarColumn,
},
props: { props: {
openSidebar: Boolean, openSidebar: Boolean,
}, },
@@ -64,14 +64,11 @@ export default {
<style lang="sass" scoped> <style lang="sass" scoped>
.schedule-body .schedule-body
width: 100% width: 100%
//overflow-y: auto
overflow-x: auto overflow-x: auto
//&::-webkit-scrollbar-track:horizontal border-top-left-radius: 4px
// margin: 0 24px 0 104px border-top-right-radius: 4px
//&::-webkit-scrollbar-track:vertical &::-webkit-scrollbar-track:horizontal
// margin: 48px 0 24px 0 margin: 0 24px 0 24px
.q-scrollarea :deep(.q-scrollarea__bar), .q-scrollarea :deep(.q-scrollarea__thumb)
opacity: 1
.background .background
background: linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 35%, rgba(0,212,255,1) 100%) background: linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 35%, rgba(0,212,255,1) 100%)
@@ -81,4 +78,15 @@ export default {
z-index: 5 z-index: 5
background-color: var(--default-white) background-color: var(--default-white)
padding-top: 38px padding-top: 38px
.column-wrapper
position: relative
background-color: var(--default-white)
.footer
border-bottom-left-radius: 4px
border-bottom-right-radius: 4px
.margin
border-bottom: 4px solid var(--bg-ligth-blue-color)
</style> </style>

View File

@@ -1,17 +1,30 @@
import * as moment from "moment/moment"; import * as moment from "moment/moment";
moment.locale("ru");
const state = () => ({ const state = () => ({
currentDate: moment(), currentDate: moment(),
workingHours: { workingHours: {
start: "8:00", start: "8:00",
end: "18:00", end: "18:00",
}, },
selectedDates: {
from: moment(),
to: moment().clone().add(6, "day"),
},
}); });
const getters = {}; const getters = {};
const actions = {}; const actions = {
changeSelectedDates({ commit }, dates) {
commit("setSelectedDates", dates);
},
};
const mutations = {}; const mutations = {
setSelectedDates(state, data) {
state.selectedDates = { ...data };
},
};
export default { export default {
state, state,