diff --git a/src/front/src/components/calendar_of_events/BigCalendar.vue b/src/front/src/components/calendar_of_events/BigCalendar.vue index 6fc32e58a..84e8c7e55 100644 --- a/src/front/src/components/calendar_of_events/BigCalendar.vue +++ b/src/front/src/components/calendar_of_events/BigCalendar.vue @@ -15,6 +15,7 @@ import CustomCalendar from '@/components/calendar_of_events/UI_calendar/CustomCa import MiniCalendar from '@/components/calendar_of_events/UI_calendar/MiniCalendar.vue'; import { useCalendarStore } from '@/store/calendarStore'; import { useAccountStore } from '@/store/AccountStore'; +import { useRoute } from 'vue-router'; export default { components: { MiniCalendar, CustomCalendar }, @@ -22,6 +23,7 @@ export default { const calendarStore = useCalendarStore(); const accountStore = useAccountStore(); const calendarKey = ref(0); + const route = useRoute(); onMounted(() => { const currentYear = new Date().getFullYear(); @@ -29,6 +31,9 @@ export default { calendarStore.loadCalendars(); calendarStore.loadDictEmployees(); calendarStore.loadEmployees(); + if (route.query.date) { + calendarStore.setSelectedDate(route.query.date); + } }); watch( diff --git a/src/front/src/components/calendar_of_events/EventCreate.vue b/src/front/src/components/calendar_of_events/EventCreate.vue index b9479dc98..fe5dcd16f 100644 --- a/src/front/src/components/calendar_of_events/EventCreate.vue +++ b/src/front/src/components/calendar_of_events/EventCreate.vue @@ -531,15 +531,18 @@ watch(eventCalendar, (newCalendar) => { } }); -const delEvent = (idev) => { - axiosApiInstance.delete(`api/calendar_of_events/my_events/?delid=${idev}`).then((result) => { - feedalert.alert = true; - feedalert.text = result.data.mess; - feedalert.ico = 'mdi-check'; - feedalert.color = 'orange-accent-1'; - emit('getCalendar'); - }); - emit('closeDialog'); +const delEvent = async (idev) => { + try { + const result = await axiosApiInstance.delete(`api/calendar_of_events/my_events/?delid=${idev}`) + feedalert.alert = true + feedalert.text = result.data.mess + feedalert.ico = 'mdi-check' + feedalert.color = 'orange-accent-1' + emit('getCalendar') + emit('closeDialog') + } catch (e) { + console.error('Ошибка удаления события:', e); + } }; const newFiles = ref([]); diff --git a/src/front/src/components/calendar_of_events/EventShow.vue b/src/front/src/components/calendar_of_events/EventShow.vue index 5f4ca8000..fdd7b1d94 100644 --- a/src/front/src/components/calendar_of_events/EventShow.vue +++ b/src/front/src/components/calendar_of_events/EventShow.vue @@ -1,185 +1,172 @@