diff --git a/src/front/src/components/calendar_of_events/BigCalendar.vue b/src/front/src/components/calendar_of_events/BigCalendar.vue index c2f7d342d..8863d4666 100644 --- a/src/front/src/components/calendar_of_events/BigCalendar.vue +++ b/src/front/src/components/calendar_of_events/BigCalendar.vue @@ -73,8 +73,13 @@ - - + + + @@ -90,11 +95,11 @@ > --> - + @@ -106,14 +111,12 @@ import EventCreate from "@/components/calendar_of_events/event-create.vue"; import CalendarMy from "@/components/calendar_of_events/calendar-my.vue"; import { axiosApiInstance } from "@/utils/axios-api"; import { useAccountStore } from "@/store/AccountStore"; -import CalendarFull from '@/components/calendar_of_events/UI_calendar/calendarFull.vue'; - +import CalendarFull from "@/components/calendar_of_events/UI_calendar/calendarFull.vue"; export default { components: { EventCreate, CalendarMy, CalendarFull }, - setup(props, {emit}) { - + setup(props, { emit }) { const accountStore = useAccountStore(); const showDialog = ref(false); const week = useWeekendsStore(); @@ -123,24 +126,22 @@ export default { const MyYear = ref(selectdate.value.getFullYear()); const MyMonth = ref(selectdate.value.getMonth() + 1); const calendarForMy = ref([]); - const eventFromCalendar = ref({}) - const idEvent = ref(null) - // const idEvent = ref(2) + const eventFromCalendar = ref({}); + const idEvent = ref(null); + // const idEvent = ref(4) + // const rule = new RRule({ + // freq: RRule.WEEKLY, + // interval: 5, + // byweekday: [RRule.MO, RRule.FR], + // dtstart: datetime(2024, 7, 1), + // until: datetime(2024, 8, 15) + // }) + // const dates = rule.all() -// const rule = new RRule({ -// freq: RRule.WEEKLY, -// interval: 5, -// byweekday: [RRule.MO, RRule.FR], -// dtstart: datetime(2024, 7, 1), -// until: datetime(2024, 8, 15) -// }) - -// const dates = rule.all() - -// // const dates = rule.all(); -// console.log(dates, '==============================='); + // // const dates = rule.all(); + // console.log(dates, '==============================='); const getMonth = (month) => { MyMonth.value = month + 1; @@ -150,7 +151,6 @@ export default { }; const getCalendar = () => { - axiosApiInstance .get(`api/calendar_of_events/my_calendars/`) .then((res) => { @@ -159,35 +159,56 @@ export default { (e.visible = accountStore.calendar.includes(e.id) ? false : true) ); calendarForMy.value = res.data; - console.log(calendarForMy.value , 'eventFromCalendar.value-----------------------') + // console.log(calendarForMy.value , 'eventFromCalendar.value-----------------------') }); }; getCalendar(); - const getEvents = () => { - + console.log( + idEvent.value, + "idEvent.value------------------------------------------------------------------" + ); axiosApiInstance - .get(`api/calendar_of_events/my_events/${idEvent.value==null?'':`?id=${idEvent.value}`}`) + .get( + `api/calendar_of_events/my_events/${ + idEvent.value == null ? "" : `?id=${idEvent.value}` + }` + ) .then((res) => { - eventFromCalendar.value = res.data - - - if (idEvent.value==null) { - eventFromCalendar.value.event = {name:'', participant: [accountStore.user.is_idEmployee], files: [], date_start: new Date(), date_end: new Date(), period: null, description: '', calendar: null} - } + eventFromCalendar.value = res.data; - }); + if (idEvent.value == null) { + eventFromCalendar.value.event = { + name: "", + participant: [accountStore.user.is_idEmployee], + files: [], + date_start: new Date(), + date_end: new Date(), + period: null, + description: "", + calendar: null, + }; + } + console.log(eventFromCalendar.value, 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvv') + } + + + ); }; getEvents(); - const createEvent = () => { - showDialog.value = true - emit("getCalendar"); - } - + const createEvent = (i) => { + if (i != undefined) { + idEvent.value = i; + getEvents() + } + showDialog.value = true; + getCalendar(); + // emit("getCalendar"); + }; const weekendsData = () => { cal.value.$el @@ -235,6 +256,10 @@ export default { } }; + const infoEvent = (i) => { + console.log(i, "iiiiiiiiii"); + }; + return { drawer_right, selectdate, @@ -249,7 +274,8 @@ export default { accountStore, getCalendar, eventFromCalendar, - createEvent + createEvent, + infoEvent, }; }, }; 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 d96498e76..1792efc1a 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 @@ -8,8 +8,6 @@ :year="YearNow" :model-value="selectDay" > - - -