diff --git a/src/front/src/components/calendar_of_events/BigCalendar.vue b/src/front/src/components/calendar_of_events/BigCalendar.vue index 5ad8c1339..12d75e4f6 100644 --- a/src/front/src/components/calendar_of_events/BigCalendar.vue +++ b/src/front/src/components/calendar_of_events/BigCalendar.vue @@ -127,8 +127,8 @@ export default { const MyMonth = ref(selectdate.value.getMonth() + 1); const calendarForMy = ref([]); const eventFromCalendar = ref({}); - const idEvent = ref(null); - // 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"); + axiosApiInstance .get(`api/calendar_of_events/my_calendars/`) .then((res) => { @@ -160,24 +160,24 @@ export default { (e.visible = accountStore.calendar.includes(e.id) ? false : true) ); calendarForMy.value = res.data; - // console.log(calendarForMy.value , 'eventFromCalendar.value-----------------------') + }); }; getCalendar(); - const getEvents = () => { - console.log(idEvent.value, "idEvent.value----------------"); + const getEvents = (idEvent) => { + console.log(idEvent, 'idEvent-------------------') axiosApiInstance .get( `api/calendar_of_events/my_events/${ - idEvent.value == null ? "" : `?id=${idEvent.value}` + idEvent == null ? "" : `?id=${idEvent}` }` ) .then((res) => { eventFromCalendar.value = res.data; - if (idEvent.value == null) { + if (idEvent == null) { eventFromCalendar.value.event = { name: "", participant: [accountStore.user.is_idEmployee], @@ -195,8 +195,9 @@ export default { getEvents(); const createEvent = (idEv) => { + console.log(idEv, '222222222222') showDialog.value = true; - // getEvents(); + getEvents(idEv); }; const weekendsData = () => { diff --git a/src/front/src/components/calendar_of_events/UI_calendar/calendarFull.vue b/src/front/src/components/calendar_of_events/UI_calendar/calendarFull.vue index d0837d137..22ec3b59f 100644 --- a/src/front/src/components/calendar_of_events/UI_calendar/calendarFull.vue +++ b/src/front/src/components/calendar_of_events/UI_calendar/calendarFull.vue @@ -2,7 +2,7 @@ - {{ YearNow }} г. - + {{ YearNow }} г. + props.allEvent, set: (value) => emit("update:allEvent", value), }); - const events = ref([]); const returnPeriod = computed({ get() { let select = []; propsAllEvent.value.forEach((e) => { - // console.log(e, "e"); + // console.log(e, "e"); e.events.forEach((i) => { if ( @@ -130,7 +129,7 @@ export default { until: new Date(objRule.origOptions.until), }); let actRule = rule.all(); - + actRule .filter( (date) => @@ -150,16 +149,15 @@ export default { new Date(r).setHours(0, 0, 0, 0) == new Date(i.date_end).setHours(0, 0, 0, 0), }; - - events.value.push(ev); + select.push(ev); }); } else { let dates = getDatesBetweenDates( new Date(i.date_start), new Date(i.date_end) ); - + dates.forEach((d) => { let ev = { title: i.name, @@ -171,9 +169,8 @@ export default { new Date(d).setHours(0, 0, 0, 0) == new Date(i.date_end).setHours(0, 0, 0, 0), }; - events.value.push(ev); + select.push(ev); }); - } }); }); @@ -201,7 +198,6 @@ export default { return new Date(currentYear, currentMonth + 1, 0); }; - const selectDay = ref([new Date()]); const monthNow = ref(new Date().getMonth()); const YearNow = ref(new Date().getFullYear()); @@ -275,7 +271,6 @@ export default { }; const whatDay = (e) => { - emit("getEvent", e.id); }; @@ -296,7 +291,6 @@ export default { type, types, switchCalendar, - events, monthNow, YearNow,