mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 06:20:21 +00:00
[mastertask, subtask] gif-loader pri odoslani requestu na create
This commit is contained in:
1 parent
d44493d0cf
commit
58351f61ea
3 files changed
+21
-6
No files matched your search
@@ -19,6 +19,7 @@
|
|||||||
<v-icon class="mx-1" icon="mdi-paperclip"></v-icon>
|
<v-icon class="mx-1" icon="mdi-paperclip"></v-icon>
|
||||||
<p>{{ (file.size / (1024 * 1024)).toFixed(2) }} MB</p>
|
<p>{{ (file.size / (1024 * 1024)).toFixed(2) }} MB</p>
|
||||||
<v-icon size="small" icon="mdi-close" @click.stop="remove(uploadedFiles.indexOf(file))"></v-icon>
|
<v-icon size="small" icon="mdi-close" @click.stop="remove(uploadedFiles.indexOf(file))"></v-icon>
|
||||||
|
<img v-if="isSaving" class="gif-loader" :src="require('@/plugins/app/_img/spinner.gif')" alt="Loading...">
|
||||||
</v-chip>
|
</v-chip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -33,6 +34,11 @@ export default {
|
|||||||
files: {
|
files: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
|
},
|
||||||
|
|
||||||
|
isSaving: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -78,4 +84,7 @@ export default {
|
|||||||
position: absolute
|
position: absolute
|
||||||
width: 1px
|
width: 1px
|
||||||
height: 1px
|
height: 1px
|
||||||
|
|
||||||
|
.gif-loader
|
||||||
|
height: 30px
|
||||||
</style>
|
</style>
|
||||||
@@ -45,10 +45,11 @@
|
|||||||
<QuillEditor ref="description" v-model="mastertask.description" placeholder="Popis" theme="snow" class="rich-text-editor" @input="mastertask.description = $event.srcElement.innerHTML" />
|
<QuillEditor ref="description" v-model="mastertask.description" placeholder="Popis" theme="snow" class="rich-text-editor" @input="mastertask.description = $event.srcElement.innerHTML" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Z-files-upload class="mt-15 files" :files="mastertask.files" @files-uploaded="filesUploaded" />
|
<Z-files-upload class="mt-15 files" :files="mastertask.files" @files-uploaded="filesUploaded" :is-saving="isSaving" />
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
|
||||||
<v-btn class="button primary" @click="save()">{{ mastertask.id ? 'ULOŽIŤ' : 'VYTVORIŤ' }}</v-btn>
|
<v-btn class="button primary" v-if="!isSaving" @click="save()">{{ mastertask.id ? 'ULOŽIŤ' : 'VYTVORIŤ' }}</v-btn>
|
||||||
|
<v-btn class="button primary disabled" v-else disabled>{{ $t('Ukladám...')}}</v-btn>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
<v-card v-else height="100%" class="d-flex flex-column scrolling">
|
<v-card v-else height="100%" class="d-flex flex-column scrolling">
|
||||||
@@ -130,6 +131,7 @@ export default {
|
|||||||
errorUtils,
|
errorUtils,
|
||||||
v$: useVuelidate(),
|
v$: useVuelidate(),
|
||||||
mastertask: null,
|
mastertask: null,
|
||||||
|
isSaving: false,
|
||||||
showAddEmployeeInput: false,
|
showAddEmployeeInput: false,
|
||||||
date: null,
|
date: null,
|
||||||
projectCodeSearch: null
|
projectCodeSearch: null
|
||||||
@@ -226,6 +228,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async showModal({mastertask, editMode = false}) {
|
async showModal({mastertask, editMode = false}) {
|
||||||
|
this.isSaving = false
|
||||||
this.editMode = null
|
this.editMode = null
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.mastertask = null
|
this.mastertask = null
|
||||||
@@ -269,6 +272,7 @@ export default {
|
|||||||
this._mergeDeadlineTimeDate()
|
this._mergeDeadlineTimeDate()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
this.isSaving = true
|
||||||
this.mastertask.deadline = moment(this.mastertask.deadline).format('YYYY-MM-DD HH:MM:SS')
|
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)
|
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()
|
this.closeModal()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error)
|
this.$toast.error(error)
|
||||||
|
} finally {
|
||||||
|
this.isSaving = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
<QuillEditor ref="description" v-model="subtask.description" placeholder="Popis" theme="snow" class="rich-text-editor" @input="subtask.description = $event.srcElement.innerHTML" />
|
<QuillEditor ref="description" v-model="subtask.description" placeholder="Popis" theme="snow" class="rich-text-editor" @input="subtask.description = $event.srcElement.innerHTML" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Z-files-upload class="mt-15 files" :files="subtask.files" @files-uploaded="filesUploaded" />
|
<Z-files-upload class="mt-15 files" :files="subtask.files" @files-uploaded="filesUploaded" :is-saving="isSaving" />
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
|
||||||
<v-btn class="button primary" v-if="!isSaving" @click="save()">{{ subtask.id ? "UPRAVIŤ" : "VYTVORIŤ" }}</v-btn>
|
<v-btn class="button primary" v-if="!isSaving" @click="save()">{{ subtask.id ? "UPRAVIŤ" : "VYTVORIŤ" }}</v-btn>
|
||||||
@@ -190,9 +190,9 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async showModal({subtask, editMode = false, mastertask = {}}) {
|
async showModal({subtask, editMode = false, mastertask = {}}) {
|
||||||
this.isSaving = false
|
this.isSaving = false
|
||||||
this.subtask = null
|
this.subtask = null
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => this.v$.$reset())
|
this.$nextTick(() => this.v$.$reset())
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user