mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
Laravel Vapor - Code sync from Shipping Portal to solve random mass downloading of 0KB pdf files when using docker
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<img :src="src" class="w-100" v-if="type !== 'pdf'">
|
||||
<div class="btn btn-info b-rad-none pointer m-b-20" @click="openBase64NewTab()" v-show="type === 'pdf'">Open in new window</div>
|
||||
<a :href="'data:application/pdf;base64,'+src" :download="file.file.filename" v-show="type === 'pdf'"><div class="btn btn-success b-rad-none pointer m-b-20">Download</div></a>
|
||||
<iframe v-if="type === 'pdf'" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
|
||||
<iframe v-if="type === 'pdf' && isClicked" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</modal-component>
|
||||
@@ -31,7 +31,8 @@
|
||||
return {
|
||||
isLoading: false,
|
||||
loaded: false,
|
||||
src: ''
|
||||
src: '',
|
||||
isClicked: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -41,6 +42,7 @@
|
||||
},
|
||||
methods:{
|
||||
loadFile(){
|
||||
this.isClicked = true;
|
||||
if(!this.loaded) {
|
||||
this.isLoading = true;
|
||||
let filePath = this.type === 'pdf' ? this.file.file.file_info.original.file : this.file.file.file_info[0].original.file;
|
||||
|
||||
Reference in New Issue
Block a user