修改导出组件

This commit is contained in:
龙运模 2024-07-13 18:05:17 +08:00
parent 3b6d58581b
commit 1d11e683a5
2 changed files with 7 additions and 15 deletions

View File

@ -56,20 +56,12 @@ export default {
}
},
down(item){
const blob = new Blob([item.file_url]);
let fileName = item.type_desc+".xlsx";
if ('download' in document.createElement('a')) { // IE
let eLink = document.createElement('a');
eLink.download = fileName
eLink.style.display = 'none';
eLink.href = URL.createObjectURL(blob);
document.body.appendChild(eLink);
eLink.click();
URL.revokeObjectURL(eLink.href); // URL
document.body.removeChild(eLink);
} else { // IE10+
navigator.msSaveBlob(blob, fileName);
}
const link = document.createElement('a');
link.href = item.file_url;
link.setAttribute('download', '');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
exportClick(){
if(this.exportVisible){

View File

@ -218,7 +218,7 @@ export default {
}, 500);
},
async exportData() {
const res = await this.$API.system.company.export.post();
const res = await this.$API.system.company.export.post(this.params);
if(res.code == 200){
this.$message.success('开始导出');
}