refactor [P-57]: add FullCalendar
This commit is contained in:
1 parent
fed7886d82
commit
13e20dd4d0
9 files changed
+729
-231
No files matched your search
@@ -1,12 +1,5 @@
|
||||
<template>
|
||||
<v-expansion-panels
|
||||
class="calendar"
|
||||
variant="accordion"
|
||||
flat
|
||||
tile
|
||||
static
|
||||
v-model="openGroup"
|
||||
>
|
||||
<v-expansion-panels class="calendar" variant="accordion" flat tile static v-model="openGroup">
|
||||
<v-expansion-panel elevation="0" flat tile static>
|
||||
<v-expansion-panel-title flat tile static class="py-0 px-3">
|
||||
<div @click.stop="">
|
||||
@@ -47,16 +40,14 @@
|
||||
</template>
|
||||
|
||||
<template v-slot:append>
|
||||
|
||||
<transition name="fade">
|
||||
<v-btn
|
||||
v-if="
|
||||
x.author == accountStore.user.is_idEmployee ||
|
||||
x.author == user.is_idEmployee ||
|
||||
x.participant.some(
|
||||
(e) =>
|
||||
e.editor == true &&
|
||||
e.participant_calendar ==
|
||||
accountStore.user.is_idEmployee
|
||||
e.participant_calendar == user.is_idEmployee,
|
||||
)
|
||||
"
|
||||
size="x-small"
|
||||
@@ -74,21 +65,22 @@
|
||||
</template>
|
||||
</v-expansion-panel-text>
|
||||
</v-expansion-panel>
|
||||
<v-dialog v-model="showDialog" min-width="636" max-width="800">
|
||||
<calendar-create
|
||||
@closeDialog = "showDialog = false"
|
||||
:calendar="calendar"
|
||||
@update:calendar="calendar = $event"
|
||||
@getCalendar="$emit('getCalendar')"
|
||||
/>
|
||||
<v-dialog v-model="showDialog" min-width="636" max-width="800">
|
||||
<calendar-create
|
||||
@closeDialog="showDialog = false"
|
||||
:calendar="calendar"
|
||||
@update:calendar="calendar = $event"
|
||||
@getCalendar="$emit('getCalendar')"
|
||||
/>
|
||||
</v-dialog>
|
||||
</v-expansion-panels>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref } from "vue";
|
||||
import calendarCreate from "@/components/calendar_of_events/calendar-create.vue";
|
||||
import { useAccountStore } from "@/store/AccountStore";
|
||||
import { ref } from 'vue';
|
||||
import calendarCreate from '@/components/calendar_of_events/calendar-create.vue';
|
||||
import { useAccountStore } from '@/store/AccountStore';
|
||||
import { storeToRefs } from 'pinia';
|
||||
export default {
|
||||
components: { calendarCreate },
|
||||
|
||||
@@ -99,51 +91,52 @@ export default {
|
||||
},
|
||||
|
||||
title: {
|
||||
typr: String,
|
||||
default: "",
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
const showDialog = ref(false);
|
||||
const accountStore = useAccountStore();
|
||||
const { user, calendar: userCalendar } = storeToRefs(accountStore);
|
||||
|
||||
const calendar = ref({});
|
||||
const openGroup = ref([0]);
|
||||
const trans = ref(false);
|
||||
const hover = ref(0);
|
||||
|
||||
const editCreatedCalendar = (cal) => {
|
||||
|
||||
if (cal === undefined) {
|
||||
calendar.value = {
|
||||
cl_name: "",
|
||||
participant: [{ editor: true, participant_calendar: accountStore.user.is_idEmployee }],
|
||||
cl_color: "red",
|
||||
cl_descr: "",
|
||||
cl_name: '',
|
||||
participant: [{ editor: true, participant_calendar: user.value.is_idEmployee }],
|
||||
cl_color: 'red',
|
||||
cl_descr: '',
|
||||
};
|
||||
} else {
|
||||
|
||||
calendar.value = cal;
|
||||
}
|
||||
showDialog.value = true;
|
||||
};
|
||||
|
||||
const chekUpdate = (cal) => {
|
||||
let setcal = new Set(accountStore.calendar);
|
||||
let setcal = new Set(userCalendar.value);
|
||||
if (cal.visible == false) {
|
||||
setcal.add(cal.id);
|
||||
} else {
|
||||
setcal.delete(cal.id);
|
||||
}
|
||||
accountStore.calendar = Array.from(setcal);
|
||||
userCalendar.value = Array.from(setcal);
|
||||
};
|
||||
|
||||
return {
|
||||
showDialog,
|
||||
accountStore,
|
||||
user,
|
||||
calendar,
|
||||
showDialog,
|
||||
editCreatedCalendar,
|
||||
chekUpdate,
|
||||
accountStore,
|
||||
openGroup,
|
||||
trans,
|
||||
hover,
|
||||
|
||||
Reference in new issue
Block a user