修改导出组件
This commit is contained in:
parent
3b6d58581b
commit
1d11e683a5
@ -56,20 +56,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
down(item){
|
down(item){
|
||||||
const blob = new Blob([item.file_url]);
|
const link = document.createElement('a');
|
||||||
let fileName = item.type_desc+".xlsx";
|
link.href = item.file_url;
|
||||||
if ('download' in document.createElement('a')) { // 非IE下载
|
link.setAttribute('download', '');
|
||||||
let eLink = document.createElement('a');
|
document.body.appendChild(link);
|
||||||
eLink.download = fileName
|
link.click();
|
||||||
eLink.style.display = 'none';
|
document.body.removeChild(link);
|
||||||
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);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
exportClick(){
|
exportClick(){
|
||||||
if(this.exportVisible){
|
if(this.exportVisible){
|
||||||
|
|||||||
@ -218,7 +218,7 @@ export default {
|
|||||||
}, 500);
|
}, 500);
|
||||||
},
|
},
|
||||||
async exportData() {
|
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){
|
if(res.code == 200){
|
||||||
this.$message.success('开始导出');
|
this.$message.success('开始导出');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user