анимация к завершённому голосованию, сортировка департаментов, отмена скролла у конструктора, открытие карточки пользователя в завершённых голосованиях
This commit is contained in:
1 parent
14ea9ae9b8
commit
a482345a3b
6 files changed
+350
-56
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>
|
||||||
|
|||||||
@@ -14,13 +14,13 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
|
||||||
<div class="v-col flex-grow-1 flex-shrink-0 ">
|
<div class="v-col flex-grow-1 flex-shrink-0 ">
|
||||||
|
|
||||||
<v-stepper v-model="step" editable class="d-flex flex-column fill-height">
|
<v-stepper v-model="step" editable class="d-flex flex-column fill-height">
|
||||||
<v-stepper-header class="flex-grow-0 flex-shrink-1">
|
<v-stepper-header class="flex-grow-0 flex-shrink-1">
|
||||||
<v-stepper-item :complete="step > 0" step="1">Основная информация
|
<v-stepper-item :complete="step > 0" step="1">Основная информация
|
||||||
|
|
||||||
</v-stepper-item>
|
</v-stepper-item>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-stepper-item :complete="step > 1" step="2">Создание опроса</v-stepper-item>
|
<v-stepper-item :complete="step > 1" step="2">Создание опроса</v-stepper-item>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<div class="flex-grow-1 flex-shrink-0">
|
<div class="flex-grow-1 flex-shrink-0">
|
||||||
|
|
||||||
<v-textarea v-model="form.description" :rules="[rules.required]" label="Описание"
|
<v-textarea v-model="form.description" :rules="[rules.required]" label="Описание"
|
||||||
|
|
||||||
variant="outlined"></v-textarea>
|
variant="outlined"></v-textarea>
|
||||||
</div>
|
</div>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-btn color="teal-darken-4" size="medium" @click="step = 1">Далее</v-btn>
|
<v-btn color="teal-darken-4" size="medium" @click="step = 1">Далее</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
@@ -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">
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="3" class="py-0">
|
<v-col cols="3" class="py-0">
|
||||||
|
|
||||||
<v-select density="compact" v-model="question.settings.choice" :items="questionTypes"
|
<v-select density="compact" v-model="question.settings.choice" :items="questionTypes"
|
||||||
@update:model-value="question.answers=[]"
|
@update:model-value="question.answers=[]"
|
||||||
:list-props="{density:'compact'}"
|
:list-props="{density:'compact'}"
|
||||||
item-title="name" item-value="choice" label="" hide-details variant="outlined"></v-select>
|
item-title="name" item-value="choice" label="" hide-details variant="outlined"></v-select>
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
|
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</transition-group>
|
</transition-group>
|
||||||
<div class="d-flex justify-start">
|
<div class="d-flex justify-start">
|
||||||
<v-btn size="small" color="teal-darken-4" @click="addAnswer(index)">Добавить ответ</v-btn>
|
<v-btn size="small" color="teal-darken-4" @click="addAnswer(index)">Добавить ответ</v-btn>
|
||||||
@@ -147,9 +147,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
|
||||||
<div class="v-row">
|
<div class="v-row">
|
||||||
|
|
||||||
<v-radio-group class="text-caption" inline v-model="question.settings.onlyDep">
|
<v-radio-group class="text-caption" inline v-model="question.settings.onlyDep">
|
||||||
<template v-slot:label>
|
<template v-slot:label>
|
||||||
<div class="text-body-2 font-weight-bold">Голосование по отделам:</div>
|
<div class="text-body-2 font-weight-bold">Голосование по отделам:</div>
|
||||||
@@ -158,24 +158,24 @@
|
|||||||
<template v-slot:label>
|
<template v-slot:label>
|
||||||
<div class="text-caption">{{ x.name }}</div>
|
<div class="text-caption">{{ x.name }}</div>
|
||||||
</template>
|
</template>
|
||||||
</v-radio>
|
</v-radio>
|
||||||
</v-radio-group>
|
</v-radio-group>
|
||||||
|
|
||||||
<!-- <v-switch color="teal-darken-4" v-model="question.settings.withoutDirector"
|
<!-- <v-switch color="teal-darken-4" v-model="question.settings.withoutDirector"
|
||||||
:label="`Без начальства : ${question.settings.withoutDirector ? 'да ' : 'нет'}`" hide-details
|
:label="`Без начальства : ${question.settings.withoutDirector ? 'да ' : 'нет'}`" hide-details
|
||||||
class="v-col-auto"></v-switch> -->
|
class="v-col-auto"></v-switch> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<v-autocomplete
|
|
||||||
|
<v-autocomplete
|
||||||
class=" text-no-wrap"
|
class=" text-no-wrap"
|
||||||
v-model="question.selectedEmployees" :items="allEmployeesgroupedbydep"
|
v-model="question.selectedEmployees" :items="allEmployeesgroupedbydep"
|
||||||
item-title="fio" item-value="id" label="Выберите сотрудников" multiple variant="outlined"
|
item-title="fio" item-value="id" label="Выберите сотрудников" multiple variant="outlined"
|
||||||
density="compact"
|
density="compact"
|
||||||
@update:model-value="(selected)=>question.answers=question.answers.filter(e=>selected.includes(e.text))"
|
@update:model-value="(selected)=>question.answers=question.answers.filter(e=>selected.includes(e.text))"
|
||||||
>
|
>
|
||||||
<template #prepend-item>
|
<template #prepend-item>
|
||||||
@@ -185,38 +185,38 @@
|
|||||||
<template #selection="{item}">
|
<template #selection="{item}">
|
||||||
<v-chip
|
<v-chip
|
||||||
:prepend-avatar="checkremote(`${spravURL}${item.raw.login}.jpg`)"
|
:prepend-avatar="checkremote(`${spravURL}${item.raw.login}.jpg`)"
|
||||||
>
|
>
|
||||||
|
|
||||||
{{ item.raw.familyname }}</v-chip>
|
{{ item.raw.familyname }}</v-chip>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<template #item="data">
|
<template #item="data">
|
||||||
|
|
||||||
<template v-if="typeof data.item.raw !== 'object'">
|
<template v-if="typeof data.item.raw !== 'object'">
|
||||||
<v-divider/>
|
<v-divider/>
|
||||||
<v-list-group class='pa-4 text-overline text-grey' v-text="data.item.raw"></v-list-group>
|
<v-list-group class='pa-4 text-overline text-grey' v-text="data.item.raw"></v-list-group>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<v-list-item
|
<v-list-item
|
||||||
|
|
||||||
slim
|
slim
|
||||||
density="compact"
|
density="compact"
|
||||||
:append-avatar="checkremote(`${spravURL}${data.item.raw.login}.jpg`)"
|
:append-avatar="checkremote(`${spravURL}${data.item.raw.login}.jpg`)"
|
||||||
@click="onEmployeesChange(data.item.raw.id, index)"
|
@click="onEmployeesChange(data.item.raw.id, index)"
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
|
|
||||||
<v-checkbox hide-details
|
<v-checkbox hide-details
|
||||||
|
|
||||||
:model-value="question.selectedEmployees.includes(data.item.raw.id)"
|
:model-value="question.selectedEmployees.includes(data.item.raw.id)"
|
||||||
density="compact"></v-checkbox>
|
density="compact"></v-checkbox>
|
||||||
</template>
|
</template>
|
||||||
<v-list-item-title class="text-third" v-text="data.item.raw.fio"></v-list-item-title>
|
<v-list-item-title class="text-third" v-text="data.item.raw.fio"></v-list-item-title>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -232,10 +232,10 @@
|
|||||||
<transition-group name="list" tag="div">
|
<transition-group name="list" tag="div">
|
||||||
<div v-for="(person, ind) in question.answers" :key="person" class="v-row align-center mb-4">
|
<div v-for="(person, ind) in question.answers" :key="person" class="v-row align-center mb-4">
|
||||||
<v-col cols="7" class="py-0" >
|
<v-col cols="7" class="py-0" >
|
||||||
|
|
||||||
<v-chip :prepend-avatar="checkremote(`${spravURL}${findEmployeeById(person.text)?.login}.jpg`)" :text="findEmployeeById(person.text)?.fio ">
|
<v-chip :prepend-avatar="checkremote(`${spravURL}${findEmployeeById(person.text)?.login}.jpg`)" :text="findEmployeeById(person.text)?.fio ">
|
||||||
|
|
||||||
|
|
||||||
</v-chip>
|
</v-chip>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="py-0 d-flex" cols="5">
|
<v-col class="py-0 d-flex" cols="5">
|
||||||
@@ -253,7 +253,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
<v-divider class="ma-2 pa-1"></v-divider>
|
<v-divider class="ma-2 pa-1"></v-divider>
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
|
|
||||||
<v-btn size="small" color="orange-darken-4" @click="addQuestion">Добавить вопрос</v-btn>
|
<v-btn size="small" color="orange-darken-4" @click="addQuestion">Добавить вопрос</v-btn>
|
||||||
</div>
|
</div>
|
||||||
@@ -263,25 +263,25 @@
|
|||||||
<v-btn color="teal-darken-4" size="medium" @click="step = 2">Далее</v-btn>
|
<v-btn color="teal-darken-4" size="medium" @click="step = 2">Далее</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
</v-stepper-window-item>
|
</v-stepper-window-item>
|
||||||
|
|
||||||
<!-- Подтверждение -->
|
<!-- Подтверждение -->
|
||||||
<v-stepper-window-item step="3" class="fill-height">
|
<v-stepper-window-item step="3" class="fill-height">
|
||||||
|
|
||||||
<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>
|
||||||
<v-alert v-if="errorMessage" class="mb-4 " type="error">
|
<v-alert v-if="errorMessage" class="mb-4 " type="error">
|
||||||
{{ errorMessage }}
|
{{ errorMessage }}
|
||||||
</v-alert>
|
</v-alert>
|
||||||
|
|
||||||
<p><v-icon size="xsmall" :class="form.title===null||form.title.length==0?'':'opacity-0'" color='red' icon="mdi-alert"/><strong class="px-2">Название:</strong> {{ form.title }}</p>
|
<p><v-icon size="xsmall" :class="form.title===null||form.title.length==0?'':'opacity-0'" color='red' icon="mdi-alert"/><strong class="px-2">Название:</strong> {{ form.title }}</p>
|
||||||
<p><v-icon size="xsmall" :class="form.description===null||form.description.length==0?'':'opacity-0'" color='red' icon="mdi-alert"/><strong class="px-2">Описание:</strong> {{ form.description }}</p>
|
<p><v-icon size="xsmall" :class="form.description===null||form.description.length==0?'':'opacity-0'" color='red' icon="mdi-alert"/><strong class="px-2">Описание:</strong> {{ form.description }}</p>
|
||||||
<p><strong class="px-2">Дата начала:</strong> {{ form.startDate.toLocaleDateString() }}</p>
|
<p><strong class="px-2">Дата начала:</strong> {{ form.startDate.toLocaleDateString() }}</p>
|
||||||
<p><strong class="px-2">Дата окончания:</strong> {{ form.endDate.toLocaleDateString() }}</p>
|
<p><strong class="px-2">Дата окончания:</strong> {{ form.endDate.toLocaleDateString() }}</p>
|
||||||
<p><strong class="px-2">Вопросы:</strong></p>
|
<p><strong class="px-2">Вопросы:</strong></p>
|
||||||
|
|
||||||
<v-card v-for="(question, index) in form.questions" :key="index" class="mb-4 pa-3">
|
<v-card v-for="(question, index) in form.questions" :key="index" class="mb-4 pa-3">
|
||||||
<div class="pa-2">
|
<div class="pa-2">
|
||||||
|
|
||||||
@@ -289,8 +289,8 @@
|
|||||||
|
|
||||||
<div v-if="question.settings.choice === 'free' && question.answers.length">
|
<div v-if="question.settings.choice === 'free' && question.answers.length">
|
||||||
<p><strong>Варианты ответов:</strong></p>
|
<p><strong>Варианты ответов:</strong></p>
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(answer, answerIndex) in question.answers" :key="answerIndex">
|
<li v-for="(answer, answerIndex) in question.answers" :key="answerIndex">
|
||||||
{{ answer.text }}
|
{{ answer.text }}
|
||||||
@@ -309,20 +309,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-btn color="teal-darken-4" size="medium" @click="step -= 1">Назад</v-btn>
|
<v-btn color="teal-darken-4" size="medium" @click="step -= 1">Назад</v-btn>
|
||||||
<v-btn :disabled="errorMessage!=''" color="teal-darken-4" size="medium" @click="saveVoting">Сохранить</v-btn>
|
<v-btn :disabled="errorMessage!=''" color="teal-darken-4" size="medium" @click="saveVoting">Сохранить</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-stepper-window-item>
|
</v-stepper-window-item>
|
||||||
|
|
||||||
</v-stepper-window>
|
</v-stepper-window>
|
||||||
</v-stepper>
|
</v-stepper>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
@@ -374,7 +374,7 @@ export default {
|
|||||||
for (let x of allEmployees.value.sort((a,b)=>a.id_dict_department-b.id_dict_department)){
|
for (let x of allEmployees.value.sort((a,b)=>a.id_dict_department-b.id_dict_department)){
|
||||||
if(!groupped.includes(x.department))groupped.push(x.department)
|
if(!groupped.includes(x.department))groupped.push(x.department)
|
||||||
groupped.push(x)
|
groupped.push(x)
|
||||||
}
|
}
|
||||||
return groupped
|
return groupped
|
||||||
})
|
})
|
||||||
const findEmployeeById = (id) =>
|
const findEmployeeById = (id) =>
|
||||||
@@ -538,7 +538,7 @@ export default {
|
|||||||
removeQuestion,
|
removeQuestion,
|
||||||
addAnswer,
|
addAnswer,
|
||||||
removeAnswer,
|
removeAnswer,
|
||||||
findEmployeeById,
|
findEmployeeById,
|
||||||
saveVoting,
|
saveVoting,
|
||||||
isVoteCreated,
|
isVoteCreated,
|
||||||
resetForm,
|
resetForm,
|
||||||
|
|||||||
@@ -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
|
||||||
class="cursor-pointer"
|
:image="checkremote(`${spravURL()}${voter.login}.jpg`)"
|
||||||
@click.stop="opendialog(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>
|
<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