diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index b7810cf92..78caae4de 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -142,13 +142,29 @@
- {{ index + 1 }}.
+ {{ index + 1 }}.
Список завершенных тестов будет здесь. Список доступных тестов будет здесь.
Отдел: {{ answer.employee ? answer.employee.department : '' }}
@@ -268,7 +271,21 @@ export default {
};
const getTopResults = (question) => {
- return [...question?.answers].sort((a, b) => b.count - a.count);
+ const sortedAnswers = [...question.answers].sort((a, b) => b.count - a.count);
+
+ // Присваиваем одинаковые индексы для одинаковых значений count
+ let rank = 1;
+ let previousCount = null;
+ return sortedAnswers.map((answer, index) => {
+ if (answer.count !== previousCount) {
+ rank = index + 1;
+ previousCount = answer.count;
+ }
+ return {
+ ...answer,
+ rank
+ };
+ });
};
const truncateText = (text, maxLength) => {
diff --git a/src/front/src/views/TestHomePage.vue b/src/front/src/views/TestHomePage.vue
index b1a3077c3..575aa00f4 100644
--- a/src/front/src/views/TestHomePage.vue
+++ b/src/front/src/views/TestHomePage.vue
@@ -1,23 +1,130 @@
-
+