ф
This commit is contained in:
1 parent
03828d965a
commit
4a26a749b3
2 files changed
+96
-50
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="pt-2 h-100 ">
|
<v-row class="pt-2">
|
||||||
<template v-if="isVoteCreated">
|
<template v-if="isVoteCreated">
|
||||||
<v-card class="text-center pa-8" flat>
|
<v-card class="text-center pa-8" flat>
|
||||||
<v-icon color="success" size="48">mdi-check-circle</v-icon>
|
<v-icon color="success" size="48">mdi-check-circle</v-icon>
|
||||||
@@ -8,72 +8,76 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="bg-green h-100 mb-0 pb-0 ">
|
<div class="v-col">
|
||||||
|
<v-stepper v-model="step" editable>
|
||||||
<v-stepper class="h-50 d-flex flex-column" v-model="step" editable>
|
<v-stepper-header>
|
||||||
<v-stepper-header class="v-col-auto">
|
|
||||||
<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>
|
||||||
<template v-slot:item.1>
|
|
||||||
<v-card title="Step Two" flat>...</v-card>
|
<v-stepper-window>
|
||||||
</template>
|
|
||||||
<v-stepper-window class="v-col">
|
|
||||||
<!-- Основная информация -->
|
<!-- Основная информация -->
|
||||||
<v-stepper-window-item step="1" class="h-100 d-flex flex-column bg-yellow h-100" >
|
<v-stepper-window-item step="1">
|
||||||
<!-- <v-row class="flex-column h-100"> -->
|
<v-card flat>
|
||||||
<v-col cols="4" class="bg-green">1</v-col>
|
<v-card-title>Основная информация</v-card-title>
|
||||||
<v-col>1</v-col>
|
<v-card-text>
|
||||||
<!-- </v-row> -->
|
|
||||||
<!-- <v-card class=" v-row flex-column">
|
|
||||||
<v-card-title class="v-col-auto">
|
|
||||||
<div>Основная информация</div></v-card-title>
|
|
||||||
<v-card-text class="v-col flex-grow-1">
|
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="form.title"
|
v-model="form.title"
|
||||||
:rules="[rules.required]"
|
:rules="[rules.required]"
|
||||||
label="Название голосования"
|
label="Название голосования"
|
||||||
outlined
|
variant="underlined"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="form.description"
|
v-model="form.description"
|
||||||
:rules="[rules.required]"
|
:rules="[rules.required]"
|
||||||
label="Описание"
|
label="Описание"
|
||||||
outlined
|
variant="outlined"
|
||||||
></v-textarea>
|
></v-textarea>
|
||||||
|
<v-divider></v-divider>
|
||||||
<div class="d-flex ga-10">
|
<div class="pt-2">Дата и время:</div>
|
||||||
<div class="d-flex ga-3 align-center">
|
<div class="d-flex justify-space-around">
|
||||||
<h6 class="text-subtitle-1">Дата и время начала:</h6>
|
<div class="d-flex ga-3 align-center" >
|
||||||
|
<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-select
|
||||||
v-model="selectedTimeStart"
|
v-model="selectedTimeStart"
|
||||||
:items="timeOptions"
|
:items="timeOptions"
|
||||||
dense
|
density="compact"
|
||||||
outlined
|
variant="plain"
|
||||||
hide-details
|
hide-details
|
||||||
/>
|
|
||||||
|
>
|
||||||
|
<template v-slot:prepend-inner>
|
||||||
|
<v-icon icon="mdi-timer" size="xsmall" color="red" ></v-icon>
|
||||||
|
</template>
|
||||||
|
</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">Дата и время окончания:</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-select
|
||||||
v-model="selectedTimeEnd"
|
v-model="selectedTimeEnd"
|
||||||
:items="timeOptions"
|
:items="timeOptions"
|
||||||
dense
|
density="compact"
|
||||||
outlined
|
outlined
|
||||||
|
variant="plain"
|
||||||
hide-details
|
hide-details
|
||||||
/>
|
|
||||||
|
>
|
||||||
|
<template v-slot:prepend-inner>
|
||||||
|
<v-icon icon="mdi-timer" size="xsmall" color="red" ></v-icon>
|
||||||
|
</template>
|
||||||
|
</v-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions class="v-col-4 ">
|
<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>
|
||||||
</v-card> -->
|
</v-card>
|
||||||
</v-stepper-window-item>
|
</v-stepper-window-item>
|
||||||
|
|
||||||
<!-- Создание опроса -->
|
<!-- Создание опроса -->
|
||||||
@@ -84,33 +88,73 @@
|
|||||||
<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-text-field
|
||||||
|
density="comfortable"
|
||||||
v-model="question.text"
|
v-model="question.text"
|
||||||
:label="'Вопрос ' + (index + 1)"
|
:label="'Вопрос ' + (index + 1)"
|
||||||
:rules="[rules.required]"
|
:rules="[rules.required]"
|
||||||
outlined
|
variant="underlined"
|
||||||
></v-text-field>
|
|
||||||
<v-btn color="error" @click="removeQuestion(index)">
|
>
|
||||||
<v-icon>mdi-delete</v-icon>
|
<template v-slot:append>
|
||||||
</v-btn>
|
<v-btn color="error" icon="mdi-delete" size="small" @click="removeQuestion(index)"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</v-text-field>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<v-file-input
|
<v-file-input
|
||||||
|
density="comfortable"
|
||||||
v-model="question.image"
|
v-model="question.image"
|
||||||
accept="image/*"
|
accept="image/*"
|
||||||
label="Картинка для вопроса"
|
label="Картинка для вопроса"
|
||||||
outlined
|
outlined
|
||||||
></v-file-input>
|
></v-file-input>
|
||||||
<v-select
|
<v-divider></v-divider>
|
||||||
v-model="question.settings.type"
|
<div>Настройки вопроса</div>
|
||||||
:items="questionTypes"
|
<div class="v-row px-2">
|
||||||
label="Тип ответа"
|
|
||||||
outlined
|
<v-col class="align-self-center font-weight-bold">
|
||||||
></v-select>
|
Тип ответа
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="3"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
<v-select
|
||||||
|
density="compact"
|
||||||
|
v-model="question.settings.type"
|
||||||
|
:items="questionTypes"
|
||||||
|
label=""
|
||||||
|
hide-details
|
||||||
|
|
||||||
|
|
||||||
|
></v-select>
|
||||||
|
</v-col>
|
||||||
|
</div>
|
||||||
|
<div class="v-row">
|
||||||
|
<v-col class="align-self-center font-weight-bold">
|
||||||
|
Число возможных ответов
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="2">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
|
density="compact"
|
||||||
v-model="question.settings.multiChoice"
|
v-model="question.settings.multiChoice"
|
||||||
:rules="[rules.required && question.settings.multiChoice > 0]"
|
:rules="[rules.required && question.settings.multiChoice > 0]"
|
||||||
hide-details="auto"
|
hide-details
|
||||||
label="Число возможных ответов"
|
type="number"
|
||||||
></v-text-field>
|
min="1"
|
||||||
|
class="v-col-auto"
|
||||||
|
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</v-text-field>
|
||||||
|
</v-col>
|
||||||
|
</div>
|
||||||
|
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<div v-if="question.settings.type === 'Ввести вручную'">
|
<div v-if="question.settings.type === 'Ввести вручную'">
|
||||||
<div
|
<div
|
||||||
@@ -251,22 +295,24 @@
|
|||||||
</v-stepper-window-item>
|
</v-stepper-window-item>
|
||||||
|
|
||||||
</v-stepper-window>
|
</v-stepper-window>
|
||||||
|
|
||||||
</v-stepper>
|
</v-stepper>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {computed, ref, watch} from "vue";
|
import {computed, ref, watch} from "vue";
|
||||||
import {createVote, getEmployees} 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";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {DateSelect},
|
components: {DateSelect},
|
||||||
emits: ['updating'],
|
emits: ['updating'],
|
||||||
setup(props, {emit}) {
|
setup(props, {emit}) {
|
||||||
|
const accountStore = useAccountStore();
|
||||||
|
const user = accountStore.user;
|
||||||
const step = ref(0);
|
const step = ref(0);
|
||||||
const isVoteCreated = ref(false);
|
const isVoteCreated = ref(false);
|
||||||
const form = ref({
|
const form = ref({
|
||||||
@@ -428,7 +474,7 @@ export default {
|
|||||||
form.value.endDate = dates
|
form.value.endDate = dates
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectedEmployees = ref([]);
|
// const selectedEmployees = ref([]);
|
||||||
|
|
||||||
const onEmployeesChange = (selected) => {
|
const onEmployeesChange = (selected) => {
|
||||||
form.value.questions[currentQuestionIndex.value].answers = selected.map((id) => ({ text: id, image: null }));
|
form.value.questions[currentQuestionIndex.value].answers = selected.map((id) => ({ text: id, image: null }));
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- Конструктор -->
|
<!-- Конструктор -->
|
||||||
<v-tabs-window-item value="constructor" class="h-100 overflow-auto ">
|
<v-tabs-window-item value="constructor" class="">
|
||||||
<VoteConstructor @updating="updating" />
|
<VoteConstructor @updating="updating" />
|
||||||
</v-tabs-window-item>
|
</v-tabs-window-item>
|
||||||
<!-- </v-tabs-window> -->
|
<!-- </v-tabs-window> -->
|
||||||
|
|||||||
Reference in new issue
Block a user