fix [P-47]: отображение событий
This commit is contained in:
1 parent
19aa007317
commit
b4960a8c05
6 files changed
+160
-127
No files matched your search
@@ -30,10 +30,11 @@
|
||||
<v-checkbox-btn
|
||||
class="text-caption"
|
||||
:class="`text-${x.cl_color}`"
|
||||
v-model="x.visible"
|
||||
:color="x.cl_color"
|
||||
v-model="x.visible"
|
||||
@update:modelValue="chekUpdate(x)"
|
||||
></v-checkbox-btn>
|
||||
<!-- :model-value="x.visible" -->
|
||||
</template>
|
||||
<template v-slot:title>
|
||||
<span class="text-body-2"> {{ x.cl_name }} </span>
|
||||
@@ -45,7 +46,7 @@
|
||||
v-if="
|
||||
x.author == user.is_idEmployee ||
|
||||
x.participant.some(
|
||||
(e) => e.editor == true && e.participant_calendar == user.is_idEmployee,
|
||||
(e) => e.editor === true && e.participant_calendar === user.is_idEmployee,
|
||||
)
|
||||
"
|
||||
size="x-small"
|
||||
@@ -79,7 +80,8 @@ import { ref } from 'vue';
|
||||
import calendarCreate from '@/components/calendar_of_events/calendar-create.vue';
|
||||
import { useAccountStore } from '@/store/AccountStore';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { axiosApiInstance } from '../../utils/axios-api';
|
||||
import { useCalendarStore } from '@/store/calendarStore';
|
||||
|
||||
export default {
|
||||
components: { calendarCreate },
|
||||
|
||||
@@ -95,10 +97,12 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
setup(props) {
|
||||
const showDialog = ref(false);
|
||||
const accountStore = useAccountStore();
|
||||
const { user, calendar: userCalendar } = storeToRefs(accountStore);
|
||||
const { user } = storeToRefs(accountStore);
|
||||
const calendarStore = useCalendarStore();
|
||||
const { toggleCalendarVisibility } = calendarStore;
|
||||
|
||||
const calendar = ref({});
|
||||
const openGroup = ref([0]);
|
||||
@@ -120,27 +124,9 @@ export default {
|
||||
};
|
||||
|
||||
const chekUpdate = (cal) => {
|
||||
let setcal = new Set(userCalendar.value);
|
||||
if (cal.visible == false) {
|
||||
|
||||
setcal.add(cal.id);
|
||||
} else {
|
||||
testRequest();
|
||||
setcal.delete(cal.id);
|
||||
}
|
||||
userCalendar.value = Array.from(setcal);
|
||||
toggleCalendarVisibility(cal.id, cal.visible);
|
||||
};
|
||||
|
||||
async function testRequest() {
|
||||
try {
|
||||
const response = await axiosApiInstance.get('api/calendar_of_events/my_events/?id=1');
|
||||
|
||||
console.log(response.data); // response.data, а не response.body!
|
||||
} catch (error) {
|
||||
console.error('Ошибка:', error);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
accountStore,
|
||||
user,
|
||||
|
||||
Reference in new issue
Block a user