Merge branch 'develop'

This commit is contained in:
Nukeap committed 2025-02-11 14:54:55 +03:00
commit 12b86a9201
174 files changed
+12054 -1022

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "front",
"version": "0.0.84",
"version": "0.0.85",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "front",
"version": "0.0.84",
"version": "0.0.85",
"dependencies": {
"@ckeditor/ckeditor5-build-classic": "^44.1.0",
"@ckeditor/ckeditor5-dev-translations": "^43.0.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "front",
"version": "0.0.84",
"version": "0.0.85",
"scripts": {
"dev": "vite",
"build": "vite build",
+21 -27
View File
@@ -2,51 +2,45 @@
<router-view />
</template>
<script setup >
import {useAccountStore} from '@/store/AccountStore'
const accountStore = useAccountStore()
accountStore.setUser(accountStore.getuserFromStorage())
<script setup>
import { useAccountStore } from '@/store/AccountStore';
const accountStore = useAccountStore();
accountStore.setUser(accountStore.getuserFromStorage());
</script>
<style>
::-webkit-scrollbar {
width: 1px;
height: 6px;
width: 1px;
height: 6px;
}
/* Track */
::-webkit-scrollbar-track {
-webkit-border-radius: 6px;
border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
/* Handle */
::-webkit-scrollbar-thumb {
-webkit-border-radius: 6px;
border-radius: 6px;
background: rgb(var(--v-theme-scrollbar))
-webkit-border-radius: 6px;
border-radius: 6px;
background: rgb(var(--v-theme-scrollbar));
}
::-webkit-scrollbar-thumb:window-inactive {
background: rgb(var(--v-theme-scrollbar))
background: rgb(var(--v-theme-scrollbar));
}
.bggrad {
background: linear-gradient(to top right, rgba(19,84,122,.8), rgba(128,208,199,.8));
background: linear-gradient(to top right, rgba(19, 84, 122, 0.8), rgba(128, 208, 199, 0.8));
}
.bgCard {
/* #ffffff6b #ffffff8c*/
background: #ffffff38 ;
/* #ffffff6b #ffffff8c*/
background: #ffffff38;
}
.bgText {
background: #ffffffb0;
line-height: 2.1rem!important;
background: #ffffffb0;
line-height: 2.1rem !important;
}
.gap {
@@ -54,11 +48,11 @@ import {useAccountStore} from '@/store/AccountStore'
}
.w100 {
max-width: 100%!important
max-width: 100% !important;
}
.bottom-alert {
bottom: 10px;
left: 40%;
left: 40%;
}
</style>
@@ -51,9 +51,7 @@
<v-col>
<calendar-my
:calendars="
calendarForMy.filter(
(e) => e.author == accountStore.user.is_idEmployee
)
calendarForMy.filter((e) => e.author == accountStore.user.is_idEmployee)
"
title="Мои календари"
@getCalendar="getCalendar"
@@ -61,9 +59,7 @@
<calendar-my
:calendars="
calendarForMy.filter(
(e) => e.author != accountStore.user.is_idEmployee
)
calendarForMy.filter((e) => e.author != accountStore.user.is_idEmployee)
"
title="Подписки"
/>
@@ -103,18 +99,18 @@
</template>
<script>
import { ref, onMounted, watch } 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";
import { axiosApiInstance } from "@/utils/axios-api";
import { useAccountStore } from "@/store/AccountStore";
import CalendarFull from "@/components/calendar_of_events/UI_calendar/calendarFull.vue";
import { ref, onMounted, watch } 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';
import { axiosApiInstance } from '@/utils/axios-api';
import { useAccountStore } from '@/store/AccountStore';
import CalendarFull from '@/components/calendar_of_events/UI_calendar/calendarFull.vue';
export default {
components: { EventCreate, CalendarMy, CalendarFull },
setup(props, { emit }) {
setup() {
const accountStore = useAccountStore();
const showDialog = ref(false);
const week = useWeekendsStore();
@@ -135,36 +131,27 @@ export default {
};
const getCalendar = () => {
axiosApiInstance
.get(`api/calendar_of_events/my_calendars/`)
.then((res) => {
res.data.forEach(
(e) =>
(e.visible = accountStore.calendar.includes(e.id) ? false : true)
);
calendarForMy.value = res.data;
});
axiosApiInstance.get(`api/calendar_of_events/my_calendars/`).then((res) => {
res.data.forEach((e) => (e.visible = accountStore.calendar.includes(e.id) ? false : true));
calendarForMy.value = res.data;
});
};
getCalendar();
const getEvents = (idEvent, clik) => {
axiosApiInstance
.get(
`api/calendar_of_events/my_events/${
idEvent === undefined ? "" : `?id=${idEvent}`
}`
)
.get(`api/calendar_of_events/my_events/${idEvent === undefined ? '' : `?id=${idEvent}`}`)
.then((res) => {
if (idEvent === undefined) {
res.data.event = {
name: "",
name: '',
participant: [accountStore.user.is_idEmployee],
files: [],
date_start: new Date(),
date_end: new Date(),
period: null,
description: "",
description: '',
calendar: null,
};
}
@@ -184,28 +171,25 @@ export default {
};
const weekendsData = () => {
cal.value.$el
.querySelectorAll(".v-date-picker-month__day")
.forEach((e) => {
let datas = e.getAttribute("data-v-date");
let weeks =
new Date(datas).getDay() === 6 || new Date(datas).getDay() === 0;
if (weeks) {
e.querySelectorAll("span").forEach((n) => {
n.classList.add("text-red");
cal.value.$el.querySelectorAll('.v-date-picker-month__day').forEach((e) => {
let datas = e.getAttribute('data-v-date');
let weeks = new Date(datas).getDay() === 6 || new Date(datas).getDay() === 0;
if (weeks) {
e.querySelectorAll('span').forEach((n) => {
n.classList.add('text-red');
});
}
if (MyMonth.value in week.week[MyYear.value]) {
if (week.week[MyYear.value][MyMonth.value].includes(datas)) {
e.querySelectorAll('span').forEach((n) => {
n.classList.add('text-red');
if (n.classList.contains('text-red') && weeks) {
n.classList.replace('text-red', 'text-black');
}
});
}
if (MyMonth.value in week.week[MyYear.value]) {
if (week.week[MyYear.value][MyMonth.value].includes(datas)) {
e.querySelectorAll("span").forEach((n) => {
n.classList.add("text-red");
if (n.classList.contains("text-red") && weeks) {
n.classList.replace("text-red", "text-black");
}
});
}
}
});
}
});
};
onMounted(() => {
@@ -214,11 +198,11 @@ export default {
watch(
() => week.week,
(newValue, oldValue) => {
(newValue) => {
if (newValue) {
weekendsData();
}
}
},
);
const CheckingStore = () => {
@@ -230,7 +214,7 @@ export default {
};
const infoEvent = (i) => {
console.log(i, "iiiiiiiiii");
console.log(i, 'iiiiiiiiii');
};
return {
@@ -16,11 +16,7 @@
return-object
>
<template v-slot:selection="{ item }">
<v-chip
class="me-2"
color="teal-darken-3"
size="small"
label>
<v-chip class="me-2" color="teal-darken-3" size="small" label>
<span> {{ item.title }}</span>
<v-icon
v-if="item.value != accountStore.user.is_idEmployee"
@@ -53,12 +49,7 @@
<template v-slot:item="{ props, item }">
<v-list-group v-bind="props" :value="item.raw.title">
<template v-slot:activator="{ props }">
<v-list-item
v-bind="props"
@click.stop=""
density="compact"
class="text-body-2"
>
<v-list-item v-bind="props" @click.stop="" density="compact" class="text-body-2">
<template v-slot:prepend>
<v-checkbox-btn
@click.stop="selectedStaff = item.raw"
@@ -78,7 +69,7 @@
<v-list-item
v-for="x in item.raw.employees.filter((e) =>
e.title.toLowerCase().includes(filtered.toLowerCase())
e.title.toLowerCase().includes(filtered.toLowerCase()),
)"
:key="x.id"
:value="x.title"
@@ -101,9 +92,9 @@
</template>
<script>
import { ref, computed } from "vue";
import { splitname } from "@/utils/universal_functions";
import { useAccountStore } from "@/store/AccountStore";
import { ref, computed } from 'vue';
import { splitname } from '@/utils/universal_functions';
import { useAccountStore } from '@/store/AccountStore';
export default {
props: {
@@ -113,18 +104,18 @@ export default {
},
okey: {
type: String,
default: "selected",
default: 'selected',
},
},
setup(props, { emit }) {
const filtered = ref("");
const filtered = ref('');
const accountStore = useAccountStore();
const back = ref([]);
const staffed = computed({
get() {
if (props.okey == "editor") {
if (props.okey == 'editor') {
let ns = [];
props.staff.forEach((e) => {
let emp = { ...e };
@@ -147,10 +138,7 @@ export default {
get() {
let selected = [];
props.staff.forEach((e) => {
if (
e.employees.length != 1 &&
e.employees.every((n) => n[props.okey] == true)
) {
if (e.employees.length != 1 && e.employees.every((n) => n[props.okey] == true)) {
e[props.okey] = true;
selected.push(e);
} else if (e.employees.length == 1) {
@@ -176,13 +164,13 @@ export default {
});
const emitUp = (part) => {
if ("employees" in part) {
if ('employees' in part) {
part.employees.forEach((e) => {
if (e.id != accountStore.user.is_idEmployee) {
e[props.okey] = !part[props.okey];
}
});
emit("returnIdParticant", {
emit('returnIdParticant', {
okey: props.okey,
staff: part.employees,
select: [],
@@ -191,7 +179,7 @@ export default {
if (part[0].id != accountStore.user.is_idEmployee) {
let val = part.every((e) => e[props.okey] == true) ? false : true;
cbstaff(part, val);
emit("returnIdParticant", {
emit('returnIdParticant', {
okey: props.okey,
staff: back.value,
select: [],
@@ -200,7 +188,7 @@ export default {
}
} else {
part[props.okey] = !part[props.okey];
emit("returnIdParticant", {
emit('returnIdParticant', {
okey: props.okey,
staff: [part],
select: [],
@@ -213,10 +201,10 @@ export default {
if (e.id != accountStore.user.is_idEmployee) {
e[props.okey] = value;
}
if (!("employees" in e)) {
if (!('employees' in e)) {
back.value.push(e);
}
if ("employees" in e) {
if ('employees' in e) {
cbstaff(e.employees, value);
}
});
@@ -226,7 +214,7 @@ export default {
return (
item.includes(filtered.value) ||
itemText.raw.employees.some((e) =>
e.title.toLowerCase().includes(filtered.value.toLowerCase())
e.title.toLowerCase().includes(filtered.value.toLowerCase()),
)
);
}
@@ -10,10 +10,7 @@
<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 pb-5" lg="2">
Название
</v-col>
<v-col class="text-body-2 text-text_grey pb-5" lg="2"> Название </v-col>
<v-col>
<v-textarea
density="compact"
@@ -37,8 +34,8 @@
propsCalendar.cl_color === null
? 'flat'
: propsCalendar.cl_color === x
? 'flat'
: 'tonal'
? 'flat'
: 'tonal'
"
/> </v-col
></v-row>
@@ -80,8 +77,8 @@
<v-icon v-bind="props" icon="mdi-help-circle-outline" />
</template>
<div class="custom-tooltip">
Участники с доступом редактирования смогут изменять поля
календаря, а также редактировать и удалять события
Участники с доступом редактирования смогут изменять поля календаря, а также
редактировать и удалять события
</div>
</v-tooltip>
</v-col>
@@ -92,12 +89,12 @@
</template>
<script>
import { computed, ref } from "vue";
import { axiosApiInstance } from "@/utils/axios-api";
import calendarCreateSelect from "@/components/calendar_of_events/calendar-create-select.vue";
import { useAlertStore } from "@/store/useAlertStore";
import DialogCreate from "./UI_calendar/dialogCreate.vue";
import { useAccountStore } from "@/store/AccountStore";
import { computed, ref } from 'vue';
import { axiosApiInstance } from '@/utils/axios-api';
import calendarCreateSelect from '@/components/calendar_of_events/calendar-create-select.vue';
import { useAlertStore } from '@/store/useAlertStore';
import DialogCreate from './UI_calendar/dialogCreate.vue';
import { useAccountStore } from '@/store/AccountStore';
export default {
components: { calendarCreateSelect, DialogCreate },
@@ -105,7 +102,7 @@ export default {
props: {
calendar: {
type: Object,
default: {},
default: () => {},
},
},
@@ -113,15 +110,10 @@ export default {
const accountStore = useAccountStore();
const returnIdParticant = (idPart) => {
idPart.staff.forEach((e) => {
let indx = propsCalendar.value.participant.findIndex(
(l) => l.participant_calendar == e.id
);
let ind = propsCalendar.value.participant.find(
(l) => l.participant_calendar == e.id
);
if (idPart.okey == "editor") {
let indx = propsCalendar.value.participant.findIndex((l) => l.participant_calendar == e.id);
let ind = propsCalendar.value.participant.find((l) => l.participant_calendar == e.id);
if (idPart.okey == 'editor') {
ind.editor = e.editor;
} else {
if (e.selected == true) {
@@ -135,7 +127,7 @@ export default {
}
} else {
let ind = propsCalendar.value.participant.findIndex(
(l) => l.participant_calendar == e.id
(l) => l.participant_calendar == e.id,
);
if (ind != -1) {
@@ -144,32 +136,29 @@ export default {
}
}
});
};
const propsCalendar = computed({
get: () => props.calendar,
set: (value) => emit("update:calendar", value),
set: (value) => emit('update:calendar', value),
});
const feedalert = useAlertStore().alert;
const rules = {
cl_name: [(val) => req(val)],
cl_descr: [(val) => req(val)],
};
const titleCard = ref("");
const titleCard = ref('');
const newCalendar = ref(false);
const calendarNewOrOld = () => {
if (propsCalendar.value.hasOwnProperty("id")) {
titleCard.value = "Редактирование календаря";
if (propsCalendar.value.author != accountStore.user.is_idEmployee)
newCalendar.value = true;
if ('id' in propsCalendar.value) {
titleCard.value = 'Редактирование календаря';
if (propsCalendar.value.author != accountStore.user.is_idEmployee) newCalendar.value = true;
} else {
titleCard.value = "Новый календарь";
titleCard.value = 'Новый календарь';
newCalendar.value = true;
}
@@ -186,22 +175,19 @@ export default {
.then((result) => {
feedalert.alert = true;
feedalert.text = result.data.mess;
feedalert.ico = "mdi-check";
feedalert.color = "green-darken-4";
emit("getCalendar");
emit("closeDialog");
feedalert.ico = 'mdi-check';
feedalert.color = 'green-darken-4';
emit('getCalendar');
emit('closeDialog');
});
}
};
const staff = ref([]);
axiosApiInstance
.get("api/calendar_of_events/get_employees/")
.then((res) => {
staff.value = res.data.filter((e) => e.employees.length > 0);
});
axiosApiInstance.get('api/calendar_of_events/get_employees/').then((res) => {
staff.value = res.data.filter((e) => e.employees.length > 0);
});
const newStaff = computed({
get() {
@@ -209,7 +195,7 @@ export default {
if (propsCalendar.value.participant.length > 0) {
e.employees.forEach((empl) => {
let ab = propsCalendar.value.participant.find(
(a) => a.participant_calendar === empl.id
(a) => a.participant_calendar === empl.id,
);
if (ab) {
empl.selected = true;
@@ -227,21 +213,21 @@ export default {
});
const color = [
"red",
"pink",
"deep-orange",
"amber",
"yellow",
"lime",
"light-green",
"green",
"light-blue",
"blue",
"indigo",
"deep-purple",
"purple",
"blue-grey",
"brown",
'red',
'pink',
'deep-orange',
'amber',
'yellow',
'lime',
'light-green',
'green',
'light-blue',
'blue',
'indigo',
'deep-purple',
'purple',
'blue-grey',
'brown',
];
const colorPik = (col) => {
@@ -258,16 +244,15 @@ export default {
.then((result) => {
feedalert.alert = true;
feedalert.text = result.data.mess;
feedalert.ico = "mdi-check";
feedalert.color = "orange-accent-1";
emit("getCalendar");
feedalert.ico = 'mdi-check';
feedalert.color = 'orange-accent-1';
emit('getCalendar');
});
emit("closeDialog");
emit('closeDialog');
};
const req = (val) => {
return !!val || "Поле обязательно";
return !!val || 'Поле обязательно';
};
return {
+86 -125
View File
@@ -1,5 +1,4 @@
<template>
<v-carousel
v-model="currentslide"
:interval="interval"
@@ -8,173 +7,135 @@
height="450"
hide-delimiters
hide-delimiter-background
:show-arrows="carous.length<2?false:'hover'"
:show-arrows="carous.length < 2 ? false : 'hover'"
color="white"
@update:modelValue="slidechanged"
>
<template v-for="(x, i) in carous" :key="i">
<v-carousel-item
v-if="!x.link.endsWith('mp4')"
:src="`${burl}${x.link}`"
cover
eager
>
<v-container
fill-height
fluid
pa-0
ma-0
pb-3
class="flex-column h-100 d-flex"
>
<v-card
v-if="x.text != '' || x.title != null"
class="bgCard h-100 d-flex flex-column"
>
<v-card-title
v-if="x.title != null"
class="text-h3 text-uppercase titles text-text_carous ma-1 mb-0"
>
<v-row no-gutters>
<v-col class="align-self-center">
{{ x.title }}
</v-col>
<v-col class="flex-grow-0">
<v-img
width="50"
:aspect-ratio="1"
:src="`${burl}${x.sender}`"
cover
/>
</v-col>
</v-row>
</v-card-title>
<v-card-text
v-if="x.text != ''"
class="w-50 flex-grow-0 text-h6 bgText overflow-auto ma-1 pa-0"
>
<v-textarea
class="text-text_caroustext-black textareas font-weight-medium nocursor"
:model-value="x.text"
variant="solo"
readonly
auto-grow
rows="1"
hide-details
flat
bg-color="transparent"
/>
</v-card-text>
</v-card>
</v-container>
</v-carousel-item>
<v-carousel-item v-else >
<div class="d-flex justify-center">
<video
ref="videoElement"
style="height: 450px"
controls
preload="metadata"
@ended="ended"
@loadedmetadata="interval = 10000000000"
<template v-for="(x, i) in carous" :key="i">
<v-carousel-item v-if="!x.link.endsWith('mp4')" :src="`${burl}${x.link}`" cover eager>
<v-container fill-height fluid pa-0 ma-0 pb-3 class="flex-column h-100 d-flex">
<v-card v-if="x.text != '' || x.title != null" class="bgCard h-100 d-flex flex-column">
<v-card-title
v-if="x.title != null"
class="text-h3 text-uppercase titles text-text_carous ma-1 mb-0"
>
<source :src="`${burl}${x.link}`" type="video/mp4" />
Текущий браузер не поддерживает воспроизведение этого видео.
</video>
</div>
<!-- currentslide=currentslide<carous.length-1?currentslide+1:0 -->
</v-carousel-item>
</template>
<v-row no-gutters>
<v-col class="align-self-center">
{{ x.title }}
</v-col>
<v-col class="flex-grow-0">
<v-img width="50" :aspect-ratio="1" :src="`${burl}${x.sender}`" cover />
</v-col>
</v-row>
</v-card-title>
<v-card-text
v-if="x.text != ''"
class="w-50 flex-grow-0 text-h6 bgText overflow-auto ma-1 pa-0"
>
<v-textarea
class="text-text_caroustext-black textareas font-weight-medium nocursor"
:model-value="x.text"
variant="solo"
readonly
auto-grow
rows="1"
hide-details
flat
bg-color="transparent"
/>
</v-card-text>
</v-card>
</v-container>
</v-carousel-item>
<v-carousel-item v-else>
<div class="d-flex justify-center">
<video
ref="videoElement"
style="height: 450px"
controls
preload="metadata"
@ended="ended"
@loadedmetadata="interval = 10000000000"
>
<source :src="`${burl}${x.link}`" type="video/mp4" />
Текущий браузер не поддерживает воспроизведение этого видео.
</video>
</div>
<!-- currentslide=currentslide<carous.length-1?currentslide+1:0 -->
</v-carousel-item>
</template>
</v-carousel>
</template>
<script>
import { ref, computed } from "vue";
import { baseURL } from "@/utils/axios-api";
import { axiosApiInstance } from "@/utils/axios-api";
import { useAlertStore } from "@/store/useAlertStore";
import { ref } from 'vue';
import { baseURL } from '@/utils/axios-api';
import { axiosApiInstance } from '@/utils/axios-api';
import { useAlertStore } from '@/store/useAlertStore';
export default {
setup() {
const currentslide=ref(0)
const currentslide = ref(0);
const burl = baseURL.slice(0, -1);
const videoElement=ref(null)
const carous = ref([{ link: `/media/newsimage/scales.jpg`, "title": null, "text": "" }]);
const videoElement = ref(null);
const carous = ref([{ link: `/media/newsimage/scales.jpg`, title: null, text: '' }]);
const feedalert = useAlertStore().alert;
const getfromserver = () => {
axiosApiInstance.get("api/navigation/carousels/").then((result) => {
if (result.data.mess != "") {
axiosApiInstance.get('api/navigation/carousels/').then((result) => {
if (result.data.mess != '') {
feedalert.alert = true;
feedalert.text = result.data.mess;
feedalert.color = "red-darken-2";
feedalert.ico = "mdi-alert-outline";
feedalert.color = 'red-darken-2';
feedalert.ico = 'mdi-alert-outline';
}
console.log(result.data);
if (result.data.result.length > 0) {
carous.value = result.data.result;
}
});
};
getfromserver();
const interval=ref(10000)
const slidechanged=()=>{
console.log(videoElement.value);
if (carous.value[currentslide.value].link.endsWith('mp4')){
videoElement.value.forEach((e)=>{
if(e.currentSrc!=burl+carous.value[currentslide.value].link){
e.pause()
const interval = ref(10000);
const slidechanged = () => {
if (carous.value[currentslide.value].link.endsWith('mp4')) {
videoElement.value.forEach((e) => {
if (e.currentSrc != burl + carous.value[currentslide.value].link) {
e.pause();
}
// else{
// console.log("sdflkhlh");
// e.play()
// }
})
});
}
if(carous.value[currentslide.value].link.endsWith('mp4')){
interval.value = 10000000000
}else{
interval.value=10000
if (carous.value[currentslide.value].link.endsWith('mp4')) {
interval.value = 10000000000;
} else {
interval.value = 10000;
}
}
const ended = (val)=>{
val.target.currentTime = 0
};
const ended = (val) => {
val.target.currentTime = 0;
val.target.pause();
document.exitFullscreen()
currentslide.value=currentslide.value<carous.value.length-1?currentslide.value+1:0
}
document.exitFullscreen();
currentslide.value =
currentslide.value < carous.value.length - 1 ? currentslide.value + 1 : 0;
};
return {
slidechanged,
videoElement,
currentslide,
interval,
// intervalcomp,
burl,
carous,
ended
ended,
};
},
};
Whitespace-only changes.
@@ -1,6 +1,5 @@
<template>
<div class="px-4">
{{ displayDays + declOfNum(displayDays, [' день', ' дня', ' дней']) }}
{{ displayHours + declOfNum(displayHours, [' час', ' часа', ' часов']) }}
{{ displayMinutes + declOfNum(displayMinutes, [' минута', ' минуты', ' минут']) }}
{{ displaySeconds + declOfNum(displaySeconds, [' секунда', ' секунды', ' секунд']) }}
@@ -0,0 +1,18 @@
<template>
<v-container>
<HeaderDetailTesting />
</v-container>
</template>
<script>
import HeaderDetailTesting from './HeaderDetailTesting.vue';
export default {
components: {
HeaderDetailTesting,
}
}
</script>
@@ -0,0 +1,43 @@
<template>
<v-row class="ma-0 border-b-thin">
<v-col cols="auto" class="flex-grow-1">
<div class="text-subtitle-1 text-grey-lighten-1">Тест</div>
<div class="text-h5">{{ title }}</div>
</v-col>
<v-col cols="auto" class="d-flex flex-column">
<div class="align-self-end text-grey-lighten-1">!!!</div>
<div class="text-h4 text-grey-lighten-1">{{ time }}Таймер сюдаааа!!!</div>
</v-col>
</v-row>
<v-row class="ma-0 border-b-thin">
<v-col cols="auto" class="flex-grow-1">
<v-container class="d-flex align-center max-width">
<v-btn elevation="1" color="teal-darken-1" size="x-small" rounded icon="mdi-information-outline" />
<v-pagination :length="25" :total-visible="20" next-icon="mdi-menu-right" prev-icon="mdi-menu-left">
<template #item="item">
{{ item }}
</template>
</v-pagination>
</v-container>
</v-col>
<v-col cols="auto" class="align-self-center">
<v-btn elevation="0" color="#0000001F" rounded="1">Выйти</v-btn>
</v-col>
</v-row>
</template>
<script>
export default {
props: {
title: {
type: String,
default: 'Название теста здесь',
},
time: {
}
}
}
</script>
@@ -43,6 +43,14 @@
</div>
<v-divider></v-divider>
<div class="flex-grow-0 flex-shrink-1">
<div class="pt-2 d-flex align-center"><span class="text-overline text-grey text-center">Публикация новости: </span>
<v-switch v-model="form.createnews"
class="px-2"
density="comfortable"
hide-details
color="primary"
:label="form.createnews?'да':'нет'"
></v-switch></div>
<div class="pt-2 text-overline text-grey">Дата и время:</div>
<div class="d-flex justify-space-around">
<div class="d-flex ga-3 align-center">
@@ -360,6 +368,7 @@ export default {
startDate: new Date(),
endDate: new Date(new Date().setDate(new Date().getDate() + 14)),
questions: [],
createnews:false
});
const rules = {
+6
View File
@@ -177,6 +177,12 @@ const routes = [
ico: "mdi-account",
},
},
{
path: "/test/testdetail/:id",
name: "TestDetail",
component: () =>
import("@/components/testing/DetailCardTest.vue")
},
{
path: '/secret',
name: 'Secret Page',
+68 -73
View File
@@ -1,32 +1,39 @@
import {useAccountStore} from '@/store/AccountStore'
import axios from "axios";
import { useAccountStore } from '@/store/AccountStore';
import axios from 'axios';
const spravURL = 'http://10.252.44.33/accounting6/images/photo/'
const spravURLBase = 'http://10.252.44.33/accounting6/'
const baseURL = process.env.NODE_ENV === 'development' ? 'http://127.0.0.1:8000/' : `http://${window.location.host}/`;
const baseWS = process.env.NODE_ENV === 'development' ? 'ws://127.0.0.1:8000/' : `ws://${window.location.host}/`;
const spravURL = 'http://10.252.44.33/accounting6/images/photo/';
const spravURLBase = 'http://10.252.44.33/accounting6/';
const baseURL =
process.env.NODE_ENV === 'development'
? 'http://127.0.0.1:8000/'
: `http://${window.location.host}/`;
const baseWS =
process.env.NODE_ENV === 'development' ? 'ws://127.0.0.1:8000/' : `ws://${window.location.host}/`;
// const baseURL = process.env.NODE_ENV == 'development'? 'http://127.0.0.1:8000/': `http://10.252.44.60:9965/`;
// const baseWS = process.env.NODE_ENV == 'development'? 'ws://127.0.0.1:8000/': `ws://10.252.44.60:9966/`;
// для релизного меняем 'http://ukd/'
// const baseURL = 'http://127.0.0.1:8000/';
async function refreshToken() {
const refresh = localStorage.getItem('refresh');
try {
const result = await axios.post('/api/accounts/token/refresh/', {refresh}, {
baseURL
})
const result = await axios.post(
'/api/accounts/token/refresh/',
{ refresh },
{
baseURL,
},
);
if (result.config.data) localStorage.setItem('refresh', JSON.parse(result.config.data).refresh);
localStorage.setItem('access', result.data.access)
localStorage.setItem('access', result.data.access);
return result.data.access;
} catch (e) {
const accountStore = useAccountStore()
accountStore.logout()
accountStore.cod2user.value = false
const accountStore = useAccountStore();
accountStore.logout();
accountStore.cod2user.value = false;
return Promise.reject(e);
}
@@ -40,32 +47,36 @@ const clearAxios = axios.create({
baseURL,
});
axiosApiInstance.defaults.headers.common['Authorization'] = `Bearer ${localStorage.getItem('access')}`
axiosApiInstance.defaults.headers.common['Authorization'] =
`Bearer ${localStorage.getItem('access')}`;
axiosApiInstance.interceptors.request.use(config => {
const access = localStorage.getItem('access');
if (access) {
config.headers = {
'Authorization': `Bearer ${access}`,
axiosApiInstance.interceptors.request.use(
(config) => {
const access = localStorage.getItem('access');
if (access) {
config.headers = {
Authorization: `Bearer ${access}`,
};
}
}
return config;
}, error => {
return Promise.reject(error);
})
return config;
},
(error) => {
return Promise.reject(error);
},
);
axiosApiInstance.interceptors.response.use(
response => {
(response) => {
return response;
},
async error => {
async (error) => {
const originalRequest = error.config;
if ((error.response.status === 401 || error.response.status === 403) && !originalRequest._retry) {
if (
(error.response.status === 401 || error.response.status === 403) &&
!originalRequest._retry
) {
originalRequest._retry = true;
try {
const token = await refreshToken();
axiosApiInstance.defaults.headers.common['Authorization'] = `Bearer ${token}`;
@@ -75,64 +86,54 @@ axiosApiInstance.interceptors.response.use(
}
return axiosApiInstance(originalRequest);
} catch (e) {
return Promise.reject(error);
return Promise.reject(error) ?? e;
}
}
return Promise.reject(error);
})
},
);
async function getVotes(status) {
try {
const response = await axiosApiInstance.get(`/api/vote/getvotes?status=${status}`);
return response.data;
} catch (error) {
console.error('Ошибка запроса голосования:', error);
throw error;
throw new Error('Ошибка запроса голосования:', error);
}
}
async function createVote(voteData) {
try {
const formData = new FormData();
voteData.questions.forEach(question => {
formData.append('questionsfiles', question.image)
if(!!question.image){
const {name,size,lastModified}=question.image
question.image={name,size,lastModified}
voteData.questions.forEach((question) => {
formData.append('questionsfiles', question.image);
if (question.image) {
const { name, size, lastModified } = question.image;
question.image = { name, size, lastModified };
}
question.answers.forEach((answer) => {
formData.append('answersfiles', answer.image);
if (answer.image) {
const { name, size, lastModified } = answer.image;
answer.image = { name, size, lastModified };
}
question.answers.forEach(answer=>{
formData.append('answersfiles', answer.image)
if(!!answer.image){
const {name,size,lastModified}=answer.image
answer.image={name,size,lastModified}
}
})
});
});
formData.append('news', voteData.createnews);
formData.append('title', voteData.title);
formData.append('description', voteData.description);
formData.append('startDate', new Date(voteData.startDate).toISOString());
formData.append('endDate', new Date(voteData.endDate).toISOString());
formData.append('questions', JSON.stringify(voteData.questions));
const response = await axiosApiInstance.post('/api/vote/votecreate/', formData, {
headers: {'Content-Type': 'multipart/form-data'},
await axiosApiInstance.post('/api/vote/votecreate/', formData, {
headers: { 'Content-Type': 'multipart/form-data' },
});
// return response.data;
} catch (error) {
console.error('Ошибка создания голосования:', error);
throw error;
throw new Error(error);
}
}
@@ -141,8 +142,7 @@ async function getVoteDetail(id) {
const response = await axiosApiInstance.get(`/api/vote/votedetail/${id}/`);
return response.data;
} catch (error) {
console.error("Ошибка получения деталей голосования:", error);
throw error;
throw new Error(error);
}
}
@@ -169,10 +169,8 @@ async function getVoteDetail(id) {
async function deleteVote(id) {
try {
await axiosApiInstance.delete(`/api/vote/votedetail/${id}/`);
console.log("Голосование успешно удалено");
} catch (error) {
console.error("Ошибка удаления голосования:", error);
throw error;
throw new Error(error);
}
}
@@ -181,8 +179,7 @@ async function getEmployees() {
const response = await axiosApiInstance.get(`api/vote/getdictemployee/`);
return response.data;
} catch (error) {
console.error("Ошибка получения всех сотрудников:", error);
throw error;
throw new Error(error);
}
}
@@ -191,12 +188,10 @@ async function getVoteResult(id) {
const response = await axiosApiInstance.get(`/api/vote/getresults/?id=${id}`);
return response.data;
} catch (error) {
console.error("Ошибка получения результата голосования:", error);
throw error;
throw new Error(error);
}
}
export {
axiosApiInstance,
clearAxios,
@@ -212,4 +207,4 @@ export {
deleteVote,
getEmployees,
getVoteResult,
}
};
+14 -19
View File
@@ -1,26 +1,21 @@
<template>
<v-row>
<v-col
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
>
F.A.Q.
</v-col>
</v-row>
<v-row>
<v-col
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
>
F.A.Q.
</v-col>
</v-row>
</template>
<script>
import {pagecounter} from '@/utils/universal_functions'
import { pagecounter } from '@/utils/universal_functions';
export default {
setup(){
pagecounter()
}
}
setup() {
pagecounter();
},
};
</script>
<style>
</style>
<style></style>
+88 -150
View File
@@ -1,160 +1,98 @@
<template>
<v-carousel
cover
:height="carushi"
hide-delimiters
hide-delimiter-background
show-arrows="hover"
color="white"
>
<v-carousel-item v-for="(x, i) in carous" :key="i" :src="`${burl}${x.link}`" cover eager>
<v-container fill-height fluid pa-0 ma-0 pb-3 class="flex-column h-100 d-flex">
<v-card class="bgCard h-100 d-flex flex-column">
<v-card-title class="ma-2 text-h3 text-uppercase titles py-5 flex-column">
<v-row>
<v-col class="pa-0 pl-1 align-self-center">{{ x.title }} </v-col>
<v-carousel
cover
:height="carushi"
hide-delimiters
hide-delimiter-background
show-arrows="hover"
color="white"
>
<v-carousel-item
v-for="(x, i) in carous" :key="i"
:src="`${burl}${x.link}`"
cover
eager
>
<v-col class="flex-grow-0 pa-0 pr-1">
<v-img width="50" :aspect-ratio="1" :src="`${burl}${x.sender}`" cover />
</v-col>
</v-row>
</v-card-title>
<v-card-text
v-if="'text' in x && x.text.length > 0"
class="ml-2 mb-0 mb-2 flex-grow-0 pb-3 text-h6 h-100 pl-3 py-3 mr-1"
>
<v-row>
<v-col cols="6" class="bgText">
<v-textarea
class="mt-n3 text-black textareas pt-2 font-weight-medium"
:model-value="x.text"
variant="plain"
readonly
auto-grow
rows="1"
hide-details
/>
</v-col>
<v-container
fill-height
fluid
pa-0 ma-0 pb-3
class="flex-column h-100 d-flex"
>
<v-card class="bgCard h-100 d-flex flex-column">
<v-card-title class="ma-2 text-h3 text-uppercase titles py-5 flex-column">
<v-row>
<v-col class="pa-0 pl-1 align-self-center">{{x.title}}
</v-col>
<v-col class="flex-grow-0 pa-0 pr-1">
<v-img
width="50"
:aspect-ratio="1"
:src="`${burl}${x.sender}`"
cover
/>
</v-col>
</v-row>
</v-card-title>
<v-card-text v-if="'text' in x && x.text.length>0" class="ml-2 mb-0 mb-2 flex-grow-0 pb-3 text-h6 h-100 pl-3 py-3 mr-1 ">
<v-row>
<v-col cols="6" class="bgText">
<v-img :aspect-ratio="1" :src="`${burl}${x.link2}`" />
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-container>
</v-carousel-item>
</v-carousel>
</template>
<v-col cols=6 class=" bgText">
<v-textarea
class="mt-n3 text-black textareas pt-2 font-weight-medium"
:model-value=x.text
variant='plain'
readonly
auto-grow
rows="1"
hide-details
<script>
import { ref, computed } from 'vue';
/>
</v-col>
import { baseURL } from '@/utils/axios-api';
import { axiosApiInstance } from '@/utils/axios-api';
<v-col cols=6 class=" bgText">
<v-img
:aspect-ratio="1"
:src="`${burl}${x.link2}`"
/>
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-container>
</v-carousel-item>
</v-carousel>
</template>
<script>
import { ref, computed } from 'vue'
import {getfromserver} from '@/utils/universal_functions'
import { baseURL } from '@/utils/axios-api'
import { axiosApiInstance } from '@/utils/axios-api'
export default {
setup() {
const burl = baseURL.slice(0,-1)
const carous=ref([{link: ""}])
axiosApiInstance.get(`api/fns/links/`).then(data => {
carous.value= data.data
// t_dailyRound.value = data.data
export default {
setup() {
const burl = baseURL.slice(0, -1);
const carous = ref([{ link: '' }]);
// result.value=JSON.parse(JSON.stringify(data.data.daily))
axiosApiInstance.get(`api/fns/links/`).then((data) => {
carous.value = data.data;
})
// getfromserver("api/fns/links/", carous)
const carushi = computed(()=> {
return window.innerHeight-50
})
return { burl, carous, carushi}
}
// t_dailyRound.value = data.data
// result.value=JSON.parse(JSON.stringify(data.data.daily))
});
// getfromserver("api/fns/links/", carous)
}
</script>
<style>
.bgCard {
/* #ffffff6b #ffffff8c*/
background: #ffffff38 ;
}
.bgText {
background: #ffffffb0;
line-height: 3.1rem!important;
}
.titles {
/* font-family: cursive !important; */
background: #ffffff8c;
}
.textareas .v-field__input {
font-size: 2.5em!important;
}
</style>
const carushi = computed(() => {
return window.innerHeight - 50;
});
return { burl, carous, carushi };
},
};
</script>
<style>
.bgCard {
/* #ffffff6b #ffffff8c*/
background: #ffffff38;
}
.bgText {
background: #ffffffb0;
line-height: 3.1rem !important;
}
.titles {
/* font-family: cursive !important; */
background: #ffffff8c;
}
.textareas .v-field__input {
font-size: 2.5em !important;
}
</style>
+73 -196
View File
@@ -1,223 +1,100 @@
<template>
<v-container>
<v-tabs v-model="activeTab" class="mb-4 text-teal-darken-4">
<v-tab>Назначенные ({{ scheduledTests.length }})</v-tab>
<v-tab>Завершенные ({{ completedTests.length }})</v-tab>
<v-tab>Каталог</v-tab>
<v-container :fluid="true">
<v-tabs v-model="activeTab" class="mb-2 text-teal-darken-4">
<v-tab v-for="tab in tabs" :key="tab.value" :value="tab.value"> {{ tab.title }} </v-tab>
</v-tabs>
<v-tabs-window v-model="activeTab">
<!-- Назначенные -->
<v-tabs-window-item>
<v-card outlined>
<v-card-title>
Назначенные
</v-card-title>
<v-text-field
v-model="search"
class="mx-4"
clearable
label="Найти тестирование по названию"
variant="outlined"
/>
<v-data-table
:headers="headers"
:items="filteredScheduledTests"
hide-default-footer
hide-default-header
item-value="id"
>
<template #item.image="{ item }">
<v-img :src="item.image" alt="Test Image" height="100" width="100"/>
</template>
<template #item.title="{ item }">
<TestCard :item="item"/>
</template>
<template #item.actions="{ item }">
<v-btn v-if="item.type === 'test'" class="mr-4" color="teal-darken-4" variant="tonal">Тренироваться
</v-btn>
<v-btn color="teal-darken-4">Пройти</v-btn>
</template>
</v-data-table>
</v-card>
<v-tabs-window v-model="activeTab" class="border-t-thin">
<!-- Вкладка назначенные -->
<v-tabs-window-item class="my-2">
<CatalogTest title="Назначенные" :activeTab="activeTab" :testingCard="getAllTests">
<template #buttons>
<v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0">
Тренироваться
</v-btn>
<v-btn color="teal-darken-1" elevation="0"> Пройти </v-btn>
</template>
</CatalogTest>
</v-tabs-window-item>
<!-- Завершенные -->
<!-- Вкладка завершенных -->
<v-tabs-window-item>
<v-card class="mb-6" outlined>
<v-card-title>
Завершенные
</v-card-title>
<v-data-table
:headers="headers"
:items="filteredCompletedTests"
hide-default-footer
hide-default-header
item-value="id"
>
<template #item.image="{ item }">
<v-img :src="item.image" alt="Test Image" height="100" width="100"/>
</template>
<template #item.title="{ item }">
<TestCard :item="item"/>
</template>
<template #item.actions="{ item }">
<v-btn color="teal-darken-4">Посмотреть результаты</v-btn>
</template>
</v-data-table>
</v-card>
<CatalogTest title="Завершенные" :activeTab="activeTab" :testingCard="getAllTests">
<!-- Здесь отобразить результат теста после того как будет готов БЭК и УМТ -->
<template #results>
<!-- <div>
<v-icon icon="mdi-calendar-clock" size="large" />
<span class="ml-1">12354</span>
</div> -->
</template>
<template #buttons>
<v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0">
Результаты
</v-btn>
</template>
</CatalogTest>
</v-tabs-window-item>
<!-- Каталог -->
<!-- Вкладка каталога -->
<v-tabs-window-item>
<v-card outlined>
<v-card-title>
Каталог
</v-card-title>
<v-text-field
v-model="search"
class="mx-4"
clearable
label="Найти тестирование по названию"
variant="outlined"
/>
<v-data-table
:headers="headers"
:items="filteredTests"
hide-default-footer
hide-default-header
item-value="id"
>
<template #item.image="{ item }">
<v-img :src="item.image" alt="Test Image" height="100" width="100"/>
</template>
<template #item.title="{ item }">
<TestCard :item="item"/>
</template>
<template #item.actions="{ item }">
<v-btn v-if="item.type === 'test'" class="mr-4" color="teal-darken-4" variant="tonal">Тренироваться
</v-btn>
<v-btn color="teal-darken-4">Пройти</v-btn>
</template>
</v-data-table>
</v-card>
<CatalogTest title="Каталог" :activeTab="activeTab" :testingCard="getAllTests">
<template #buttons>
<v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0">
Тренироваться
</v-btn>
</template>
</CatalogTest>
</v-tabs-window-item>
</v-tabs-window>
</v-container>
</template>
<script>
import {computed, ref} from 'vue';
import TestCard from "@/components/tests/TestCard.vue";
import CatalogTest from '@/components/testing/CatalogTest.vue';
import { axiosApiInstance } from '@/utils/axios-api';
import { ref, computed, watch } from 'vue';
export default {
components: {TestCard},
components: {
CatalogTest,
},
setup() {
const activeTab = ref(0);
const search = ref('');
const currentTest = ref('');
const headers = [
{text: 'Картинка', value: 'image', sortable: false},
{text: 'Название', value: 'title', align: 'start'},
{text: 'Действия', value: 'actions', sortable: false},
];
const getAllTests = ref([]);
const tests = ref([
{
id: 1,
title: 'Комплекс тестовых вопросов на знание в области информационно-коммуникационных технологий',
type: 'test',
description: 'Краткое описание тестирования',
date: '2025-02-28',
questions: 20,
time: '15 минут',
attempts: 1,
image: 'https://icdn.lenta.ru/images/2024/03/27/12/20240327123127525/square_1280_63e6b3d7acbfce65d885ae4cf216dfe2.jpg',
},
{
id: 2,
title: 'Удобство раздела тестирования',
type: 'survey',
description: 'Опрос среди сотрудников ЦОД МФ',
date: '2025-06-22',
questions: 28,
time: null,
attempts: null,
image: 'https://icdn.lenta.ru/images/2024/03/27/12/20240327123127525/square_1280_63e6b3d7acbfce65d885ae4cf216dfe2.jpg',
},
{
id: 3,
title: 'Законченная карточка законченного тестирования',
type: 'survey',
description: 'законченное описание законченного тестирования',
date: '2024-06-22',
questions: 1,
time: null,
attempts: null,
image: 'https://icdn.lenta.ru/images/2024/03/27/12/20240327123127525/square_1280_63e6b3d7acbfce65d885ae4cf216dfe2.jpg',
const getTestById = () => {
let status =
activeTab.value == 0 ? '?status=active' : activeTab.value == 1 ? '?status=completed' : '';
axiosApiInstance
.get(`/api/tests/gettests/${status}`)
.then((resp) => (getAllTests.value = resp.data))
.finally(() => {
if (activeTab.value == 0) {
currentTest.value = getAllTests.value.length;
}
});
};
getTestById();
watch(
() => activeTab.value,
() => {
getTestById();
},
);
const tabs = computed(() => [
{ value: 0, title: `Назначенные (${currentTest.value})` },
{ value: 1, title: 'Завершенные' },
{ value: 2, title: 'Каталог' },
]);
const currentDate = new Date();
const scheduledTests = computed(() => {
return tests.value.filter(test => new Date(test.date) > currentDate);
});
const completedTests = computed(() => {
return tests.value.filter(test => new Date(test.date) <= currentDate);
});
const filteredScheduledTests = computed(() => {
if (!search.value) return scheduledTests.value;
return scheduledTests.value.filter(test =>
test.title.toLowerCase().includes(search.value.toLowerCase())
);
});
const filteredCompletedTests = computed(() => {
if (!search.value) return completedTests.value;
return completedTests.value.filter(test =>
test.title.toLowerCase().includes(search.value.toLowerCase())
);
});
const filteredTests = computed(() => {
if (!search.value) return tests.value.filter(test => new Date(test.date) > currentDate);
return tests.value.filter(test => new Date(test.date) > currentDate)
.filter((test) =>
test.title.toLowerCase().includes(search.value.toLowerCase())
);
});
return {
activeTab,
search,
headers,
tests,
filteredTests,
filteredScheduledTests,
filteredCompletedTests,
scheduledTests,
completedTests,
tabs,
getAllTests,
};
},
};
</script>
<style>
.v-data-table__wrapper {
overflow-x: auto;
}
</style>
+2
View File
@@ -19,6 +19,8 @@
<div>
<v-card class="vote-card-information" variant="flat">
<v-card-text class="justify-center align-center vote-card-information-title">
<p>ВЫ УЖЕ ПРОГОЛОСОВАЛИ.</p>
<p>СПАСИБО!</p>
+3 -3
View File
@@ -20,11 +20,12 @@
<!-- Вкладка завершенных -->
<v-tabs-window-item>
<CatalogTest title="Завершенные" :activeTab="activeTab" :testingCard="getAllTests">
<!-- Здесь отобразить результат теста после того как будет готов БЭК и УМТ -->
<template #results>
<div>
<!-- <div>
<v-icon icon="mdi-calendar-clock" size="large" />
<span class="ml-1">12354</span>
</div>
</div> -->
</template>
<template #buttons>
<v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0">
@@ -44,7 +45,6 @@
</CatalogTest>
</v-tabs-window-item>
</v-tabs-window>
{{ getAllTests }}
</v-container>
</template>