修改导出组件
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user