mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
97 lines
2.3 KiB
Vue
97 lines
2.3 KiB
Vue
<template>
|
|
<v-dialog
|
|
v-model="visible"
|
|
:width="modalWidth"
|
|
:height="modalHeight"
|
|
persistent
|
|
:retain-focus="false"
|
|
>
|
|
<v-card style="position: relative">
|
|
<div class="d-flex justify-space-between align-center">
|
|
<h1>
|
|
Ste si istý, že chcete zmazať tím <b>{{ team.name }}</b
|
|
>?
|
|
</h1>
|
|
<div class="d-flex align-center">
|
|
<a-reset-size-button @reset="resetModalSize" />
|
|
<a-close-button @close="closeModal()" />
|
|
</div>
|
|
</div>
|
|
|
|
<v-card-actions
|
|
class="mt-10 d-flex justify-start align-center mobile-view"
|
|
>
|
|
<v-btn
|
|
class="button primary half"
|
|
variant="flat"
|
|
:disabled="isDeleting"
|
|
@click="deleteTeam()"
|
|
>ÁNO</v-btn
|
|
>
|
|
<v-btn class="button primary half outline" @click.stop="closeModal()"
|
|
>ZRUŠIŤ</v-btn
|
|
>
|
|
</v-card-actions>
|
|
<a-resize-handle
|
|
:current-width="modalWidthPx"
|
|
:current-height="modalHeightPx"
|
|
@resize="handleModalResize"
|
|
@resize-end="handleResizeEnd"
|
|
/>
|
|
</v-card>
|
|
</v-dialog>
|
|
</template>
|
|
|
|
<script>
|
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin';
|
|
import AResizeHandle from '@/plugins/tm@modal/_components/a-resize-handle.vue';
|
|
import AResetSizeButton from '@/plugins/tm@modal/_components/a-reset-size-button.vue';
|
|
import ACloseButton from '@/plugins/tm@modal/_components/a-close-button.vue';
|
|
|
|
export default {
|
|
components: {
|
|
AResizeHandle,
|
|
AResetSizeButton,
|
|
ACloseButton,
|
|
},
|
|
mixins: [modalMixin],
|
|
emits: ['update'],
|
|
|
|
data() {
|
|
return {
|
|
visible: false,
|
|
team: null,
|
|
isDeleting: false,
|
|
modalName: 'z-delete-team-modal',
|
|
};
|
|
},
|
|
|
|
methods: {
|
|
async showModal({ team }) {
|
|
this.team = team;
|
|
this.visible = true;
|
|
},
|
|
|
|
closeModal() {
|
|
this.visible = false;
|
|
},
|
|
|
|
async deleteTeam() {
|
|
if (this.isDeleting) return;
|
|
|
|
this.isDeleting = true;
|
|
try {
|
|
await this.$axios.delete_auth(`v1/teams/${this.team.id}`);
|
|
this.visible = false;
|
|
this.$emit('update', this.team);
|
|
this.$store.commit('tm/delete_team', this.team);
|
|
} catch (error) {
|
|
this.$toast.error(this.$parseError(error));
|
|
} finally {
|
|
this.isDeleting = false;
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|