P-112 Адаптировать картинки
This commit is contained in:
1 parent
fa06b82232
commit
0a2cf14bc4
4 files changed
+59
-58
No files matched your search
@@ -4,30 +4,29 @@
|
|||||||
<div class="d-flex flex-column flex-fill px-2 ">
|
<div class="d-flex flex-column flex-fill px-2 ">
|
||||||
<v-col cols="auto">
|
<v-col cols="auto">
|
||||||
<v-row class="d-flex flex-column">
|
<v-row class="d-flex flex-column">
|
||||||
<v-col cols="12" class="d-flex flex-row pa-0">
|
<v-col class="d-flex flex-row pa-0" cols="12">
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-card-title>{{ data.name }}</v-card-title>
|
<v-card-title>{{ data.name }}</v-card-title>
|
||||||
<v-card-subtitle>{{ data.description }}</v-card-subtitle>
|
<v-card-subtitle>{{ data.description }}</v-card-subtitle>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="auto">
|
<v-col cols="auto">
|
||||||
<v-btn color="red-darken-1" density="compact" size="small" icon="mdi-close-thick" @click="$emit('closer')">
|
<v-btn color="red-darken-1" density="compact" icon="mdi-close-thick" size="small"
|
||||||
|
@click="$emit('closer')">
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
|
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
<div class="d-flex flex-column flex-fill ">
|
<div class="d-flex flex-column flex-fill ">
|
||||||
<v-stepper class="d-flex flex-column flex-fill" v-model="activeStep">
|
<v-stepper v-model="activeStep" class="d-flex flex-column flex-fill">
|
||||||
<!-- Шаги голосования -->
|
<!-- Шаги голосования -->
|
||||||
<v-stepper-header class="py-0">
|
<v-stepper-header class="py-0">
|
||||||
<template v-for="question in data.questions" :key="question.numb">
|
<template v-for="question in data.questions" :key="question.numb">
|
||||||
<v-stepper-item
|
<v-stepper-item
|
||||||
:color="question.numb < activeStep+1?'success':'warning'"
|
:color="question.numb < activeStep+1?'success':'warning'"
|
||||||
edit-icon="mdi-help"
|
:complete="question.numb < activeStep+1"
|
||||||
:complete="question.numb < activeStep+1" :step="question.numb">
|
:step="question.numb" edit-icon="mdi-help">
|
||||||
Вопрос {{ question.numb }}
|
Вопрос {{ question.numb }}
|
||||||
</v-stepper-item>
|
</v-stepper-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -35,26 +34,21 @@
|
|||||||
|
|
||||||
<v-stepper-window class="d-flex flex-column flex-fill">
|
<v-stepper-window class="d-flex flex-column flex-fill">
|
||||||
<v-stepper-window-item v-for="(question, index) in data.questions" :key="question.numb"
|
<v-stepper-window-item v-for="(question, index) in data.questions" :key="question.numb"
|
||||||
class=""
|
:step="question.numb"
|
||||||
:step="question.numb">
|
class="">
|
||||||
|
|
||||||
<!-- <v-card class="d-flex flex-fill" > -->
|
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="" >{{ question.question }}</div>
|
<h3 class="text-center">{{ question.question }}</h3>
|
||||||
|
|
||||||
<v-row>
|
<v-row>
|
||||||
<div class="v-col align-self-center ">
|
<div class="v-col align-self-start">
|
||||||
<v-img class=""
|
<v-img :src="question.file"
|
||||||
style="max-height:400px"
|
class="cursor-pointer"
|
||||||
@click.stop="opendialog({answer:question.question, file:question.file})"
|
style="max-height:45vh"
|
||||||
:src="question.file"/>
|
@click.stop="opendialog({answer:question.question, file:question.file})"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="v-col-6">
|
<div class="v-col-6" style="max-height:50vh">
|
||||||
|
<v-list v-model:selected="result[question.id]" density="compact" select-strategy="leaf" slim style="max-height: 100%; overflow-y: auto;">
|
||||||
<v-list v-model:selected="result[question.id]" slim density="compact" select-strategy="leaf">
|
<v-list-item v-for="answer in question.answers" :key="answer.id" :value="answer.id"
|
||||||
|
density="compact">
|
||||||
<v-list-item density="compact" v-for="answer in question.answers" :key="answer.id"
|
|
||||||
:value="answer.id">
|
|
||||||
{{ answer.answer }}
|
{{ answer.answer }}
|
||||||
<template v-slot:prepend="{ isSelected }">
|
<template v-slot:prepend="{ isSelected }">
|
||||||
<v-list-item-action start>
|
<v-list-item-action start>
|
||||||
@@ -62,65 +56,54 @@
|
|||||||
</v-list-item-action>
|
</v-list-item-action>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
|
<v-avatar :image="answer.file" @click.stop="opendialog(answer)"></v-avatar>
|
||||||
<v-avatar @click.stop="opendialog(answer)" :image="answer.file"></v-avatar>
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
</v-list>
|
</v-list>
|
||||||
</div>
|
</div>
|
||||||
</v-row>
|
</v-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Действия -->
|
<!-- Действия -->
|
||||||
<v-card-actions class="">
|
<v-card-actions class="">
|
||||||
|
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
<!-- </v-card> -->
|
|
||||||
<!-- </v-card> -->
|
|
||||||
</v-stepper-window-item>
|
</v-stepper-window-item>
|
||||||
|
|
||||||
</v-stepper-window>
|
</v-stepper-window>
|
||||||
<v-stepper-actions>
|
<v-stepper-actions>
|
||||||
<template v-slot:prev>
|
<template v-slot:prev>
|
||||||
|
|
||||||
<v-btn @click="prevStep" outlined>Назад</v-btn></template>
|
<v-btn outlined @click="prevStep">Назад</v-btn>
|
||||||
|
</template>
|
||||||
<template v-slot:next>
|
<template v-slot:next>
|
||||||
|
|
||||||
<v-btn v-if="activeStep < data.questions.length - 1" :disabled="!isCurrentQuestionAnswered" @click="nextStep"
|
<v-btn v-if="activeStep < data.questions.length - 1" :disabled="!isCurrentQuestionAnswered"
|
||||||
color="teal-darken-4">
|
color="teal-darken-4"
|
||||||
|
@click="nextStep">
|
||||||
Далее
|
Далее
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn v-else :disabled="!isCurrentQuestionAnswered" color="teal-darken-4" @click="submitVote">
|
<v-btn v-else :disabled="!isCurrentQuestionAnswered" color="teal-darken-4" @click="submitVote">
|
||||||
Отправить
|
Отправить
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</template></v-stepper-actions>
|
</template>
|
||||||
|
</v-stepper-actions>
|
||||||
</v-stepper>
|
</v-stepper>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-card>
|
</v-card>
|
||||||
<v-dialog v-model="dialog">
|
<v-dialog v-model="dialog" max-width="100vh">
|
||||||
<v-card max-height="800">
|
<v-card max-height="800">
|
||||||
<v-card-title class="v-row">
|
<v-card-title class="v-row">
|
||||||
<div clas="v-col-auto">
|
<div class="v-col-auto">
|
||||||
|
{{ activepick.answer }}
|
||||||
{{ activepick.answer }} </div>
|
</div>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<div clas="bg-yellow">
|
<div>
|
||||||
<v-btn color="red-darken-1" density="compact" size="small" icon="mdi-close-thick" @click="dialog=false">
|
<v-btn color="red-darken-1" density="compact" icon="mdi-close-thick" size="small" @click="dialog=false"/>
|
||||||
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-item>
|
<v-card-item>
|
||||||
|
|
||||||
<v-img :src="activepick.file" max-height="600"></v-img>
|
<v-img :src="activepick.file" max-height="600"></v-img>
|
||||||
</v-card-item>
|
</v-card-item>
|
||||||
</v-card>
|
</v-card>
|
||||||
@@ -129,12 +112,12 @@
|
|||||||
|
|
||||||
<!-- Спасибо за голос -->
|
<!-- Спасибо за голос -->
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<v-card width="400" class="mx-auto">
|
<v-card class="mx-auto" width="400">
|
||||||
<v-row align="center" justify="center" class="pa-3">
|
<v-row align="center" class="pa-3" justify="center">
|
||||||
<v-col class="text-center">
|
<v-col class="text-center">
|
||||||
<v-icon :color="messeger[messeger.key].color" :icon="messeger[messeger.key].icon" size="64"/>
|
<v-icon :color="messeger[messeger.key].color" :icon="messeger[messeger.key].icon" size="64"/>
|
||||||
<h2>{{ messeger[messeger.key].text }}</h2>
|
<h2>{{ messeger[messeger.key].text }}</h2>
|
||||||
<v-btn @click="$emit('closer')" class="ma-3 ">Закрыть</v-btn>
|
<v-btn class="ma-3 " @click="$emit('closer')">Закрыть</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card>
|
</v-card>
|
||||||
@@ -206,7 +189,6 @@ export default {
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
messeger.value.key = 'bad'
|
messeger.value.key = 'bad'
|
||||||
}
|
}
|
||||||
|
|
||||||
).finally(() => isVoteSubmitted.value = true)
|
).finally(() => isVoteSubmitted.value = true)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-card-text class=" d-flex justify-space-between ga-3 text-h6"> {{ voteCard.name }}
|
<v-card-text class="d-flex justify-space-between ga-3 text-h6">
|
||||||
|
<v-tooltip bottom>
|
||||||
|
<template v-slot:activator="{ props }">
|
||||||
|
<span
|
||||||
|
v-bind="props"
|
||||||
|
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||||
|
{{ voteCard.name }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<span>{{ voteCard.name }}</span>
|
||||||
|
</v-tooltip>
|
||||||
<v-btn v-if="user.id === voteCard.author || user.is_superuser" flat size="medium" @click="$emit('openEditVoteModal', voteCard)">
|
<v-btn v-if="user.id === voteCard.author || user.is_superuser" flat size="medium" @click="$emit('openEditVoteModal', voteCard)">
|
||||||
<v-icon color="orange-lighten-1">mdi-pencil</v-icon>
|
<v-icon color="orange-lighten-1">mdi-pencil</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
@@ -19,7 +29,18 @@
|
|||||||
</v-carousel>
|
</v-carousel>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-card-text class="">{{ voteCard.description }}</v-card-text>
|
<v-card-text class="">
|
||||||
|
<v-tooltip bottom>
|
||||||
|
<template v-slot:activator="{ props }">
|
||||||
|
<span
|
||||||
|
v-bind="props"
|
||||||
|
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||||
|
{{ voteCard.description }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<span>{{ voteCard.description }}</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</v-card-text>
|
||||||
<Timer :voteTime="{ dateend: voteCard.dateend, datestart: voteCard.datestart }"
|
<Timer :voteTime="{ dateend: voteCard.dateend, datestart: voteCard.datestart }"
|
||||||
@changeBtn="(time) => timeChange = time"/>
|
@changeBtn="(time) => timeChange = time"/>
|
||||||
<v-card-actions class="justify-space-between mt-4 pb-2">
|
<v-card-actions class="justify-space-between mt-4 pb-2">
|
||||||
@@ -96,7 +117,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
console.log(props.voteCard.author, '^-^')
|
|
||||||
const timeChange = ref(false)
|
const timeChange = ref(false)
|
||||||
const youSure = ref(false)
|
const youSure = ref(false)
|
||||||
const isFinished = ref(false);
|
const isFinished = ref(false);
|
||||||
|
|||||||
@@ -417,7 +417,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 }));
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ async function createVote(voteData) {
|
|||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
voteData.questions.forEach(question => {
|
voteData.questions.forEach(question => {
|
||||||
formData.append('questionsfiles', question.image)
|
formData.append('questionsfiles', question.image)
|
||||||
console.log(question.image);
|
|
||||||
if(!!question.image){
|
if(!!question.image){
|
||||||
const {name,size,lastModified}=question.image
|
const {name,size,lastModified}=question.image
|
||||||
question.image={name,size,lastModified}
|
question.image={name,size,lastModified}
|
||||||
|
|||||||
Reference in new issue
Block a user