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