From 150a6f817b185169cce5831671d7d7abab30cf98 Mon Sep 17 00:00:00 2001 From: Denzel Date: Fri, 17 Jan 2025 15:44:46 +0300 Subject: [PATCH] =?UTF-8?q?P-96=20=D0=A0=D0=BE=D0=BB=D1=8C=20=D0=B0=D0=B4?= =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/src/components/vote/VoteCard.vue | 10 +++++++--- .../src/components/vote/VoteConstructor.vue | 3 --- src/front/src/views/VoteHomePage.vue | 19 ++++--------------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/front/src/components/vote/VoteCard.vue b/src/front/src/components/vote/VoteCard.vue index efff4d34d..31056ec8c 100644 --- a/src/front/src/components/vote/VoteCard.vue +++ b/src/front/src/components/vote/VoteCard.vue @@ -1,7 +1,7 @@ - + mdi-delete @@ -75,6 +75,7 @@ import Timer from "@/components/UI/Timer.vue" import {baseURL} from "@/utils/axios-api"; import {computed, ref} from 'vue' +import {useAccountStore} from "@/store/AccountStore"; export default { components: {Timer}, @@ -95,9 +96,12 @@ export default { } }, setup(props) { + console.log(props.voteCard.author, '^-^') const timeChange = ref(false) const youSure = ref(false) const isFinished = ref(false); + const accountStore = useAccountStore(); + const user = accountStore.user; const images = computed(() => { return props.voteCard.files.length > 0 ? props.voteCard.files : ['/media/defaultimg/vote.png'] @@ -111,7 +115,7 @@ export default { isFinished.value = true; } - return {timeChange, baseURL, images, youSure, isFinished} + return {timeChange, baseURL, images, youSure, isFinished, user} } } diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index 416c31bac..bdc5f1378 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -251,14 +251,11 @@ import {computed, ref, watch} from "vue"; import {createVote, getEmployees} from "@/utils/axios-api"; import DateSelect from "@/components/UI/date-select.vue"; -import {useAccountStore} from "@/store/AccountStore"; export default { components: {DateSelect}, emits: ['updating'], setup(props, {emit}) { - const accountStore = useAccountStore(); - const user = accountStore.user; const step = ref(0); const isVoteCreated = ref(false); const form = ref({ diff --git a/src/front/src/views/VoteHomePage.vue b/src/front/src/views/VoteHomePage.vue index 7fd347774..09de78a7b 100644 --- a/src/front/src/views/VoteHomePage.vue +++ b/src/front/src/views/VoteHomePage.vue @@ -53,20 +53,6 @@ @openVoteModal="(voting) => openModal('vote', voting)" @openResultModal="(voting) => openModal('results', voting)" /> - - - - - - - - - - - - - - @@ -119,12 +105,16 @@ import {useRoute, useRouter} from "vue-router"; import {deleteVote, getVoteDetail, getVotes} from "@/utils/axios-api"; import {formatDate} from "@vueuse/shared"; import VoteResult from "@/components/vote/VoteResult.vue"; +import {useAccountStore} from "@/store/AccountStore"; export default { methods: {formatDate}, components: {VoteResult, CurrentVote, VoteConstructor, VoteCardVue}, setup() { + const accountStore = useAccountStore(); + const user = accountStore.user; + console.log(user.is_superuser) const testResults = [ {name: 'Дональд Трамп', votes: 99}, {name: 'Иван Иванов', votes: 30}, @@ -226,7 +216,6 @@ export default { updating("active"); updating("completed"); - console.log(completedVotes); return { currentTab,