Merge branch '38_calendar_back' into P-10

This commit is contained in:
Nukeap committed 2024-05-28 21:29:14 +03:00
commit ab8811773f
8 files changed
+379 -9

No files matched your search

+1
View File
@@ -7,4 +7,5 @@ urlpatterns = [
path('calendarEvents/', CalendarEventsAPIView.as_view(), name='calendarEvents'),
path('get_calendars/', GetCalendars.as_view(), name='get_calendars'),
path('exclusionDatas/', ExclusionDatesAPIView.as_view(), name='exclusionDatas'),
# path('createEvents/', CreateEventsAPIView.as_view(), name='createEvents')
]
@@ -1,10 +1,32 @@
<template>
<v-row no-gutters>
<v-col class="flex-grow-0 d-flex flex-column">
<v-col class="flex-grow-0 d-flex flex-column ">
<v-card class="h-100 rounded-0 d-flex flex-colmn" width="250">
<v-row no-gutters class="flex-column">
<v-col class="flex-grow-0">
<!-- <v-btn></v-btn> -->
<v-text-field
density="compact"
clearable
append-inner-icon="mdi-magnify"
hide-details
class="py-3"
label="Найти событие"
rows="1"
no-resize
variant="outlined"
/>
</v-col>
<v-col class="flex-grow-0">
<v-btn
type="submit"
class="text-subtitle-1 font-weight-light"
color="btn_text"
block
elevation="1"
@click="showDialog = true"
>Создать событие</v-btn
>
</v-col>
<v-col class="w100" lg="3">
<v-locale-provider locale="ru">
@@ -20,14 +42,12 @@
@update:month="getMonth"
@update:year="getYear"
>
</v-date-picker>
<pre>
{{ week }}
</pre>
</v-locale-provider>
</v-col>
<v-col>
<calendar-my />
</v-col>
<v-col></v-col>
</v-row>
<!-- <v-date-picker show-adjacent-months></v-date-picker> -->
@@ -48,6 +68,11 @@
rail
>
</v-navigation-drawer>
{{ showDialog }}
<event-create
@update:opendialog="showDialog = $event"
:opendialog="showDialog"
/>
</v-row>
</template>
@@ -56,10 +81,15 @@ import { axiosApiInstance } from "@/utils/axios-api";
import { ref, onMounted } from "vue";
import { useWeekendsStore } from "@/store/WeekendsStore";
import EventCreate from "@/components/calendar_of_events/event-create.vue";
import CalendarMy from "@/components/calendar_of_events/calendar-my.vue";
// const burl = baseURL.slice(0, -1);
export default {
components: { EventCreate, CalendarMy },
setup() {
const showDialog = ref(false);
const week = useWeekendsStore().week;
const drawer_right = ref(false);
const cal = ref(null);
@@ -130,6 +160,7 @@ export default {
weekendsData,
week,
CheckingStore,
showDialog,
};
},
};
@@ -0,0 +1,218 @@
<template>
<v-dialog v-model="dialog_create_event" max-width="636">
<v-card height="436" class="pa-3">
<v-card-title class="pr-0 pl-2 d-flex justify-space-between">
Новый календарь
<v-icon
icon="mdi-close cursor-pointer"
size="small"
color="grey"
@click="dialog_create_event = false"
></v-icon>
</v-card-title>
<v-card-text class="d-flex py-0 px-3">
<v-row no-gutters class="flex-column">
<v-col class="d-flex flex-column">
<v-row no-gutters class="align-center">
<v-col class="text-body-2 text-text_grey" lg="2">
Название
</v-col>
<v-col>
<v-textarea
density="compact"
label="Описание"
row-height="25"
rows="1"
variant="outlined"
hide-details
></v-textarea></v-col
></v-row>
<v-row no-gutters class="align-center">
<v-col class="text-body-2 text-text_grey" lg="2"> Цвет </v-col>
<v-col v-for="(x, key) in color" :key="key">
<v-avatar
class="cursor-pointer"
@click="colorPik(x.color, key)"
size="x-small"
:color="x.color"
:variant="newcalendar.cl_color===null?'flat': newcalendar.cl_color===x.color ?'flat': 'tonal'"
/> </v-col
></v-row>
{{color}}
<v-row no-gutters class="align-center">
<v-col class="text-body-2 text-text_grey" lg="2">
Участники
</v-col>
<v-col>
<!-- <v-select
v-model="value"
:items="items"
label="Выберите из списка или найдите по ФИО"
chips
multiple
hide-details
></v-select> -->
</v-col
></v-row>
</v-col>
<v-col class="d-flex flex-grow-0">
<v-textarea
density="compact"
label="Описание"
row-height="25"
rows="4"
variant="outlined"
hide-details
shaped
no-resize
></v-textarea>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-btn
class="text-subtitle-1"
elevation="0"
width="150"
@click="dialog_create_event = false"
>Отменить</v-btn
>
<v-btn
class="text-subtitle-1 font-weight-regular"
color="btn_text"
variant="flat"
elevation="0"
width="150"
>Создать</v-btn
>
</v-card-actions>
<!-- <v-row no-gutters class="gap flex-column">
v-col*
</v-row> -->
<!-- <v-row>
<v-col>
<v-textarea
v-model="newcalendar.cl_name"
placeholder="Название календаря"
no-resize
rows="1"
hide-details
density="compact"
/>
</v-col>
</v-row>
{{newcalendar}} -->
</v-card>
</v-dialog>
</template>
<script>
import { computed, ref } from "vue";
import { axiosApiInstance } from "@/utils/axios-api";
export default {
props: {
opendialog: {
type: Boolean,
default: false,
},
},
setup(props, { emit }) {
// 1. ПОчему фигурируют эвенты при создании календарей?
// 2. Мне кажется, должен быть цвет по умолчанию в любом случае -- как без цвета отрисовывать потом на календаре? Но то ладно
const dialog_create_event = computed({
get: () => props.opendialog,
set: (value) => emit("update:opendialog", value),
});
// get_calendars
// const confirmation = () => {
// axiosApiInstance
// .get(`api/calendar_of_events/createEvents/`)
// .then((data) => {
// console.log(data.data, "datadatadatawwwwwwwwwwww");
// });
// };
// я бы убрал наверное объект в просто массив цветов без ключей
const color = ref([
{ color: "#F44336", ton: false },
{ color: "#E91E63", ton: false },
{ color: "#FF5722", ton: false },
{ color: "#FFC107", ton: false },
{ color: "#FFEB3B", ton: false },
{ color: "#CDDC39", ton: false },
{ color: "#8BC34A", ton: false },
{ color: "#4CAF50", ton: false },
{ color: "#00BCD4", ton: false },
{ color: "#03A9F4", ton: false },
{ color: "#2196F3", ton: false },
{ color: "#3F51B5", ton: false },
{ color: "#673AB7", ton: false },
{ color: "#9C27B0", ton: false },
{ color: "#607D8B", ton: false },
{ color: "#795548", ton: false },
]);
// Лишнее усложнение
// const colorPik = (col, key) => {
// color.value.map((e, k) => {
// // e.ton = false
// if (k != key ) {
// e.ton = !color.value[k].ton;
// }
// else if ((k == key) && color.value[k].ton == true ) {
// e.ton = false
// console.log(k, key, color.value[k].ton, 'kuku');
// }
// console.log(k, key, color.value[k].ton)
// });
// console.log(color, key, "col");
// };
// вместо этого
const colorPik = (col)=>{
if(newcalendar.value.cl_color===col){
newcalendar.value.cl_color=null
}else{newcalendar.value.cl_color=col
}
}
// почему запрос запускается при загрузке
// confirmation();
const newcalendar = ref({
cl_name: "",
cl_color: null,
cl_descr: "",
patrcipant_calendar: [],
});
return {
dialog_create_event,
newcalendar,
color,
colorPik,
};
},
};
</script>
<style></style>
@@ -0,0 +1,71 @@
<template>
<v-list density="compact">
<v-list-group value="Admin">
<template v-slot:activator="{ props }">
<v-list-item v-bind="props">
<template v-slot:prepend>
<div @click.stop="">
<span> Мои календари </span>
</div>
<v-btn
size="x-small"
icon="mdi-plus"
variant="text"
@click.stop="showDialog = true"
></v-btn>
</template>
</v-list-item>
</template>
<v-list-item
v-for="(x, i) in mycalendar"
:key="i"
:title="x.name"
:value="x.name"
>
<template v-slot:prepend="{ isActive }">
<v-checkbox-btn
:color="x.color"
:model-value="isActive"
v-model="x.chek"
/>
</template>
</v-list-item>
</v-list-group>
<calendar-create
@update:opendialog="showDialog = $event"
:opendialog="showDialog"
/>
</v-list>
</template>
<script>
import { ref, onMounted, computed } from "vue";
import calendarCreate from "./calendar-create.vue";
export default {
components: { calendarCreate },
setup(props, { emit }) {
const showDialog = ref(false);
const selected = ref(true);
const subscribe = [
{ name: "Дни рождения", chek: true, id: 0, color: "yellow" },
];
const mycalendar = ref([
{ name: "Портал ЦОД2", chek: false, id: 1, color: "red" },
{ name: "Личный календарь", chek: true, id: 2, color: "green" },
]);
return {
mycalendar,
subscribe,
selected,
showDialog,
};
},
};
</script>
<style></style>
@@ -0,0 +1,42 @@
<template>
<v-dialog v-model="dialog_create_event" max-width="700">
<v-card height="400"> hello </v-card>
</v-dialog>
</template>
<script>
import { computed, ref } from "vue";
import { axiosApiInstance } from "@/utils/axios-api";
export default {
props: {
opendialog: {
type: Boolean,
default: false,
},
},
setup(props, { emit }) {
const dialog_create_event = computed({
get: () => props.opendialog,
set: (value) => emit("update:opendialog", value),
});
const confirmation = () => {
axiosApiInstance
.get(`api/calendar_of_events/createEvents/`)
.then((data) => {
console.log(data.data, "datadatadatawwwwwwwwwwww");
});
};
confirmation()
return {
dialog_create_event,
};
},
};
</script>
<style></style>
@@ -6,6 +6,7 @@
rows="1"
placeholder="Название календаря"
/> -->
<v-text-field v-model="dataToEdit.name" placeholder="Заголовок" />
</v-card-title>
<v-card-subtitle>
@@ -29,6 +30,7 @@
density="compact"
v-bind="props"
>
<template v-slot:prepend-inner>
<v-icon
v-bind="props"
@@ -69,7 +71,7 @@
language: 'ru',
}"
/> -->
{{dataToEdit}}
<v-textarea
v-model="dataToEdit.place"
placeholder="Местопроведение события"
@@ -123,6 +125,8 @@ import CKEditor from "@ckeditor/ckeditor5-vue";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import "@ckeditor/ckeditor5-build-classic/build/translations/ru";
import EventDialogEditParticipant from "./event-dialog-edit-participant.vue";
import eventDialogEdit from "@/components/calendar_of_events/event-dialog-edit.vue";
export default {
props: {
event: {
@@ -20,9 +20,10 @@
/> -->
<!-- <event-dialog-info :event="event" v-else /> -->
<component
:is = "editEvent ? 'eventDialogEdit':'eventDialogInfo'"
:is = "editEvent ? 'eventDialogEdit':'eventDialogInfo'"
:event="event"
@returnUpdateData="returnUpdateData"
/>
</v-dialog>
</template>
+2
View File
@@ -29,6 +29,7 @@ export default createVuetify({
main_theme: "#f7f7f7",
scrollbar: '#367F8A',
cards: '#F5F5F5',
text_grey: '#7A7A7A', //Цвет серого текста
text_carous: '#242424',
navigation: '#004D40', // Цвет текста и иконок в левом навигационном меню
black_grey: '#3C3C3C', // Цвет для карусели с цифрами в работе
@@ -55,6 +56,7 @@ export default createVuetify({
main_theme: "#101311",
scrollbar: '#367F8A',
cards: '#F5F5F5',
text_grey: '#7A7A7A', //Цвет серого текста
text_carous: '#242424',
navigation: '#FDF5E6',
black_grey: '#3C3C3C',