diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index 5af5538b4..416c31bac 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -20,7 +20,7 @@ - + Основная информация - - - -
Начало:
-
- -
- - - - - - - - -
-
- - -
Окончание:
-
- -
- +
+
Дата и время начала:
+ + +
+
+
Дата и время окончания:
+ + - - - - - - +
+
Далее @@ -180,7 +147,7 @@ > { 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 })); } }; @@ -352,10 +312,12 @@ 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: [], + selectedEmployees: [] }); + currentQuestionIndex.value = form.value.questions.length - 1; }; const removeQuestion = (index) => { @@ -367,7 +329,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 }); } }; @@ -458,23 +420,19 @@ export default { form.value.endDate = dates } - const selectedEmployees = ref([]); + // 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 { - selectedEmployees, onEmployeesChange, returnend, returnstart, step, form, questionTypes, - groupedEmployees, - currentQuestionIndex, - currentQuestion, addQuestion, removeQuestion, addAnswer,