[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

@@ -7,12 +7,10 @@
<Z-remaining-time :hours="mastertask.duration - mastertask.time_worked" />
<Z-spent-time :hours="mastertask.time_worked" :is-exceeded="mastertask.time_worked > mastertask.duration" />
<Z-description :description="mastertask.description" />
<Z-files :files="mastertask.files" :download-file="downloadFile" :showDownload="showDownload" />
<Z-files :files="mastertask.files" />
</template>
<script>
import * as FileSaver from "file-saver"
import ZCreatedBy from '../../_components/read-only/z-created-by.vue'
import ZDeadline from '../../_components/read-only/z-deadline.vue'
import ZDescription from '../../_components/read-only/z-description.vue'
@@ -41,31 +39,6 @@ export default {
type: Object,
required: true
}
},
data() {
return {
showDownload: false
}
},
methods: {
async downloadFile(id) {
this.showDownload = true // Show loader
const file = this.mastertask.files[id]
// Iterate over each file in the task
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>