This commit is contained in:
Nukeap committed 2025-01-22 16:46:37 +03:00
1 parent e6eac9f982
commit 2dcec97731
2 files changed
+13 -4

No files matched your search

@@ -42,12 +42,15 @@
<span>{{ voteCard.description }}</span>
</v-tooltip>
</v-card-text>
<div class="px-2">
<Timer v-if="!isFinished" :voteTime="{ dateend: voteCard.dateend, datestart: voteCard.datestart }"
@changeBtn="(time) => timeChange = time"/>
<div v-else class="font-weight-bold text-center"> Завершено: {{
new Date(voteCard.dateend).toLocaleDateString()
}}
</div>
</div>
<v-card-actions class="justify-space-between mt-4 pb-2">
<template v-if="!isFinished">
<v-btn :disabled="voteCard.is_passed || timeChange" color="teal-darken-4" prepend-icon="mdi-vote-outline"
+10 -4
View File
@@ -6,9 +6,13 @@
v-model="currentTab"
align="center">
<v-tab v-for="x in tabs" :key="x.value" :value="x.value">{{ x.text }}</v-tab>
<v-tab v-if="accountStore.user.is_staff" value="constructor">Создать новое голосование</v-tab>
</v-tabs>
</v-col>
<v-col class="pa-0 overflow-hidden">
<v-window v-model="currentTab" class="h-100">
<!-- Текущие голосования -->
<v-tabs-window-item v-for="x in ['active','completed']" :value="x" class="h-100 overflow-auto">
@@ -31,11 +35,11 @@
</v-row>
</v-tabs-window-item>
<!-- Конструктор -->
<v-tabs-window-item class="h-100 overflow-auto" value="constructor">
<v-tabs-window-item v-if="accountStore.user.is_staff" class="h-100 overflow-auto" value="constructor">
<VoteConstructor @updating="updating"/>
</v-tabs-window-item>
</v-window>
<!-- Модальные окна -->
<v-dialog v-model="voteModal" @click:outside="closeModal">
<CurrentVote :data="res" @closer="closeModal"/>
@@ -63,16 +67,17 @@ import {useRoute, useRouter} from "vue-router";
import VoteResult from "@/components/vote/VoteResult.vue";
import {deleteVote, getVoteDetail, getVoteResult, getVotes} from "@/utils/axios-api";
import {formatDate} from "@vueuse/shared";
import { useAccountStore } from "@/store/AccountStore";
export default {
methods: {formatDate},
components: {CurrentVote, VoteConstructor, VoteCardVue, VoteResult},
setup() {
const accountStore = useAccountStore();
const tabs = [
{value: "active", text: 'Текущие голосования'},
{value: "completed", text: 'Завершенные голосования'},
{value: "constructor", text: 'Создать новое голосование'},
]
const currentTab = ref("active");
@@ -173,6 +178,7 @@ export default {
updating("active");
return {
accountStore,
currentTab,
votes,
sortedVotes,