[bugy & CR]

This commit is contained in:
romankko2 committed 2023-08-17 17:43:23 +02:00
1 parent 4f7847bc1b
commit 88792943e6
20 files changed
+201 -107

No files matched your search

@@ -1,6 +1,7 @@
<template>
<A-mastertask-name :name="subtask._master_task.name" :id="subtask.master_task_id" :color="subtask._master_task.color" @close-modal="$emit('close-modal')" />
<A-mastertask-status :status="subtask.is_finished" />
<A-mastertask-status :isFinished="subtask.is_finished" />
<A-task-deadline :deadline="subtask.deadline" />
<A-task-timeblocks :timeblocks="subtask.timeblocks" :subtask="subtask" @update-subtask="$emit('update-subtask', $event)" />
<Z-created-by :employee-id="subtask.created_by" />
<A-task-assigned-employee :employee="subtask._employee" />
@@ -8,12 +9,10 @@
<A-task-remaining-time :hours="subtask.duration - subtask.spent_time" />
<A-task-spent-time :hours="subtask.spent_time" :subtask="subtask" />
<A-task-description :description="subtask.description" :mastertask-description="subtask.master_task_description" />
<Z-files :files="subtask.files" :download-file="downloadFile" :showDownload="showDownload" />
<Z-files :files="subtask.files" />
</template>
<script>
import * as FileSaver from "file-saver"
import AMastertaskName from './_components/a-mastertask-name.vue'
import AMastertaskStatus from './_components/a-mastertask-status.vue'
import ATaskTimeblocks from './_components/a-task-timeblocks.vue'
@@ -22,6 +21,7 @@ import ATaskAssignedEmployee from './_components/a-task-assigned-employee.vue
import ATaskPlannedTime from './_components/a-task-planned-time.vue'
import ATaskSpentTime from './_components/a-task-spent-time.vue'
import ATaskRemainingTime from './_components/a-task-remaining-time.vue'
import ATaskDeadline from './_components/a-task-deadline.vue'
import ATaskDescription from './_components/a-task-description.vue'
import ZFiles from '@/plugins/tm@modal/_components/read-only/z-files.vue'
@@ -38,7 +38,8 @@ export default {
ATaskPlannedTime,
ATaskSpentTime,
ATaskRemainingTime,
ATaskDescription
ATaskDescription,
ATaskDeadline
},
props: {
@@ -46,30 +47,6 @@ export default {
type: Object,
required: true
}
},
data() {
return {
showDownload: false
}
},
methods: {
async downloadFile(id) {
this.showDownload = true // Show loader
// Iterate over each file in the task
const file = this.subtask.files[id]
const fileName = file.name
fetch(file.path)
.then(response => response.blob())
.then(blob => {
FileSaver.saveAs(blob, fileName)
this.showDownload = false
})
.catch(error => this.$toast.error(error))
},
}
}
}
</script>