Merge branch 'dev-denzel' into Vit

This commit is contained in:
Nukeap committed 2025-01-22 16:42:39 +03:00
commit e6eac9f982
1 file changed
+28 -15
+28 -15
View File
@@ -1,5 +1,5 @@
<template> <template>
<v-container> <v-container style="height: 85vh">
<div class="text-end"> <div class="text-end">
<v-btn class="" color="red-darken-1" density="compact" icon="mdi-close-thick" size="small" <v-btn class="" color="red-darken-1" density="compact" icon="mdi-close-thick" size="small"
@click="$emit('closer')"> @click="$emit('closer')">
@@ -46,7 +46,7 @@
<v-card class="mb-4"> <v-card class="mb-4">
<v-card-title class="text-teal-darken-3">Топ {{ getTopResults(question).length }}</v-card-title> <v-card-title class="text-teal-darken-3">Топ {{ getTopResults(question).length }}</v-card-title>
<v-card-text> <v-card-text>
<v-list style="max-height: 40vh; overflow-y: auto;"> <v-list style="max-height: 45vh; overflow-y: auto;">
<v-list-item <v-list-item
v-for="(answer, answerIndex) in getTopResults(question)" v-for="(answer, answerIndex) in getTopResults(question)"
:key="answerIndex" :key="answerIndex"
@@ -88,18 +88,17 @@
</v-col> </v-col>
</v-row> </v-row>
</v-tabs-window-item> </v-tabs-window-item>
<!-- Не голосовали --> <v-tabs-window-item>
<!-- <v-tabs-window-item v-for="(question, questionIndex) in questions" :key="questionIndex">--> <v-card-title class="text-red-darken-3">Не голосовали:</v-card-title>
<!-- <v-card-title class="text-red-darken-3">Не голосовали:</v-card-title>--> <v-card-item style="max-height: 60vh; overflow-y: auto;">
<!-- <v-list style="max-height: 40vh; overflow-y: auto;">--> <template v-for="(voters, department) in groupedByDepartment" :key="department">
<!-- <v-list-item--> <v-list-item-subtitle>{{ department }}</v-list-item-subtitle>
<!-- v-for="(answer, answerIndex) in getTopResults(question)"--> <v-list-item v-for="(voter, voterIndex) in voters" :key="voterIndex">
<!-- :key="answerIndex"--> {{ voter.fio }}
<!-- >--> </v-list-item>
<!-- {{answer.employee.fio}}--> </template>
<!-- </v-list-item>--> </v-card-item>
<!-- </v-list>--> </v-tabs-window-item>
<!-- </v-tabs-window-item>-->
</v-tabs-window> </v-tabs-window>
</v-container> </v-container>
@@ -154,6 +153,7 @@ export default {
const title = props.data.name; const title = props.data.name;
const description = props.data.description; const description = props.data.description;
const nonVoters = props.data.nonvoting;
const getWinner = (question) => { const getWinner = (question) => {
return question.answers.reduce( return question.answers.reduce(
@@ -196,6 +196,17 @@ export default {
activepick.value = val activepick.value = val
} }
const groupedByDepartment = computed(() => {
return nonVoters.reduce((groups, voter) => {
const department = voter.department || '';
if (!groups[department]) {
groups[department] = [];
}
groups[department].push(voter);
return groups;
}, {});
});
return { return {
activepick, activepick,
opendialog, opendialog,
@@ -209,7 +220,9 @@ export default {
voteCount, voteCount,
title, title,
description, description,
getPercentage getPercentage,
nonVoters,
groupedByDepartment
}; };
}, },
}; };