This commit is contained in:
Denzel committed 2025-01-21 12:17:04 +03:00
1 parent 56c68d3596
commit 60ef869623
1 file changed
+12 -3
+12 -3
View File
@@ -35,7 +35,6 @@
Количество голосов: {{ getWinner(question)?.count || 0 }} Количество голосов: {{ getWinner(question)?.count || 0 }}
</v-card-subtitle> </v-card-subtitle>
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<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>
@@ -47,7 +46,7 @@
> >
<p> <p>
<strong>{{ answer.employee ? answer.employee.fio : answer.name }}</strong>: {{ answer.count }} <strong>{{ answer.employee ? answer.employee.fio : answer.name }}</strong>: {{ answer.count }}
голосов {{voteCount(answer.count)}}
<template v-if="answer.employee"> <template v-if="answer.employee">
<br/> <br/>
<small>Отдел: {{ answer.employee ? answer.employee.department : '' }}</small> <small>Отдел: {{ answer.employee ? answer.employee.department : '' }}</small>
@@ -101,13 +100,23 @@ export default {
return text && text.length > maxLength; return text && text.length > maxLength;
}; };
const voteCount = (count) => {
let currentVote = '';
const lastDigit = count % 10;
if (lastDigit === 1) currentVote = 'голос'
if (lastDigit > 1) currentVote = 'голоса'
if (lastDigit > 5 || count === 0) currentVote = 'голосов'
return currentVote
}
return { return {
activeTab, activeTab,
questions, questions,
getWinner, getWinner,
getTopResults, getTopResults,
truncateText, truncateText,
shouldShowTooltip shouldShowTooltip,
voteCount
}; };
}, },
}; };