анимация к завершённому голосованию, сортировка департаментов, отмена скролла у конструктора, открытие карточки пользователя в завершённых голосованиях
This commit is contained in:
1 parent
14ea9ae9b8
commit
a482345a3b
6 files changed
+309
-15
No files matched your search
@@ -67,7 +67,7 @@
|
|||||||
<v-btn
|
<v-btn
|
||||||
color="modal_btn"
|
color="modal_btn"
|
||||||
variant="text"
|
variant="text"
|
||||||
@click= "$emit('update:opendialog', value)"
|
@click= "$emit('update:opendialog', false)"
|
||||||
>
|
>
|
||||||
Закрыть
|
Закрыть
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|||||||
@@ -0,0 +1,143 @@
|
|||||||
|
<template>
|
||||||
|
<v-container class="d-flex flex-column align-center">
|
||||||
|
<div id="container">
|
||||||
|
<div id="success-box">
|
||||||
|
<div class="face">
|
||||||
|
<div class="eye"></div>
|
||||||
|
<div class="eye right"></div>
|
||||||
|
<div class="mouth happy"></div>
|
||||||
|
</div>
|
||||||
|
<div class="shadow scale"></div>
|
||||||
|
<div class="message"><h1 class="alert">Все проголосовали!</h1><p>тех, кто не голосовал нет</p></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</v-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$white: #80CBC4;
|
||||||
|
$gray: #CBCDD3;
|
||||||
|
$dark: #000000;
|
||||||
|
|
||||||
|
@import url('https://fonts.googleapis.com/css?family=Lato:400,700');
|
||||||
|
|
||||||
|
$font: 'Lato', sans-serif;
|
||||||
|
|
||||||
|
#container {
|
||||||
|
position: relative;
|
||||||
|
margin: auto;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 50vw;
|
||||||
|
height: 40vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
#success-box {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 80vh;
|
||||||
|
top: -50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
height: 40%;
|
||||||
|
top: 47%;
|
||||||
|
color: #004D40;
|
||||||
|
}
|
||||||
|
|
||||||
|
.face {
|
||||||
|
position: absolute;
|
||||||
|
width: 22%;
|
||||||
|
height: 22%;
|
||||||
|
background: $white;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid $dark;
|
||||||
|
top: 21%;
|
||||||
|
left: 37.5%;
|
||||||
|
z-index: 2;
|
||||||
|
animation: bounce 1s ease-in infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eye {
|
||||||
|
position: absolute;
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
background: $dark;
|
||||||
|
border-radius: 50%;
|
||||||
|
top: 40%;
|
||||||
|
left: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
left: 68%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mouth {
|
||||||
|
position:absolute;
|
||||||
|
top: 43%;
|
||||||
|
left: 41%;
|
||||||
|
width: 7px;
|
||||||
|
height: 7px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.happy {
|
||||||
|
border: 2px solid;
|
||||||
|
border-color: transparent $dark $dark transparent;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow {
|
||||||
|
position: absolute;
|
||||||
|
width: 21%;
|
||||||
|
height: 3%;
|
||||||
|
opacity: .5;
|
||||||
|
background: $dark;
|
||||||
|
left: 40%;
|
||||||
|
top: 43%;
|
||||||
|
border-radius: 50%;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scale {
|
||||||
|
animation: scale 1s ease-in infinite;
|
||||||
|
}
|
||||||
|
.move {
|
||||||
|
animation: move 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes bounce {
|
||||||
|
50% {
|
||||||
|
transform: translateY(-10px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes scale {
|
||||||
|
50% {
|
||||||
|
transform: scale(0.9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes move {
|
||||||
|
0% {
|
||||||
|
left: 25%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
left: 60%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
left: 25%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
<template>
|
||||||
|
<div id="container">
|
||||||
|
<div id="error-box">
|
||||||
|
<div class="face2">
|
||||||
|
<div class="eye"></div>
|
||||||
|
<div class="eye right"></div>
|
||||||
|
<div class="mouth sad"></div>
|
||||||
|
</div>
|
||||||
|
<div class="shadow move"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$white: #EF5350;
|
||||||
|
$gray: #CBCDD3;
|
||||||
|
$dark: #000000;
|
||||||
|
|
||||||
|
#container {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 200px;
|
||||||
|
height: 110px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#error-box {
|
||||||
|
position: absolute;
|
||||||
|
width: 350px;
|
||||||
|
height: 350px;
|
||||||
|
right: -32%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.face2 {
|
||||||
|
position: absolute;
|
||||||
|
width: 22%;
|
||||||
|
height: 22%;
|
||||||
|
background: $white;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid $dark;
|
||||||
|
top: 7%;
|
||||||
|
left: 37.5%;
|
||||||
|
z-index: 2;
|
||||||
|
animation: roll 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eye {
|
||||||
|
position: absolute;
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
background: $dark;
|
||||||
|
border-radius: 50%;
|
||||||
|
top: 40%;
|
||||||
|
left: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
left: 68%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mouth {
|
||||||
|
position:absolute;
|
||||||
|
top: 43%;
|
||||||
|
left: 41%;
|
||||||
|
width: 7px;
|
||||||
|
height: 7px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sad {
|
||||||
|
top: 49%;
|
||||||
|
border: 2px solid;
|
||||||
|
border-color: $dark transparent transparent $dark;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow {
|
||||||
|
position: absolute;
|
||||||
|
width: 21%;
|
||||||
|
height: 3%;
|
||||||
|
opacity: .5;
|
||||||
|
background: $dark;
|
||||||
|
left: 40%;
|
||||||
|
top: 28%;
|
||||||
|
border-radius: 50%;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scale {
|
||||||
|
animation: scale 1s ease-in infinite;
|
||||||
|
}
|
||||||
|
.move {
|
||||||
|
animation: move 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes scale {
|
||||||
|
50% {
|
||||||
|
transform: scale(0.9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes roll {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
left: 25%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
left: 60%;
|
||||||
|
transform: rotate(168deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
left: 25%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes move {
|
||||||
|
0% {
|
||||||
|
left: 25%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
left: 60%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
left: 25%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,10 +11,6 @@
|
|||||||
</template>
|
</template>
|
||||||
<span>{{ voteCard.name }}</span>
|
<span>{{ voteCard.name }}</span>
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
<!-- <v-btn v-if="user.id === voteCard.author || user.is_superuser" flat size="medium"-->
|
|
||||||
<!-- @click="$emit('openEditVoteModal', voteCard)">-->
|
|
||||||
<!-- <v-icon color="orange-lighten-1">mdi-pencil</v-icon>-->
|
|
||||||
<!-- </v-btn>-->
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col>
|
<v-col>
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
<v-card flat class="fill-height d-flex flex-column">
|
<v-card flat class="fill-height d-flex flex-column">
|
||||||
<v-card-title>Создание опроса:</v-card-title>
|
<v-card-title>Создание опроса:</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text style="max-height: 62vh; overflow-y: auto;">
|
||||||
<transition-group name="list" tag="div">
|
<transition-group name="list" tag="div">
|
||||||
<div v-for="(question, index) in form.questions" :key="index" class="mb-4">
|
<div v-for="(question, index) in form.questions" :key="index" class="mb-4">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
</v-tab>
|
</v-tab>
|
||||||
<v-tab>Не голосовали</v-tab>
|
<v-tab>Не голосовали</v-tab>
|
||||||
</v-tabs>
|
</v-tabs>
|
||||||
|
|
||||||
<v-tabs-window v-model="activeTab">
|
<v-tabs-window v-model="activeTab">
|
||||||
<v-tabs-window-item v-for="(question, questionIndex) in questions" :key="questionIndex">
|
<v-tabs-window-item v-for="(question, questionIndex) in questions" :key="questionIndex">
|
||||||
<v-row>
|
<v-row>
|
||||||
@@ -89,18 +88,25 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
</v-tabs-window-item>
|
</v-tabs-window-item>
|
||||||
<v-tabs-window-item>
|
<v-tabs-window-item>
|
||||||
<v-card-title class="text-red-darken-3">Не голосовали:</v-card-title>
|
<NonVoteSad v-if="Object.keys(groupedByDepartment).length > 0" />
|
||||||
<v-card-item style="max-height: 60vh; overflow-y: auto;">
|
<v-card-title v-if="Object.keys(groupedByDepartment).length > 0" class="text-red-darken-3">Не голосовали:</v-card-title>
|
||||||
|
<v-card-item style="max-height: 50vh; overflow-y: auto;">
|
||||||
|
<NonVoteHappy v-if="Object.keys(groupedByDepartment).length < 1"/>
|
||||||
<template v-for="(voters, department) in groupedByDepartment" :key="department">
|
<template v-for="(voters, department) in groupedByDepartment" :key="department">
|
||||||
<v-list-item-title class="text-teal-darken-4">{{ department }}</v-list-item-title>
|
<v-list-item-title class="text-teal-darken-4">{{ department }}</v-list-item-title>
|
||||||
<v-list-item v-for="(voter, voterIndex) in voters" :key="voterIndex">
|
<v-list-item v-for="(voter, voterIndex) in voters" :key="`${department}-${voterIndex}`">
|
||||||
<!-- {{ voter.fio }}-->
|
|
||||||
<p>
|
<p>
|
||||||
<v-avatar :image="checkremote(`${spravURL()}${voter.login}.jpg`)"
|
<v-avatar
|
||||||
|
:image="checkremote(`${spravURL()}${voter.login}.jpg`)"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
@click.stop="opendialog(checkremote(`${spravURL()}${voter.login}.jpg`))"/>
|
@click="userCardIndex = `${department}-${voterIndex}`"
|
||||||
|
/>
|
||||||
|
<InfoUserCard
|
||||||
|
:opendialog="userCardIndex === `${department}-${voterIndex}`"
|
||||||
|
@update:opendialog="userCardIndex = $event ? `${department}-${voterIndex}` : null"
|
||||||
|
:author="voter"
|
||||||
|
/>
|
||||||
<strong class="ml-4">{{ voter.fio }}</strong>
|
<strong class="ml-4">{{ voter.fio }}</strong>
|
||||||
(<small>{{ voter.post }}</small>) 👿
|
|
||||||
</p>
|
</p>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -133,9 +139,13 @@
|
|||||||
import {computed, ref} from 'vue';
|
import {computed, ref} from 'vue';
|
||||||
import {baseURL, spravURL} from "@/utils/axios-api";
|
import {baseURL, spravURL} from "@/utils/axios-api";
|
||||||
import {checkremote} from "@/utils/universal_functions";
|
import {checkremote} from "@/utils/universal_functions";
|
||||||
|
import NonVoteHappy from "@/components/vote/NonVoteHappy.vue";
|
||||||
|
import NonVoteSad from "@/components/vote/NonVoteSad.vue";
|
||||||
|
import InfoUserCard from "@/components/UI/fiousercard/infoUserCard.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'VoteResult',
|
name: 'VoteResult',
|
||||||
|
components: {InfoUserCard, NonVoteSad, NonVoteHappy},
|
||||||
methods: {
|
methods: {
|
||||||
checkremote,
|
checkremote,
|
||||||
spravURL() {
|
spravURL() {
|
||||||
@@ -157,6 +167,7 @@ export default {
|
|||||||
setup(props) {
|
setup(props) {
|
||||||
const activeTab = ref(0);
|
const activeTab = ref(0);
|
||||||
const questions = computed(() => props.data.questions || []);
|
const questions = computed(() => props.data.questions || []);
|
||||||
|
const userCardIndex = ref(null);
|
||||||
|
|
||||||
const title = props.data.name;
|
const title = props.data.name;
|
||||||
const description = props.data.description;
|
const description = props.data.description;
|
||||||
@@ -204,7 +215,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const groupedByDepartment = computed(() => {
|
const groupedByDepartment = computed(() => {
|
||||||
return nonVoters.reduce((groups, voter) => {
|
// Группируем пользователей по департаментам
|
||||||
|
const departments = nonVoters.reduce((groups, voter) => {
|
||||||
const department = voter.department || '';
|
const department = voter.department || '';
|
||||||
if (!groups[department]) {
|
if (!groups[department]) {
|
||||||
groups[department] = [];
|
groups[department] = [];
|
||||||
@@ -212,9 +224,25 @@ export default {
|
|||||||
groups[department].push(voter);
|
groups[department].push(voter);
|
||||||
return groups;
|
return groups;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
// Сортируем департаменты по id_dict_department
|
||||||
|
const sortedDepartments = Object.keys(departments).sort((a, b) => {
|
||||||
|
const idA = nonVoters.find(voter => voter.department === a)?.id_dict_department;
|
||||||
|
const idB = nonVoters.find(voter => voter.department === b)?.id_dict_department;
|
||||||
|
return idA - idB;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Возвращаем отсортированные департаменты с пользователями
|
||||||
|
const sortedGroupedByDepartment = {};
|
||||||
|
sortedDepartments.forEach(department => {
|
||||||
|
sortedGroupedByDepartment[department] = departments[department];
|
||||||
|
});
|
||||||
|
|
||||||
|
return sortedGroupedByDepartment;
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
userCardIndex,
|
||||||
activepick,
|
activepick,
|
||||||
opendialog,
|
opendialog,
|
||||||
dialog,
|
dialog,
|
||||||
|
|||||||
Reference in new issue
Block a user