From 2108058a6b6da1e16094f8263fdea3289e2c418d Mon Sep 17 00:00:00 2001 From: Andrei Filippov Date: Fri, 1 Nov 2024 11:48:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B3=D0=BE=D0=BB=D0=BE=D1=81=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/back/vote/models.py | 2 - src/back/vote/views.py | 8 ++-- src/front/src/components/vote/VoteAdmin.vue | 35 +++++++++----- src/front/src/components/vote/VoteForm.vue | 11 +++-- src/front/src/views/Vote.vue | 53 +++++++++++++++++++-- 5 files changed, 83 insertions(+), 26 deletions(-) diff --git a/src/back/vote/models.py b/src/back/vote/models.py index 69d7b7fbc..bf65bbafe 100644 --- a/src/back/vote/models.py +++ b/src/back/vote/models.py @@ -11,7 +11,6 @@ class ThanksVote(models.Model): vote_thanks_date = models.DateTimeField(auto_now_add=True) class Meta: - # unique_together = ('cand_name', 'voted_user') verbose_name = "Голосование, хочу сказать спасибо!" verbose_name_plural = "Голосование, хочу сказать спасибо!" @@ -27,7 +26,6 @@ class BestVote(models.Model): vote_best_date = models.DateTimeField(auto_now_add=True) class Meta: - # unique_together = ('cand_name', 'voted_user') verbose_name = "Голосование, мой коллега самый лучший" verbose_name_plural = "Голосование, мой коллега самый лучший" diff --git a/src/back/vote/views.py b/src/back/vote/views.py index 78b076d54..a4cf450b2 100644 --- a/src/back/vote/views.py +++ b/src/back/vote/views.py @@ -42,8 +42,8 @@ class SetThanks(APIView): class GetThanks(APIView): def get(self, request): # Группировка кандидатов по имени и подсчет каждого - count_thanks = ThanksVote.objects.values( - 'cand_name').annotate(total=Count('id')) + count_thanks = ThanksVote.objects.values('voted_user', + 'cand_name').annotate(total=Count('id')) return Response(count_thanks) @@ -63,8 +63,8 @@ class SetBest(APIView): class GetBest(APIView): def get(self, request): # Группировка кандидатов по имени и подсчет каждого - count_bests = BestVote.objects.values( - 'department_user', 'cand_name').annotate(total=Count('id')) + count_bests = BestVote.objects.values('voted_user', + 'department_user', 'cand_name').annotate(total=Count('id')) return Response(count_bests) diff --git a/src/front/src/components/vote/VoteAdmin.vue b/src/front/src/components/vote/VoteAdmin.vue index f907756e2..776f9b693 100644 --- a/src/front/src/components/vote/VoteAdmin.vue +++ b/src/front/src/components/vote/VoteAdmin.vue @@ -10,26 +10,26 @@ Процент проголосовавших - + {{ perc_bst }}% - + Лидер номинации - - {{ department }} - + + + {{ department }}
{{ employee.name }}
-
+
ФИО не участвовавших в голосовании - + {{ key }}
@@ -51,14 +51,14 @@ Процент проголосовавших - + - + Лидер номинации - +
{{ leader }}
@@ -66,7 +66,7 @@ ФИО не участвовавших в голосовании - + {{ key }}
@@ -176,8 +176,17 @@ export default { margin-left: 10%; } -#scroll-window { +.scroll-leaders { overflow-y: scroll; - height: 400px; + height: 95px; +} + +.scroll-window { + overflow-y: scroll; + height: 378px; +} + +.perc-voted { + font-size: 1.2em; } \ No newline at end of file diff --git a/src/front/src/components/vote/VoteForm.vue b/src/front/src/components/vote/VoteForm.vue index 2b1ee8bc3..7c8867b4e 100644 --- a/src/front/src/components/vote/VoteForm.vue +++ b/src/front/src/components/vote/VoteForm.vue @@ -1,8 +1,8 @@