From 438fb6fadc65c48c2e28a4f36cf821fbce769d8e Mon Sep 17 00:00:00 2001 From: Denzel Date: Fri, 17 Jan 2025 09:04:59 +0300 Subject: [PATCH 1/4] 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 2/4] 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 3/4] 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 4/4] 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 @@ />
- -
Далее