анимация к завершённому голосованию, сортировка департаментов, отмена скролла у конструктора, открытие карточки пользователя в завершённых голосованиях

This commit is contained in:
Denzel committed 2025-01-23 13:28:13 +03:00
1 parent 14ea9ae9b8
commit a482345a3b
6 files changed
+310 -16

No files matched your search

@@ -67,7 +67,7 @@
<v-btn
color="modal_btn"
variant="text"
@click= "$emit('update:opendialog', value)"
@click= "$emit('update:opendialog', false)"
>
Закрыть
</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>
<span>{{ voteCard.name }}</span>
</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-row>
<v-col>
@@ -82,7 +82,7 @@
<v-card flat class="fill-height d-flex flex-column">
<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">
<div v-for="(question, index) in form.questions" :key="index" class="mb-4">
<div class="d-flex">
+38 -10
View File
@@ -28,7 +28,6 @@
</v-tab>
<v-tab>Не голосовали</v-tab>
</v-tabs>
<v-tabs-window v-model="activeTab">
<v-tabs-window-item v-for="(question, questionIndex) in questions" :key="questionIndex">
<v-row>
@@ -89,18 +88,25 @@
</v-row>
</v-tabs-window-item>
<v-tabs-window-item>
<v-card-title class="text-red-darken-3">Не голосовали:</v-card-title>
<v-card-item style="max-height: 60vh; overflow-y: auto;">
<NonVoteSad v-if="Object.keys(groupedByDepartment).length > 0" />
<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">
<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">
<!-- {{ voter.fio }}-->
<v-list-item v-for="(voter, voterIndex) in voters" :key="`${department}-${voterIndex}`">
<p>
<v-avatar :image="checkremote(`${spravURL()}${voter.login}.jpg`)"
class="cursor-pointer"
@click.stop="opendialog(checkremote(`${spravURL()}${voter.login}.jpg`))"/>
<v-avatar
:image="checkremote(`${spravURL()}${voter.login}.jpg`)"
class="cursor-pointer"
@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>
(<small>{{ voter.post }}</small>) 👿
</p>
</v-list-item>
</template>
@@ -133,9 +139,13 @@
import {computed, ref} from 'vue';
import {baseURL, spravURL} from "@/utils/axios-api";
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 {
name: 'VoteResult',
components: {InfoUserCard, NonVoteSad, NonVoteHappy},
methods: {
checkremote,
spravURL() {
@@ -157,6 +167,7 @@ export default {
setup(props) {
const activeTab = ref(0);
const questions = computed(() => props.data.questions || []);
const userCardIndex = ref(null);
const title = props.data.name;
const description = props.data.description;
@@ -204,7 +215,8 @@ export default {
}
const groupedByDepartment = computed(() => {
return nonVoters.reduce((groups, voter) => {
// Группируем пользователей по департаментам
const departments = nonVoters.reduce((groups, voter) => {
const department = voter.department || '';
if (!groups[department]) {
groups[department] = [];
@@ -212,9 +224,25 @@ export default {
groups[department].push(voter);
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 {
userCardIndex,
activepick,
opendialog,
dialog,