diff --git a/src/front/src/components/calendar_of_events/BigCalendar.vue b/src/front/src/components/calendar_of_events/BigCalendar.vue
index 8863d4666..a9d6f4613 100644
--- a/src/front/src/components/calendar_of_events/BigCalendar.vue
+++ b/src/front/src/components/calendar_of_events/BigCalendar.vue
@@ -151,6 +151,7 @@ export default {
};
const getCalendar = () => {
+ console.log(idEvent.value,' idEvent.value');
axiosApiInstance
.get(`api/calendar_of_events/my_calendars/`)
.then((res) => {
@@ -166,10 +167,7 @@ export default {
getCalendar();
const getEvents = () => {
- console.log(
- idEvent.value,
- "idEvent.value------------------------------------------------------------------"
- );
+
axiosApiInstance
.get(
`api/calendar_of_events/my_events/${
@@ -177,6 +175,7 @@ export default {
}`
)
.then((res) => {
+ console.log(eventFromCalendar.value, 'eventFromCalendar.value')
eventFromCalendar.value = res.data;
if (idEvent.value == null) {
@@ -191,7 +190,7 @@ export default {
calendar: null,
};
}
- console.log(eventFromCalendar.value, 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvv')
+
}
@@ -200,13 +199,12 @@ export default {
getEvents();
- const createEvent = (i) => {
- if (i != undefined) {
- idEvent.value = i;
- getEvents()
- }
+ const createEvent = () => {
+
+
showDialog.value = true;
getCalendar();
+ console.log('1');
// emit("getCalendar");
};
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 1792efc1a..d0837d137 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
@@ -24,8 +24,6 @@
-
{{ getMonthName(monthNow + 1) }}
@@ -52,8 +50,18 @@
-
+
props.allEvent,
set: (value) => emit("update:allEvent", value),
});
- const events = ref([
-
- ]);
+ const events = ref([]);
const returnPeriod = computed({
get() {
- let select = [propsAllEvent.value];
+ let select = [];
propsAllEvent.value.forEach((e) => {
- // console.log(e, 'e')
+ // console.log(e, "e");
+
e.events.forEach((i) => {
- // console.log(i, 'i')
+ if (
+ i.period == null &&
+ new Date(i.date_end) > new Date(getLastDayOfMonth())
+ )
+ i.date_end = new Date(getLastDayOfMonth());
+
+ // console.log(i, "i");
let objRule = JSON.parse(i.period);
if (objRule != null) {
@@ -117,55 +130,78 @@ export default {
until: new Date(objRule.origOptions.until),
});
let actRule = rule.all();
- actRule.forEach((r) => {
- let ev = {
+
+ actRule
+ .filter(
+ (date) =>
+ new Date(date).getMonth() ===
+ new Date(selectDay.value).getMonth() &&
+ new Date(date).getYear() ===
+ new Date(selectDay.value).getYear()
+ )
+ .forEach((r) => {
+ let ev = {
title: i.name,
color: e.cl_color,
start: new Date(r),
end: new Date(i.date_end),
- id: i.id
-
- }
- events.value.push(ev)
- // console.log(r , "rule");
- // console.log(ev , "ev");
- })
-
-
+ id: i.id,
+ disable:
+ new Date(r).setHours(0, 0, 0, 0) ==
+ new Date(i.date_end).setHours(0, 0, 0, 0),
+ };
+
+ events.value.push(ev);
+
+ });
+ } else {
+ let dates = getDatesBetweenDates(
+ new Date(i.date_start),
+ new Date(i.date_end)
+ );
+
+ dates.forEach((d) => {
+ let ev = {
+ title: i.name,
+ color: e.cl_color,
+ start: new Date(d),
+ end: new Date(i.date_end),
+ id: i.id,
+ disable:
+ new Date(d).setHours(0, 0, 0, 0) ==
+ new Date(i.date_end).setHours(0, 0, 0, 0),
+ };
+ events.value.push(ev);
+ });
+
}
});
});
-
return select;
},
});
- // const value = computed({
+ const getDatesBetweenDates = (startDate, endDate) => {
+ let dates = [];
+ let currentDate = new Date(startDate);
- // get() {
+ while (currentDate <= endDate) {
+ dates.push(new Date(currentDate));
+ currentDate.setDate(currentDate.getDate() + 1);
+ }
- // console.log('111111111111111111111');
- // return new Date(today.value)
- // },
- // set(newValue) {
- // console.log(newValue, "value===============");
- // },
- // });
+ return dates;
+ };
- // const dayNow = new Date();
+ const getLastDayOfMonth = () => {
+ let currentMonth = new Date(selectDay.value).getMonth();
+ let currentYear = new Date(selectDay.value).getFullYear();
- // const dayNow = ref(new Date(
- // new Date().setDate(
- // new Date().getDate() - 3
- // )
- // ))
+ return new Date(currentYear, currentMonth + 1, 0);
+ };
- // const selectDay = new Date(
- // new Date().setDate(
- // new Date().getDate() - 3
- // )
- // )
+
const selectDay = ref([new Date()]);
const monthNow = ref(new Date().getMonth());
const YearNow = ref(new Date().getFullYear());
@@ -239,9 +275,8 @@ export default {
};
const whatDay = (e) => {
- console.log(e.id, "---e.id---------------");
- emit("getEvent", e.id)
-
+
+ emit("getEvent", e.id);
};
// const controlDate = computed({
diff --git a/src/front/src/components/calendar_of_events/UI_calendar/periodEvents.vue b/src/front/src/components/calendar_of_events/UI_calendar/periodEvents.vue
index e23a56f5d..1b93d39ad 100644
--- a/src/front/src/components/calendar_of_events/UI_calendar/periodEvents.vue
+++ b/src/front/src/components/calendar_of_events/UI_calendar/periodEvents.vue
@@ -41,7 +41,7 @@ export default {
))
// : (propsDateEvent.value.date_end = new Date())&&(propsDateEvent.value.date_start = new Date())
emit('chekUp', newValue)
- console.log(propsDateEvent.value.date_start, 'propsDateEvent.value.date_start');
+
},
});
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 2acdd2b7b..c5ebf38d3 100644
--- a/src/front/src/components/calendar_of_events/event-create.vue
+++ b/src/front/src/components/calendar_of_events/event-create.vue
@@ -239,12 +239,15 @@ export default {
// let rule = new RRule({
// dtstart: objRule.origOptions.dtstart
- // // ...objRule.origOptions
+ // // ...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]);
- console.log(dateEventsRules.value, "------dateEventsRules.value =");
+
return select;
},
set(newValue) {
@@ -253,12 +256,12 @@ export default {
dtstart: new Date(propsEvent.value.event.date_start),
until: new Date(propsEvent.value.event.date_end),
});
- propsEvent.value.event.period =
+
Object.keys(newValue.rule).length == 0
? null
: JSON.stringify(newRulse);
dateEventsRules.value = newRulse.all();
- console.log(dateEventsRules.value, "returnP");
+
},
});
@@ -348,7 +351,7 @@ export default {
const files = ref([]);
const postFiles = (f) => {
files.value = f;
- console.log(f, "postFiles");
+
};
const calendar = computed({
@@ -431,7 +434,7 @@ export default {
const dateEvent = computed({
get() {
- console.log("работает?");
+
return formatComa(new Date(propsEvent.value.event.date_start));
},
diff --git a/src/front/src/components/calendar_of_events/load-ical.vue b/src/front/src/components/calendar_of_events/load-ical.vue
index ef5dd445b..7619b8cda 100644
--- a/src/front/src/components/calendar_of_events/load-ical.vue
+++ b/src/front/src/components/calendar_of_events/load-ical.vue
@@ -59,9 +59,7 @@ export default {
participants: participant.value,
calendar: calendar.value,
})
- .then((data) => {
- console.log(data, "datas");
- });
+
}
const handleFilesUpload = (event) => {
diff --git a/src/front/src/views/safety/DocumentationSafety.vue b/src/front/src/views/safety/DocumentationSafety.vue
index 8ec5b631c..828d64e3e 100644
--- a/src/front/src/views/safety/DocumentationSafety.vue
+++ b/src/front/src/views/safety/DocumentationSafety.vue
@@ -161,7 +161,7 @@ export default {
const downloadItem = (file) => {
let url = development.value ? burl + file.file_name : spravURLBase + `files/${file.typeoffile == 'comm' ? 'committee1_docs' : 'order_responsibility_docs'}/${file.parent}/${get_name(file.file_name)}`
- console.log(burl + file.file_name);
+
axiosApiInstance.get(url, { responseType: "blob" }).then((response) => {
saveAs(response.data, get_name(decodeURI(file.file_name)));
});