анимация к завершённому голосованию, сортировка департаментов, отмена скролла у конструктора, открытие карточки пользователя в завершённых голосованиях

This commit is contained in:
Denzel committed 2025-01-23 13:28:13 +03:00
1 parent 14ea9ae9b8
commit a482345a3b
6 files changed
+350 -56

No files matched your search

@@ -14,13 +14,13 @@
</v-card>
</template>
<template v-else>
<div class="v-col flex-grow-1 flex-shrink-0 ">
<v-stepper v-model="step" editable class="d-flex flex-column fill-height">
<v-stepper-header class="flex-grow-0 flex-shrink-1">
<v-stepper-item :complete="step > 0" step="1">Основная информация
</v-stepper-item>
<v-divider></v-divider>
<v-stepper-item :complete="step > 1" step="2">Создание опроса</v-stepper-item>
@@ -40,7 +40,7 @@
<div class="flex-grow-1 flex-shrink-0">
<v-textarea v-model="form.description" :rules="[rules.required]" label="Описание"
variant="outlined"></v-textarea>
</div>
<v-divider></v-divider>
@@ -70,7 +70,7 @@
</div>
</div>
</v-card-text>
<v-card-actions>
<v-btn color="teal-darken-4" size="medium" @click="step = 1">Далее</v-btn>
</v-card-actions>
@@ -82,7 +82,7 @@
<v-card flat class="fill-height d-flex flex-column">
<v-card-title>Создание опроса:</v-card-title>
<v-card-text>
<v-card-text style="max-height: 62vh; overflow-y: auto;">
<transition-group name="list" tag="div">
<div v-for="(question, index) in form.questions" :key="index" class="mb-4">
<div class="d-flex">
@@ -105,7 +105,7 @@
</v-col>
<v-col cols="3" class="py-0">
<v-select density="compact" v-model="question.settings.choice" :items="questionTypes"
<v-select density="compact" v-model="question.settings.choice" :items="questionTypes"
@update:model-value="question.answers=[]"
:list-props="{density:'compact'}"
item-title="name" item-value="choice" label="" hide-details variant="outlined"></v-select>
@@ -139,7 +139,7 @@
</v-btn>
</div>
</transition-group>
<div class="d-flex justify-start">
<v-btn size="small" color="teal-darken-4" @click="addAnswer(index)">Добавить ответ</v-btn>
@@ -147,9 +147,9 @@
</div>
</div>
<div v-else>
<div class="v-row">
<div class="v-row">
<v-radio-group class="text-caption" inline v-model="question.settings.onlyDep">
<template v-slot:label>
<div class="text-body-2 font-weight-bold">Голосование по отделам:</div>
@@ -158,24 +158,24 @@
<template v-slot:label>
<div class="text-caption">{{ x.name }}</div>
</template>
</v-radio>
</v-radio>
</v-radio-group>
<!-- <v-switch color="teal-darken-4" v-model="question.settings.withoutDirector"
:label="`Без начальства : ${question.settings.withoutDirector ? 'да ' : 'нет'}`" hide-details
class="v-col-auto"></v-switch> -->
</div>
<v-autocomplete
<v-autocomplete
class=" text-no-wrap"
v-model="question.selectedEmployees" :items="allEmployeesgroupedbydep"
item-title="fio" item-value="id" label="Выберите сотрудников" multiple variant="outlined"
density="compact"
density="compact"
@update:model-value="(selected)=>question.answers=question.answers.filter(e=>selected.includes(e.text))"
>
<template #prepend-item>
@@ -185,38 +185,38 @@
<template #selection="{item}">
<v-chip
:prepend-avatar="checkremote(`${spravURL}${item.raw.login}.jpg`)"
>
>
{{ item.raw.familyname }}</v-chip>
</template>
<template #item="data">
<template v-if="typeof data.item.raw !== 'object'">
<v-divider/>
<v-list-group class='pa-4 text-overline text-grey' v-text="data.item.raw"></v-list-group>
</template>
<template v-else>
<v-list-item
slim
density="compact"
:append-avatar="checkremote(`${spravURL}${data.item.raw.login}.jpg`)"
@click="onEmployeesChange(data.item.raw.id, index)"
>
<template #prepend>
<v-checkbox hide-details
:model-value="question.selectedEmployees.includes(data.item.raw.id)"
:model-value="question.selectedEmployees.includes(data.item.raw.id)"
density="compact"></v-checkbox>
</template>
<v-list-item-title class="text-third" v-text="data.item.raw.fio"></v-list-item-title>
</v-list-item>
</template>
</template>
@@ -232,10 +232,10 @@
<transition-group name="list" tag="div">
<div v-for="(person, ind) in question.answers" :key="person" class="v-row align-center mb-4">
<v-col cols="7" class="py-0" >
<v-chip :prepend-avatar="checkremote(`${spravURL}${findEmployeeById(person.text)?.login}.jpg`)" :text="findEmployeeById(person.text)?.fio ">
</v-chip>
</v-col>
<v-col class="py-0 d-flex" cols="5">
@@ -253,7 +253,7 @@
</div>
</transition-group>
<v-divider class="ma-2 pa-1"></v-divider>
<div class="d-flex justify-center">
<div class="d-flex justify-center">
<v-btn size="small" color="orange-darken-4" @click="addQuestion">Добавить вопрос</v-btn>
</div>
@@ -263,25 +263,25 @@
<v-btn color="teal-darken-4" size="medium" @click="step = 2">Далее</v-btn>
</v-card-actions>
</v-card>
</v-stepper-window-item>
<!-- Подтверждение -->
<v-stepper-window-item step="3" class="fill-height">
<v-card flat class="fill-height d-flex flex-column">
<v-card-title>Подтверждение</v-card-title>
<v-card-text>
<v-alert v-if="errorMessage" class="mb-4 " type="error">
{{ errorMessage }}
</v-alert>
<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>
<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>
<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></p>
<v-card v-for="(question, index) in form.questions" :key="index" class="mb-4 pa-3">
<div class="pa-2">
@@ -289,8 +289,8 @@
<div v-if="question.settings.choice === 'free' && question.answers.length">
<p><strong>Варианты ответов:</strong></p>
<ul>
<li v-for="(answer, answerIndex) in question.answers" :key="answerIndex">
{{ answer.text }}
@@ -309,20 +309,20 @@
</div>
</div>
</v-card>
</v-card-text>
<v-card-actions>
<v-btn color="teal-darken-4" size="medium" @click="step -= 1">Назад</v-btn>
<v-btn :disabled="errorMessage!=''" color="teal-darken-4" size="medium" @click="saveVoting">Сохранить</v-btn>
</v-card-actions>
</v-card>
</v-stepper-window-item>
</v-stepper-window>
</v-stepper>
</div>
</template>
</v-row>
@@ -374,7 +374,7 @@ export default {
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)
groupped.push(x)
}
}
return groupped
})
const findEmployeeById = (id) =>
@@ -538,7 +538,7 @@ export default {
removeQuestion,
addAnswer,
removeAnswer,
findEmployeeById,
findEmployeeById,
saveVoting,
isVoteCreated,
resetForm,