From 739d2f03beb40e16566fbf62c4b38ba798d71275 Mon Sep 17 00:00:00 2001 From: Inna Date: Mon, 29 Sep 2025 08:25:21 +0300 Subject: [PATCH] =?UTF-8?q?fix=20[P-290]:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0?= =?UTF-8?q?=20=D0=BA=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/back/calendar_of_events/views.py | 3 +-- .../src/components/UI/defaultportal/uploading-file.vue | 9 ++++++++- .../calendar_of_events/UI_calendar/CustomCalendar.vue | 8 ++------ .../src/components/calendar_of_events/event-create.vue | 1 - src/front/src/store/calendarStore.js | 7 ++++--- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/back/calendar_of_events/views.py b/src/back/calendar_of_events/views.py index f3c6bd0d8..41fab9df2 100644 --- a/src/back/calendar_of_events/views.py +++ b/src/back/calendar_of_events/views.py @@ -20,11 +20,10 @@ class ExclusionDatesAPIView(APIView): year = self.request.query_params.get('year', datetime.now().year) exclude = ExclusionDates.objects.filter(exclusiondate__year=year) months = {} - for i in range(1,12): + for i in range(1,13): months[i] = exclude.filter(exclusiondate__month=i).values_list("exclusiondate", flat=True) return Response({year:months}) - class MyCalendars(APIView): def get(self, request): diff --git a/src/front/src/components/UI/defaultportal/uploading-file.vue b/src/front/src/components/UI/defaultportal/uploading-file.vue index 8847d5aea..3144e3cb0 100644 --- a/src/front/src/components/UI/defaultportal/uploading-file.vue +++ b/src/front/src/components/UI/defaultportal/uploading-file.vue @@ -66,8 +66,12 @@ export default { type: Array, default: () => [], }, + newFiles: { + type: Array, + default: [], + }, }, - emits: ['update:files', 'postFiles'], + emits: ['update:files', 'update: newFiles', 'postFiles'], setup(props, { emit }) { const localNewFiles = ref([]); @@ -80,6 +84,7 @@ export default { (newVal) => { localNewFiles.value = [...newVal]; }, + { immediate: true }, ); const formatFileSize = (bytes) => { @@ -176,6 +181,8 @@ export default { // Обработка изменения новых файлов const handleFilesChange = (files) => { + + if (!files) { // localNewFiles.value = []; emit('postFiles', []); 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 e6958b38b..fab6a70ac 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 @@ -377,12 +377,8 @@ export default { }); onMounted(async () => { - try { - const currentYear = new Date().getFullYear(); - await calendarStore.fetchHolidays(currentYear); - } catch (error) { - console.error('Failed to load holidays:', error); - } + const currentYear = new Date().getFullYear(); + calendarStore.fetchHolidays(currentYear); }); watch(selectedDate, (newDate) => { diff --git a/src/front/src/components/calendar_of_events/event-create.vue b/src/front/src/components/calendar_of_events/event-create.vue index 663a8cc5a..f2edf7deb 100644 --- a/src/front/src/components/calendar_of_events/event-create.vue +++ b/src/front/src/components/calendar_of_events/event-create.vue @@ -234,7 +234,6 @@ export default { ], calendar: [(val) => !!val || 'Выберите календарь'], }; - console.log(propsEvent.value); const repeatRules = [ { type: 'Не повторять', rule: null, id: 1 }, { diff --git a/src/front/src/store/calendarStore.js b/src/front/src/store/calendarStore.js index 04af4741a..ffe6874ac 100644 --- a/src/front/src/store/calendarStore.js +++ b/src/front/src/store/calendarStore.js @@ -205,11 +205,12 @@ export const useCalendarStore = defineStore('calendarStore', () => { // Проверка на исключение (рабочая суббота или праздничный будний день) const isExceptionDay = holidaysForMonth.includes(normalizedCurrentDate); - return { + const result = { isNonWorking: (isWeekend && !isExceptionDay) || (!isWeekend && isExceptionDay), - isWeekendForStyling: isWeekend && !isExceptionDay, // только для серого фона - isHoliday: !isWeekend && isExceptionDay, // только праздничный будний + isWeekendForStyling: isWeekend && !isExceptionDay, + isHoliday: !isWeekend && isExceptionDay, }; + return result; }; // Открыть диалог создания/редактирования