From 58351f61ea7cf4b3bd35e98945c845cfaadf8b53 Mon Sep 17 00:00:00 2001 From: romankko2 Date: Fri, 7 Jul 2023 11:40:43 +0200 Subject: [PATCH] [mastertask, subtask] gif-loader pri odoslani requestu na create --- app/src/plugins/tm@_components/z-files-upload.vue | 9 +++++++++ .../tm@modal/master-task/z-master-task-modal.vue | 10 ++++++++-- app/src/plugins/tm@modal/task/z-task-modal.vue | 8 ++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/src/plugins/tm@_components/z-files-upload.vue b/app/src/plugins/tm@_components/z-files-upload.vue index 5fe28f7..066c229 100644 --- a/app/src/plugins/tm@_components/z-files-upload.vue +++ b/app/src/plugins/tm@_components/z-files-upload.vue @@ -19,6 +19,7 @@

{{ (file.size / (1024 * 1024)).toFixed(2) }} MB

+ Loading... @@ -33,6 +34,11 @@ export default { files: { type: Array, default: () => [] + }, + + isSaving: { + type: Boolean, + required: false } }, @@ -78,4 +84,7 @@ export default { position: absolute width: 1px height: 1px + +.gif-loader + height: 30px \ No newline at end of file diff --git a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue index 2a531e9..864dca0 100644 --- a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue +++ b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue @@ -45,10 +45,11 @@ - + - {{ mastertask.id ? 'ULOŽIŤ' : 'VYTVORIŤ' }} + {{ mastertask.id ? 'ULOŽIŤ' : 'VYTVORIŤ' }} + {{ $t('Ukladám...')}} @@ -130,6 +131,7 @@ export default { errorUtils, v$: useVuelidate(), mastertask: null, + isSaving: false, showAddEmployeeInput: false, date: null, projectCodeSearch: null @@ -226,6 +228,7 @@ export default { }, async showModal({mastertask, editMode = false}) { + this.isSaving = false this.editMode = null this.visible = true this.mastertask = null @@ -269,6 +272,7 @@ export default { this._mergeDeadlineTimeDate() try { + this.isSaving = true this.mastertask.deadline = moment(this.mastertask.deadline).format('YYYY-MM-DD HH:MM:SS') if (this.mastertask.id) await this.$axios.put_auth_data(`v1/mastertasks/${this.mastertask.id}`, this.mastertask) @@ -278,6 +282,8 @@ export default { this.closeModal() } catch (error) { this.$toast.error(error) + } finally { + this.isSaving = true } }, diff --git a/app/src/plugins/tm@modal/task/z-task-modal.vue b/app/src/plugins/tm@modal/task/z-task-modal.vue index 6c776cd..3000f0a 100644 --- a/app/src/plugins/tm@modal/task/z-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-task-modal.vue @@ -55,7 +55,7 @@ - + {{ subtask.id ? "UPRAVIŤ" : "VYTVORIŤ" }} @@ -190,9 +190,9 @@ export default { methods: { async showModal({subtask, editMode = false, mastertask = {}}) { - this.isSaving = false - this.subtask = null - this.visible = true + this.isSaving = false + this.subtask = null + this.visible = true this.$nextTick(() => this.v$.$reset()) try {