закоменчен функционал для редактирования
This commit is contained in:
1 parent
fad555a341
commit
5d2cfe98bb
2 files changed
+27
-26
No files matched your search
@@ -11,10 +11,10 @@
|
||||
</template>
|
||||
<span>{{ voteCard.name }}</span>
|
||||
</v-tooltip>
|
||||
<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-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>
|
||||
<v-row>
|
||||
<v-col>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
:isFinished="currentTab==='active'"
|
||||
:voteCard="voting"
|
||||
@deleteVoting="deleteVoting"
|
||||
@openEditVoteModal="(voting) => openModal('edit', voting)"
|
||||
@openResultModal="(voting) => openModal('results', voting)"
|
||||
@openVoteModal="(voting) => openModal('vote', voting)"
|
||||
/>
|
||||
@@ -53,18 +52,18 @@
|
||||
<CurrentVote :data="res" @closer="closeModal"/>
|
||||
</v-dialog>
|
||||
|
||||
<v-dialog v-model="editVoteModal" max-width="1200px" @click:outside="closeModal">
|
||||
<v-card>
|
||||
<v-card-title>Редактировать голосование: {{ selectedVoting?.title }}</v-card-title>
|
||||
<v-card-text>
|
||||
<VoteConstructor/>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn color="teal-darken-4">Сохранить</v-btn>
|
||||
<v-btn @click="closeModal">Закрыть</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- <v-dialog v-model="editVoteModal" max-width="1200px" @click:outside="closeModal">-->
|
||||
<!-- <v-card>-->
|
||||
<!-- <v-card-title>Редактировать голосование: {{ selectedVoting?.title }}</v-card-title>-->
|
||||
<!-- <v-card-text>-->
|
||||
<!-- <VoteConstructor/>-->
|
||||
<!-- </v-card-text>-->
|
||||
<!-- <v-card-actions>-->
|
||||
<!-- <v-btn color="teal-darken-4">Сохранить</v-btn>-->
|
||||
<!-- <v-btn @click="closeModal">Закрыть</v-btn>-->
|
||||
<!-- </v-card-actions>-->
|
||||
<!-- </v-card>-->
|
||||
<!-- </v-dialog>-->
|
||||
|
||||
<v-dialog v-model="resultsModal" max-width="1200px" @click:outside="closeModal">
|
||||
<v-card>
|
||||
@@ -115,7 +114,7 @@ export default {
|
||||
updating("active");
|
||||
|
||||
const voteModal = ref(false);
|
||||
const editVoteModal = ref(false);
|
||||
// const editVoteModal = ref(false);
|
||||
const resultsModal = ref(false);
|
||||
const selectedVoting = ref(null);
|
||||
|
||||
@@ -145,7 +144,7 @@ export default {
|
||||
|
||||
const closeModal = () => {
|
||||
voteModal.value = false;
|
||||
editVoteModal.value = false;
|
||||
// editVoteModal.value = false;
|
||||
resultsModal.value = false;
|
||||
selectedVoting.value = null;
|
||||
router.push({name: "VoteHomePage"});
|
||||
@@ -157,10 +156,12 @@ export default {
|
||||
await loadVoteDetails(voting.id);
|
||||
voteModal.value = true;
|
||||
router.push({name: "Voting", params: {id: voting.id}});
|
||||
} else if (type === "edit") {
|
||||
editVoteModal.value = true;
|
||||
router.push({name: "EditVote", params: {id: voting.id}});
|
||||
} else if (type === "results") {
|
||||
}
|
||||
// else if (type === "edit") {
|
||||
// editVoteModal.value = true;
|
||||
// router.push({name: "EditVote", params: {id: voting.id}});
|
||||
// }
|
||||
else if (type === "results") {
|
||||
await loadVoteResult(voting.id);
|
||||
resultsModal.value = true;
|
||||
router.push({name: "VoteResults", params: {id: voting.id}});
|
||||
@@ -181,13 +182,13 @@ export default {
|
||||
watch(
|
||||
() => route,
|
||||
async () => {
|
||||
if (!voteModal.value && !editVoteModal.value && !resultsModal.value) {
|
||||
if (!voteModal.value && !resultsModal.value) {
|
||||
const voting = votes.value.find((v) => v.id === route.params.id);
|
||||
if (route.name === "Voting") {
|
||||
await loadVoteDetails(route.params.id);
|
||||
voteModal.value = true;
|
||||
}
|
||||
if (route.name === "EditVote") editVoteModal.value = true;
|
||||
// if (route.name === "EditVote") editVoteModal.value = true;
|
||||
if (route.name === "VoteResults") {
|
||||
await loadVoteResult(route.params.id)
|
||||
resultsModal.value = true;
|
||||
@@ -205,7 +206,7 @@ export default {
|
||||
votes,
|
||||
sortedVotes,
|
||||
voteModal,
|
||||
editVoteModal,
|
||||
// editVoteModal,
|
||||
resultsModal,
|
||||
selectedVoting,
|
||||
openModal,
|
||||
|
||||
Reference in new issue
Block a user