Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
membru.tbf.ro
/
src
/
components
/
Modals
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
Delete.vue
| Size :
3.72
KB
Copy
<template> <div class="modal_info modal_delete"> <div class="fe-btn-translation" @click="$root.$emit('open_modal_translation', 'Delete', arrayTranslations)" v-if="globalTranslate">OPEN TRANSLATION</div> <div class="header-submodal"> <div class="image"><img src="/build/icons/trash-icon.svg"></div> <div class="title">{{ $t('delete.title') }}</div> </div> <div class="description-modal"> {{ type == 'master_goal' ? $t('delete.description_master_goal') : $t('delete.description',{text: $t('delete.' + type)}) }} <!-- <br>{{ nameItem }} --> </div> <div class="button-actions"> <button class="btn-default-tbf button-action" @click="cancelDelete"> <div class="lds-ring white-spin"><div></div><div></div><div></div><div></div></div> {{ $t('delete.cancel') }} </button> <button class="btn-red-tbf button-action" @click="submitDelete"> <div class="lds-ring white-spin"><div></div><div></div><div></div><div></div></div> {{ $t('delete.delete') }} </button> </div> </div> </template> <script type="text/javascript"> export default { data() { return { loaded: false, nameItem: '', arrayTranslations: [ 'delete.cancel', 'delete.delete', 'delete.description', 'delete.description_master_goal', 'delete.kr', 'delete.master_goal', 'delete.objective', 'delete.title', 'delete.user' ] }; }, props: { model: Object, type: String, from: String }, mounted() { switch (this.type) { case 'kr': this.nameItem = this.model.name break; case 'objective': this.nameItem = this.model.name break; case 'user': this.nameItem = this.model.first_name + ' ' + this.model.last_name break; case 'master_goal': this.nameItem = this.model.name break; case 'tag': this.nameItem = this.model.name break; case 'role': this.nameItem = this.model.name break; } }, methods: { cancelDelete(){ this.$emit("close_modal"); }, submitDelete(){ switch (this.type) { case 'kr': this.deleteKr() break; case 'objective': this.deleteObjective() break; case 'user': this.deleteUser() break; case 'master_goal': this.deleteMasterGoal() break; } this.$emit("close_modal"); }, deleteKr(){ axios.delete('/key-results/' + this.model.id) .then(() => { setTimeout(() => { this.refreshPage() this.$emit("close_modal"); }, 100) }) }, deleteObjective(){ axios.delete('/objectives/' + this.model.slug) .then(() => { setTimeout(() => { this.refreshPage() this.$emit("close_modal"); }, 100) }) }, deleteMasterGoal(){ axios.delete('/master-goals/' + this.model.slug) .then(() => { setTimeout(() => { this.refreshPage() this.$emit("close_modal"); }, 100) }) }, deleteUser(){ axios.delete('/people/' + this.model.slug) .then(() => { setTimeout(() => { this.refreshPage() this.$emit("close_modal"); }, 100) }) }, refreshPage(){ switch (this.from) { case 'daily_plan': this.$root.$emit('refreshPlanOfDay') break; case 'objectives': this.$root.$emit('refreshObjectivesList') break; case 'show_objective': this.$root.$emit('refreshObjectivePage') break; case 'users': this.$root.$emit('refreshUsersList') this.$auth.fetch() break; case 'show_user': this.$root.$emit('refreshUserPage') break; case 'master_goals': this.$root.$emit('refreshMasterGoalsList') break; case 'tree': this.$root.$emit('refreshMasterGoalTree') break; } } } }; </script>
Back