diff --git a/src/front/src/components/vote/VoteResult.vue b/src/front/src/components/vote/VoteResult.vue
index 972a73e26..bf85f21bb 100644
--- a/src/front/src/components/vote/VoteResult.vue
+++ b/src/front/src/components/vote/VoteResult.vue
@@ -26,7 +26,6 @@
-
{{ question.name }}
@@ -56,6 +55,13 @@
Должность: {{ answer.employee ? answer.employee.post : '' }}
+
@@ -114,6 +120,11 @@ export default {
return currentVote
}
+ const getPercentage = (count, question) => {
+ const totalVotes = question.answers.reduce((sum, answer) => sum + answer.count, 0);
+ return totalVotes > 0 ? (count / totalVotes) * 100 : 0;
+ };
+
return {
activeTab,
questions,
@@ -123,7 +134,8 @@ export default {
shouldShowTooltip,
voteCount,
title,
- description
+ description,
+ getPercentage
};
},
};