Merge branch 'Vit' into develop

This commit is contained in:
Nukeap committed 2025-01-22 14:21:24 +03:00
commit 72765c5b1a
3 files changed
+168 -123

No files matched your search

+166 -116
View File
@@ -1,62 +1,76 @@
<template> <template>
<v-row class="pt-2 mx-1 bg-pink flex-column fill-height"> <v-row class="pt-2 mx-1 flex-column fill-height flex-grow-0 " >
<template v-if="isVoteCreated"> <template v-if="isVoteCreated">
<v-card class="text-center pa-8" flat> <v-card class="d-flex flex-column flex-grow-1 flex-shrink-0 text-center pa-8" flat>
<v-spacer></v-spacer>
<div class>
<v-icon color="success" size="48">mdi-check-circle</v-icon> <v-icon color="success" size="48">mdi-check-circle</v-icon>
<h2 class="mt-4">Голосование создано!</h2> <h2 class="mt-4">Голосование создано!</h2>
<v-btn class="mt-4" color="teal-darken-4" @click="resetForm">Создать ещё</v-btn> <v-btn class="mt-4" color="teal-darken-4" @click="resetForm">Создать ещё</v-btn>
</div>
<v-spacer></v-spacer>
</v-card> </v-card>
</template> </template>
<template v-else> <template v-else>
<div class="v-col-12 bg-green flex-grow-1 flex-shrink-0"> <div class="v-col flex-grow-1 flex-shrink-0 ">
<v-stepper v-model="step" class="full-height" editable> <v-stepper v-model="step" editable class="d-flex flex-column fill-height">
<v-stepper-header class=""> <v-stepper-header class="flex-grow-0 flex-shrink-1">
<v-stepper-item :complete="step > 0" step="1">Основная информация</v-stepper-item> <v-stepper-item :complete="step > 0" step="1">Основная информация
</v-stepper-item>
<v-divider></v-divider> <v-divider></v-divider>
<v-stepper-item :complete="step > 1" step="2">Создание опроса</v-stepper-item> <v-stepper-item :complete="step > 1" step="2">Создание опроса</v-stepper-item>
<v-divider></v-divider> <v-divider></v-divider>
<v-stepper-item :complete="step > 2" step="3">Подтверждение</v-stepper-item> <v-stepper-item :complete="step > 2" step="3">Подтверждение</v-stepper-item>
</v-stepper-header> </v-stepper-header>
<v-stepper-window class="bg-green flex-grow-1 flex-shrink-0 mb-6"> <v-stepper-window class="fill-height">
<!-- Основная информация --> <!-- Основная информация -->
<v-stepper-window-item step="1"> <v-stepper-window-item step="1" class="fill-height">
<v-card flat> <v-card flat class="fill-height d-flex flex-column ">
<v-card-title>Основная информация</v-card-title> <v-card-title>Основная информация</v-card-title>
<v-card-text> <v-card-text class="d-flex flex-column overflow-auto">
<v-text-field v-model="form.title" :rules="[rules.required]" label="Название голосования" <v-text-field v-model="form.title" :rules="[rules.required]" label="Название голосования"
class="flex-grow-0 flex-shrink-1"
variant="underlined"></v-text-field> variant="underlined"></v-text-field>
<div class="flex-grow-1 flex-shrink-0">
<v-textarea v-model="form.description" :rules="[rules.required]" label="Описание" <v-textarea v-model="form.description" :rules="[rules.required]" label="Описание"
variant="outlined"></v-textarea> variant="outlined"></v-textarea>
</div>
<v-divider></v-divider> <v-divider></v-divider>
<div class="pt-2">Дата и время:</div> <div class="flex-grow-0 flex-shrink-1">
<div class="pt-2 text-overline text-grey">Дата и время:</div>
<div class="d-flex justify-space-around"> <div class="d-flex justify-space-around">
<div class="d-flex ga-3 align-center"> <div class="d-flex ga-3 align-center">
<h6 class="text-subtitle-1 pt-2">начало:</h6> <h6 class="text-subtitle-1 pt-2">начало:</h6>
<date-select :datedefault="form.startDate" @returndate="returnstart"/> <date-select :datedefault="form.startDate" @returndate="returnstart" />
<v-select v-model="selectedTimeStart" :items="timeOptions" density="compact" hide-details <v-select v-model="selectedTimeStart" :items="timeOptions" density="compact" variant="plain"
variant="plain"> hide-details>
<template v-slot:prepend-inner> <template v-slot:prepend-inner>
<v-icon color="red" icon="mdi-timer" size="xsmall"></v-icon> <v-icon icon="mdi-timer" size="xsmall" color="red"></v-icon>
</template> </template>
</v-select> </v-select>
</div> </div>
<div class="d-flex ga-3 align-center"> <div class="d-flex ga-3 align-center">
<h6 class="text-subtitle-1 pt-2">окончание:</h6> <h6 class="text-subtitle-1 pt-2">окончание:</h6>
<date-select :datedefault="form.endDate" @returndate="returnend"/> <date-select :datedefault="form.endDate" @returndate="returnend" />
<v-select v-model="selectedTimeEnd" :items="timeOptions" density="compact" hide-details <v-select v-model="selectedTimeEnd" :items="timeOptions" density="compact" outlined variant="plain"
outlined hide-details>
variant="plain">
<template v-slot:prepend-inner> <template v-slot:prepend-inner>
<v-icon color="red" icon="mdi-timer" size="xsmall"></v-icon> <v-icon icon="mdi-timer" size="xsmall" color="red"></v-icon>
</template> </template>
</v-select> </v-select>
</div> </div>
</div> </div>
</div>
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
<v-btn color="teal-darken-4" size="medium" @click="step = 1">Далее</v-btn> <v-btn color="teal-darken-4" size="medium" @click="step = 1">Далее</v-btn>
</v-card-actions> </v-card-actions>
@@ -64,36 +78,37 @@
</v-stepper-window-item> </v-stepper-window-item>
<!-- Создание опроса --> <!-- Создание опроса -->
<v-stepper-window-item step="2"> <v-stepper-window-item step="2" class="fill-height">
<v-card class="h-100 " flat>
<v-card flat class="fill-height d-flex flex-column">
<v-card-title>Создание опроса:</v-card-title> <v-card-title>Создание опроса:</v-card-title>
<v-card-text> <v-card-text>
<transition-group name="list" tag="div">
<div v-for="(question, index) in form.questions" :key="index" class="mb-4"> <div v-for="(question, index) in form.questions" :key="index" class="mb-4">
<div class="d-flex"> <div class="d-flex">
<v-text-field v-model="question.text" :label="'Вопрос ' + (index + 1)" :rules="[rules.required]" <v-text-field density="comfortable" v-model="question.text" :label="'Вопрос ' + (index + 1)"
density="comfortable" variant="underlined"> :rules="[rules.required]" variant="underlined">
<template v-slot:append> <template v-slot:append>
<v-btn color="error" icon="mdi-delete" size="small" @click="removeQuestion(index)"/> <v-btn color="error" icon="mdi-delete" size="small" @click="removeQuestion(index)" />
</template> </template>
</v-text-field> </v-text-field>
</div> </div>
<v-file-input v-model="question.image" accept="image/*" density="comfortable" <v-file-input density="comfortable" v-model="question.image" accept="image/*"
label="Картинка для вопроса" variant="outlined"></v-file-input> label="Картинка для вопроса" variant="outlined"></v-file-input>
<v-divider></v-divider> <v-divider></v-divider>
<div class="py-2">Настройки вопроса</div> <div class="py-2 text-overline text-grey">Настройки вопроса</div>
<div class="v-row "> <div class="v-row ">
<v-col class="align-self-center font-weight-bold py-0"> <v-col class="align-self-center font-weight-bold py-0">
Тип ответа Тип ответа
</v-col> </v-col>
<v-col class="py-0" cols="3"> <v-col cols="3" class="py-0">
<v-select v-model="question.settings.choice" :items="questionTypes" density="compact" <v-select density="compact" v-model="question.settings.choice" :items="questionTypes"
hide-details item-title="name" item-value="choice" label="" @update:model-value="question.answers=[]"
variant="outlined"></v-select> :list-props="{density:'compact'}"
item-title="name" item-value="choice" label="" hide-details variant="outlined"></v-select>
<!-- choice --> <!-- choice -->
</v-col> </v-col>
</div> </div>
@@ -101,11 +116,10 @@
<v-col class="align-self-center font-weight-bold"> <v-col class="align-self-center font-weight-bold">
Число возможных ответов Число возможных ответов
</v-col> </v-col>
<v-col class="" cols="2"> <v-col cols="1" class="">
<v-text-field v-model="question.settings.multiChoice" :rules="[rules.required && question.settings.multiChoice > 0]" <v-text-field density="compact" v-model="question.settings.multiChoice"
density="compact" hide-details :rules="[rules.required && question.settings.multiChoice > 0]" hide-details type="number"
min="1" min="1" variant="outlined">
type="number" variant="outlined">
<template v-slot:prepend> <template v-slot:prepend>
</template> </template>
@@ -115,43 +129,68 @@
<v-card-text class="px-0"> <v-card-text class="px-0">
<div v-if="question.settings.choice === 'free'"> <div v-if="question.settings.choice === 'free'">
<transition-group name="list" tag="div">
<div v-for="(answer, ind) in question.answers" :key="ind" class="d-flex align-start mb-4"> <div v-for="(answer, ind) in question.answers" :key="ind" class="d-flex align-start mb-4">
<v-text-field v-model="answer.text" :label="'Ответ ' + (ind + 1)" :rules="[rules.required]" <v-text-field v-model="answer.text" :label="'Ответ ' + (ind + 1)" :rules="[rules.required]"
class="mr-4" density="compact" variant="outlined"></v-text-field> class="mr-4" variant="outlined" density="compact"></v-text-field>
<v-file-input v-model="answer.image" accept="image/*" dense density="compact" hide-details <v-file-input v-model="answer.image" accept="image/*" dense hide-details label="Картинка"
label="Картинка" variant="outlined"></v-file-input> variant="outlined" density="compact"></v-file-input>
<v-btn class="ms-1" color="error" icon="mdi-delete" size="small" <v-btn class="ms-1" color="error" icon="mdi-delete" size="small" @click="removeAnswer(index,ind)">
@click="removeAnswer(index,ind)">
</v-btn> </v-btn>
</div> </div>
<v-btn color="teal-darken-4" @click="addAnswer(index)">Добавить ответ</v-btn>
</transition-group>
<div class="d-flex justify-start">
<v-btn size="small" color="teal-darken-4" @click="addAnswer(index)">Добавить ответ</v-btn>
</div>
</div> </div>
<div v-else> <div v-else>
<div class="v-row"> <div class="v-row">
<v-radio-group v-model="question.settings.onlyDep" inline label="Голосование по отделам:"> <v-radio-group class="text-caption" inline v-model="question.settings.onlyDep">
<v-radio v-for="x in onlyDepdict" :key="x.name" :label="x.name" :value=x.value></v-radio> <template v-slot:label>
<div class="text-body-2 font-weight-bold">Голосование по отделам:</div>
</template>
<v-radio v-for="x in onlyDepdict" :key="x.name" :value=x.value>
<template v-slot:label>
<div class="text-caption">{{ x.name }}</div>
</template>
</v-radio>
</v-radio-group> </v-radio-group>
<!-- <v-switch color="teal-darken-4" v-model="question.settings.withoutDirector"--> <!-- <v-switch color="teal-darken-4" v-model="question.settings.withoutDirector"
<!-- :label="`Без начальства : ${question.settings.withoutDirector ? 'да ' : 'нет'}`" hide-details--> :label="`Без начальства : ${question.settings.withoutDirector ? 'да ' : 'нет'}`" hide-details
<!-- class="v-col-auto"></v-switch>--> class="v-col-auto"></v-switch> -->
</div> </div>
<v-autocomplete <v-autocomplete
v-model="question.selectedEmployees" class=" text-no-wrap"
:items="allEmployeesgroupedbydep" class=" text-no-wrap" v-model="question.selectedEmployees" :items="allEmployeesgroupedbydep"
density="compact" item-title="fio" item-value="id" label="Выберите сотрудников" multiple item-title="fio" item-value="id" label="Выберите сотрудников" multiple variant="outlined"
variant="outlined" density="compact"
@update:model-value="(selected)=>question.answers=question.answers.filter(e=>selected.includes(e.text))" @update:model-value="(selected)=>question.answers=question.answers.filter(e=>selected.includes(e.text))"
> >
<template #prepend-item> <template #prepend-item>
<v-checkbox :model-value="question.selectedEmployees.length==allEmployees.length" <v-checkbox class="pa-0" :model-value="question.selectedEmployees.length==allEmployees.length" label="Все"
class="pa-0"
label="Все"
@update:model-value="handleSelectAll(question.selectedEmployees.length==allEmployees.length, index)"></v-checkbox> @update:model-value="handleSelectAll(question.selectedEmployees.length==allEmployees.length, index)"></v-checkbox>
</template> </template>
<template #selection="{item}">
<v-chip
:prepend-avatar="checkremote(`${spravURL}${item.raw.login}.jpg`)"
>
{{ item.raw.familyname }}</v-chip>
</template>
<template #item="data"> <template #item="data">
@@ -162,51 +201,62 @@
<template v-else> <template v-else>
<v-list-item <v-list-item
:append-avatar="checkremote(`${spravURL}${data.item.raw.login}.jpg`)"
density="compact"
slim slim
density="compact"
:append-avatar="checkremote(`${spravURL}${data.item.raw.login}.jpg`)"
@click="onEmployeesChange(data.item.raw.id, index)" @click="onEmployeesChange(data.item.raw.id, index)"
> >
<template #prepend> <template #prepend>
<v-checkbox :model-value="question.selectedEmployees.includes(data.item.raw.id)" <v-checkbox hide-details
density="compact" :model-value="question.selectedEmployees.includes(data.item.raw.id)"
hide-details></v-checkbox> density="compact"></v-checkbox>
</template> </template>
<v-list-item-title class="text-third" v-text="data.item.raw.fio"></v-list-item-title> <v-list-item-title class="text-third" v-text="data.item.raw.fio"></v-list-item-title>
</v-list-item> </v-list-item>
<!-- <v-list-tile-avatar> -->
<!-- </v-list-tile-avatar> -->
</template> </template>
</template> </template>
</v-autocomplete> </v-autocomplete>
<transition-group name="list" tag="div">
<div v-for="(person, ind) in question.answers" :key="person" class="v-row align-center mb-4"> <div v-for="(person, ind) in question.answers" :key="person" class="v-row align-center mb-4">
<v-col class="py-0" cols="7"> <v-col cols="7" class="py-0" >
<v-chip <v-chip :prepend-avatar="checkremote(`${spravURL}${findEmployeeById(person.text)?.login}.jpg`)" :text="findEmployeeById(person.text)?.fio ">
:prepend-avatar="checkremote(`${spravURL}${findEmployeeById(person.text)?.login}.jpg`)"
:text="findEmployeeById(person.text)?.fio ">
</v-chip> </v-chip>
</v-col> </v-col>
<v-col class="py-0 d-flex" cols="5"> <v-col class="py-0 d-flex" cols="5">
<v-file-input v-model="person.image" accept="image/*" dense density="compact" hide-details <v-file-input v-model="person.image" accept="image/*" dense hide-details label="Картинка"
label="Картинка" variant="outlined"></v-file-input> variant="outlined" density="compact"></v-file-input>
<v-btn class="ms-1" color="error" icon="mdi-delete" size="small" <v-btn class="ms-1" color="error" icon="mdi-delete" size="small"
@click="question.selectedEmployees.splice(ind,1); removeAnswer(index,ind)"> @click="question.selectedEmployees.splice(ind,1); removeAnswer(index,ind)">
</v-btn> </v-btn>
</v-col> </v-col>
</div> </div>
</transition-group>
</div> </div>
</v-card-text> </v-card-text>
</div> </div>
<v-btn color="teal-darken-4" @click="addQuestion">Добавить вопрос</v-btn> </transition-group>
<v-divider class="ma-2 pa-1"></v-divider>
<div class="d-flex justify-center">
<v-btn size="small" color="orange-darken-4" @click="addQuestion">Добавить вопрос</v-btn>
</div>
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
<v-btn color="teal-darken-4" size="medium" @click="step -= 1">Назад</v-btn> <v-btn color="teal-darken-4" size="medium" @click="step -= 1">Назад</v-btn>
@@ -217,21 +267,17 @@
</v-stepper-window-item> </v-stepper-window-item>
<!-- Подтверждение --> <!-- Подтверждение -->
<v-stepper-window-item step="3"> <v-stepper-window-item step="3" class="fill-height">
<v-card flat>
<v-card flat class="fill-height d-flex flex-column">
<v-card-title>Подтверждение</v-card-title> <v-card-title>Подтверждение</v-card-title>
<v-card-text> <v-card-text>
<v-alert v-if="errorMessage" class="mb-4 " type="error">
{{ errorMessage }}
</v-alert>
<p> <p><v-icon size="xsmall" :class="form.title===null||form.title.length==0?'':'opacity-0'" color='red' icon="mdi-alert"/><strong class="px-2">Название:</strong> {{ form.title }}</p>
<v-icon :class="form.title===null||form.title.length==0?'':'opacity-0'" color='red' icon="mdi-alert" <p><v-icon size="xsmall" :class="form.description===null||form.description.length==0?'':'opacity-0'" color='red' icon="mdi-alert"/><strong class="px-2">Описание:</strong> {{ form.description }}</p>
size="xsmall"/>
<strong class="px-2">Название:</strong> {{ form.title }}
</p>
<p>
<v-icon :class="form.description===null||form.description.length==0?'':'opacity-0'" color='red'
icon="mdi-alert" size="xsmall"/>
<strong class="px-2">Описание:</strong> {{ form.description }}
</p>
<p><strong class="px-2">Дата начала:</strong> {{ form.startDate.toLocaleDateString() }}</p> <p><strong class="px-2">Дата начала:</strong> {{ form.startDate.toLocaleDateString() }}</p>
<p><strong class="px-2">Дата окончания:</strong> {{ form.endDate.toLocaleDateString() }}</p> <p><strong class="px-2">Дата окончания:</strong> {{ form.endDate.toLocaleDateString() }}</p>
<p><strong class="px-2">Вопросы:</strong></p> <p><strong class="px-2">Вопросы:</strong></p>
@@ -253,9 +299,7 @@
</div> </div>
<div v-if="question.settings.choice === 'employee' && question.answers.length"> <div v-if="question.settings.choice === 'employee' && question.answers.length">
<div>Количество допустимых ответов: {{ question.settings.multiChoice }}</div> <div>Количество допустимых ответов: {{ question.settings.multiChoice }}</div>
<div class="">Голосование по отделам: <div class="">Голосование по отделам: {{ onlyDepdict.find(e=>e.value===question.settings.onlyDep).name}}</div>
{{ onlyDepdict.find(e => e.value === question.settings.onlyDep).name }}
</div>
<p><strong>Выбранные сотрудники:</strong></p> <p><strong>Выбранные сотрудники:</strong></p>
<ul> <ul>
<li v-for="employeeId in question.answers" :key="employeeId"> <li v-for="employeeId in question.answers" :key="employeeId">
@@ -269,11 +313,9 @@
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
<v-btn color="teal-darken-4" size="medium" @click="step -= 1">Назад</v-btn> <v-btn color="teal-darken-4" size="medium" @click="step -= 1">Назад</v-btn>
<v-btn color="teal-darken-4" size="medium" @click="saveVoting">Сохранить</v-btn> <v-btn :disabled="errorMessage!=''" color="teal-darken-4" size="medium" @click="saveVoting">Сохранить</v-btn>
</v-card-actions> </v-card-actions>
<v-alert v-if="errorMessage" class="mb-4" type="error">
{{ errorMessage }}
</v-alert>
</v-card> </v-card>
</v-stepper-window-item> </v-stepper-window-item>
@@ -287,16 +329,16 @@
</template> </template>
<script> <script>
import {computed, ref, watch} from "vue"; import { computed, ref, watch } from "vue";
import {createVote, getEmployees, spravURL} from "@/utils/axios-api"; import { spravURL } from "@/utils/axios-api";
import { createVote, getEmployees } from "@/utils/axios-api";
import DateSelect from "@/components/UI/date-select.vue"; import DateSelect from "@/components/UI/date-select.vue";
import {useAccountStore} from "@/store/AccountStore"; import { useAccountStore } from "@/store/AccountStore";
import {checkremote} from "@/utils/universal_functions"; import { checkremote } from "@/utils/universal_functions";
export default { export default {
components: {DateSelect}, components: { DateSelect },
emits: ['updating'], emits: ['updating'],
setup(props, {emit}) { setup(props, { emit }) {
const accountStore = useAccountStore(); const accountStore = useAccountStore();
const user = accountStore.user; const user = accountStore.user;
const step = ref(0); const step = ref(0);
@@ -314,7 +356,7 @@ export default {
}; };
const currentQuestionIndex = ref(0); const currentQuestionIndex = ref(0);
const questionTypes = [{name: "Ввести вручную", choice: 'free'}, {name: "Выбрать сотрудника", choice: 'employee'}]; const questionTypes = [{ name: "Ввести вручную", choice: 'free' }, { name: "Выбрать сотрудника", choice: 'employee' }];
const groupedEmployees = ref([]); const groupedEmployees = ref([]);
const allEmployees = computed(() => [ const allEmployees = computed(() => [
@@ -327,10 +369,10 @@ export default {
const currentQuestion = computed(() => const currentQuestion = computed(() =>
form.value.questions[currentQuestionIndex.value] || null form.value.questions[currentQuestionIndex.value] || null
); );
const allEmployeesgroupedbydep = computed(() => { const allEmployeesgroupedbydep = computed(()=>{
let groupped = [] let groupped = []
for (let x of allEmployees.value.sort((a, b) => a.id_dict_department - b.id_dict_department)) { for (let x of allEmployees.value.sort((a,b)=>a.id_dict_department-b.id_dict_department)){
if (!groupped.includes(x.department)) groupped.push(x.department) if(!groupped.includes(x.department))groupped.push(x.department)
groupped.push(x) groupped.push(x)
} }
return groupped return groupped
@@ -349,7 +391,7 @@ export default {
form.value.questions[index].selectedEmployees = groupedEmployees.value.map(employee => employee.id); form.value.questions[index].selectedEmployees = groupedEmployees.value.map(employee => employee.id);
} else { } else {
form.value.questions[index].answers = []; form.value.questions[index].answers = [];
form.value.questions[index].selectedEmployees = [] form.value.questions[index].selectedEmployees=[]
} }
}; };
@@ -358,7 +400,7 @@ export default {
const addQuestion = () => { const addQuestion = () => {
form.value.questions.push({ form.value.questions.push({
text: "", text: "",
settings: {choice: "free", multiChoice: 1, onlyDep: null, withoutDirector: false}, settings: { choice: "free", multiChoice: 1, onlyDep: null, withoutDirector: false },
image: null, image: null,
answers: [], answers: [],
selectedEmployees: [] selectedEmployees: []
@@ -375,11 +417,11 @@ export default {
const addAnswer = (index) => { const addAnswer = (index) => {
if (currentQuestion.value) { if (currentQuestion.value) {
form.value.questions[index].answers.push({text: "", image: null}); form.value.questions[index].answers.push({ text: "", image: null });
} }
}; };
const removeAnswer = (index, ind) => { const removeAnswer = (index,ind) => {
// if (currentQuestion.value) { // if (currentQuestion.value) {
form.value.questions[index].answers.splice(ind, 1) form.value.questions[index].answers.splice(ind, 1)
// currentQuestion.value.answers.splice(index, 1); // currentQuestion.value.answers.splice(index, 1);
@@ -415,7 +457,7 @@ export default {
isVoteCreated.value = false; isVoteCreated.value = false;
}; };
const timeOptions = Array.from({length: 48}, (_, i) => { const timeOptions = Array.from({ length: 48 }, (_, i) => {
const hours = String(Math.floor(i / 2)).padStart(2, "0"); const hours = String(Math.floor(i / 2)).padStart(2, "0");
const minutes = i % 2 === 0 ? "00" : "30"; const minutes = i % 2 === 0 ? "00" : "30";
return `${hours}:${minutes}`; return `${hours}:${minutes}`;
@@ -470,21 +512,19 @@ export default {
const selectedEmployees = ref([]); const selectedEmployees = ref([]);
const onEmployeesChange = (selected, index) => { const onEmployeesChange = (selected, index) => {
let ind = form.value.questions[index].selectedEmployees.findIndex(e => e == selected) let ind = form.value.questions[index].selectedEmployees.findIndex(e=>e==selected)
if (ind > -1) { if(ind>-1){
form.value.questions[index].selectedEmployees.splice(ind, 1) form.value.questions[index].selectedEmployees.splice(ind,1)
let answ = form.value.questions[index].answers.findIndex(a => a.text == selected) let answ =form.value.questions[index].answers.findIndex(a=>a.text==selected)
form.value.questions[index].answers.splice(answ, 1) form.value.questions[index].answers.splice(answ,1)
} else { }
else{
form.value.questions[index].selectedEmployees.push(selected) form.value.questions[index].selectedEmployees.push(selected)
form.value.questions[index].answers.push({text: selected, image: null}); form.value.questions[index].answers.push({ text: selected, image: null });
} }
}; };
const onlyDepdict = [{name: 'За любого сотрудника', value: null}, { const onlyDepdict = [{name:'За любого сотрудника' ,value:null},{name:"Кроме своего отдела" ,value:false}, {name:"Только за свой отдел" ,value:true}]
name: "Кроме своего отдела",
value: false
}, {name: "Только за свой отдел", value: true}]
return { return {
onlyDepdict, onlyDepdict,
allEmployeesgroupedbydep, allEmployeesgroupedbydep,
@@ -521,4 +561,14 @@ export default {
.v-input--horizontal .v-input__prepend { .v-input--horizontal .v-input__prepend {
margin-inline-end: 4px; margin-inline-end: 4px;
} }
.list-enter-active,
.list-leave-active {
transition: all 0.5s ease;
}
.list-enter-from,
.list-leave-to {
opacity: 0;
transform: translateX(50px);
}
</style> </style>
+1 -6
View File
@@ -140,12 +140,7 @@ const routes = [
ico: "mdi-account", ico: "mdi-account",
}, },
}, },
// {
// path: "/vote",
// name: "Vote",
// component: () =>
// import("@/views/Vote.vue")
// },
{ {
path: "/vote", path: "/vote",
name: "VoteHomePage", name: "VoteHomePage",
+1 -1
View File
@@ -31,7 +31,7 @@
</v-row> </v-row>
</v-tabs-window-item> </v-tabs-window-item>
<!-- Конструктор --> <!-- Конструктор -->
<v-tabs-window-item class="h-100 " value="constructor"> <v-tabs-window-item class="h-100 overflow-auto" value="constructor">
<VoteConstructor @updating="updating"/> <VoteConstructor @updating="updating"/>
</v-tabs-window-item> </v-tabs-window-item>
</v-window> </v-window>