From 438fb6fadc65c48c2e28a4f36cf821fbce769d8e Mon Sep 17 00:00:00 2001 From: Denzel Date: Fri, 17 Jan 2025 09:04:59 +0300 Subject: [PATCH 01/28] ref --- .../src/components/vote/VoteConstructor.vue | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index f4ffc5925..c99a54c37 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -36,30 +36,31 @@ outlined > -
-
Дата начала:
+
+
+
Дата и время начала:
-
-
Дата окончания:
+
+
Дата и время окончания:
+
+ @@ -71,6 +72,7 @@ + {{form}} Создание опроса
@@ -298,20 +300,13 @@ export default { const handleSelectAll = (selected) => { if (selected.includes("all")) { - currentQuestion.value.answers = groupedEmployees.value.map((employee) => ({ + form.value.questions[currentQuestionIndex.value].answers = groupedEmployees.value.map((employee) => ({ text: employee.id, - image: null + image: null, })); selectedEmployees.value = groupedEmployees.value.map(employee => employee.id); - } else if ( - selected.length === groupedEmployees.value.length && - !selected.includes("all") - ) { - currentQuestion.value.answers = selected.map((id) => ({ text: id, image: null })); - selectedEmployees.value = groupedEmployees.value.map(employee => employee.id); } else { - currentQuestion.value.answers = selected.map((id) => ({ text: id, image: null })); - selectedEmployees.value = groupedEmployees.value.map(employee => employee.id); + form.value.questions[currentQuestionIndex.value].answers = selected.map((id) => ({ text: id, image: null })); } }; @@ -320,10 +315,11 @@ export default { const addQuestion = () => { form.value.questions.push({ text: "", - settings: {type: "Ввести вручную", multiChoice: 1, onlyDep: false, withoutDirector: false}, + settings: { type: "Ввести вручную", multiChoice: 1, onlyDep: false, withoutDirector: false }, image: null, answers: [], }); + currentQuestionIndex.value = form.value.questions.length - 1; }; const removeQuestion = (index) => { @@ -335,7 +331,7 @@ export default { const addAnswer = () => { if (currentQuestion.value) { - currentQuestion.value.answers.push({text: "", image: null}); + form.value.questions[currentQuestionIndex.value].answers.push({ text: "", image: null }); } }; @@ -429,7 +425,7 @@ export default { const selectedEmployees = ref([]); const onEmployeesChange = (selected) => { - currentQuestion.value.answers = selected.map((id) => ({ text: id, image: null })); + form.value.questions[currentQuestionIndex.value].answers = selected.map((id) => ({ text: id, image: null })); }; return { From a35a3f8450443face4418cb6262e6c46ff0eef4e Mon Sep 17 00:00:00 2001 From: Denzel Date: Fri, 17 Jan 2025 09:09:34 +0300 Subject: [PATCH 02/28] ref --- src/front/src/components/vote/VoteConstructor.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index c99a54c37..c4d8a9598 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -150,7 +150,7 @@ > { form.value.questions[currentQuestionIndex.value].answers = selected.map((id) => ({ text: id, image: null })); }; return { - selectedEmployees, + // selectedEmployees, onEmployeesChange, returnend, returnstart, From e502319bc57ae95beee71a0a8f57f1fa08cf8339 Mon Sep 17 00:00:00 2001 From: Denzel Date: Fri, 17 Jan 2025 09:14:08 +0300 Subject: [PATCH 03/28] ref --- src/front/src/components/vote/VoteConstructor.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index c4d8a9598..42ca5a229 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -72,7 +72,6 @@ - {{form}} Создание опроса
@@ -430,16 +429,12 @@ export default { }; return { - // selectedEmployees, onEmployeesChange, returnend, returnstart, step, form, questionTypes, - groupedEmployees, - currentQuestionIndex, - currentQuestion, addQuestion, removeQuestion, addAnswer, From 1060949128e8190debaced63f776d736bda2f391 Mon Sep 17 00:00:00 2001 From: Denzel Date: Fri, 17 Jan 2025 09:18:12 +0300 Subject: [PATCH 04/28] ref --- src/front/src/components/vote/VoteConstructor.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index 42ca5a229..416c31bac 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -60,8 +60,6 @@ />
- -
Далее From 3fd589ffcf7511385a1f7198ec17917fa8954a61 Mon Sep 17 00:00:00 2001 From: Nukeap <53114367+Nukeap@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:00:35 +0300 Subject: [PATCH 05/28] Update views.py --- src/back/vote/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/back/vote/views.py b/src/back/vote/views.py index 50dcf26f2..dd0ab50f3 100644 --- a/src/back/vote/views.py +++ b/src/back/vote/views.py @@ -93,7 +93,7 @@ class VoteCreate(APIView): question = Question( question=question_data['text'], vote=vote, - file=question_data['image'], + # file=question_data['image'], numb=count, settings=question_data.get('settings', {}), ) @@ -101,7 +101,7 @@ class VoteCreate(APIView): for answer in question_data['answers']: Answer( answer=answer['text'], - file=answer['image'], + # file=answer['image'], question=question ).save() From a93acd177b2faf0ce84cc7658e166658168a769c Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 17 Jan 2025 11:01:04 +0300 Subject: [PATCH 06/28] fix: delete title on main page --- src/front/src/views/VoteHomePage.vue | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/front/src/views/VoteHomePage.vue b/src/front/src/views/VoteHomePage.vue index fa53d614d..88ac20755 100644 --- a/src/front/src/views/VoteHomePage.vue +++ b/src/front/src/views/VoteHomePage.vue @@ -1,15 +1,10 @@