From e9f36aa490964ee3cf59da82db0883a07ab08642 Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Tue, 17 Jun 2025 14:27:49 +0300 Subject: [PATCH] =?UTF-8?q?fix=20[P-274]:=20=D0=92=20=D0=B3=D0=BE=D0=BB?= =?UTF-8?q?=D0=BE=D1=81=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=D1=85=20=D1=81?= =?UTF-8?q?=D0=B2=D1=8F=D0=B7=D0=B0=D1=82=D1=8C=20=D0=BA=D0=BB=D0=B8=D0=BA?= =?UTF-8?q?=20=D0=BF=D0=BE=20=D1=87=D0=B5=D0=BA=D0=B1=D0=BE=D0=BA=D1=81?= =?UTF-8?q?=D1=83=20=D1=81=20=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/src/components/vote/CurrentVote.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/front/src/components/vote/CurrentVote.vue b/src/front/src/components/vote/CurrentVote.vue index 203b47cc1..ac912ae59 100644 --- a/src/front/src/components/vote/CurrentVote.vue +++ b/src/front/src/components/vote/CurrentVote.vue @@ -64,7 +64,7 @@ {{ answer.employee?.fio || answer.name }} @@ -197,6 +197,20 @@ export default { } }; + const toggleAnswer = (questionId, answerId) => { + const currentAnswers = result.value[questionId]; + const index = currentAnswers.indexOf(answerId); + + if (index === -1) { + const question = props.data.questions.find(q => q.id === questionId); + if (currentAnswers.length < question.settings.multiChoice) { + currentAnswers.push(answerId); + } + } else { + currentAnswers.splice(index, 1); + } + }; + const submitVote = () => { let voteData = [] for (let val of Object.values(result.value)) { @@ -263,6 +277,7 @@ export default { isCurrentQuestionAnswered, nextStep, prevStep, + toggleAnswer, submitVote, isVoteSubmitted, result