Merge branch '38_calendar_back' into P-10
This commit is contained in:
commit
ab8811773f
8 files changed
+377
-7
No files matched your search
@@ -7,4 +7,5 @@ urlpatterns = [
|
|||||||
path('calendarEvents/', CalendarEventsAPIView.as_view(), name='calendarEvents'),
|
path('calendarEvents/', CalendarEventsAPIView.as_view(), name='calendarEvents'),
|
||||||
path('get_calendars/', GetCalendars.as_view(), name='get_calendars'),
|
path('get_calendars/', GetCalendars.as_view(), name='get_calendars'),
|
||||||
path('exclusionDatas/', ExclusionDatesAPIView.as_view(), name='exclusionDatas'),
|
path('exclusionDatas/', ExclusionDatesAPIView.as_view(), name='exclusionDatas'),
|
||||||
|
# path('createEvents/', CreateEventsAPIView.as_view(), name='createEvents')
|
||||||
]
|
]
|
||||||
@@ -4,7 +4,29 @@
|
|||||||
<v-card class="h-100 rounded-0 d-flex flex-colmn" width="250">
|
<v-card class="h-100 rounded-0 d-flex flex-colmn" width="250">
|
||||||
<v-row no-gutters class="flex-column">
|
<v-row no-gutters class="flex-column">
|
||||||
<v-col class="flex-grow-0">
|
<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>
|
||||||
<v-col class="w100" lg="3">
|
<v-col class="w100" lg="3">
|
||||||
<v-locale-provider locale="ru">
|
<v-locale-provider locale="ru">
|
||||||
@@ -20,14 +42,12 @@
|
|||||||
@update:month="getMonth"
|
@update:month="getMonth"
|
||||||
@update:year="getYear"
|
@update:year="getYear"
|
||||||
>
|
>
|
||||||
|
|
||||||
</v-date-picker>
|
</v-date-picker>
|
||||||
<pre>
|
|
||||||
{{ week }}
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
</v-locale-provider>
|
</v-locale-provider>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<v-col>
|
||||||
|
<calendar-my />
|
||||||
|
</v-col>
|
||||||
<v-col></v-col>
|
<v-col></v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<!-- <v-date-picker show-adjacent-months></v-date-picker> -->
|
<!-- <v-date-picker show-adjacent-months></v-date-picker> -->
|
||||||
@@ -48,6 +68,11 @@
|
|||||||
rail
|
rail
|
||||||
>
|
>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
|
{{ showDialog }}
|
||||||
|
<event-create
|
||||||
|
@update:opendialog="showDialog = $event"
|
||||||
|
:opendialog="showDialog"
|
||||||
|
/>
|
||||||
</v-row>
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -56,10 +81,15 @@ import { axiosApiInstance } from "@/utils/axios-api";
|
|||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useWeekendsStore } from "@/store/WeekendsStore";
|
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);
|
// const burl = baseURL.slice(0, -1);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { EventCreate, CalendarMy },
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
|
const showDialog = ref(false);
|
||||||
const week = useWeekendsStore().week;
|
const week = useWeekendsStore().week;
|
||||||
const drawer_right = ref(false);
|
const drawer_right = ref(false);
|
||||||
const cal = ref(null);
|
const cal = ref(null);
|
||||||
@@ -130,6 +160,7 @@ export default {
|
|||||||
weekendsData,
|
weekendsData,
|
||||||
week,
|
week,
|
||||||
CheckingStore,
|
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"
|
rows="1"
|
||||||
placeholder="Название календаря"
|
placeholder="Название календаря"
|
||||||
/> -->
|
/> -->
|
||||||
|
|
||||||
<v-text-field v-model="dataToEdit.name" placeholder="Заголовок" />
|
<v-text-field v-model="dataToEdit.name" placeholder="Заголовок" />
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-subtitle>
|
<v-card-subtitle>
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
density="compact"
|
density="compact"
|
||||||
v-bind="props"
|
v-bind="props"
|
||||||
>
|
>
|
||||||
|
|
||||||
<template v-slot:prepend-inner>
|
<template v-slot:prepend-inner>
|
||||||
<v-icon
|
<v-icon
|
||||||
v-bind="props"
|
v-bind="props"
|
||||||
@@ -69,7 +71,7 @@
|
|||||||
language: 'ru',
|
language: 'ru',
|
||||||
}"
|
}"
|
||||||
/> -->
|
/> -->
|
||||||
|
{{dataToEdit}}
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="dataToEdit.place"
|
v-model="dataToEdit.place"
|
||||||
placeholder="Местопроведение события"
|
placeholder="Местопроведение события"
|
||||||
@@ -123,6 +125,8 @@ import CKEditor from "@ckeditor/ckeditor5-vue";
|
|||||||
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
|
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
|
||||||
import "@ckeditor/ckeditor5-build-classic/build/translations/ru";
|
import "@ckeditor/ckeditor5-build-classic/build/translations/ru";
|
||||||
import EventDialogEditParticipant from "./event-dialog-edit-participant.vue";
|
import EventDialogEditParticipant from "./event-dialog-edit-participant.vue";
|
||||||
|
import eventDialogEdit from "@/components/calendar_of_events/event-dialog-edit.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
event: {
|
event: {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
:is = "editEvent ? 'eventDialogEdit':'eventDialogInfo'"
|
:is = "editEvent ? 'eventDialogEdit':'eventDialogInfo'"
|
||||||
:event="event"
|
:event="event"
|
||||||
@returnUpdateData="returnUpdateData"
|
@returnUpdateData="returnUpdateData"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export default createVuetify({
|
|||||||
main_theme: "#f7f7f7",
|
main_theme: "#f7f7f7",
|
||||||
scrollbar: '#367F8A',
|
scrollbar: '#367F8A',
|
||||||
cards: '#F5F5F5',
|
cards: '#F5F5F5',
|
||||||
|
text_grey: '#7A7A7A', //Цвет серого текста
|
||||||
text_carous: '#242424',
|
text_carous: '#242424',
|
||||||
navigation: '#004D40', // Цвет текста и иконок в левом навигационном меню
|
navigation: '#004D40', // Цвет текста и иконок в левом навигационном меню
|
||||||
black_grey: '#3C3C3C', // Цвет для карусели с цифрами в работе
|
black_grey: '#3C3C3C', // Цвет для карусели с цифрами в работе
|
||||||
@@ -55,6 +56,7 @@ export default createVuetify({
|
|||||||
main_theme: "#101311",
|
main_theme: "#101311",
|
||||||
scrollbar: '#367F8A',
|
scrollbar: '#367F8A',
|
||||||
cards: '#F5F5F5',
|
cards: '#F5F5F5',
|
||||||
|
text_grey: '#7A7A7A', //Цвет серого текста
|
||||||
text_carous: '#242424',
|
text_carous: '#242424',
|
||||||
navigation: '#FDF5E6',
|
navigation: '#FDF5E6',
|
||||||
black_grey: '#3C3C3C',
|
black_grey: '#3C3C3C',
|
||||||
|
|||||||
Reference in new issue
Block a user