Merge branch 'dev-denzel' into Vit

This commit is contained in:
Nukeap committed 2025-01-17 12:49:20 +03:00
commit 90b5ba3786
1 file changed
+30 -72
@@ -20,7 +20,7 @@
<v-stepper-window>
<!-- Основная информация -->
<v-stepper-window-item step="1">
<v-card>
<v-card flat>
<v-card-title>Основная информация</v-card-title>
<v-card-text>
<v-text-field
@@ -36,63 +36,30 @@
outlined
></v-textarea>
<v-row >
<v-col>
<v-row align="end" >
<div class="text-subtitle-2 v-col-auto ">Начало:</div>
<div class="v-col-auto">
<date-select :datedefault="form.startDate" @returndate="returnstart" />
</div>
<v-col cols="2" class="">
<v-select
hide-details
class="text-black font-weight-bold align-self-end "
v-model="selectedTimeStart"
:items="timeOptions"
dense
variant="plain"
>
<template v-slot:prepend >
<v-icon
class="pt-2"
icon="mdi-calendar-clock"
size="x-small"
color="red-darken-3"
/>
</template>
</v-select>
</v-col>
</v-row>
</v-col>
<v-col>
<v-row align="end">
<div class="v-col-auto text-subtitle-2">Окончание:</div>
<div class="v-col-auto ">
<date-select :datedefault="form.endDate" @returndate="returnend" />
</div>
<v-select
hide-details
class="v-col-4 align-self-end"
<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
outlined
hide-details
/>
</div>
<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
variant="plain"
outlined
prepend-icon="mdi-calendar-clock"
hide-details
/>
</v-row>
</v-col>
</v-row>
</div>
</div>
</v-card-text>
<v-card-actions>
<v-btn color="teal-darken-4" size="medium" @click="step = 1">Далее</v-btn>
@@ -180,7 +147,7 @@
></v-switch>
<v-autocomplete
clearable
v-model="selectedEmployees"
v-model="question.selectedEmployees"
:items="allEmployees"
item-title="fio"
item-value="id"
@@ -330,20 +297,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 }));
}
};
@@ -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,