This commit is contained in:
Alex committed 2025-01-16 16:24:19 +03:00
1 parent eeb05b6e54
commit 71be58b25f
1 file changed
+52 -23
+52 -23
View File
@@ -6,31 +6,58 @@
</v-btn>
</v-card-text>
<v-row>
<v-col>
<v-carousel show-arrows="hover" hide-delimiters cycle height="200">
<v-carousel-item v-for="(picture, index) in images"
:key="index"
:src="`${baseURL.slice(0, -1)}${picture}`">
</v-carousel-item>
</v-carousel>
</v-col>
<v-col>
<v-carousel
show-arrows="hover"
hide-delimiters cycle
height="200">
<v-carousel-item
v-for="(picture, index) in images"
:key="index"
:src="`${baseURL.slice(0, -1)}${picture}`">
</v-carousel-item>
</v-carousel>
</v-col>
</v-row>
<v-card-text class="">{{ voteCard.description }}</v-card-text>
<Timer :voteTime="{dateend:voteCard.dateend,datestart:voteCard.datestart}" @changeBtn="(time) => timeChange = time"/>
<Timer :voteTime="{ dateend: voteCard.dateend, datestart: voteCard.datestart }" @changeBtn="(time) => timeChange = time" />
<v-card-actions class="justify-space-between mt-4 pb-2">
<v-btn
:disabled="voteCard.is_passed || timeChange"
color="teal-darken-4"
prepend-icon="mdi-vote-outline"
variant="outlined"
rounded="xl"
size="small"
@click="$emit('openVoteModal', voteCard)">
{{!voteCard.is_passed?"Проголосовать":"Уже проголосовали"}}
<v-btn :disabled="voteCard.is_passed || timeChange" color="teal-darken-4" prepend-icon="mdi-vote-outline"
variant="outlined" rounded="xl" size="small" @click="$emit('openVoteModal', voteCard)">
{{ !voteCard.is_passed ? "Проголосовать" : "Уже проголосовали" }}
</v-btn>
<v-btn color="error" @click="$emit('deleteVoting', voteCard.id)" size="medium">
<v-btn color="error" @click="youSure=true" size="medium">
<v-icon>mdi-delete</v-icon>
<v-dialog v-model="youSure" width="500">
<v-card max-width="450" class="flex">
<v-btn
class="align-self-end ma-2 text-red"
icon="mdi-close"
variant="text"
size="medium"
@click="youSure = false"
/>
<div class="ml-5 text-h6">
Вы действительно хотите удалить голосование?
</div>
<template v-slot:actions>
<v-btn-group>
<v-btn
class="text-red"
@click="$emit('deleteVoting', voteCard.id), youSure = false">
Да
</v-btn>
<v-btn
class="text-green"
@click="youSure = false">
Нет
</v-btn>
</v-btn-group>
</template>
</v-card>
</v-dialog>
</v-btn>
</v-card-actions>
</v-card>
@@ -60,10 +87,12 @@ export default {
},
setup(props) {
const timeChange = ref(false)
const images = computed(()=>{
return props.voteCard.files.length>0? props.voteCard.files:['/media/defaultimg/vote.png']
const youSure = ref(false)
const images = computed(() => {
return props.voteCard.files.length > 0 ? props.voteCard.files : ['/media/defaultimg/vote.png']
})
return { timeChange, baseURL ,images}
return { timeChange, baseURL, images, youSure }
}
}