diff --git a/src/front/src/components/UI/Timer.vue b/src/front/src/components/UI/Timer.vue index 279cbda77..f4da44b39 100644 --- a/src/front/src/components/UI/Timer.vue +++ b/src/front/src/components/UI/Timer.vue @@ -3,9 +3,9 @@ - - До {{ disabledcard.text }} голосования осталось: - + + До {{ disabledcard.text }} голосования осталось: + @@ -60,7 +60,7 @@ export default { const displayDays = ref(0); const displaySeconds = ref(0); const isFinished = ref(false); - + const minutes = computed(() => seconds * 60); const hours = computed(() => minutes.value * 60); @@ -104,7 +104,6 @@ export default { if (distance <= 1) { clearInterval(timer) setTimeout(()=>countDown(),1000) - return } @@ -118,7 +117,7 @@ export default { displayMinutes.value = minutesOf < 10 ? "0" + minutesOf : minutesOf displaySeconds.value = secondsOf < 10 ? "0" + secondsOf : secondsOf - }, 1000) + }) } countDown() @@ -131,7 +130,7 @@ export default { declOfNum, dateendorStart, disabledcard, - + }; } } diff --git a/src/front/src/components/vote/CurrentVote.vue b/src/front/src/components/vote/CurrentVote.vue index f04fd170f..618750ac5 100644 --- a/src/front/src/components/vote/CurrentVote.vue +++ b/src/front/src/components/vote/CurrentVote.vue @@ -15,7 +15,6 @@ -
@@ -31,7 +30,6 @@ -
- - {{ answer.name }} + + {{ answer.employee?.fio || answer.name }} +
- - - - diff --git a/src/front/src/components/vote/VoteCard.vue b/src/front/src/components/vote/VoteCard.vue index 7eed1d1ec..9d93c9a2f 100644 --- a/src/front/src/components/vote/VoteCard.vue +++ b/src/front/src/components/vote/VoteCard.vue @@ -4,14 +4,15 @@ {{ voteCard.name }} - + mdi-pencil @@ -33,17 +34,20 @@ {{ voteCard.description }} - -
Завершено: {{ new Date(voteCard.dateend).toLocaleDateString() }}
+
Завершено: {{ + new Date(voteCard.dateend).toLocaleDateString() + }} +
- - diff --git a/src/front/src/utils/axios-api.js b/src/front/src/utils/axios-api.js index 3973b0652..ef7061d63 100644 --- a/src/front/src/utils/axios-api.js +++ b/src/front/src/utils/axios-api.js @@ -186,6 +186,16 @@ async function getEmployees() { } } +async function getVoteResult(id) { + try { + const response = await axiosApiInstance.get(`/api/vote/getresults/?id=${id}`); + return response.data; + } catch (error) { + console.error("Ошибка получения результата голосования:", error); + throw error; + } +} + export { axiosApiInstance, @@ -200,5 +210,6 @@ export { updateVote, patchVote, deleteVote, - getEmployees + getEmployees, + getVoteResult } diff --git a/src/front/src/views/VoteHomePage.vue b/src/front/src/views/VoteHomePage.vue index adb6b39f9..5c4e46445 100644 --- a/src/front/src/views/VoteHomePage.vue +++ b/src/front/src/views/VoteHomePage.vue @@ -1,127 +1,112 @@