fix [P-290]: исправлено обновление календарей после редактирования

This commit is contained in:
Inna committed 2025-10-03 09:17:32 +03:00
1 parent cda088fa65
commit a7703fbc1b
6 files changed
+25 -10

No files matched your search

@@ -337,8 +337,6 @@ export default {
extendedProps: instance.extendedProps, extendedProps: instance.extendedProps,
}); });
}); });
console.log(`Generated ${instances.length} instances for event ${event.id}`);
} else { } else {
// Обычное неповторяющееся событие // Обычное неповторяющееся событие
api.addEvent({ api.addEvent({
@@ -39,7 +39,11 @@
title="Мои календари" title="Мои календари"
@getCalendar="loadCalendars" @getCalendar="loadCalendars"
/> />
<calendar-my :calendars="subscribedCalendars" title="Подписки" /> <calendar-my
:calendars="subscribedCalendars"
title="Подписки"
@getCalendar="loadCalendars"
/>
</v-col> </v-col>
</v-row> </v-row>
</v-col> </v-col>
@@ -39,7 +39,7 @@
</v-locale-provider> </v-locale-provider>
</v-menu> </v-menu>
</v-col> </v-col>
<v-col class="flex-grow-0" :class="`order-${order[1]}`"> <v-col class="flex-grow-0" :class="`order-${order[1]}`" v-if="showTime">
<v-textarea <v-textarea
density="compact" density="compact"
no-resize no-resize
@@ -97,6 +97,16 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
// Новый проп - ограничение по времени (для окончания повторений)
timeLimit: {
type: String,
default: '23:59',
},
// Новый проп - режим работы (обычный или для окончания повторений)
showTime: {
type: Boolean,
default: true,
},
}, },
emits: ['update:dateEvent', 'adjustEndDate'], emits: ['update:dateEvent', 'adjustEndDate'],
@@ -224,7 +224,6 @@ export default {
'#ffc107', // Янтарный '#ffc107', // Янтарный
]; ];
const colorPik = (col) => { const colorPik = (col) => {
if (propsCalendar.value.cl_color === col) { if (propsCalendar.value.cl_color === col) {
propsCalendar.value.cl_color = null; propsCalendar.value.cl_color = null;
@@ -19,7 +19,7 @@
<template v-if="Object.keys(calendars).length > 0"> <template v-if="Object.keys(calendars).length > 0">
<v-list-item <v-list-item
v-for="(x, i) in calendars" v-for="(x, i) in calendars"
:key="i" :key="x.id"
:value="x.cl_name" :value="x.cl_name"
@mouseenter="hover = i" @mouseenter="hover = i"
@mouseleave="hover = null" @mouseleave="hover = null"
@@ -33,8 +33,8 @@
:color="x.cl_color" :color="x.cl_color"
v-model="x.visible" v-model="x.visible"
@update:modelValue="toggleVisiblityEvents(x)" @update:modelValue="toggleVisiblityEvents(x)"
:model-value="x.visible"
></v-checkbox-btn> ></v-checkbox-btn>
<!-- :model-value="x.visible" -->
</template> </template>
<template v-slot:title> <template v-slot:title>
<span class="text-body-2"> {{ x.cl_name }} </span> <span class="text-body-2"> {{ x.cl_name }} </span>
@@ -128,7 +128,7 @@
<v-row no-gutters class="align-top" style="height: 50px"> <v-row no-gutters class="align-top" style="height: 50px">
<v-col class="text-body-2 text-text_grey" lg="2"> Окончание события </v-col> <v-col class="text-body-2 text-text_grey" lg="2"> Окончание события </v-col>
<v-col class="d-flex flex-column"> <v-col class="d-flex flex-column">
<v-row v-if="selectedRule.rule" class="gap" no-gutters> <v-row class="gap" no-gutters>
<v-checkbox <v-checkbox
v-model="showRepeatEnd" v-model="showRepeatEnd"
density="compact" density="compact"
@@ -136,10 +136,11 @@
class="pr-3 pb-3" class="pr-3 pb-3"
/> />
<time-select <time-select
:showTime="false"
v-if="showRepeatEnd" v-if="showRepeatEnd"
:chek="false" :chek="false"
:order="[1, 2]" :order="[1, 2]"
:dateEvent="repeatEndDate ? String(repeatEndDate) : '' " :dateEvent="repeatEndDate ? String(repeatEndDate) : ''"
@update:dateEvent="updateRepeatEndDate" @update:dateEvent="updateRepeatEndDate"
/> />
</v-row> </v-row>
@@ -177,7 +178,7 @@
</template> </template>
<script> <script>
import { computed, ref, watch } from 'vue'; import { computed, onMounted, ref, watch } from 'vue';
import { axiosApiInstance } from '@/utils/axios-api'; import { axiosApiInstance } from '@/utils/axios-api';
import { useAccountStore } from '@/store/AccountStore'; import { useAccountStore } from '@/store/AccountStore';
import DialogCreate from '@/components/calendar_of_events/UI_calendar/dialogCreate.vue'; import DialogCreate from '@/components/calendar_of_events/UI_calendar/dialogCreate.vue';
@@ -374,8 +375,10 @@ export default {
// Инициализация повторов при редактировании // Инициализация повторов при редактировании
const initializeRule = () => { const initializeRule = () => {
console.log('initializeRule called with period:', propsEvent.value.event.period);
if (!propsEvent.value.event.period) { if (!propsEvent.value.event.period) {
selectedRule.value = repeatRules[0]; // "Не повторять" selectedRule.value = repeatRules[0]; // "Не повторять"
console.log('No period found, setting to default rule');
repeatEndDate.value = propsEvent.value.event.date_end repeatEndDate.value = propsEvent.value.event.date_end
? new Date(propsEvent.value.event.date_end) ? new Date(propsEvent.value.event.date_end)
: new Date(); : new Date();
@@ -403,6 +406,7 @@ export default {
} }
selectedRule.value = foundRule || repeatRules[0]; selectedRule.value = foundRule || repeatRules[0];
console.log('Found rule:', foundRule);
// ВАЖНО: инициализируем repeatEndDate и showRepeatEnd // ВАЖНО: инициализируем repeatEndDate и showRepeatEnd
if (rruleOptions.until) { if (rruleOptions.until) {