From d4ebc14212b6716e2cff55914da60f0aef0c68c9 Mon Sep 17 00:00:00 2001
From: iriska-gri <79623434+iriska-gri@users.noreply.github.com>
Date: Tue, 25 Jun 2024 13:33:23 +0300
Subject: [PATCH] =?UTF-8?q?P-42=20=D0=A0=D0=B0=D0=B1=D0=BE=D1=87=D0=B0?=
=?UTF-8?q?=D1=8F=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D1=8F=20=D1=80=D0=B5?=
=?UTF-8?q?=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?=
=?UTF-8?q?=D0=B8=D1=8F=20=D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80?=
=?UTF-8?q?=D1=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/back/calendar_of_events/views.py | 1 +
.../calendar_of_events/BigCalendar.vue | 67 +++++-----
.../calendar-create-select.vue | 32 ++---
.../calendar_of_events/calendar-create.vue | 51 ++++----
.../calendar_of_events/calendar-my.vue | 116 +++++++++---------
5 files changed, 131 insertions(+), 136 deletions(-)
diff --git a/src/back/calendar_of_events/views.py b/src/back/calendar_of_events/views.py
index 914d8dbbd..74bd63a42 100644
--- a/src/back/calendar_of_events/views.py
+++ b/src/back/calendar_of_events/views.py
@@ -39,6 +39,7 @@ class MyCalendars(APIView):
'''
+ print(request.data, '---------------')
try:
ob=MyCalendarPostParameters(data=request.data)
diff --git a/src/front/src/components/calendar_of_events/BigCalendar.vue b/src/front/src/components/calendar_of_events/BigCalendar.vue
index 3f5352561..7bcff20b0 100644
--- a/src/front/src/components/calendar_of_events/BigCalendar.vue
+++ b/src/front/src/components/calendar_of_events/BigCalendar.vue
@@ -44,35 +44,31 @@
-
+
-
-
-
-
-
+
+
+
-
-
@@ -128,17 +124,19 @@ export default {
MyYear.value = year;
};
- axiosApiInstance
- .get("api/calendar_of_events/my_calendars/")
- .then((res) => {
- res.data.forEach(
- (e) =>
- (e.visible = accountStore.calendar.includes(e.id) ? false : true
- )
- );
- calendarForMy.value = res.data;
- console.log(calendarForMy.value, 'calendarForMy.valuecalendarForMy.valuecalendarForMy.value');
- });
+ const getCalendar = () => {
+ axiosApiInstance
+ .get("api/calendar_of_events/my_calendars/")
+ .then((res) => {
+ res.data.forEach(
+ (e) =>
+ (e.visible = accountStore.calendar.includes(e.id) ? false : true)
+ );
+ calendarForMy.value = res.data;
+ });
+ };
+
+ getCalendar();
const weekendsData = () => {
cal.value.$el
@@ -198,6 +196,7 @@ export default {
showDialog,
calendarForMy,
accountStore,
+ getCalendar,
};
},
};
diff --git a/src/front/src/components/calendar_of_events/calendar-create-select.vue b/src/front/src/components/calendar_of_events/calendar-create-select.vue
index 8fcc4ea4f..7f0649ea4 100644
--- a/src/front/src/components/calendar_of_events/calendar-create-select.vue
+++ b/src/front/src/components/calendar_of_events/calendar-create-select.vue
@@ -106,16 +106,16 @@ export default {
const filtered = ref("");
const staff = ref([]);
- const calendarParticipant = computed({
- get: () => props.participant,
- set: (value) => emit("update:participant", value),
- });
-
+ // const calendarParticipant = computed({
+ // get: () => props.participant,
+ // set: (value) => emit("update:participant", value),
+ // });
+
axiosApiInstance
.get("api/calendar_of_events/get_employees/")
.then((res) => {
staff.value = res.data.filter((e) => e.employees.length > 0);
-
+
staff.value.forEach((e) => {
if (props.participant.length > 0) {
e.employees.forEach((empl) => {
@@ -131,38 +131,26 @@ export default {
});
});
-
-
const selectedStaff = computed(() => {
-
let selected = [];
- // let idEmployees = props.participant
-
-
-
-
-
+ let idEmployees = [];
staff.value.forEach((e) => {
-
e.employees
.filter((n) => n.selected == true)
.map((res) => {
- calendarParticipant.value.push({ participant_calendar: res.id });
+ idEmployees.push({ participant_calendar: res.id });
});
if (e.employees.every((n) => n.selected == true)) {
e.selected = true;
selected.push(e);
- }
- else {
+ } else {
e.selected = false;
selected.push(...e.employees.filter((n) => n.selected == true));
}
});
+ emit("returnIdParticant", idEmployees);
-
- // calendarParticipant.value = idEmployees
-
return selected;
});
diff --git a/src/front/src/components/calendar_of_events/calendar-create.vue b/src/front/src/components/calendar_of_events/calendar-create.vue
index cdf473207..8feec3bf3 100644
--- a/src/front/src/components/calendar_of_events/calendar-create.vue
+++ b/src/front/src/components/calendar_of_events/calendar-create.vue
@@ -3,8 +3,11 @@
{{ calendar }}
- Новый календарь
-
+ {{
+ calendar.hasOwnProperty("id")
+ ? "Редактирование календаря"
+ : "Новый календарь"
+ }}
-
-
@@ -81,10 +82,10 @@
class="text-subtitle-1"
elevation="0"
width="150"
-
+ @click="dialog_create_calendar = false"
>Отменить
-
+
Создать
+ {{ calendar.hasOwnProperty("id") ? "Редактировать" : "Создать" }}
+
-
-
-
-
-
+
+
+
+
+
+
+
-Календарей нет
+ Календарей нет
@@ -73,7 +78,7 @@
@update:opendialog="showDialog = $event"
:opendialog="showDialog"
:calendar="calendar"
-
+ @getCalendar="$emit('getCalendar')"
/>
@@ -103,7 +108,7 @@ export default {
const calendar = ref({});
const openGroup = ref([0]);
const trans = ref(false);
- const hover = ref(0)
+ const hover = ref(0);
@@ -130,7 +135,8 @@ export default {
accountStore,
openGroup,
trans,
- hover
+ hover,
+
};
},
};
@@ -148,11 +154,10 @@ export default {
}
.calendar .v-expansion-panel-text__wrapper {
- padding: 0!important;
- padding-right: 10px!important;
+ padding: 0 !important;
+ padding-right: 10px !important;
}
.trasitlist:hover .transitbtn {
-
animation-fill-mode: forwards;
/* transition: opacity 0.1s; */
animation-duration: 0.5s;
@@ -173,12 +178,9 @@ export default {
.transitbtn {
opacity: 0;
-
+
/* animation-direction: reverse; */
/* animation-duration: 0.1s;
animation-name: filli; */
}
-
-
-