diff --git a/src/back/calendar_of_events/views.py b/src/back/calendar_of_events/views.py
index 3152feda9..914d8dbbd 100644
--- a/src/back/calendar_of_events/views.py
+++ b/src/back/calendar_of_events/views.py
@@ -40,6 +40,7 @@ class MyCalendars(APIView):
'''
try:
+
ob=MyCalendarPostParameters(data=request.data)
if ob.is_valid():
ob = ob.data
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 836f9da6f..8fcc4ea4f 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
@@ -105,11 +105,17 @@ export default {
setup(props, { emit }) {
const filtered = ref("");
const staff = ref([]);
+
+ 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) => {
@@ -125,18 +131,38 @@ export default {
});
});
+
+
const selectedStaff = computed(() => {
+
let selected = [];
+ // let idEmployees = props.participant
+
+
+
+
+
staff.value.forEach((e) => {
+
+ e.employees
+ .filter((n) => n.selected == true)
+ .map((res) => {
+ calendarParticipant.value.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));
}
});
+
+
+ // 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 ebd797646..cdf473207 100644
--- a/src/front/src/components/calendar_of_events/calendar-create.vue
+++ b/src/front/src/components/calendar_of_events/calendar-create.vue
@@ -1,10 +1,10 @@
- {{calendar}}
+ {{ calendar }}
Новый календарь
-
+
-
@@ -54,7 +53,11 @@
Участники
-
+
+
@@ -78,15 +81,17 @@
class="text-subtitle-1"
elevation="0"
width="150"
- @click="dialog_create_calendar = false"
+
>Отменить
+
Создать
@@ -120,6 +125,7 @@
import { computed, ref } from "vue";
import { axiosApiInstance } from "@/utils/axios-api";
import calendarCreateSelect from "@/components/calendar_of_events/calendar-create-select.vue";
+import { useAlertStore } from "@/store/useAlertStore";
export default {
components: { calendarCreateSelect },
@@ -132,59 +138,35 @@ export default {
calendar: {
type: Object,
- default: {cl_name:'', participant: []},
+ default: { cl_name: "", participant: [] },
},
},
setup(props, { emit }) {
+ console.log('-1111111111111')
+
+
const dialog_create_calendar = computed({
get: () => props.opendialog,
set: (value) => emit("update:opendialog", value),
});
- // const calendar = ref([
- // {
- // cl_color: "#F44336",
- // cl_descr: "Малюсенький календарь",
- // cl_name: "Мой первый календарь",
- // editor: true,
- // participant: [
- // { editor: 0, user: 107 },
- // { editor: 1, user: 125 },
- // ],
- // events: {
- // date_end: "2024-06-29T12:20:28+03:00",
- // date_start: "2024-05-29T12:20:24+03:00",
- // description: "Описание такое описание",
- // event: 1,
- // id: 1,
- // name: "Первое событие в календаре",
- // period: null,
- // },
- // id: 1,
- // },
- // ]);
- // const getMyCalendar = () => {
- // axiosApiInstance
- // .get(`api/calendar_of_events/get_calendars/`)
- // .then((data) => {
- // console.log(data.data, "datadatadatawwwwwwwwwwww");
- // });
- // };
- // getMyCalendar();
+ const feedalert = useAlertStore().alert;
- // get_calendars
- // const confirmation = () => {
- // axiosApiInstance
- // .get(`api/calendar_of_events/employee/`)
- // .then((data) => {
- // console.log(data.data, "datadatadatawwwwwwwwwwww");
- // });
- // };
+
- // confirmation()
+ const postCalendar = () => {
+ axiosApiInstance
+ .post(`api/calendar_of_events/my_calendars/`, props.calendar)
+ .then((result) => {
+ feedalert.alert = true;
+ feedalert.text = result.data.mess;
+ feedalert.ico = "mdi-check";
+ feedalert.color = "green-darken-4";
+ });
+ };
const color = [
"red",
@@ -212,16 +194,18 @@ export default {
}
};
-
-
-
+ const upParticant = () => {
+ console.log('hi')
+ props.calendar.participant = $event
+ }
return {
dialog_create_calendar,
-
+
+ postCalendar,
color,
colorPik,
-
+ upParticant
};
},
};
diff --git a/src/front/src/components/calendar_of_events/calendar-my.vue b/src/front/src/components/calendar_of_events/calendar-my.vue
index 943fd8459..f5e4746a9 100644
--- a/src/front/src/components/calendar_of_events/calendar-my.vue
+++ b/src/front/src/components/calendar_of_events/calendar-my.vue
@@ -73,6 +73,7 @@
@update:opendialog="showDialog = $event"
:opendialog="showDialog"
:calendar="calendar"
+
/>
diff --git a/src/front/src/layouts/default/alertDefault.vue b/src/front/src/layouts/default/alertDefault.vue
index 7519b9215..ae1410980 100644
--- a/src/front/src/layouts/default/alertDefault.vue
+++ b/src/front/src/layouts/default/alertDefault.vue
@@ -1,63 +1,47 @@
-
-
+
+
+
+ {{ feedalert.text }}
+
- {{feedalert.text}}
-
-
+
-
\ No newline at end of file
+