47 lines
1.2 KiB
Vue
47 lines
1.2 KiB
Vue
<template>
|
|
<v-row no-gutters>
|
|
<v-col class="flex-grow-0 d-flex flex-column">
|
|
<mini-calendar />
|
|
</v-col>
|
|
<v-col class="d-flex flex-column">
|
|
<custom-calendar :key="calendarKey" />
|
|
</v-col>
|
|
</v-row>
|
|
</template>
|
|
|
|
<script>
|
|
import { ref, onMounted, watch } from 'vue';
|
|
import CustomCalendar from '@/components/calendar_of_events/UI_calendar/CustomCalendar.vue';
|
|
import MiniCalendar from '@/components/calendar_of_events/UI_calendar/MiniCalendar.vue';
|
|
import { useCalendarStore } from '@/store/calendarStore';
|
|
import { useAccountStore } from '@/store/AccountStore';
|
|
|
|
export default {
|
|
components: { MiniCalendar, CustomCalendar },
|
|
setup() {
|
|
const calendarStore = useCalendarStore();
|
|
const accountStore = useAccountStore();
|
|
const calendarKey = ref(0);
|
|
|
|
onMounted(() => {
|
|
const currentYear = new Date().getFullYear();
|
|
calendarStore.fetchHolidays(currentYear);
|
|
calendarStore.loadCalendars();
|
|
calendarStore.loadDictEmployees();
|
|
calendarStore.loadEmployees();
|
|
});
|
|
|
|
watch(
|
|
() => accountStore.user?.id,
|
|
(newId, oldId) => {
|
|
if (newId !== oldId) calendarKey.value += 1;
|
|
},
|
|
);
|
|
|
|
return { calendarKey };
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style scoped></style>
|