Merge branch 'develop'
This commit is contained in:
commit
1c77e551db
9 files changed
+215
-279
No files matched your search
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "front",
|
||||
"version": "0.0.81",
|
||||
"version": "0.0.82",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "front",
|
||||
"version": "0.0.81",
|
||||
"version": "0.0.82",
|
||||
"dependencies": {
|
||||
"-": "^0.0.1",
|
||||
"@ckeditor/ckeditor5-build-classic": "^41.4.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "front",
|
||||
"version": "0.0.81",
|
||||
"version": "0.0.82",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 281 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 MiB |
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<h3>ДО КОНЦА ГОЛОСОВАНИЯ ОСТАЛОСЬ:</h3>
|
||||
<div class="card-count">{{ displayDays }} дней {{ displayHours }} часов {{ displayMinutes }} минут</div>
|
||||
<h6>ДО КОНЦА ГОЛОСОВАНИЯ ОСТАЛОСЬ:</h6>
|
||||
<div class="text-red text-h6">{{ displayDays }} дней {{ displayHours }} часов {{ displayMinutes }} минут</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
const timer = setInterval(() => {
|
||||
const now = new Date();
|
||||
// здесь задается конец отчета (гггг, мм, дд, остальные цифры не меняются)
|
||||
const end = new Date(2024, 11 - 1, 14, 10, 10, 10);
|
||||
const end = new Date(2025, 0, 13, 23, 59, 59);
|
||||
const distance = end.getTime() - now.getTime();
|
||||
|
||||
if (distance < 0) {
|
||||
|
||||
@@ -1,52 +1,11 @@
|
||||
<template>
|
||||
<v-row justify="center" align="center" class="pa-2">
|
||||
<v-col justify="center" align="center" class="flex-column">
|
||||
|
||||
<v-card width="700" height="820" class="elevation-12">
|
||||
<v-card class="mb-2" color="teal-darken-1" elevation="0">
|
||||
<!-- <v-card-title>Голосование</v-card-title> -->
|
||||
<v-card-title color="teal-darken-1">«Мой коллега самый лучший»</v-card-title>
|
||||
</v-card>
|
||||
<v-card class="px-2">
|
||||
<v-card-title class="bg-teal-darken-1">Процент проголосовавших</v-card-title>
|
||||
<v-card-text class="text-h6 pa-1">
|
||||
{{ perc_best }}%
|
||||
</v-card-text>
|
||||
|
||||
</v-card>
|
||||
|
||||
<v-card class="mb-2">
|
||||
<v-card-title class="bg-teal-darken-1">Лидер номинации</v-card-title>
|
||||
</v-card>
|
||||
<v-card class="scroll-leaders" elevation="0">
|
||||
<v-card v-for="(employees, department) in max_bst" :key="department" elevation="0">
|
||||
<v-card-title>{{ department }}</v-card-title>
|
||||
<div v-for="employee in employees.slice(0,3)" :key="employee.name">
|
||||
{{ employee.cand_name }} - {{ employee.total }}
|
||||
</div>
|
||||
</v-card>
|
||||
</v-card>
|
||||
<v-card color="teal-darken-1" class="ma-2">
|
||||
<v-card-title>ФИО не участвовавших в голосовании</v-card-title>
|
||||
</v-card>
|
||||
<v-card elevation="0">
|
||||
<v-card class="scroll-window" elevation="0">
|
||||
<v-card v-for="[key, val] of Object.entries(notvotedbest)">
|
||||
<v-card-title>{{ key }}</v-card-title>
|
||||
<div v-for="item_fio in val">
|
||||
{{ item_fio.fio }}
|
||||
</div>
|
||||
</v-card>
|
||||
</v-card>
|
||||
</v-card>
|
||||
|
||||
</v-card>
|
||||
</v-col>
|
||||
|
||||
<v-col justify="center" align="center">
|
||||
<v-card width="700" height="820" class="elevation-12">
|
||||
<v-card class="mb-2" color="teal-darken-1" elevation="0">
|
||||
<v-card class="" color="teal-darken-1" elevation="0">
|
||||
<!-- <v-card-title>Голосование</v-card-title> -->
|
||||
<v-card-title>«Хочу сказать Спасибо!»</v-card-title>
|
||||
<v-card-title >«Лучший новогодний костюм!»</v-card-title>
|
||||
</v-card>
|
||||
<v-card class="px-2">
|
||||
<v-card-title class="bg-teal-darken-1">Процент проголосовавших</v-card-title>
|
||||
|
||||
@@ -1,47 +1,48 @@
|
||||
<template>
|
||||
<v-form @submit="voteSend">
|
||||
<v-card id="scroll-window-chekbox" height="300" elevation="0">
|
||||
|
||||
<v-form @submit="voteSend" ref="vot" >
|
||||
<v-card id="scroll-window-chekbox" :height="heightel" elevation="0">
|
||||
<!-- Форма голосования -->
|
||||
|
||||
<v-virtual-scroll :items="persons.filter(e=>e.id_dict_department!=1)" :item-height="40">
|
||||
<v-virtual-scroll :items="persons">
|
||||
<template v-slot:default="{ item }">
|
||||
<v-checkbox v-model="vote" :id="item.fio" :value="item.fio" :label="item.fio" required />
|
||||
<v-checkbox hide-details="true" v-model="vote" :id="item.fio" :value="item.fio" :label="item.fio" required />
|
||||
</template>
|
||||
</v-virtual-scroll>
|
||||
</v-card>
|
||||
<v-card-actions class="justify-center vote-button-back">
|
||||
<v-dialog max-width="500" v-model="dialog">
|
||||
<template v-slot:activator>
|
||||
<v-btn variant="elevated" color="teal-darken-1"
|
||||
@click="approveCandidate">Подтвердить выбор</v-btn>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<v-card class="justify-center align-center">
|
||||
<v-card-title>Вы подтверждаете выбор?</v-card-title>
|
||||
<v-card-text>После подтверждения внесение измений станет невозможным.</v-card-text>
|
||||
<p>Выбранный кандидат</p>
|
||||
<v-card-title v-if="approve_name">{{ approve_name }}</v-card-title>
|
||||
<v-card-title v-else>Кандидат не выбран повторите голосование</v-card-title>
|
||||
<v-col class="d-flex flex-rows justify-center align-center" cols="12">
|
||||
<v-col cols="2">
|
||||
<v-btn v-if="approve_name" variant="elevated" color="green-darken-1"
|
||||
@click="voteSend">ДА</v-btn>
|
||||
<v-btn v-else variant="elevated" color="green-darken-1" @click="voteSend"
|
||||
disabled>ДА</v-btn>
|
||||
</v-col>
|
||||
<v-col cols="2">
|
||||
<v-btn variant="elevated" color="red-darken-1"
|
||||
@click="dialog = false">НЕТ</v-btn>
|
||||
</v-col>
|
||||
|
||||
<v-dialog max-width="500" v-model="dialog">
|
||||
<!-- <template v-slot:activator>
|
||||
|
||||
</template> -->
|
||||
<template v-slot:default>
|
||||
<v-card class="justify-center align-center">
|
||||
<v-card-title>Вы подтверждаете выбор?</v-card-title>
|
||||
<v-card-text>После подтверждения внесение измений станет невозможным.</v-card-text>
|
||||
<p>Выбранный кандидат</p>
|
||||
<v-card-title v-if="approve_name">{{ approve_name }}</v-card-title>
|
||||
<v-card-title v-else>Кандидат не выбран повторите голосование</v-card-title>
|
||||
<v-col class="d-flex flex-rows justify-center align-center" cols="12">
|
||||
<v-col cols="2">
|
||||
<v-btn v-if="approve_name" variant="elevated" color="green-darken-1"
|
||||
@click="voteSend">ДА</v-btn>
|
||||
<v-btn v-else variant="elevated" color="green-darken-1" @click="voteSend"
|
||||
disabled>ДА</v-btn>
|
||||
</v-col>
|
||||
</v-card>
|
||||
</template>
|
||||
</v-dialog>
|
||||
</v-card-actions>
|
||||
<v-col cols="2">
|
||||
<v-btn variant="elevated" color="red-darken-1"
|
||||
@click="dialog = false">НЕТ</v-btn>
|
||||
</v-col>
|
||||
</v-col>
|
||||
</v-card>
|
||||
</template>
|
||||
</v-dialog>
|
||||
</v-form>
|
||||
|
||||
|
||||
</template>
|
||||
<script scope>
|
||||
import { ref } from "vue";
|
||||
import { ref, computed } from "vue";
|
||||
import { clearAxios, axiosApiInstance } from "@/utils/axios-api";
|
||||
import { useAccountStore } from '@/store/AccountStore';
|
||||
import Vote from "@/views/Vote.vue";
|
||||
@@ -120,8 +121,11 @@ export default {
|
||||
|
||||
|
||||
// getVotesData();
|
||||
|
||||
const vot = ref(null)
|
||||
const heightel = computed(()=>!!vot.value?vot.value.clientHeight:300)
|
||||
return {
|
||||
vot,
|
||||
heightel,
|
||||
approveCandidate,
|
||||
voteSend,
|
||||
// vote_data,
|
||||
|
||||
@@ -331,11 +331,11 @@ export default {
|
||||
ico: "mdi-calendar",
|
||||
path: "/ical",
|
||||
},
|
||||
// {
|
||||
// name: "Голосование",
|
||||
// ico: "mdi-vote",
|
||||
// path: "/vote",
|
||||
// },
|
||||
{
|
||||
name: "Голосование",
|
||||
ico: "mdi-vote",
|
||||
path: "/vote",
|
||||
},
|
||||
|
||||
{
|
||||
name: "Об инспекции",
|
||||
|
||||
+163
-190
@@ -1,101 +1,56 @@
|
||||
<template>
|
||||
<v-row justify="center" class="d-flex align-start h-100">
|
||||
<v-col cols="12" class="d-flex align-center justify-center vote-main-title pa-0 ma-0">
|
||||
<v-col cols="6" class="pb-0 mb-0">ВЫБИРАЕМ ЛУЧШИХ СОТРУДНИКОВ 2024</v-col>
|
||||
<v-row justify="center" class="d-flex align-start h-100" :style="{ backgroundImage: `url('${bgImage}')`, backgroundSize: 'cover' }">
|
||||
<v-col cols="12" class="d-flex align-center justify-center text-h5 py-3 ma-0">
|
||||
<!-- <v-col class="pb-0 mb-0 text-center">ТЕКУЩИЕ ГОЛОСОВАНИЯ</v-col> -->
|
||||
</v-col>
|
||||
<!-- Голосование Лучший сотрудник -->
|
||||
<v-col cols="12" justify="center" class="d-flex vote-card-container">
|
||||
<v-col cols="6" justify="center" align="center">
|
||||
<div class="flip-card" :class="{ 'flipped': isFlipped1 }">
|
||||
<div class="flip-card-inner">
|
||||
<div v-if="!uservotedbest" class="flip-card-front">
|
||||
<!-- Передняя сторона карточки -->
|
||||
<v-card class="justify-center elevation-24" width="500" height="510" elevated>
|
||||
<v-card-title class="vote-title">ЛУЧШИЙ В ОТДЕЛЕ</v-card-title>
|
||||
<div class="justify-center">
|
||||
<div>
|
||||
<v-card class="vote-card-information" flat>
|
||||
|
||||
<v-card-text
|
||||
class="justify-center align-center vote-card-information-title">
|
||||
<p>ВЫ УЖЕ ПРОГОЛОСОВАЛИ.</p>
|
||||
<p>СПАСИБО!</p>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||
</v-card>
|
||||
</div>
|
||||
<div v-else class="flip-card-front" @click="toggleFlip1">
|
||||
<!-- Передняя сторона карточки -->
|
||||
<v-card class="justify-center elevation-24" width="500" height="510" elevated>
|
||||
<v-card-title class="vote-title">ЛУЧШИЙ В ОТДЕЛЕ</v-card-title>
|
||||
<div class="justify-center">
|
||||
<div>
|
||||
<v-card class="vote-card-information" variant="flat">
|
||||
|
||||
|
||||
<v-card-text class="justify-center align-center
|
||||
vote-card-information-title">
|
||||
Выберите сотрудника,<br>
|
||||
который, на Ваш взгляд,<br>
|
||||
внес наибольший вклад в результат работы<br>
|
||||
Отдела в 2024 году
|
||||
</v-card-text>
|
||||
|
||||
</v-card>
|
||||
</div>
|
||||
<v-btn :height="100" variant="flat" type="button">
|
||||
<v-img :width="100" cover src="@/assets/click3.gif"></v-img>
|
||||
</v-btn>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||
</v-card>
|
||||
</div>
|
||||
<!-- Передняя сторона карточки КОНЕЦ-->
|
||||
<div class="flip-card-back">
|
||||
<!-- Задняя сторона карточки -->
|
||||
<v-card class="justify-center elevation-24" width="500" height="510">
|
||||
<v-card-title class="vote-title">
|
||||
МОЙ КОЛЛЕГА САМЫЙ ЛУЧШИЙ
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<vote-form :type_fetch="'best'" :persons="mydepartment" :myrealdep="myrealdep" @voted="toggleFlip1" />
|
||||
</v-card-text>
|
||||
<!-- Кнопка активации поворота -->
|
||||
<v-card-actions class="justify-center vote-button-back">
|
||||
<v-btn @click="toggleFlip1" variant="elevated" color="teal-darken-1"
|
||||
type="button">назад</v-btn>
|
||||
</v-card-actions>
|
||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||
</v-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Задняя сторона карточки КОНЕЦ-->
|
||||
</v-col>
|
||||
<!-- Голосование Лучший сотрудник КОНЕЦ-->
|
||||
<!-- Голосование Спасибо -->
|
||||
<v-col cols="6" justify="center" align="center">
|
||||
<v-col cols="12" justify="center" align="center">
|
||||
<div class="flip-card" :class="{ 'flipped': isFlipped2 }">
|
||||
<div class="flip-card-inner">
|
||||
<div v-if="!uservotedthanks" class="flip-card-front">
|
||||
<!-- Передняя сторона карточки -->
|
||||
<v-card class="justify-center elevation-24" width="500" height="510" variant="elevated">
|
||||
<v-card-title class="vote-title">ХОЧУ СКАЗАТЬ СПАСИБО</v-card-title>
|
||||
<v-card-title class="text-h5 my-2">ЛУЧШИЙ НОВОГОДНИЙ КОСТЮМ</v-card-title>
|
||||
<div class="justify-center">
|
||||
<div>
|
||||
<v-card class="vote-card-information" variant="flat">
|
||||
|
||||
<v-card-text
|
||||
class="justify-center align-center vote-card-information-title">
|
||||
<v-card-text class="justify-center align-center vote-card-information-title">
|
||||
<p>ВЫ УЖЕ ПРОГОЛОСОВАЛИ.</p>
|
||||
<p>СПАСИБО!</p>
|
||||
</v-card-text>
|
||||
<v-dialog >
|
||||
<template v-slot:activator="{ props: activatorProps }">
|
||||
|
||||
<span class="text-h5">Проголосовало</span> <span
|
||||
v-bind="admin_panel ? activatorProps : ''" class="text-green text-h4"
|
||||
:class="{ 'cursor-pointer': admin_panel }">
|
||||
{{
|
||||
Math.round((voteresults.uservotedthanks.length * 100 / (allsorted.length + 1)).toFixed(2)) }}%</span>
|
||||
|
||||
</template>
|
||||
<template v-slot:default="{ isActive }">
|
||||
<v-row justify="center" class="h-100 admin-vote">
|
||||
<v-card width="1500" height="900">
|
||||
<vote-admin :usersvotedbest="voteresults.usersvotedbest"
|
||||
:uservotedthanks="voteresults.uservotedthanks"
|
||||
:all_cod="allsorted" />
|
||||
<v-row justify="center" align="center">
|
||||
|
||||
<v-btn color="teal-darken-1"
|
||||
@click="isActive.value = false">ЗАКРЫТЬ</v-btn>
|
||||
|
||||
</v-row>
|
||||
</v-card>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-dialog>
|
||||
</v-card>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||
@@ -103,27 +58,55 @@
|
||||
</div>
|
||||
<div v-else class="flip-card-front" @click="toggleFlip2">
|
||||
<!-- Передняя сторона карточки -->
|
||||
<v-card class="justify-center elevation-24" width="500" height="510" variant="elevated">
|
||||
<v-card-title class="vote-title ">ХОЧУ СКАЗАТЬ СПАСИБО</v-card-title>
|
||||
<div class="justify-center">
|
||||
<v-card
|
||||
|
||||
|
||||
class="elevation-24 d-flex align-сenter justify-space-between flex-column" width="500" height="510" variant="elevated" >
|
||||
|
||||
<div class="">
|
||||
<div class="text-h5 my-2">ЛУЧШИЙ НОВОГОДНИЙ КОСТЮМ</div>
|
||||
<div class="mt-4 ">
|
||||
<div class=" align-center font-weight-bold">
|
||||
Выберите сотрудника,
|
||||
костюм которого вам больше всего понравился
|
||||
|
||||
<div>
|
||||
<v-card class="vote-card-information" variant="flat">
|
||||
|
||||
<v-card-text class="justify-center align-center
|
||||
vote-card-information-title">
|
||||
Выберите сотрудника <br>
|
||||
(не из Вашего отдела),<br>
|
||||
которому Вы лично готовы обьявить<br>
|
||||
благодарность по итогам работы в 2024 году
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<v-btn :height="100" variant="flat" type="button">
|
||||
<v-img :width="100" cover src="@/assets/click3.gif"></v-img>
|
||||
</v-btn>
|
||||
</div>
|
||||
<div align="center" class="">
|
||||
<v-dialog >
|
||||
<template v-slot:activator="{ props: activatorProps }">
|
||||
|
||||
<span class="text-h5">Проголосовало</span> <span
|
||||
v-bind="admin_panel ? activatorProps : ''" class="text-green text-h4"
|
||||
:class="{ 'cursor-pointer': admin_panel }">
|
||||
{{
|
||||
Math.round((voteresults.uservotedthanks.length * 100 / (allsorted.length + 1)).toFixed(2)) }}%</span>
|
||||
|
||||
</template>
|
||||
<template v-slot:default="{ isActive }">
|
||||
<v-row justify="center" class="h-100 admin-vote">
|
||||
<v-card width="1500" height="900">
|
||||
<vote-admin :usersvotedbest="voteresults.usersvotedbest"
|
||||
:uservotedthanks="voteresults.uservotedthanks"
|
||||
:all_cod="allsorted" />
|
||||
<v-row justify="center" align="center">
|
||||
|
||||
<v-btn color="teal-darken-1"
|
||||
@click="isActive.value = false">ЗАКРЫТЬ</v-btn>
|
||||
|
||||
</v-row>
|
||||
</v-card>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-dialog>
|
||||
<div class="my-4"><count-down /></div>
|
||||
</div>
|
||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||
</v-card>
|
||||
@@ -131,18 +114,20 @@
|
||||
<!-- Передняя сторона карточки КОНЕЦ-->
|
||||
<!-- Задняя сторона карточки -->
|
||||
<div class="flip-card-back">
|
||||
<v-card class="justify-center elevation-24" width="500" height="510" variant="elevated">
|
||||
<v-card-title class="vote-title ">
|
||||
ХОЧУ СКАЗАТЬ СПАСИБО
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
|
||||
<vote-form :type_fetch="'thanks'" :persons="allsorted.filter(e=>e.department!=myrealdep.department)" :myrealdep="myrealdep" @voted="toggleFlip2" />
|
||||
</v-card-text>
|
||||
<v-card class="d-flex align-сenter justify-space-between elevated-24 flex-column" width="500" height="510" variant="elevated">
|
||||
<div class="text-h5 my-2">ЛУЧШИЙ НОВОГОДНИЙ КОСТЮМ</div>
|
||||
<!-- <v-card-text class=""> -->
|
||||
|
||||
<vote-form class="flex-grow-1 " ref="voteform" :type_fetch="'thanks'"
|
||||
:persons="allsorted"
|
||||
:myrealdep="myrealdep" @voted="toggleFlip2" />
|
||||
<!-- </v-card-text> -->
|
||||
<!-- Кнопка активации поворота -->
|
||||
<v-card-actions class="justify-center vote-button-back">
|
||||
<v-btn @click="toggleFlip2" variant="elevated" color="teal-darken-1"
|
||||
<v-card-actions class="justify-center">
|
||||
<v-btn @click="toggleFlip2" variant="elevated" color="red-darken-4"
|
||||
type="button">назад</v-btn>
|
||||
<v-btn variant="elevated" color="teal-darken-1"
|
||||
@click="approveCandidate">Подтвердить выбор</v-btn>
|
||||
</v-card-actions>
|
||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||
</v-card>
|
||||
@@ -155,18 +140,18 @@
|
||||
<!-- <v-col cols="12" class="d-flex justify-center align-end ">
|
||||
<h1>ПРИНЯЛИ УЧАСТИЕ В ГОЛОСОВАНИИ</h1>
|
||||
</v-col> -->
|
||||
<v-col cols="12" class="d-flex justify-center align-end pa-0">
|
||||
|
||||
<!-- <v-col cols="12" class="d-flex justify-center align-end pa-0">
|
||||
|
||||
<v-col v-if="admin_panel" justify="center" align="center" cols="6" class=" pa-0">
|
||||
|
||||
<v-dialog>
|
||||
<template v-slot:activator="{ props: activatorProps }">
|
||||
<v-dialog> -->
|
||||
<!-- <template v-slot:activator="{ props: activatorProps }">
|
||||
<v-btn v-bind="activatorProps " variant='plain'
|
||||
class="procent_card_font pa-0">
|
||||
{{ Math.round((voteresults.usersvotedbest.filter(e=>e.department_user==mydepartment[0].department).length*100/(mydepartment.length+1)).toFixed(2))}}%
|
||||
</v-btn>
|
||||
</template>
|
||||
<template v-slot:default="{ isActive }">
|
||||
</template> -->
|
||||
<!-- <template v-slot:default="{ isActive }">
|
||||
<v-row justify="center" class="h-100 admin-vote">
|
||||
<v-card width="1500" height="900">
|
||||
|
||||
@@ -181,44 +166,22 @@
|
||||
</v-row>
|
||||
</template>
|
||||
</v-dialog>
|
||||
</v-col>
|
||||
<v-col v-else justify="center" align="center" cols="6" class="procent_card_font pa-0">
|
||||
</v-col> -->
|
||||
<!-- <v-col v-else justify="center" align="center" cols="6" class="procent_card_font pa-0">
|
||||
|
||||
<span>{{ (Math.round(((voteresults.usersvotedbest.filter(e=>e.department_user==mydepartment[0].department).length )*100/(mydepartment.length+1)).toFixed(2)))}}%</span>
|
||||
|
||||
</v-col>
|
||||
<v-col v-if="admin_panel" justify="center" align="center" cols="6" class=" pa-0">
|
||||
<v-dialog>
|
||||
<template v-slot:activator="{ props: activatorProps }">
|
||||
<v-btn v-bind="activatorProps " variant='plain'
|
||||
class="procent_card_font pa-0" >
|
||||
<span>{{ Math.round((voteresults.uservotedthanks.length*100/(allsorted.length+1)).toFixed(2))}}%</span>
|
||||
</v-btn>
|
||||
</template>
|
||||
<template v-slot:default="{ isActive }">
|
||||
<v-row justify="center" class="h-100 admin-vote">
|
||||
<v-card width="1500" height="900">
|
||||
<vote-admin :usersvotedbest="voteresults.usersvotedbest" :uservotedthanks="voteresults.uservotedthanks" :all_cod="allsorted" />
|
||||
<v-row justify="center" align="center">
|
||||
</v-col> -->
|
||||
|
||||
<v-btn color="teal-darken-1"
|
||||
@click="isActive.value = false">ЗАКРЫТЬ</v-btn>
|
||||
|
||||
</v-row>
|
||||
</v-card>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-dialog>
|
||||
</v-col>
|
||||
<v-col v-else justify="center" align="center" cols="6" class="procent_card_font pa-0">
|
||||
<!-- <v-col v-else justify="center" align="center" cols="6" class="procent_card_font pa-0">
|
||||
<span>{{ Math.round((voteresults.uservotedthanks.length*100/(allsorted.length+1)).toFixed(2))}}%</span>
|
||||
</v-col>
|
||||
</v-col>
|
||||
<v-col cols="12" class="d-flex justify-center align-start pa-0">
|
||||
</v-col> -->
|
||||
<!-- </v-col> -->
|
||||
<!-- <v-col cols="12" class="d-flex justify-center align-start pa-0">
|
||||
<v-col justify="center" align="center" cols="6" class="vote-cards_cell ">
|
||||
<count-down />
|
||||
|
||||
</v-col>
|
||||
</v-col>
|
||||
</v-col> -->
|
||||
|
||||
<!-- Голосование Спасибо КОНЕЦ-->
|
||||
</v-row>
|
||||
@@ -227,6 +190,7 @@
|
||||
import { ref, computed } from "vue";
|
||||
import { clearAxios, axiosApiInstance } from "@/utils/axios-api";
|
||||
import VoteForm from '@/components/vote/VoteForm.vue';
|
||||
import bgImage from '@/assets/bg/bg.png';
|
||||
|
||||
import VoteAdmin from '@/components/vote/VoteAdmin.vue';
|
||||
import CountDown from '@/components/CountDown.vue';
|
||||
@@ -240,53 +204,55 @@ export default {
|
||||
components: {
|
||||
VoteForm,
|
||||
CountDown,
|
||||
|
||||
|
||||
VoteAdmin,
|
||||
},
|
||||
|
||||
setup() {
|
||||
const voted_best=ref([])
|
||||
const full_list_pers=ref([])
|
||||
|
||||
const voteform=ref(null)
|
||||
const voted_best = ref([])
|
||||
const full_list_pers = ref([])
|
||||
let votedListBst = ref([]);
|
||||
let votedListThn = ref([]);
|
||||
let voted_thn = ref(false);
|
||||
let voted_bst = ref(false);
|
||||
const myrealdep = ref({id_dict_department:0, id:0})
|
||||
const uservoted=ref([true,true])
|
||||
const myrealdep = ref({ id_dict_department: 0, id: 0 })
|
||||
const uservoted = ref([true, true])
|
||||
const allcod = ref([])
|
||||
const isFlipped1 = ref(false);
|
||||
const isFlipped2 = ref(false);
|
||||
const voteresults=ref({usersvotedbest:[],uservotedthanks:[]} )
|
||||
const voteresults = ref({ usersvotedbest: [], uservotedthanks: [] })
|
||||
|
||||
// const isVoted = () => {
|
||||
// clearAxios.get(`/api/vote/getthanks/`).then((data) => {
|
||||
// votedListThn = data.data;
|
||||
// let finded_thn = votedListThn.find(({ voted_user }) => voted_user === account_login)
|
||||
// if (finded_thn.voted_user === account_login) {
|
||||
// voted_thn.value = true;
|
||||
// clearAxios.get(`/api/vote/getthanks/`).then((data) => {
|
||||
// votedListThn = data.data;
|
||||
// let finded_thn = votedListThn.find(({ voted_user }) => voted_user === account_login)
|
||||
// if (finded_thn.voted_user === account_login) {
|
||||
// voted_thn.value = true;
|
||||
|
||||
// }
|
||||
// });
|
||||
// clearAxios.get(`/api/vote/getbest/`).then((data) => {
|
||||
// votedListBst = data.data;
|
||||
// let finded_bst = votedListBst.find(({ voted_user }) => voted_user === account_login)
|
||||
// if (finded_bst.voted_user === account_login) {
|
||||
// voted_bst.value = true;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// clearAxios.get(`/api/vote/getbest/`).then((data) => {
|
||||
// votedListBst = data.data;
|
||||
// let finded_bst = votedListBst.find(({ voted_user }) => voted_user === account_login)
|
||||
// if (finded_bst.voted_user === account_login) {
|
||||
// voted_bst.value = true;
|
||||
// }
|
||||
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
axiosApiInstance.get('/api/vote/getvoteinfo/').then((res)=>{
|
||||
axiosApiInstance.get('/api/vote/getvoteinfo/').then((res) => {
|
||||
allcod.value = res.data.allcod
|
||||
// console.log(account_login.user);
|
||||
myrealdep.value = allcod.value.find(e=>e.login === account_login.user.login)
|
||||
myrealdep.value = allcod.value.find(e => e.login === account_login.user.login)
|
||||
console.log(myrealdep.value);
|
||||
// uservoted.value = res.data.uservoted
|
||||
voteresults.value = res.data.voteresults
|
||||
console.log(res.data.voteresults);
|
||||
})
|
||||
|
||||
|
||||
|
||||
const toggleFlip1 = () => {
|
||||
|
||||
@@ -298,51 +264,58 @@ export default {
|
||||
isFlipped2.value = !isFlipped2.value;
|
||||
}
|
||||
|
||||
if (['9966-00-134', '9966-00-141','9966-00-011','9966-00-125'].includes(account_login.user.login)) {
|
||||
admin_panel = true;
|
||||
|
||||
if (['9966-00-134', '9966-00-141', '9966-00-011', '9966-00-125'].includes(account_login.user.login)) {
|
||||
admin_panel.value = true;
|
||||
|
||||
}
|
||||
const allsorted = computed({
|
||||
get(){
|
||||
let all = allcod.value.filter(e=> e.id!=myrealdep.value.id)
|
||||
return all.sort((a,b)=>{if(b.fio>a.fio) return -1
|
||||
else if(b.fio<a.fio)return 1
|
||||
return 0
|
||||
})
|
||||
get() {
|
||||
let all = allcod.value.filter(e => e.id != myrealdep.value.id)
|
||||
return all.sort((a, b) => {
|
||||
if (b.fio > a.fio) return -1
|
||||
else if (b.fio < a.fio) return 1
|
||||
return 0
|
||||
})
|
||||
}
|
||||
})
|
||||
// isVoted();
|
||||
|
||||
|
||||
const uservotedthanks = computed({
|
||||
get(){
|
||||
get() {
|
||||
|
||||
let ind = voteresults.value.uservotedthanks.findIndex(e=>e.voted_user===account_login.user.login)
|
||||
|
||||
if (ind>-1) return false
|
||||
let ind = voteresults.value.uservotedthanks.findIndex(e => e.voted_user === account_login.user.login)
|
||||
|
||||
if (ind > -1) return false
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
const uservotedbest= computed({
|
||||
get(){
|
||||
|
||||
let ind = voteresults.value.usersvotedbest.findIndex(e=>e.voted_user===account_login.user.login)
|
||||
if (ind>-1) return false
|
||||
const uservotedbest = computed({
|
||||
get() {
|
||||
|
||||
let ind = voteresults.value.usersvotedbest.findIndex(e => e.voted_user === account_login.user.login)
|
||||
if (ind > -1) return false
|
||||
return true
|
||||
}
|
||||
})
|
||||
const mydepartment = computed({
|
||||
get(){
|
||||
get() {
|
||||
console.log(allcod.value);
|
||||
let ac= allcod.value.filter(e=> e.id_dict_department===myrealdep.value.id_dict_department && e.id!=myrealdep.value.id )
|
||||
return ac.sort((a,b)=>{if(b.fio>a.fio) return -1
|
||||
else if(b.fio<a.fio)return 1
|
||||
return 0
|
||||
})
|
||||
let ac = allcod.value.filter(e => e.id_dict_department === myrealdep.value.id_dict_department && e.id != myrealdep.value.id)
|
||||
return ac.sort((a, b) => {
|
||||
if (b.fio > a.fio) return -1
|
||||
else if (b.fio < a.fio) return 1
|
||||
return 0
|
||||
})
|
||||
}
|
||||
})
|
||||
const approveCandidate=()=>{
|
||||
if (voteform.value!==null) voteform.value.approveCandidate()
|
||||
}
|
||||
return {
|
||||
approveCandidate,
|
||||
voteform,
|
||||
myrealdep,
|
||||
allsorted,
|
||||
mydepartment,
|
||||
@@ -356,8 +329,9 @@ export default {
|
||||
voted_thn,
|
||||
uservotedthanks,
|
||||
uservotedbest,
|
||||
voteresults
|
||||
|
||||
voteresults,
|
||||
bgImage
|
||||
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -444,5 +418,4 @@ export default {
|
||||
font-size: 2.3em;
|
||||
font-weight: 400;
|
||||
|
||||
}
|
||||
</style>
|
||||
}</style>
|
||||
Reference in new issue
Block a user