This commit is contained in:
Nukeap committed 2025-02-05 09:00:16 +03:00
1 parent 8afb476ba9
commit 5fe912e8c4
2 files changed
+29 -42

No files matched your search

+4
View File
@@ -9,4 +9,8 @@ export default [
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, {languageOptions: { globals: {...globals.browser, ...globals.node} }},
pluginJs.configs.recommended, pluginJs.configs.recommended,
...pluginVue.configs["flat/essential"], ...pluginVue.configs["flat/essential"],
{rules: {
'no-console': 'warn',
}}
]; ];
@@ -15,7 +15,6 @@
no-resize no-resize
variant="outlined" variant="outlined"
/> />
</v-col> </v-col>
<v-col class="flex-grow-0 px-2"> <v-col class="flex-grow-0 px-2">
<v-btn <v-btn
@@ -52,9 +51,7 @@
<v-col> <v-col>
<calendar-my <calendar-my
:calendars=" :calendars="
calendarForMy.filter( calendarForMy.filter((e) => e.author == accountStore.user.is_idEmployee)
(e) => e.author == accountStore.user.is_idEmployee
)
" "
title="Мои календари" title="Мои календари"
@getCalendar="getCalendar" @getCalendar="getCalendar"
@@ -62,9 +59,7 @@
<calendar-my <calendar-my
:calendars=" :calendars="
calendarForMy.filter( calendarForMy.filter((e) => e.author != accountStore.user.is_idEmployee)
(e) => e.author != accountStore.user.is_idEmployee
)
" "
title="Подписки" title="Подписки"
/> />
@@ -104,13 +99,13 @@
</template> </template>
<script> <script>
import { ref, onMounted, watch } from "vue"; import { ref, onMounted, watch } from 'vue';
import { useWeekendsStore } from "@/store/WeekendsStore"; import { useWeekendsStore } from '@/store/WeekendsStore';
import EventCreate from "@/components/calendar_of_events/event-create.vue"; import EventCreate from '@/components/calendar_of_events/event-create.vue';
import CalendarMy from "@/components/calendar_of_events/calendar-my.vue"; import CalendarMy from '@/components/calendar_of_events/calendar-my.vue';
import { axiosApiInstance } from "@/utils/axios-api"; import { axiosApiInstance } from '@/utils/axios-api';
import { useAccountStore } from "@/store/AccountStore"; import { useAccountStore } from '@/store/AccountStore';
import CalendarFull from "@/components/calendar_of_events/UI_calendar/calendarFull.vue"; import CalendarFull from '@/components/calendar_of_events/UI_calendar/calendarFull.vue';
export default { export default {
components: { EventCreate, CalendarMy, CalendarFull }, components: { EventCreate, CalendarMy, CalendarFull },
@@ -136,13 +131,8 @@ export default {
}; };
const getCalendar = () => { const getCalendar = () => {
axiosApiInstance axiosApiInstance.get(`api/calendar_of_events/my_calendars/`).then((res) => {
.get(`api/calendar_of_events/my_calendars/`) res.data.forEach((e) => (e.visible = accountStore.calendar.includes(e.id) ? false : true));
.then((res) => {
res.data.forEach(
(e) =>
(e.visible = accountStore.calendar.includes(e.id) ? false : true)
);
calendarForMy.value = res.data; calendarForMy.value = res.data;
}); });
}; };
@@ -151,21 +141,17 @@ export default {
const getEvents = (idEvent, clik) => { const getEvents = (idEvent, clik) => {
axiosApiInstance axiosApiInstance
.get( .get(`api/calendar_of_events/my_events/${idEvent === undefined ? '' : `?id=${idEvent}`}`)
`api/calendar_of_events/my_events/${
idEvent === undefined ? "" : `?id=${idEvent}`
}`
)
.then((res) => { .then((res) => {
if (idEvent === undefined) { if (idEvent === undefined) {
res.data.event = { res.data.event = {
name: "", name: '',
participant: [accountStore.user.is_idEmployee], participant: [accountStore.user.is_idEmployee],
files: [], files: [],
date_start: new Date(), date_start: new Date(),
date_end: new Date(), date_end: new Date(),
period: null, period: null,
description: "", description: '',
calendar: null, calendar: null,
}; };
} }
@@ -185,23 +171,20 @@ export default {
}; };
const weekendsData = () => { const weekendsData = () => {
cal.value.$el cal.value.$el.querySelectorAll('.v-date-picker-month__day').forEach((e) => {
.querySelectorAll(".v-date-picker-month__day") let datas = e.getAttribute('data-v-date');
.forEach((e) => { let weeks = new Date(datas).getDay() === 6 || new Date(datas).getDay() === 0;
let datas = e.getAttribute("data-v-date");
let weeks =
new Date(datas).getDay() === 6 || new Date(datas).getDay() === 0;
if (weeks) { if (weeks) {
e.querySelectorAll("span").forEach((n) => { e.querySelectorAll('span').forEach((n) => {
n.classList.add("text-red"); n.classList.add('text-red');
}); });
} }
if (MyMonth.value in week.week[MyYear.value]) { if (MyMonth.value in week.week[MyYear.value]) {
if (week.week[MyYear.value][MyMonth.value].includes(datas)) { if (week.week[MyYear.value][MyMonth.value].includes(datas)) {
e.querySelectorAll("span").forEach((n) => { e.querySelectorAll('span').forEach((n) => {
n.classList.add("text-red"); n.classList.add('text-red');
if (n.classList.contains("text-red") && weeks) { if (n.classList.contains('text-red') && weeks) {
n.classList.replace("text-red", "text-black"); n.classList.replace('text-red', 'text-black');
} }
}); });
} }
@@ -219,7 +202,7 @@ export default {
if (newValue) { if (newValue) {
weekendsData(); weekendsData();
} }
} },
); );
const CheckingStore = () => { const CheckingStore = () => {
@@ -231,7 +214,7 @@ export default {
}; };
const infoEvent = (i) => { const infoEvent = (i) => {
console.log(i, "iiiiiiiiii"); console.log(i, 'iiiiiiiiii');
}; };
return { return {