Merge branch 'Alex' into develop

This commit is contained in:
Nukeap committed 2025-01-16 16:56:12 +03:00
commit e3011d9bef
1 file changed
+51 -23
+51 -23
View File
@@ -6,32 +6,58 @@
</v-btn> </v-btn>
</v-card-text> </v-card-text>
<v-row> <v-row>
<v-col> <v-col>
<v-carousel show-arrows="hover" hide-delimiters cycle height="200"> <v-carousel
<v-carousel-item v-for="(picture, index) in images" show-arrows="hover"
:key="index" hide-delimiters cycle
:src="`${baseURL.slice(0, -1)}${picture}`"> height="200">
</v-carousel-item> <v-carousel-item
</v-carousel> v-for="(picture, index) in images"
</v-col> :key="index"
:src="`${baseURL.slice(0, -1)}${picture}`">
</v-carousel-item>
</v-carousel>
</v-col>
</v-row> </v-row>
<v-card-text class="">{{ voteCard.description }}</v-card-text> <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-card-actions class="justify-space-between mt-4 pb-2">
<v-btn <v-btn :disabled="voteCard.is_passed || timeChange" color="teal-darken-4" prepend-icon="mdi-vote-outline"
:disabled="voteCard.is_passed || timeChange" variant="outlined" rounded="xl" size="small" @click="$emit('openVoteModal', voteCard)">
color="teal-darken-4" {{ !voteCard.is_passed ? "Проголосовать" : "Уже проголосовали" }}
prepend-icon="mdi-vote-outline"
variant="outlined"
rounded="xl"
size="medium"
class="pa-2"
@click="$emit('openVoteModal', voteCard)">
{{!voteCard.is_passed?"Проголосовать":"Уже проголосовали"}}
</v-btn> </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-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-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
@@ -61,10 +87,12 @@ export default {
}, },
setup(props) { setup(props) {
const timeChange = ref(false) const timeChange = ref(false)
const images = computed(()=>{ const youSure = ref(false)
return props.voteCard.files.length>0? props.voteCard.files:['/media/defaultimg/vote.png']
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 }
} }
} }