From f001cc75fe00712f3284a74618228577e41013b8 Mon Sep 17 00:00:00 2001
From: iriska-gri <79623434+iriska-gri@users.noreply.github.com>
Date: Thu, 4 Jul 2024 10:38:26 +0300
Subject: [PATCH] =?UTF-8?q?P-47=20=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=BE?=
=?UTF-8?q?=D1=81=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../calendar_of_events/BigCalendar.vue | 8 +-
.../calendar-create-select.vue | 24 ++-
.../calendar_of_events/calendar-create.vue | 100 +++------
.../calendar_of_events/event-create.vue | 197 +++++++++---------
4 files changed, 144 insertions(+), 185 deletions(-)
diff --git a/src/front/src/components/calendar_of_events/BigCalendar.vue b/src/front/src/components/calendar_of_events/BigCalendar.vue
index 20b9038d7..471aea576 100644
--- a/src/front/src/components/calendar_of_events/BigCalendar.vue
+++ b/src/front/src/components/calendar_of_events/BigCalendar.vue
@@ -88,12 +88,12 @@
rail
>
- {{ showDialog }}
+
+
@@ -151,7 +151,7 @@ export default {
.then((res) => {
eventFromCalendar.value = res.data
if (idEvent.value==null) {
- eventFromCalendar.value.event = {name:'', participant: [], files: [], date_start: "", date_end: "", period: null, description: ''}
+ eventFromCalendar.value.event = {name:'', participant: [], files: [], date_start: "", date_end: "", period: null, description: '', calendar: null}
}
// res.data.forEach(
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 949d1e9c1..2140b7bf0 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
@@ -17,7 +17,7 @@
{{ item.title }}
-
+ {{ item }}
-
+
-
+
ВСЕ СОТРУДНИКИ
@@ -50,6 +55,7 @@
@click.stop=""
density="compact"
class="text-body-2"
+ :disabled="staffed.length == 1 && staffed[0][okey] == true"
>
e[okey] == true) &&
!item.raw.employees.every((e) => e[okey] == true)
"
- :model-value="item.raw[okey]"
+ :model-value="
+ staffed.length == 1 && staffed[0][okey] == true
+ ? true
+ : item.raw[okey]
+ "
>
@@ -139,8 +149,6 @@ export default {
let selected = [];
props.staff.forEach((e) => {
- // e.employees.filter(n => n[props.okey] == true)
-
if (e.employees.every((n) => n[props.okey] == true)) {
e[props.okey] = true;
selected.push(e);
@@ -166,12 +174,10 @@ export default {
});
} else if (item.length) {
let val = item.every((e) => e[props.okey] == true) ? false : true;
- // console.log(item, "GJVTYZKCZ");
cbstaff(item, val);
emit("returnIdParticant", { okey: props.okey, staff: back.value });
} else {
- // account(item)
item[props.okey] = !item[props.okey];
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 949afd160..1f89af227 100644
--- a/src/front/src/components/calendar_of_events/calendar-create.vue
+++ b/src/front/src/components/calendar_of_events/calendar-create.vue
@@ -72,13 +72,6 @@
:okey="'editor'"
@returnIdParticant="returnIdParticant"
/>
-
@@ -116,50 +109,30 @@ export default {
},
setup(props, { emit }) {
- const form_calendar = ref(null);
- const for_editor = ref([]);
-
const accountStore = useAccountStore();
const returnIdParticant = (idPart) => {
-
-
idPart.staff.forEach((e) => {
- if(idPart.okey == 'editor') {
-
+ if (idPart.okey == "editor") {
let ind = propsCalendar.value.participant.find(
(l) => l.participant_calendar == e.id
- )
- console.log(ind);
- ind.editor = e.editor
- // if (ind >= 0) {
- // propsCalendar.value.participant[ind].editor = e.editor
- // }
- // else {
- // propsCalendar.value.participant.push({
- // editor: e.editor,
- // participant_calendar: e.id,
- // });
- // }
-
- }
- else {
- if (e.selected == true) {
- propsCalendar.value.participant.push({
- editor: false,
- participant_calendar: e.id,
- });
- } else {
- let ind = propsCalendar.value.participant.findIndex(
- (l) => l.participant_calendar == e.id
);
- propsCalendar.value.participant.splice(ind, 1);
-
+
+ ind.editor = e.editor;
+ } else {
+ if (e.selected == true) {
+ propsCalendar.value.participant.push({
+ editor: false,
+ participant_calendar: e.id,
+ });
+ } else {
+ let ind = propsCalendar.value.participant.findIndex(
+ (l) => l.participant_calendar == e.id
+ );
+ propsCalendar.value.participant.splice(ind, 1);
+ }
}
- }
});
-
-
};
const propsCalendar = computed({
@@ -178,13 +151,13 @@ export default {
const newCalendar = ref(false);
const calendarNewOrOld = () => {
- console.log(propsCalendar.value, '------propsCalendar.valuepropsCalendar.value')
if (propsCalendar.value.hasOwnProperty("id")) {
titleCard.value = "Редактирование календаря";
- if(propsCalendar.value.author!=accountStore.user.is_idEmployee ) newCalendar.value = true
+ if (propsCalendar.value.author != accountStore.user.is_idEmployee)
+ newCalendar.value = true;
} else {
titleCard.value = "Новый календарь";
-
+
newCalendar.value = true;
}
};
@@ -214,46 +187,28 @@ export default {
axiosApiInstance
.get("api/calendar_of_events/get_employees/")
.then((res) => {
- // console.log(res.data, "res.data");
staff.value = res.data.filter((e) => e.employees.length > 0);
-
});
- const editorStaff = computed({
- get() {
- // console.log(staff.value, '111111111111111111')
- // console.log(propsCalendar.value.participant, 'propsCalendar.value.participantpropsCalendar.value.participant')
- // let r= staff.value.filter(e=> e.selected ==true)
- // return r
- }
- })
-
const newStaff = computed({
get() {
-
staff.value.forEach((e) => {
-
if (propsCalendar.value.participant.length > 0) {
-
e.employees.forEach((empl) => {
-
- let ab =
- propsCalendar.value.participant.find(
- (a) => a.participant_calendar === empl.id
- )
+ let ab = propsCalendar.value.participant.find(
+ (a) => a.participant_calendar === empl.id
+ );
if (ab) {
empl.selected = true;
- empl.editor = ab.editor
-
- }
- else {
+ empl.editor = ab.editor;
+ } else {
empl.selected = false;
- empl.editor = false
+ empl.editor = false;
}
});
}
});
- // console.log(staff.value);
+
return staff.value;
},
});
@@ -309,12 +264,9 @@ export default {
propsCalendar,
delCalendar,
rules,
- form_calendar,
titleCard,
newCalendar,
- staff,
- newStaff,
- editorStaff
+ newStaff
};
},
};
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 faead4d04..001cd6a1f 100644
--- a/src/front/src/components/calendar_of_events/event-create.vue
+++ b/src/front/src/components/calendar_of_events/event-create.vue
@@ -1,63 +1,76 @@
-
-
-
-
-
-
-
- Название
-
-
- {{ propsEvent }}
-
-
-
- Календарь
-
-
-
-
-
-
- {{ item.title }}
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
-