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>
|
<template>
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-card-text class=" d-flex justify-space-between ga-3 text-h6"> {{ voteCard.name }}
|
<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-icon color="orange-lighten-1">mdi-pencil</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
Результаты
|
Результаты
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</template>
|
</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-icon>mdi-delete</v-icon>
|
||||||
<v-dialog v-model="youSure" width="500">
|
<v-dialog v-model="youSure" width="500">
|
||||||
|
|
||||||
@@ -75,6 +75,7 @@
|
|||||||
import Timer from "@/components/UI/Timer.vue"
|
import Timer from "@/components/UI/Timer.vue"
|
||||||
import {baseURL} from "@/utils/axios-api";
|
import {baseURL} from "@/utils/axios-api";
|
||||||
import {computed, ref} from 'vue'
|
import {computed, ref} from 'vue'
|
||||||
|
import {useAccountStore} from "@/store/AccountStore";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {Timer},
|
components: {Timer},
|
||||||
@@ -95,9 +96,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
|
console.log(props.voteCard.author, '^-^')
|
||||||
const timeChange = ref(false)
|
const timeChange = ref(false)
|
||||||
const youSure = ref(false)
|
const youSure = ref(false)
|
||||||
const isFinished = ref(false);
|
const isFinished = ref(false);
|
||||||
|
const accountStore = useAccountStore();
|
||||||
|
const user = accountStore.user;
|
||||||
|
|
||||||
const images = computed(() => {
|
const images = computed(() => {
|
||||||
return props.voteCard.files.length > 0 ? props.voteCard.files : ['/media/defaultimg/vote.png']
|
return props.voteCard.files.length > 0 ? props.voteCard.files : ['/media/defaultimg/vote.png']
|
||||||
@@ -111,7 +115,7 @@ export default {
|
|||||||
isFinished.value = true;
|
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 {computed, ref, watch} from "vue";
|
||||||
import {createVote, getEmployees} from "@/utils/axios-api";
|
import {createVote, getEmployees} from "@/utils/axios-api";
|
||||||
import DateSelect from "@/components/UI/date-select.vue";
|
import DateSelect from "@/components/UI/date-select.vue";
|
||||||
import {useAccountStore} from "@/store/AccountStore";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {DateSelect},
|
components: {DateSelect},
|
||||||
emits: ['updating'],
|
emits: ['updating'],
|
||||||
setup(props, {emit}) {
|
setup(props, {emit}) {
|
||||||
const accountStore = useAccountStore();
|
|
||||||
const user = accountStore.user;
|
|
||||||
const step = ref(0);
|
const step = ref(0);
|
||||||
const isVoteCreated = ref(false);
|
const isVoteCreated = ref(false);
|
||||||
const form = ref({
|
const form = ref({
|
||||||
|
|||||||
@@ -53,20 +53,6 @@
|
|||||||
@openVoteModal="(voting) => openModal('vote', voting)"
|
@openVoteModal="(voting) => openModal('vote', voting)"
|
||||||
@openResultModal="(voting) => openModal('results', 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-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-container>
|
</v-container>
|
||||||
@@ -119,12 +105,16 @@ import {useRoute, useRouter} from "vue-router";
|
|||||||
import {deleteVote, getVoteDetail, getVotes} from "@/utils/axios-api";
|
import {deleteVote, getVoteDetail, getVotes} from "@/utils/axios-api";
|
||||||
import {formatDate} from "@vueuse/shared";
|
import {formatDate} from "@vueuse/shared";
|
||||||
import VoteResult from "@/components/vote/VoteResult.vue";
|
import VoteResult from "@/components/vote/VoteResult.vue";
|
||||||
|
import {useAccountStore} from "@/store/AccountStore";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {formatDate},
|
methods: {formatDate},
|
||||||
|
|
||||||
components: {VoteResult, CurrentVote, VoteConstructor, VoteCardVue},
|
components: {VoteResult, CurrentVote, VoteConstructor, VoteCardVue},
|
||||||
setup() {
|
setup() {
|
||||||
|
const accountStore = useAccountStore();
|
||||||
|
const user = accountStore.user;
|
||||||
|
console.log(user.is_superuser)
|
||||||
const testResults = [
|
const testResults = [
|
||||||
{name: 'Дональд Трамп', votes: 99},
|
{name: 'Дональд Трамп', votes: 99},
|
||||||
{name: 'Иван Иванов', votes: 30},
|
{name: 'Иван Иванов', votes: 30},
|
||||||
@@ -226,7 +216,6 @@ export default {
|
|||||||
|
|
||||||
updating("active");
|
updating("active");
|
||||||
updating("completed");
|
updating("completed");
|
||||||
console.log(completedVotes);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentTab,
|
currentTab,
|
||||||
|
|||||||
Reference in new issue
Block a user