ref
This commit is contained in:
1 parent
26d994b1a9
commit
438fb6fadc
1 file changed
+17
-21
@@ -36,30 +36,31 @@
|
||||
outlined
|
||||
></v-textarea>
|
||||
|
||||
<div>
|
||||
<h6 class="text-h6">Дата начала:</h6>
|
||||
<div class="d-flex ga-10">
|
||||
<div class="d-flex ga-3 align-center">
|
||||
<h6 class="text-subtitle-1">Дата и время начала:</h6>
|
||||
<date-select :datedefault="form.startDate" @returndate="returnstart" />
|
||||
<v-select
|
||||
v-model="selectedTimeStart"
|
||||
:items="timeOptions"
|
||||
dense
|
||||
label="Время начала"
|
||||
outlined
|
||||
prepend-icon="mdi-calendar-clock"
|
||||
hide-details
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="text-h6">Дата окончания:</h6>
|
||||
<div class="d-flex ga-3 align-center">
|
||||
<h6 class="text-subtitle-1">Дата и время окончания:</h6>
|
||||
<date-select :datedefault="form.endDate" @returndate="returnend" />
|
||||
<v-select
|
||||
v-model="selectedTimeEnd"
|
||||
:items="timeOptions"
|
||||
dense
|
||||
label="Время окончания"
|
||||
outlined
|
||||
prepend-icon="mdi-calendar-clock"
|
||||
hide-details
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -71,6 +72,7 @@
|
||||
<!-- Создание опроса -->
|
||||
<v-stepper-window-item step="2">
|
||||
<v-card flat>
|
||||
{{form}}
|
||||
<v-card-title>Создание опроса</v-card-title>
|
||||
<v-card-text>
|
||||
<div v-for="(question, index) in form.questions" :key="index" class="mb-4">
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user