This commit is contained in:
Nukeap committed 2025-01-16 16:40:43 +03:00
1 parent fd9f541c6e
commit 588a38c23c
3 files changed
+91 -35

No files matched your search

+85 -33
View File
@@ -1,8 +1,8 @@
<template>
<template v-if="!isVoteSubmitted">
<v-card>
<div class="d-flex flex-column flex-fill px-2" >
<!-- <v-col cols="auto">
<v-card style="height: 85vh;">
<div class="d-flex flex-column flex-fill px-2 " >
<v-col cols="auto">
<v-row class="d-flex flex-column">
<v-col cols="12" class="d-flex flex-row pa-0">
<v-col>
@@ -10,42 +10,48 @@
<v-card-subtitle>{{ data.description }}</v-card-subtitle>
</v-col>
<v-col cols="auto">
<v-btn color="red-darken-1" size="medium" class="mt-4" @click="$emit('closer')">
<v-icon>mdi-close-thick</v-icon>
<v-btn color="red-darken-1" density="compact" size="small" icon="mdi-close-thick" @click="$emit('closer')">
</v-btn>
</v-col>
</v-col>
</v-row>
</v-col> -->
<div class="bg-yellow flex-column d-flex align-stretch">
<v-stepper class="" v-model="activeStep">
</v-col>
<div class="d-flex flex-column flex-fill ">
<v-stepper class="d-flex flex-column flex-fill" v-model="activeStep">
<!-- Шаги голосования -->
<v-stepper-header class="py-0">
<template v-for="question in data.questions" :key="question.numb">
<v-stepper-item
:complete="question.numb < activeStep" :step="question.numb">
:color="question.numb < activeStep+1?'success':'warning'"
edit-icon="mdi-help"
:complete="question.numb < activeStep+1" :step="question.numb">
Вопрос {{ question.numb }}
</v-stepper-item>
</template>
</v-stepper-header>
<v-stepper-window class="bg-red" >
<v-stepper-window class="d-flex flex-column flex-fill " >
<v-stepper-window-item v-for="(question, index) in data.questions" :key="question.numb"
class=" "
class=""
:step="question.numb">
sd
<!-- <v-card class="d-flex flex-fill" > -->
<div class="v-row d-flex flex-column ">
<div class="v-col-auto" >{{ question.question }}</div>
<div class="">
<div class="" >{{ question.question }}</div>
<div class="v-col-2">
<v-img cover class=" " :src="question.file" />
</div>
<div class="v-col-auto bg-yellow">
sds
<!-- <v-list v-model:selected="result[question.id]" slim density="compact" select-strategy="leaf">
<v-row>
<div class="v-col align-self-center ">
<v-img class=""
style="max-height:400px"
@click.stop="opendialog({answer:question.question, file:question.file})"
:src="question.file"/>
</div>
<div class="v-col-6">
<v-list v-model:selected="result[question.id]" slim density="compact" select-strategy="leaf">
<v-list-item density="compact" v-for="answer in question.answers" :key="answer.id"
:value="answer.id">
@@ -55,39 +61,75 @@
<v-checkbox-btn :model-value="isSelected"></v-checkbox-btn>
</v-list-item-action>
</template>
<template v-slot:append>
<v-avatar @click.stop="opendialog(answer)" :image="answer.file"></v-avatar>
</template>
</v-list-item>
</v-list> -->
</v-list>
</div>
</v-row>
</div>
<!-- Действия -->
<!-- <v-card-actions class="">
<v-btn v-if="index > 0" @click="prevStep" outlined>Назад</v-btn>
<v-btn v-if="index < data.questions.length - 1" :disabled="!isCurrentQuestionAnswered" @click="nextStep"
<v-card-actions class="">
</v-card-actions>
<!-- </v-card> -->
<!-- </v-card> -->
</v-stepper-window-item>
</v-stepper-window>
<v-stepper-actions >
<template v-slot:prev>
<v-btn @click="prevStep" outlined>Назад</v-btn></template>
<template v-slot:next>
<v-btn v-if="activeStep < data.questions.length - 1" :disabled="!isCurrentQuestionAnswered" @click="nextStep"
color="teal-darken-4">
Далее
</v-btn>
<v-btn v-else :disabled="!isCurrentQuestionAnswered" color="teal-darken-4" @click="submitVote">
Отправить
</v-btn>
</v-card-actions> -->
<!-- </v-card> -->
<!-- </v-card> -->
</v-stepper-window-item>
</v-stepper-window>
<v-stepper-actions >sd</v-stepper-actions>
</template></v-stepper-actions>
</v-stepper>
</div>
</div>
</v-card>
<v-dialog v-model="dialog">
<v-card max-height="800">
<v-card-title class="v-row">
<div clas="v-col-auto">
{{ activepick.answer }} </div>
<v-spacer></v-spacer>
<div clas="bg-yellow">
<v-btn color="red-darken-1" density="compact" size="small" icon="mdi-close-thick" @click="dialog=false">
</v-btn>
</div>
</v-card-title>
<v-card-item>
<v-img :src="activepick.file" max-height="600" ></v-img>
</v-card-item>
</v-card>
</v-dialog>
</template>
<!-- Спасибо за голос -->
<template v-else>
<v-card width="300">
<v-row align="center" justify="center" style="height: 50vh;">
<v-col class="text-center" cols="12">
<v-icon :color="messeger[messeger.key].color" :icon="messeger[messeger.key].icon" size="64" />
@@ -95,6 +137,7 @@
<v-btn @click="$emit('closer')" class="ma-3 ">Закрыть</v-btn>
</v-col>
</v-row>
</v-card>
</template>
</template>
@@ -166,8 +209,17 @@ export default {
).finally(() => isVoteSubmitted.value = true)
};
const activepick = ref(null)
const dialog=ref(false)
const opendialog=(val)=>{
dialog.value=true
activepick.value=val
}
return {
activepick,
opendialog,
dialog,
messeger,
activeStep,
answers,
+5 -1
View File
@@ -160,7 +160,11 @@ const routes = [
path: "/vote/voting/:id",
name: "Voting",
component: () =>
import("@/views/VoteHomePage.vue")
import("@/views/VoteHomePage.vue"),
meta: {
title: "Голосование",
ico: "mdi-account",
},
},
{
path: "/vote/edit-vote/:id",
+1 -1
View File
@@ -72,7 +72,7 @@
</v-tabs-window>
<!-- Модальные окна -->
<v-dialog fullscreen v-model="voteModal" @click:outside="closeModal">
<v-dialog v-model="voteModal" @click:outside="closeModal">
<CurrentVote :data="res" @closer="closeModal"/>