From b4960a8c05aadd28f58667fcd54a0c225bfe0e11 Mon Sep 17 00:00:00 2001 From: Inna Date: Thu, 18 Sep 2025 12:09:40 +0300 Subject: [PATCH] =?UTF-8?q?fix=20[P-47]:=20=20=D0=BE=D1=82=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=82=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../calendar_of_events/BigCalendar.vue | 40 +++---- .../UI_calendar/CustomCalendar.vue | 3 +- .../UI_calendar/MiniCalendar.vue | 8 +- .../calendar_of_events/calendar-my.vue | 34 ++---- src/front/src/store/AccountStore.js | 103 ++++++++---------- src/front/src/store/calendarStore.js | 99 ++++++++++++++--- 6 files changed, 160 insertions(+), 127 deletions(-) diff --git a/src/front/src/components/calendar_of_events/BigCalendar.vue b/src/front/src/components/calendar_of_events/BigCalendar.vue index fdf10ef47..d82d4756b 100644 --- a/src/front/src/components/calendar_of_events/BigCalendar.vue +++ b/src/front/src/components/calendar_of_events/BigCalendar.vue @@ -75,27 +75,27 @@ export default { getCalendar(); - // const getEvents = (idEvent, clik) => { - // axiosApiInstance - // .get(`api/calendar_of_events/my_events/${idEvent === undefined ? '' : `?id=${idEvent}`}`) - // .then((res) => { - // if (idEvent === undefined) { - // res.data.event = { - // name: '', - // participant: [accountStore.user.is_idEmployee], - // files: [], - // date_start: new Date(), - // date_end: new Date(), - // period: null, - // description: '', - // calendar: null, - // }; - // } - // eventFromCalendar.value = res.data; - // }); - // }; + const getEvents = (idEvent, clik) => { + axiosApiInstance + .get(`api/calendar_of_events/my_events/${idEvent === undefined ? '' : `?id=${idEvent}`}`) + .then((res) => { + if (idEvent === undefined) { + res.data.event = { + name: '', + participant: [accountStore.user.is_idEmployee], + files: [], + date_start: new Date(), + date_end: new Date(), + period: null, + description: '', + calendar: null, + }; + } + eventFromCalendar.value = res.data; + }); + }; - // getEvents(); + getEvents(); onMounted(() => { week.getWeekend(MyYear.value); diff --git a/src/front/src/components/calendar_of_events/UI_calendar/CustomCalendar.vue b/src/front/src/components/calendar_of_events/UI_calendar/CustomCalendar.vue index 7e409071a..32f869cf0 100644 --- a/src/front/src/components/calendar_of_events/UI_calendar/CustomCalendar.vue +++ b/src/front/src/components/calendar_of_events/UI_calendar/CustomCalendar.vue @@ -270,7 +270,7 @@ export default { visibleEvents.value.forEach((event) => { api.addEvent({ id: event.id, - title: event.title, + title: event.name, start: event.date_start, end: event.date_end, allDay: event.all_day, @@ -328,7 +328,6 @@ export default { // Следим за изменениями событий в Pinia watch( - // () => calendarStore.loadEvents(), () => { updateCalendarEvents(); }, diff --git a/src/front/src/components/calendar_of_events/UI_calendar/MiniCalendar.vue b/src/front/src/components/calendar_of_events/UI_calendar/MiniCalendar.vue index 9951c7194..03d8d1167 100644 --- a/src/front/src/components/calendar_of_events/UI_calendar/MiniCalendar.vue +++ b/src/front/src/components/calendar_of_events/UI_calendar/MiniCalendar.vue @@ -24,7 +24,7 @@ @click="openEventDialog" >Создать событие - {{eventFromCalendar}} + @@ -43,14 +43,12 @@ @@ -71,6 +69,7 @@ export default { const calendarStore = useCalendarStore(); const accountStore = useAccountStore(); // const calendarForMy = ref([]); + const { selectedDate, myCalendars, subscribedCalendars } = storeToRefs(calendarStore); const { user } = storeToRefs(accountStore); @@ -89,7 +88,6 @@ export default { onMounted(() => { loadCalendars(); - }); // Реакция на изменения пользователя diff --git a/src/front/src/components/calendar_of_events/calendar-my.vue b/src/front/src/components/calendar_of_events/calendar-my.vue index 68f73e90f..95b8cbff6 100644 --- a/src/front/src/components/calendar_of_events/calendar-my.vue +++ b/src/front/src/components/calendar_of_events/calendar-my.vue @@ -30,10 +30,11 @@ +