P-96 Роль администратора
This commit is contained in:
1 parent
86dcc7f375
commit
150a6f817b
3 files changed
+11
-21
No files matched your search
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-card-text class=" d-flex justify-space-between ga-3 text-h6"> {{ voteCard.name }}
|
||||
<v-btn 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-btn>
|
||||
</v-card-text>
|
||||
@@ -35,7 +35,7 @@
|
||||
Результаты
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-btn color="error" size="medium" @click="youSure=true">
|
||||
<v-btn v-if="user.id === voteCard.author || user.is_superuser" color="error" size="medium" @click="youSure=true">
|
||||
<v-icon>mdi-delete</v-icon>
|
||||
<v-dialog v-model="youSure" width="500">
|
||||
|
||||
@@ -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}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -53,20 +53,6 @@
|
||||
@openVoteModal="(voting) => openModal('vote', voting)"
|
||||
@openResultModal="(voting) => openModal('results', voting)"
|
||||
/>
|
||||
<!-- <v-card>-->
|
||||
<!-- <v-card-title>{{ voting.name }}</v-card-title>-->
|
||||
<!-- <v-card-subtitle>-->
|
||||
<!-- Завершено: {{ voting.dateend }}-->
|
||||
<!-- </v-card-subtitle>-->
|
||||
<!-- <v-card-actions class="justify-space-between">-->
|
||||
<!-- <v-btn color="teal-darken-4" size="medium" @click="() => openModal('results', voting)">-->
|
||||
<!-- Результаты-->
|
||||
<!-- </v-btn>-->
|
||||
<!-- <v-btn color="error" size="medium" @click="deleteVoting(voting.id)">-->
|
||||
<!-- <v-icon>mdi-delete</v-icon>-->
|
||||
<!-- </v-btn>-->
|
||||
<!-- </v-card-actions>-->
|
||||
<!-- </v-card>-->
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user