// 导出文件
const exportFile = blob => {
//处理返回的excel文件
const reader = new FileReader();
reader.readAsDataURL(blob); // 转换为base64,可以直接放入a标签href
reader.onload = e => {
// 转换完成,创建一个a标签用于下载
let a = document.createElement("a");
a.style.display = "none";
a.download = "导出数据.xls";
a.href = e.target.result;
const body = document.body;
body.appendChild(a); // 修复firefox中无法触发click
a.click();
body.removeChild(a);
};
};