diff --git a/src/front/src/components/calendar_of_events/BigCalendar.vue b/src/front/src/components/calendar_of_events/BigCalendar.vue index a9d6f4613..5ad8c1339 100644 --- a/src/front/src/components/calendar_of_events/BigCalendar.vue +++ b/src/front/src/components/calendar_of_events/BigCalendar.vue @@ -128,7 +128,7 @@ export default { const calendarForMy = ref([]); const eventFromCalendar = ref({}); const idEvent = ref(null); - // const idEvent = ref(4) + // const idEvent = ref(27) // const rule = new RRule({ // freq: RRule.WEEKLY, @@ -151,7 +151,7 @@ export default { }; const getCalendar = () => { - console.log(idEvent.value,' idEvent.value'); + console.log(idEvent.value, " idEvent.value"); axiosApiInstance .get(`api/calendar_of_events/my_calendars/`) .then((res) => { @@ -167,7 +167,7 @@ export default { getCalendar(); const getEvents = () => { - + console.log(idEvent.value, "idEvent.value----------------"); axiosApiInstance .get( `api/calendar_of_events/my_events/${ @@ -175,7 +175,6 @@ export default { }` ) .then((res) => { - console.log(eventFromCalendar.value, 'eventFromCalendar.value') eventFromCalendar.value = res.data; if (idEvent.value == null) { @@ -190,22 +189,14 @@ export default { calendar: null, }; } - - } - - - ); + }); }; getEvents(); - const createEvent = () => { - - + const createEvent = (idEv) => { showDialog.value = true; - getCalendar(); - console.log('1'); - // emit("getCalendar"); + // getEvents(); }; const weekendsData = () => { 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 c5ebf38d3..8ed9fb13f 100644 --- a/src/front/src/components/calendar_of_events/event-create.vue +++ b/src/front/src/components/calendar_of_events/event-create.vue @@ -90,7 +90,6 @@ - - - + + v-model="returnPeriod" + :items="repeatRules" + variant="outlined" + density="compact" + return-object + item-title="type" + item-id="type" + /> - @@ -218,36 +215,28 @@ export default { { type: "Каждый год", rule: { freq: 0 } }, ]; - const dateEventsRules = ref({}); const returnPeriod = computed({ get() { + console.log(propsEvent.value, 'propsEvent.value'); let select = []; - let objRule = JSON.parse(propsEvent.value.event.period); - + if (objRule != null) { - repeatRules.findIndex(e=> e.rule.freq == objRule.origOptions.freq) - // let rule = new RRule({ - // freq: objRule.origOptions.freq, - // dtstart: new Date(objRule.origOptions.dtstart), - // until: new Date(objRule.origOptions.until), - // }); - // dateEventsRules.value = rule.all(); + repeatRules.findIndex((e) => e.rule.freq == objRule.origOptions.freq); } - // let rule = new RRule({ - // dtstart: objRule.origOptions.dtstart - // // ...objRule.origOptions - // new Date( - // new Date().setDate( - // new Date().getDate() - 3 - // }) - select.push(repeatRules[objRule != null?repeatRules.findIndex(e=> e.rule.freq == objRule.origOptions.freq): 0]); + select.push( + repeatRules[ + objRule != null + ? repeatRules.findIndex( + (e) => e.rule.freq == objRule.origOptions.freq + ) + : 0 + ] + ); - - return select; }, set(newValue) { @@ -256,12 +245,15 @@ export default { dtstart: new Date(propsEvent.value.event.date_start), until: new Date(propsEvent.value.event.date_end), }); - - Object.keys(newValue.rule).length == 0 - ? null - : JSON.stringify(newRulse); - dateEventsRules.value = newRulse.all(); - + + Object.keys(newValue.rule).length == 0 + ? null + : (propsEvent.value.event.period = JSON.stringify( + newRulse + )); + // : (propsEvent.value.event.period = JSON.stringify( + // newRulse.origOptions + // )); }, }); @@ -351,7 +343,6 @@ export default { const files = ref([]); const postFiles = (f) => { files.value = f; - }; const calendar = computed({ @@ -434,7 +425,6 @@ export default { const dateEvent = computed({ get() { - return formatComa(new Date(propsEvent.value.event.date_start)); },