Merge branch 'develop' into 22_about_inspection
This commit is contained in:
commit
b10128405a
24 files changed
+834
-374
No files matched your search
@@ -1,6 +1,7 @@
|
||||
from rest_framework import serializers
|
||||
from .models import *
|
||||
from userauth.models import *
|
||||
from userauth.serializers import *
|
||||
|
||||
# Сериализатор модели StateSize (Штатная численность)
|
||||
class StateSizeSerializer(serializers.ModelSerializer):
|
||||
@@ -25,14 +26,14 @@ class InspectionDirectionsSerializer(serializers.ModelSerializer):
|
||||
|
||||
|
||||
# Сериализаторы структуры инспекции
|
||||
class ChiefsDepsSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = DictEmployee
|
||||
fields = [ "id","login","fio","post","room","familyname","email","tel","department"]
|
||||
# class ChiefsDepsSerializer(serializers.ModelSerializer):
|
||||
# class Meta:
|
||||
# model = DictEmployee
|
||||
# fields = [ "id","login","fio","post","room","familyname","email","tel","department"]
|
||||
|
||||
|
||||
# Основной сериализатор структуры инспекции
|
||||
class StructureSerializer(ChiefsDepsSerializer):
|
||||
class StructureSerializer(InfoUserCardSerializer):
|
||||
deps = serializers.SerializerMethodField('get_deps',)
|
||||
class Meta:
|
||||
model = DictEmployee
|
||||
@@ -50,5 +51,5 @@ class DepsSerializer(serializers.ModelSerializer):
|
||||
fields = '__all__'
|
||||
|
||||
def get_chief_deps(self, obj):
|
||||
return ChiefsDepsSerializer(obj.id_chief).data
|
||||
return InfoUserCardSerializer(obj.id_chief).data
|
||||
|
||||
@@ -5,11 +5,6 @@ from django.conf import settings
|
||||
from enum import Enum
|
||||
from ckeditor_uploader.fields import RichTextUploadingField
|
||||
|
||||
class FilesEvent(models.Model):
|
||||
""" Прикрепленные файлы к событию"""
|
||||
name = models.CharField(max_length=300, verbose_name='Название файла')
|
||||
link = models.FileField(upload_to='documents/%Y/%m/%d')
|
||||
|
||||
class CalendarEventsName(models.Model):
|
||||
""" Глобавльное название календаря"""
|
||||
name=models.CharField(max_length=300, verbose_name='Название Календаря')
|
||||
@@ -34,9 +29,8 @@ class CalendarEvents(models.Model):
|
||||
description = RichTextUploadingField(null=True, blank= True, verbose_name='Описание события')
|
||||
cdate =models.DateTimeField(default=datetime.now, verbose_name='Дата создания')
|
||||
enddate = models.DateTimeField(null=True, blank= True, default=datetime.now().replace(hour=23,minute=0,second=0,microsecond=0) + timedelta(days=7), verbose_name='Дата снятия с публикации')
|
||||
frequency = models.CharField(verbose_name='Периодичность', null=True, blank= True, max_length=255, db_index=True, choices=FrequencyEvents.get_choices(), default=FrequencyEvents.get_choices()[0][1])
|
||||
frequency = models.JSONField(verbose_name='Периодичность', null=True, blank= True)
|
||||
author = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT, verbose_name='Автор события')
|
||||
docfile = models.ForeignKey(FilesEvent, on_delete=models.PROTECT, null=True, blank= True, related_name='get_files_events', verbose_name='Прикрепеленные файлы')
|
||||
place = models.CharField(null=True, blank= True, max_length=500, verbose_name='Место проведения события')
|
||||
calendarname = models.ForeignKey(CalendarEventsName, on_delete=models.PROTECT, related_name='get_calendar_events_name', verbose_name='Название для календаря')
|
||||
|
||||
@@ -47,6 +41,12 @@ class CalendarEvents(models.Model):
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
class FilesEvent(models.Model):
|
||||
""" Прикрепленные файлы к событию"""
|
||||
name = models.CharField(max_length=300, verbose_name='Название файла')
|
||||
link = models.FileField(upload_to='calendar/%Y/%m/%d')
|
||||
event = models.ForeignKey(CalendarEvents, on_delete=models.PROTECT, null=True, blank= True, related_name='get_calendar_events_files', verbose_name='Событие к которому привязаны файлы')
|
||||
|
||||
class ParticipantsEvent(models.Model):
|
||||
""" Участники события """
|
||||
|
||||
@@ -1,3 +1,60 @@
|
||||
from rest_framework import serializers
|
||||
from .models import *
|
||||
from userauth.serializers import *
|
||||
from userauth.serializers import *
|
||||
|
||||
class ParticipantsEventSerializer(serializers.ModelSerializer):
|
||||
""" Состав участников в событии """
|
||||
user = serializers.SerializerMethodField('get_user')
|
||||
|
||||
class Meta:
|
||||
model = ParticipantsEvent
|
||||
fields = ['user']
|
||||
|
||||
def get_user(self, obj):
|
||||
return InfoUserCardSerializer(obj.author.user).data
|
||||
|
||||
class CalendarEventsSerializer(serializers.ModelSerializer):
|
||||
""" Информация о событиии, авторе и прикрепленных файлах """
|
||||
author = serializers.SerializerMethodField('get_user')
|
||||
files = serializers.SerializerMethodField('get_filesevent')
|
||||
participants = serializers.SerializerMethodField('get_participant')
|
||||
|
||||
class Meta:
|
||||
model = CalendarEvents
|
||||
fields = ['name', 'description', 'cdate', 'enddate', 'frequency', 'author', 'files', 'place', 'participants']
|
||||
|
||||
def get_user(self, obj):
|
||||
return InfoUserCardSerializer(obj.author.user).data
|
||||
|
||||
def get_filesevent(self, obj):
|
||||
return FilesEventSerializer(obj.get_calendar_events_files.all(), many=True).data
|
||||
|
||||
def get_filesevent(self, obj):
|
||||
return FilesEventSerializer(obj.get_calendar_events_files.all(), many=True).data
|
||||
|
||||
def get_participant(self, obj):
|
||||
return ParticipantsEventSerializer(obj.get_calendar_events.all(), many=True).data
|
||||
|
||||
|
||||
class FilesEventSerializer(serializers.ModelSerializer):
|
||||
""" Файлы прикрепленные к событию """
|
||||
|
||||
class Meta:
|
||||
model = FilesEvent
|
||||
fields = '__all__'
|
||||
|
||||
class CalendarEventsNameSerializer(serializers.ModelSerializer):
|
||||
""" Глобальное название календаря с событиями """
|
||||
author = serializers.SerializerMethodField('get_user')
|
||||
event = serializers.SerializerMethodField('get_calendarevent')
|
||||
|
||||
class Meta:
|
||||
model = CalendarEventsName
|
||||
fields = ['name', 'author', 'event']
|
||||
|
||||
def get_user(self, obj):
|
||||
return InfoUserCardSerializer(obj.author.user).data
|
||||
|
||||
def get_calendarevent(self, obj):
|
||||
return CalendarEventsSerializer(obj.get_calendar_events_name.all(), many=True).data
|
||||
|
||||
@@ -7,15 +7,20 @@ from rest_framework.response import Response
|
||||
class CalendarEventsAPIView(APIView):
|
||||
|
||||
def get(self, request):
|
||||
return Response('ku')
|
||||
cal = CalendarEventsName.objects.all()
|
||||
|
||||
return Response(CalendarEventsNameSerializer(cal, many=True).data)
|
||||
|
||||
def post(self, request):
|
||||
|
||||
""" Записываем или обновляем глобальное название в таблицу, если есть участники так же пишем в соотвтв. таблицу с привязкой к событию.
|
||||
Добавляем или удаляяем запись о событии
|
||||
"""
|
||||
namecalendar, created = CalendarEventsName.objects.update_or_create(name=request.data['participants'],
|
||||
defaults = {'name':request.data['participants'], 'author_id': self.request.user.id})
|
||||
# print(self.request.user.id, '111111111111111111111111111111111111111111111111')
|
||||
|
||||
|
||||
for cal in request.data['calendar']:
|
||||
|
||||
CalendarEvents.objects.update_or_create(calendarname_id=namecalendar.pk,
|
||||
name = cal['summary'],
|
||||
author_id = self.request.user.id,
|
||||
@@ -25,9 +30,18 @@ class CalendarEventsAPIView(APIView):
|
||||
'enddate': cal['end'],
|
||||
'author_id': self.request.user.id,
|
||||
'place': cal['location'],
|
||||
'calendarname_id': namecalendar.pk
|
||||
'calendarname_id': namecalendar.pk,
|
||||
'frequency': 'repeat: {weekdays: [5] }'
|
||||
})
|
||||
# print(cal['summary'],'1---------------------------')
|
||||
# print(cal['description'],'2---------------------------')
|
||||
return Response('ru')
|
||||
# Create your views here.
|
||||
# if len(cal['attendees']) > 0 :
|
||||
# for player in cal['attendees']:
|
||||
# print(player, '5555555555555')
|
||||
# ParticipantsEvent.objects.update_or_create(participant=player,
|
||||
# event=envent.pk,
|
||||
# defaults= {'participant':player,
|
||||
# 'event':envent.pk
|
||||
|
||||
# })
|
||||
|
||||
|
||||
return Response('ru')
|
||||
@@ -96,7 +96,7 @@ class NewsCrossroadAPIView(ListAPIView):
|
||||
countpage= 0
|
||||
else:
|
||||
|
||||
newsqueryset = News.objects.all().order_by('-cdate')
|
||||
newsqueryset = News.objects.all().filter(cdate__lte=datetime.now()).order_by('-cdate')
|
||||
countpage = newsqueryset.count()
|
||||
if request.GET.get("name") == "/":
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "front",
|
||||
"version": "0.0.61",
|
||||
"version": "0.0.63",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "front",
|
||||
"version": "0.0.61",
|
||||
"version": "0.0.63",
|
||||
"dependencies": {
|
||||
"-": "^0.0.1",
|
||||
"@mdi/font": "7.0.96",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "front",
|
||||
"version": "0.0.61",
|
||||
"version": "0.0.63",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<v-col
|
||||
class="text-h6 pt-8 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
За выбранный период активных критиков нет
|
||||
За выбранный период комментариев нет
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="text-caption font-weight-regular">
|
||||
({{nStaff}} человек в штате)
|
||||
({{nStaff}} активных учетных записей)
|
||||
</div>
|
||||
</v-toolbar>
|
||||
</template>
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col class="flex-column pr-0">
|
||||
<v-card class="h-100">
|
||||
<vue-cal
|
||||
locale="ru"
|
||||
xsmall
|
||||
:time="false"
|
||||
hide-view-selector
|
||||
:disable-views="['years', 'year', 'week', 'day']"
|
||||
events-count-on-year-view
|
||||
active-view="month"
|
||||
:events="events"
|
||||
todayButton
|
||||
@cell-focus="selectedDate = $event"
|
||||
>
|
||||
<template #arrow-prev>
|
||||
<v-icon icon="mdi-menu-left"></v-icon>
|
||||
</template>
|
||||
<template #arrow-next>
|
||||
<v-icon icon="mdi-menu-right"></v-icon>
|
||||
</template>
|
||||
<template #today-button>
|
||||
<v-tooltip text="Сегодня" location="bottom">
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-icon
|
||||
@click="selectedDate = new Date()"
|
||||
v-bind="props"
|
||||
icon="mdi-crosshairs-gps"
|
||||
size="x-small"
|
||||
class="pt-1 pr-3"
|
||||
color="more_details_btn"
|
||||
/>
|
||||
</template>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
</vue-cal>
|
||||
</v-card>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-card class="h-100">
|
||||
<v-card-title class="text-center"
|
||||
>События на {{ dayformat(selectedDate) }}</v-card-title
|
||||
>
|
||||
<vue-cal
|
||||
locale="ru"
|
||||
xsmall
|
||||
:time="false"
|
||||
hide-view-selector
|
||||
hideTitleBar
|
||||
split
|
||||
header-format="DD"
|
||||
:events="events"
|
||||
active-view="day"
|
||||
:disable-views="['years', 'year', 'month', 'week']"
|
||||
:selected-date="selectedDate"
|
||||
>
|
||||
<template #arrow-prev>
|
||||
<v-icon icon="mdi-menu-left"></v-icon>
|
||||
</template>
|
||||
<template #arrow-next>
|
||||
<v-icon icon="mdi-menu-right"></v-icon>
|
||||
</template>
|
||||
<template #today-button>
|
||||
</template>
|
||||
</vue-cal>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueCal from "vue-cal";
|
||||
import "vue-cal/dist/vuecal.css";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { axiosApiInstance } from "@/utils/axios-api";
|
||||
|
||||
export default {
|
||||
components: { VueCal },
|
||||
|
||||
setup() {
|
||||
const events = ref([]);
|
||||
function f_generalvacation() {
|
||||
axiosApiInstance
|
||||
.get("api/general_vacation/generalvacation/")
|
||||
.then((data) => {
|
||||
for (let x in data.data) {
|
||||
if (x == "План-график") {
|
||||
data.data[x].map((e) => {
|
||||
events.value.push({
|
||||
name: e.name,
|
||||
start: e.start_work_period,
|
||||
end: e.end_work_period,
|
||||
content: e.name,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
f_generalvacation();
|
||||
});
|
||||
|
||||
const selectedDate = ref(null);
|
||||
|
||||
function dayformat(days) {
|
||||
const d = new Date(days);
|
||||
let mess = "сегодня";
|
||||
if (d.getFullYear() != "1970") {
|
||||
mess = `${d.getDate()} число`;
|
||||
}
|
||||
|
||||
return mess;
|
||||
}
|
||||
|
||||
return { events, selectedDate, f_generalvacation, dayformat };
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* Dot indicator */
|
||||
.vuecal__cell-events-count {
|
||||
width: 20px;
|
||||
min-width: 0;
|
||||
height: 11px;
|
||||
padding: 0;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.vuecal {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.vuecal__title-bar {
|
||||
border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
|
||||
.vuecal__title-bar {
|
||||
background: var(--cards);
|
||||
/* background: linear-gradient(to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)); */
|
||||
}
|
||||
.vuecal__flex .vuecal__title {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
.vuecal__cell-events-count {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 65%;
|
||||
transform: translate(-50%);
|
||||
min-width: 15px;
|
||||
height: 15px;
|
||||
line-height: 15px;
|
||||
padding: 0;
|
||||
background: linear-gradient(
|
||||
to top right,
|
||||
rgba(19, 84, 122, 0.8),
|
||||
rgba(128, 208, 199, 0.8)
|
||||
);
|
||||
color: #f8fff9 !important;
|
||||
border-radius: 12px;
|
||||
font-size: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.vuecal__event {
|
||||
color: #666;
|
||||
background-color: transparent;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
transition: box-shadow 0.3s, left 0.3s, width 0.3s;
|
||||
overflow: hidden;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.vuecal--rounded-theme .vuecal__cell-content {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
flex-grow: 0;
|
||||
border: 1px solid #00a5bc00;
|
||||
background: #c2e9d78c;
|
||||
border-radius: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.vuecal__cell-content {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vuecal__body {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.vuecal--no-time .vuecal__event {
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
.vuecal__cell--selected:before {
|
||||
border-color: rgba(30, 65, 49, 0.5);
|
||||
}
|
||||
|
||||
.vuecal__cell--today,
|
||||
.vuecal__cell--current {
|
||||
background-color: rgba(238, 181, 214, 0.548);
|
||||
}
|
||||
|
||||
.vuecal__cell--selected:before {
|
||||
border-color: rgba(30, 65, 49, 0);
|
||||
}
|
||||
|
||||
.vuecal__cell--selected {
|
||||
background-color: #3a97694a;
|
||||
z-index: 2;
|
||||
}
|
||||
</style>
|
||||
@@ -52,7 +52,6 @@
|
||||
<info-user-card
|
||||
:author="author"
|
||||
:opendialog = open
|
||||
:loging="author.login"
|
||||
@update:opendialog="open = $event"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,86 +1,91 @@
|
||||
<template>
|
||||
<div class="align-center d-flex flex-column py-1">
|
||||
|
||||
|
||||
<v-btn
|
||||
variant="text"
|
||||
v-for="x in onlineuser"
|
||||
:key="x"
|
||||
height="50"
|
||||
>
|
||||
<v-avatar
|
||||
size="36px"
|
||||
>
|
||||
<v-img
|
||||
:src="checkremote( `${spravURL}${x}.jpg`)"
|
||||
@click="whatuser(x)"
|
||||
/>
|
||||
<v-btn variant="text" v-for="x in onlineuser" :key="x" height="50">
|
||||
<v-avatar size="36px">
|
||||
<v-img :src="checkremote(`${spravURL}${x}.jpg`)" @click="whatuser(x)" />
|
||||
</v-avatar>
|
||||
</v-btn>
|
||||
<info-user-card
|
||||
|
||||
:opendialog = open
|
||||
:loging="loging"
|
||||
<info-user-card
|
||||
:author="author"
|
||||
:opendialog="open"
|
||||
@update:opendialog="open = $event"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref,watch } from 'vue'
|
||||
import { baseWS } from '@/utils/axios-api'
|
||||
import {useAccountStore} from '@/store/AccountStore'
|
||||
import { spravURL } from '@/utils/axios-api'
|
||||
import {checkremote} from '@/utils/universal_functions'
|
||||
import { ref, watch } from "vue";
|
||||
import { baseWS } from "@/utils/axios-api";
|
||||
import { useAccountStore } from "@/store/AccountStore";
|
||||
import { spravURL } from "@/utils/axios-api";
|
||||
import { checkremote } from "@/utils/universal_functions";
|
||||
import { axiosApiInstance } from "@/utils/axios-api";
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const author = ref({});
|
||||
const open = ref(false);
|
||||
const wsfuncs = {
|
||||
onliner: function (data) {
|
||||
let newset = new Set(data);
|
||||
let arr = Array.from(newset);
|
||||
|
||||
arr.splice(
|
||||
arr.findIndex((e) => e == accountStore.user.login),
|
||||
1
|
||||
);
|
||||
onlineuser.value = arr;
|
||||
},
|
||||
};
|
||||
const accountStore = useAccountStore();
|
||||
let onlineuser = ref([]);
|
||||
|
||||
setup(){
|
||||
const loging = ref('')
|
||||
const open = ref(false)
|
||||
const wsfuncs={onliner:function(data){
|
||||
let newset = new Set(data)
|
||||
let arr= Array.from(newset)
|
||||
|
||||
arr.splice(arr.findIndex(e=> e == accountStore.user.login), 1)
|
||||
onlineuser.value = arr
|
||||
}}
|
||||
const accountStore = useAccountStore()
|
||||
let onlineuser= ref([])
|
||||
|
||||
const connect = new WebSocket(baseWS+"ws/watcher/?token="+localStorage.access)
|
||||
const whatuser=(x)=> {
|
||||
loging.value = x
|
||||
open.value = true
|
||||
const connect = new WebSocket(
|
||||
baseWS + "ws/watcher/?token=" + localStorage.access
|
||||
);
|
||||
const whatuser = (x) => {
|
||||
open.value = true;
|
||||
axiosApiInstance
|
||||
.get(`api/accounts/getuser/?userlogin=${x}`)
|
||||
.then((data) => {
|
||||
author.value = {
|
||||
department: data.data.department,
|
||||
fio: data.data.fio,
|
||||
post: data.data.post,
|
||||
email: data.data.email,
|
||||
tel: data.data.tel,
|
||||
room: data.data.room,
|
||||
login: data.data.login,
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
connect.onmessage = (e) => {
|
||||
let data = JSON.parse(e.data);
|
||||
|
||||
wsfuncs[data["message"]["action"]](data.message.data);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => accountStore.cod2user,
|
||||
function () {
|
||||
if (!accountStore.cod2user.value) {
|
||||
connect.close();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
connect.onmessage=(e)=>{
|
||||
let data = JSON.parse(e.data)
|
||||
|
||||
wsfuncs[data['message']['action']](data.message.data)
|
||||
}
|
||||
|
||||
watch(()=>accountStore.cod2user,function(){
|
||||
if (!accountStore.cod2user.value){
|
||||
connect.close()
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
loging,
|
||||
author,
|
||||
open,
|
||||
onlineuser,
|
||||
checkremote,
|
||||
spravURL,
|
||||
whatuser,
|
||||
accountStore
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
accountStore,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<style></style>
|
||||
@@ -11,7 +11,6 @@
|
||||
<info-user-card
|
||||
:author=author
|
||||
:opendialog = open
|
||||
:loging="author.login"
|
||||
@update:opendialog="open = $event"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
# Календарь событий
|
||||
|
||||
Пример объекта
|
||||
```
|
||||
const events = ref([
|
||||
{
|
||||
start: '2024-04-15 14:00',
|
||||
end: '2024-04-25 18:00',
|
||||
title: 'Need to go shopping',
|
||||
icon: 'shopping_cart', // Custom attribute.
|
||||
content: 'Click to see my shopping list',
|
||||
contentFull: 'My shopping list is rather long:<br><ul><li>Avocados</li><li>Tomatoes</li><li>Potatoes</li><li>Mangoes</li></ul>', // Custom attribute.
|
||||
class: 'leisure',
|
||||
repeat: {
|
||||
every: 'week', // You can repeat on multiple days of the week.
|
||||
until: '2024-05-30' // Don't need a time here as it will take the same as original event date.
|
||||
}
|
||||
},
|
||||
{
|
||||
start: '2024-04-15 10:00',
|
||||
end: '2024-04-25 15:00',
|
||||
title: 'Golf with John',
|
||||
icon: 'golf_course', // Custom attribute.
|
||||
content: 'Do I need to tell how many holes?',
|
||||
contentFull: 'Okay.<br>It will be a 18 hole golf course.', // Custom attribute.
|
||||
class: 'sport'
|
||||
}
|
||||
])
|
||||
|
||||
```
|
||||
|
||||
Повторяющиеся события
|
||||
Когда это будет готово, вот как это будет работать.
|
||||
Вы можете повторить событие:
|
||||
Каждый день - предоставляя свойство every: "день".
|
||||
Каждую неделю - предоставляя каждую: "неделю" свойство.
|
||||
Каждый месяц - путем предоставления каждого: свойства "месяц".
|
||||
Каждый год - путем предоставления каждого: "годового" объекта недвижимости.
|
||||
Для каждого конкретного дня недели - путем предоставления массива дней недели, содержащего номера дней недели (от 1 до 7 для воскресенья).
|
||||
Каждые x дней - путем предоставления свойства every: x, где x является целым числом.
|
||||
Навсегда; Или до истечения срока действия, если вы предоставляете свойство until: {String | Date}.
|
||||
Будь то однодневный, многодневный, фоновый, на весь день, со временем или вне времени.
|
||||
|
||||
repeat: {
|
||||
weekdays: [1, 3], // You can repeat on multiple days of the week.
|
||||
until: '2020-11-30' // Don't need a time here as it will take the same as original event date.
|
||||
}
|
||||
|
||||
repeat: {
|
||||
weekdays: [5] // If original event day is not in these days, original event will still show up.
|
||||
// Without `until` property, it will go on forever.
|
||||
}
|
||||
|
||||
repeat: {
|
||||
every: 'week',
|
||||
until: new Date('2019/06/01') // You can also use a Javascript Date.
|
||||
}
|
||||
|
||||
repeat: {
|
||||
every: 14,
|
||||
until: '2019-01-20'
|
||||
}
|
||||
|
||||
repeat: {
|
||||
every: 'month',
|
||||
until: '2019-12-26'
|
||||
}
|
||||
|
||||
repeat: {
|
||||
every: 'year'
|
||||
}
|
||||
@@ -0,0 +1,397 @@
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col class="flex-column pr-0">
|
||||
<v-card class="h-100">
|
||||
<!-- <my-helper :pretext="selectedEvent" /> -->
|
||||
|
||||
<vue-cal
|
||||
locale="ru"
|
||||
xsmall
|
||||
:selected-date="new Date()"
|
||||
:time-from="8 * 60"
|
||||
:time-to="23 * 60"
|
||||
hide-view-selector
|
||||
events-count-on-year-view
|
||||
editable-events
|
||||
show-all-day-events
|
||||
todayButton
|
||||
:events="events"
|
||||
:on-event-click="onEventClick"
|
||||
active-view="month"
|
||||
:disable-views="['years', 'year', 'week', 'day']"
|
||||
@cell-focus="selectedDate = $event"
|
||||
@event-drag-create="showEventCreationDialog = true"
|
||||
>
|
||||
<template #arrow-prev>
|
||||
<v-icon icon="mdi-menu-left"></v-icon>
|
||||
</template>
|
||||
<template #arrow-next>
|
||||
<v-icon icon="mdi-menu-right"></v-icon>
|
||||
</template>
|
||||
<template #today-button>
|
||||
<v-tooltip text="Сегодня" location="bottom">
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-icon
|
||||
@click="selectedDate = new Date()"
|
||||
v-bind="props"
|
||||
icon="mdi-crosshairs-gps"
|
||||
size="x-small"
|
||||
class="pt-1 pr-3"
|
||||
color="more_details_btn"
|
||||
/>
|
||||
</template>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
</vue-cal>
|
||||
|
||||
<event-dialog
|
||||
:event="selectedEvent"
|
||||
:opendialog="showDialog"
|
||||
@update:opendialog="showDialog = $event"
|
||||
/>
|
||||
|
||||
<!-- <v-dialog
|
||||
v-model="showEventCreationDialog"
|
||||
:persistent="true"
|
||||
max-width="420"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-input
|
||||
v-model="selectedEvent.title"
|
||||
label="Event Title"
|
||||
/>
|
||||
<v-textarea
|
||||
v-model="selectedEvent.content"
|
||||
placeholder="Event Content"
|
||||
/>
|
||||
<v-textarea
|
||||
v-model="selectedEvent.content"
|
||||
placeholder="Event Content"
|
||||
/>
|
||||
<v-flex>
|
||||
<v-select
|
||||
:items="eventsCssClasses"
|
||||
placeholder="Event CSS Class"
|
||||
@change="selectedEvent.class = $event"
|
||||
:value="selectedEvent.class"
|
||||
/>
|
||||
<v-switch
|
||||
v-model="selectedEvent.background"
|
||||
label="background Event"
|
||||
/>
|
||||
</v-flex>
|
||||
<v-flex>
|
||||
<v-btn @click="cancelEventCreation()">Cancel</v-btn>
|
||||
<v-btn @click="closeCreationDialog()">Save</v-btn>
|
||||
</v-flex>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog> -->
|
||||
|
||||
</v-card>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-card class="h-100">
|
||||
<v-card-title class="text-center"
|
||||
>События на {{ dayformat(selectedDate) }}</v-card-title
|
||||
>
|
||||
|
||||
<vue-cal
|
||||
locale="ru"
|
||||
hideTitleBar
|
||||
split
|
||||
header-format="DD"
|
||||
active-view="day"
|
||||
:disable-views="['years', 'year', 'month', 'week']"
|
||||
:selected-date="selectedDate"
|
||||
small
|
||||
:time-from="8 * 60"
|
||||
:time-to="20 * 60"
|
||||
hide-view-selector
|
||||
hide-title-bar
|
||||
hide-weekends
|
||||
:events="events"
|
||||
:on-event-create="onEventCreate"
|
||||
:on-event-click="onEventClick"
|
||||
@event-drag-create="showEventCreationDialog = true"
|
||||
>
|
||||
</vue-cal>
|
||||
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueCal from "vue-cal";
|
||||
import "vue-cal/dist/vuecal.css";
|
||||
import { ref } from "vue";
|
||||
import { axiosApiInstance } from "@/utils/axios-api";
|
||||
import { formaDashTime } from "@/utils/universal_functions";
|
||||
import EventDialog from "@/components/calendar_of_events/event-dialog.vue";
|
||||
export default {
|
||||
components: { VueCal, EventDialog },
|
||||
|
||||
setup() {
|
||||
const selectedEvent = ref({});
|
||||
const selectedEventCreate = ref(null);
|
||||
const eventsCssClasses = ["bg-red", "bg-blue", "bg-green"];
|
||||
const showDialog = ref(false);
|
||||
const showEventCreationDialog = ref(false);
|
||||
const events = ref([
|
||||
// {
|
||||
// start: '2024-04-15 14:00',
|
||||
// end: '2024-04-25 18:00',
|
||||
// title: 'Need to go shopping',
|
||||
// icon: 'shopping_cart', // Custom attribute.
|
||||
// content: 'Click to see my shopping list',
|
||||
// contentFull: 'My shopping list is rather long:<br><ul><li>Avocados</li><li>Tomatoes</li><li>Potatoes</li><li>Mangoes</li></ul>', // Custom attribute.
|
||||
// class: 'leisure',
|
||||
// repeat: {
|
||||
// every: 'week', // You can repeat on multiple days of the week.
|
||||
// until: '2024-05-30' // Don't need a time here as it will take the same as original event date.
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// start: '2024-04-15 10:00',
|
||||
// end: '2024-04-25 15:00',
|
||||
// title: 'Golf with John',
|
||||
// icon: 'golf_course', // Custom attribute.
|
||||
// content: 'Do I need to tell how many holes?',
|
||||
// contentFull: 'Okay.<br>It will be a 18 hole golf course.', // Custom attribute.
|
||||
// class: 'sport'
|
||||
// }
|
||||
]);
|
||||
|
||||
const onEventClick = (event, e) => {
|
||||
selectedEvent.value = event;
|
||||
showDialog.value = true;
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
const onEventCreate = (event, deleteEventFunction) => {
|
||||
console.log(event, deleteEventFunction, "event, deleteEventFunction");
|
||||
selectedEvent.value = event;
|
||||
showEventCreationDialog.value = true;
|
||||
deleteEventFunction.value = deleteEventFunction;
|
||||
|
||||
return event;
|
||||
};
|
||||
|
||||
const cancelEventCreation = () => {
|
||||
closeCreationDialog();
|
||||
deleteEventFunction();
|
||||
};
|
||||
const closeCreationDialog = () => {
|
||||
showEventCreationDialog.value = false;
|
||||
selectedEvent.value = {};
|
||||
};
|
||||
|
||||
function f_generalvacation() {
|
||||
axiosApiInstance
|
||||
.get("api/calendar_of_events/calendarEvents/")
|
||||
.then((data) => {
|
||||
for (let key in data.data) {
|
||||
for (let x in data.data[key].event) {
|
||||
events.value.push({
|
||||
start: formaDashTime(data.data[key].event[x].cdate),
|
||||
end: formaDashTime(data.data[key].event[x].enddate),
|
||||
title: data.data[key].event[x].name,
|
||||
contentFull: data.data[key].event[x].description,
|
||||
icon: "mdi-book-open",
|
||||
class: "bg-indigo-lighten-5 border-sm",
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// {
|
||||
// start: '2024-04-15 14:00',
|
||||
// end: '2024-04-25 18:00',
|
||||
// title: 'Need to go shopping',
|
||||
// icon: 'shopping_cart', // Custom attribute.
|
||||
// content: 'Click to see my shopping list',
|
||||
// contentFull: 'My shopping list is rather long:<br><ul><li>Avocados</li><li>Tomatoes</li><li>Potatoes</li><li>Mangoes</li></ul>', // Custom attribute.
|
||||
// class: 'leisure',
|
||||
// repeat: {
|
||||
// every: 'week', // You can repeat on multiple days of the week.
|
||||
// until: '2024-05-30' // Don't need a time here as it will take the same as original event date.
|
||||
// }
|
||||
// console.log(data.data, "dataaaaaaaaaaaaa");
|
||||
});
|
||||
// for (let x in data.data) {
|
||||
// if (x == "План-график") {
|
||||
// data.data[x].map((e) => {
|
||||
// events.value.push({
|
||||
// name: e.name,
|
||||
// start: e.start_work_period,
|
||||
// end: e.end_work_period,
|
||||
// content: e.name,
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
f_generalvacation();
|
||||
|
||||
const selectedDate = ref(null);
|
||||
|
||||
function dayformat(days) {
|
||||
const d = new Date(days);
|
||||
let mess = "сегодня";
|
||||
if (d.getFullYear() != "1970") {
|
||||
mess = `${d.getDate()} число`;
|
||||
}
|
||||
|
||||
return mess;
|
||||
}
|
||||
|
||||
return {
|
||||
selectedEvent,
|
||||
events,
|
||||
selectedDate,
|
||||
f_generalvacation,
|
||||
dayformat,
|
||||
showDialog,
|
||||
onEventClick,
|
||||
showEventCreationDialog,
|
||||
eventsCssClasses,
|
||||
onEventCreate,
|
||||
closeCreationDialog,
|
||||
cancelEventCreation,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* Dot indicator */
|
||||
.vuecal__cell-events-count {
|
||||
width: 20px;
|
||||
min-width: 0;
|
||||
height: 11px;
|
||||
padding: 0;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.vuecal {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.vuecal__title-bar {
|
||||
border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
|
||||
.vuecal__title-bar {
|
||||
background: var(--cards);
|
||||
}
|
||||
.vuecal__flex .vuecal__title {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
.vuecal__cell-events-count {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 65%;
|
||||
transform: translate(-50%);
|
||||
min-width: 15px;
|
||||
height: 15px;
|
||||
line-height: 15px;
|
||||
padding: 0;
|
||||
background: linear-gradient(
|
||||
to top right,
|
||||
rgba(19, 84, 122, 0.8),
|
||||
rgba(128, 208, 199, 0.8)
|
||||
);
|
||||
color: #f8fff9 !important;
|
||||
border-radius: 12px;
|
||||
font-size: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* .vuecal__event {
|
||||
color: #666;
|
||||
background-color: transparent;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
transition: box-shadow 0.3s, left 0.3s, width 0.3s;
|
||||
overflow: hidden;
|
||||
text-align: justify;
|
||||
} */
|
||||
|
||||
.vuecal--rounded-theme .vuecal__cell-content {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
flex-grow: 0;
|
||||
border: 1px solid #00a5bc00;
|
||||
background: #c2e9d78c;
|
||||
border-radius: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.vuecal__cell-content {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vuecal__body {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.vuecal--no-time .vuecal__event {
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
.vuecal__cell--selected:before {
|
||||
border-color: rgba(30, 65, 49, 0.5);
|
||||
}
|
||||
|
||||
.vuecal__cell--today,
|
||||
.vuecal__cell--current {
|
||||
background-color: rgba(238, 181, 214, 0.548);
|
||||
}
|
||||
|
||||
.vuecal__cell--selected:before {
|
||||
border-color: rgba(30, 65, 49, 0);
|
||||
}
|
||||
|
||||
.vuecal__cell--selected {
|
||||
background-color: #3a97694a;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.vuecal__event {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vuecal__event-title {
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
margin: 4px 0 8px;
|
||||
}
|
||||
|
||||
.vuecal__event-time {
|
||||
display: inline-block;
|
||||
margin-bottom: 12px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.vuecal__event-content {
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
|
||||
|
||||
<v-text-field v-model="event.title" placeholder="Заголовок" />
|
||||
|
||||
</v-card-title>
|
||||
<v-card-subtitle>
|
||||
<v-text-field v-model="event.start" placeholder="время" />
|
||||
<!-- <strong>{{ event.start && event.start.format("DD.MM.YYYY") }}</strong> -->
|
||||
</v-card-subtitle>
|
||||
<v-card-text class="pt-2">
|
||||
<p class="pb-3" v-html="event.contentFull" />
|
||||
<strong>Время:</strong>
|
||||
|
||||
<ul class="pl-5">
|
||||
<li>
|
||||
Начало:
|
||||
{{ event.start && event.start.formatTime() }}
|
||||
</li>
|
||||
<li>
|
||||
Окончание:
|
||||
{{ event.end && event.end.formatTime() }}
|
||||
</li>
|
||||
</ul>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
|
||||
event: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
|
||||
<v-icon color="indigo-darken-3" class="pb-1">{{ event.icon }}</v-icon>
|
||||
|
||||
<span class="pl-3"> {{ event.title }}</span>
|
||||
</v-card-title>
|
||||
<v-card-subtitle>
|
||||
<strong>{{ event.start && event.start.format("DD.MM.YYYY") }}</strong>
|
||||
</v-card-subtitle>
|
||||
<v-card-text class="pt-2">
|
||||
<p class="pb-3" v-html="event.contentFull" />
|
||||
<strong>Время:</strong>
|
||||
|
||||
<ul class="pl-5">
|
||||
<li>
|
||||
Начало:
|
||||
{{ event.start && event.start.formatTime() }}
|
||||
</li>
|
||||
<li>
|
||||
Окончание:
|
||||
{{ event.end && event.end.formatTime() }}
|
||||
</li>
|
||||
</ul>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
|
||||
event: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<v-dialog v-model="mydialog" max-width="700">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<v-icon
|
||||
:icon="editEvent?'mdi-check':'mdi-pencil'"
|
||||
color="indigo-darken-3"
|
||||
class="pb-1"
|
||||
@click="editEvent?editEvent = false:editEvent = true"
|
||||
/>
|
||||
</v-card-title>
|
||||
</v-card>
|
||||
<event-dialog-edit :event="event" v-if="editEvent" />
|
||||
<event-dialog-info :event="event" v-else />
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { computed, ref } from "vue";
|
||||
import eventDialogEdit from '@/components/calendar_of_events/event-dialog-edit.vue';
|
||||
import eventDialogInfo from '@/components/calendar_of_events/event-dialog-info.vue';
|
||||
|
||||
export default {
|
||||
components: { eventDialogEdit, eventDialogInfo },
|
||||
props: {
|
||||
|
||||
opendialog: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
event: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
const editEvent = ref(false);
|
||||
|
||||
const mydialog = computed({
|
||||
get: () => props.opendialog,
|
||||
set: (value) => emit("update:opendialog", value),
|
||||
});
|
||||
|
||||
// const editEvent = () => {
|
||||
// console.log('hello')
|
||||
// }
|
||||
|
||||
return {
|
||||
mydialog,
|
||||
editEvent,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
@@ -1,25 +1,22 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <my-helper :pretext="kl" /> -->
|
||||
<v-btn @click="useICalReader"> ical</v-btn>
|
||||
|
||||
<v-btn @click="useICalReader"> ical</v-btn>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import {useICalReader} from '@/utils/universal_functions'
|
||||
import { baseURL, axiosApiInstance } from '@/utils/axios-api'
|
||||
import { ref } from 'vue';
|
||||
import { baseURL, axiosApiInstance } from "@/utils/axios-api";
|
||||
import { ref } from "vue";
|
||||
import ical from "ical.js";
|
||||
import { formatDash } from '@/utils/universal_functions'
|
||||
|
||||
const burl = baseURL.slice(0,-1)
|
||||
const burl = baseURL.slice(0, -1);
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const participant = ref('')
|
||||
const calendar = ref('')
|
||||
const participant = ref("");
|
||||
const calendar = ref("");
|
||||
const useICalReader = async () => {
|
||||
const response = await fetch(`${burl}/media/ical/calendar.ics`);
|
||||
const data = await response.text();
|
||||
@@ -32,6 +29,11 @@ export default {
|
||||
.map((vevent) => new ical.Event(vevent));
|
||||
|
||||
const calendarEvents = events.map((event) => {
|
||||
let attendees = [];
|
||||
event.attendees.map((att) => {
|
||||
attendees.push(att.jCal[1].cn);
|
||||
});
|
||||
|
||||
return {
|
||||
summary: event.summary,
|
||||
description: event.description,
|
||||
@@ -39,50 +41,30 @@ export default {
|
||||
start: event.startDate.toJSDate(),
|
||||
end: event.endDate.toJSDate(),
|
||||
location: event.location,
|
||||
attendees: event.attendees
|
||||
}
|
||||
})
|
||||
participant.value = name
|
||||
calendar.value = calendarEvents
|
||||
console.log(name, 'name')
|
||||
console.log(calendarEvents, 'calendarEventse')
|
||||
f_feedbackdata()
|
||||
// return {
|
||||
// type: "calendar",
|
||||
// title: name,
|
||||
// calendar: calendarEvents,
|
||||
// }
|
||||
}
|
||||
attendees: attendees,
|
||||
};
|
||||
});
|
||||
participant.value = name;
|
||||
calendar.value = calendarEvents;
|
||||
f_feedbackdata();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// const s= useICalReader(`${burl}/media/ical/calendar.ics`)
|
||||
// console.log(s.value, 'ddddddddd')
|
||||
function f_feedbackdata() {
|
||||
axiosApiInstance.post(`api/calendar_of_events/calendarEvents/`, {
|
||||
participants: participant.value,
|
||||
calendar: calendar.value
|
||||
})
|
||||
.then(data => {
|
||||
console.log(data,'datas')
|
||||
}
|
||||
)
|
||||
axiosApiInstance
|
||||
.post(`api/calendar_of_events/calendarEvents/`, {
|
||||
participants: participant.value,
|
||||
calendar: calendar.value,
|
||||
})
|
||||
.then((data) => {
|
||||
console.log(data, "datas");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
useICalReader
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
useICalReader,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<style></style>
|
||||
@@ -6,9 +6,10 @@
|
||||
height="450"
|
||||
hide-delimiters
|
||||
hide-delimiter-background
|
||||
show-arrows="hover"
|
||||
:show-arrows="carous.length<2?false:'hover'"
|
||||
color="white"
|
||||
>
|
||||
|
||||
<v-carousel-item
|
||||
v-for="(x, i) in carous"
|
||||
:key="i"
|
||||
@@ -16,6 +17,7 @@
|
||||
cover
|
||||
eager
|
||||
>
|
||||
|
||||
<v-container
|
||||
fill-height
|
||||
fluid
|
||||
@@ -78,7 +80,7 @@ export default {
|
||||
setup() {
|
||||
const burl = baseURL.slice(0, -1);
|
||||
|
||||
const carous = ref([{ link: "newsimage/default.jpg" }]);
|
||||
const carous = ref([{ link: `/media/newsimage/scales.jpg`, "title": null, "text": "" }]);
|
||||
const feedalert = useAlertStore().alert;
|
||||
|
||||
const getfromserver = () => {
|
||||
@@ -89,7 +91,11 @@ export default {
|
||||
feedalert.color = "red-darken-2";
|
||||
feedalert.ico = "mdi-alert-outline";
|
||||
}
|
||||
carous.value = result.data.result;
|
||||
|
||||
if (result.data.result.length > 0) {
|
||||
carous.value = result.data.result;
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</v-card>
|
||||
<v-card
|
||||
v-else class="h-100 w-100 d-flex justify-center flex-column"
|
||||
:image="`${burl}/media/default/sea.jpg`">
|
||||
:image="`${burl}/media/default/didjlenta.jpg`">
|
||||
|
||||
<v-row class="flex-grow-0">
|
||||
<v-col class="py-0">
|
||||
|
||||
@@ -21,11 +21,15 @@ export function formaComaTime(date) {
|
||||
return moment(date).format("DD.MM.YYYY H:mm");
|
||||
}
|
||||
|
||||
export function formaDashTime(date) {
|
||||
return moment(date).format("YYYY-MM-DD H:mm");
|
||||
}
|
||||
|
||||
export function checking_for_entry(where, what) {
|
||||
if (!where.includes(what)) {
|
||||
where.push(what);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getfromserver(path, reactive) {
|
||||
try {
|
||||
|
||||
@@ -117,13 +117,13 @@ setup(){
|
||||
"br": {
|
||||
"title": "Отказы",
|
||||
"abb": "(BR)",
|
||||
"tooltip": "Термин в веб-аналитике, обозначающий процентное соотношение количества посетителей, покинувших сайт прямо со страницы входа или просмотревших не более одной страницы сайта к общему количеству посетителей",
|
||||
"tooltip": "Bounce Rate - термин в веб-аналитике, обозначающий процентное соотношение количества посетителей, покинувших сайт прямо со страницы входа или просмотревших не более одной страницы сайта к общему количеству посетителей",
|
||||
"data": 0
|
||||
},
|
||||
"ppv": {
|
||||
"title": "Страниц за визит",
|
||||
"abb": "(PPV)",
|
||||
"tooltip": "Глубина просмотра страниц — поведенческая метрика, которая показывает, сколько страниц на сайте в среднем просматривает пользователь",
|
||||
"tooltip": "Pages Per Visit - глубина просмотра страниц. Поведенческая метрика, которая показывает, сколько страниц на сайте в среднем просматривает пользователь",
|
||||
"data": 0
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
import DigitalLetna from '@/components/digital-letna.vue'
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
|
||||
import EventCalendar from '@/components/UI/event-calendar.vue'
|
||||
import EventCalendar from '@/components/calendar_of_events/event-calendar.vue'
|
||||
|
||||
export default {
|
||||
|
||||
|
||||
Reference in new issue
Block a user