mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-20 21:13:59 +00:00
Export excel file from Laravel Vapor through S3 bucket
This commit is contained in:
+19
-2
@@ -14,7 +14,7 @@
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-center h-100">
|
||||
<span class="btn btn-md fs-11 bg-primary text-white fs-12 m-r-5" :class="[{'bg-primary-darker': showingPreciseAmount}]" @click="showingPreciseAmount=!showingPreciseAmount">{{ showingPreciseAmount ? 'Showing Precise Wallet Transaction' : 'Show Precise Wallet Transaction'}}</span>
|
||||
<a v-if="company" :href="route('wallet.details-export', company.reference, showingPreciseAmount)" target="_blank" class="btn btn-md btn-primary fs-11"><i class="fa fa-download m-r-5"></i>{{ showingPreciseAmount ? 'Download Precise Transaction' : 'Download Transaction'}}</a>
|
||||
<a v-if="company" @click="download(company, showingPreciseAmount)" target="_blank" class="btn btn-md btn-primary fs-11"><i class="fa fa-download m-r-5"></i>{{ showingPreciseAmount ? 'Download Precise Transaction' : 'Download Transaction'}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
@@ -122,7 +122,24 @@ export default {
|
||||
successHandler(response){
|
||||
this.isLoading = false;
|
||||
this.company = response.payload.data;
|
||||
}
|
||||
},
|
||||
download(company, paramShowingPreciseAmount) {
|
||||
let url = this.route('wallet.details-export', company.reference, paramShowingPreciseAmount);
|
||||
if(window.LARAVEL_VAPOR_ENABLED){
|
||||
return fetch(url, {
|
||||
method: 'GET',
|
||||
responseType: 'json',
|
||||
}).then(response => response.json())
|
||||
.then(response => {
|
||||
if (response.src) {
|
||||
window.location.href = response.src;
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user