Files
PORTAL_COD2/src/front/src/views/Vote.vue
T

234 lines
9.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<v-row justify="center" class="d-flex align-start h-100">
<v-col cols="12" class="h-15 d-flex justify-center proc-count_cell">
<v-col justify="center" align="center" cols="2">
<v-card color="teal-darken-1" width="200" height="100" elevation="24" class="procent-card-font">
<perc-bst />
</v-card>
</v-col>
<v-col justify="center" align="center" cols="4" class="vote-cards_cell ">
<count-down />
</v-col>
<v-col justify="center" align="center" cols="2">
<v-card color="teal-darken-1" width="200" height="100" elevation="24" class="procent-card-font">
<perc-thn />
</v-card>
</v-col>
</v-col>
<!-- Голосование Лучший сотрудник -->
<v-col justify="center" align="center">
<div class="flip-card" :class="{ 'flipped': isFlipped1 }">
<div class="flip-card-inner">
<div class="flip-card-front">
<!-- Передняя сторона карточки -->
<v-card class="justify-center elevation-24 " image="@/assets/best_employee.jpg" width="500"
height="700" variant="elevated">
<v-card-title class="vote-card-title">
&laquo;МОЙ КОЛЛЕГА САМЫЙ ЛУЧШИЙ&raquo;
</v-card-title>
<!-- Кнопка активации поворота -->
<v-card-actions class="justify-center vote-button">
<v-btn size="x-large" @click="toggleFlip1" variant="elevated" color="teal-darken-1"
type="button">ОТДАТЬ
ГОЛОС!</v-btn>
</v-card-actions>
<!-- Кнопка активации поворота КОНЕЦ-->
</v-card>
</div>
<!-- Передняя сторона карточки КОНЕЦ-->
<div class="flip-card-back">
<!-- Задняя сторона карточки -->
<v-card class="justify-center elevation-24" width="500" height="700">
<v-card-title>
&laquo;МОЙ КОЛЛЕГА САМЫЙ ЛУЧШИЙ&raquo;
</v-card-title>
<v-card-text>
<vote-form :type_fetch="'bst'" />
</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="2" v-if="admin_panel" justify="center" align="center">
<v-dialog>
<template v-slot:activator="{ props: VoteAdmin }">
<v-btn variant="elevated" v-bind="VoteAdmin" color="teal-darken-1">ИНФОРМАЦИЯ О ХОДЕ <br>
ГОЛОСОВАНИЯ</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 />
<v-row justify="center" align="center">
<v-btn variant="elevated" color="teal-darken-1"
@click="isActive.value = false">ЗАКРЫТЬ</v-btn>
</v-row>
</v-card>
</v-row>
</template>
</v-dialog>
</v-col>
<!-- Голосование Спасибо -->
<v-col justify="center" align="center">
<div class="flip-card" :class="{ 'flipped': isFlipped2 }">
<div class="flip-card-inner">
<div class="flip-card-front">
<!-- Передняя сторона карточки -->
<v-card class="justify-center elevation-24" image="@/assets/thanks.jpeg" width="500" height="700"
variant="elevated">
<v-card-title class="vote-card-title">
&laquo;ХОЧУ СКАЗАТЬ СПАСИБО!&raquo;
</v-card-title>
<!-- Кнопка активации поворота -->
<v-card-actions class="justify-center vote-button">
<v-btn size="x-large" @click="toggleFlip2" variant="elevated" color="teal-darken-1">ОТДАТЬ
ГОЛОС!</v-btn>
</v-card-actions>
<!-- Кнопка активации поворота КОНЕЦ-->
</v-card>
</div>
<!-- Передняя сторона карточки КОНЕЦ-->
<!-- Задняя сторона карточки -->
<div class="flip-card-back">
<v-card class="justify-center elevation-24" width="500" height="700" variant="elevated">
<v-card-title>
&laquo;ХОЧУ СКАЗАТЬ СПАСИБО!&raquo;
</v-card-title>
<v-card-text>
<vote-form :type_fetch="'thn'" />
</v-card-text>
<!-- Кнопка активации поворота -->
<v-card-actions class="justify-center vote-button-back">
<v-btn @click="toggleFlip2" variant="elevated" color="teal-darken-1"
type="button">назад</v-btn>
</v-card-actions>
<!-- Кнопка активации поворота КОНЕЦ-->
</v-card>
</div>
<!-- Задняя сторона карточки КОНЕЦ-->
</div>
</div>
</v-col>
<!-- Голосование Спасибо КОНЕЦ-->
</v-row>
</template>
<script>
import { ref } from "vue";
import VoteForm from '@/components/vote/VoteForm.vue';
import PercBst from '@/components/vote/PercBst.vue';
import PercThn from '@/components/vote/PercThn.vue';
import VoteAdmin from '@/components/vote/VoteAdmin.vue';
import CountDown from '@/components/CountDown.vue';
import { useAccountStore } from '@/store/AccountStore';
let admin_panel = ref(false);
let account_login = useAccountStore().user.login;
export default {
components: {
VoteForm,
CountDown,
PercBst,
PercThn,
VoteAdmin,
},
setup() {
const isFlipped1 = ref(false);
const isFlipped2 = ref(false);
const toggleFlip1 = () => {
isFlipped1.value = !isFlipped1.value;
};
const toggleFlip2 = () => {
isFlipped2.value = !isFlipped2.value;
}
if (account_login == '9966-00-011') {
admin_panel = true;
console.log(admin_panel);
}
return {
isFlipped1,
toggleFlip1,
isFlipped2,
toggleFlip2,
account_login,
admin_panel,
};
},
};
</script>
<style scoped>
.flip-card {
perspective: 1000px;
}
.flip-card-inner {
display: flex;
position: relative;
transition: transform 0.8s;
transform-style: preserve-3d;
}
.flipped .flip-card-inner {
transform: rotateY(-180deg);
}
.flip-card-front,
.flip-card-back {
display: flex;
justify-content: center;
position: absolute;
align-items: center;
width: 100%;
height: 100%;
backface-visibility: hidden;
}
.flip-card-back {
transform: rotateY(-180deg);
}
.vote-card-title {
background-color: rgba(255, 255, 255, 0.1);
color: white;
font-size: 1.7em;
}
.vote-button {
margin-top: 572px;
}
.vote-cards_cell {
height: 14% !important;
}
.proc-count_cell {
height: 18% !important;
}
.procent-card-font {
font-size: 4em;
}
.card-count {
font-size: 4em;
}
</style>