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