提交 dac7766b 编写于 作者: xinxu.wang's avatar xinxu.wang

导出时,无法生成Excel,还原代码

上级 ce2478d5
...@@ -518,24 +518,21 @@ ...@@ -518,24 +518,21 @@
}; };
let callback = (res) => { let callback = (res) => {
// if(res.code == '000000'){ if(res.code == '000000'){
// console.log('正式导出》》》》 ', res) console.log('正式导出》》》》 ', res)
// 执行下载excel // 执行下载excel
// vm.downloadFile(res.data.path, res.data.fileName) vm.downloadFile(res.data.path, res.data.fileName)
// vm.exportModalVisible = false; vm.exportModalVisible = false;
// }else{ }else{
// vm.$message.error(res.message); vm.$message.error(res.message);
// } }
}; };
vm.sendRequest( 'get', `/sensitive/dataSearch/exportWebTmp?parame=` + vm.afterParam, '', callback ); vm.sendRequest( 'post', `/sensitive/dataSearch/exportWeb`, data, callback );
}, },
downloadFile(base64, fileName) { downloadFile(base64, fileName) {
let a = document.createElement('a'); let a = document.createElement('a');
let uploadHref = 'data:application/xlsx;base64,' + base64; let uploadHref = 'data:application/xls;base64,' + base64;
a.setAttribute('href', uploadHref); a.setAttribute('href', uploadHref);
if (fileName == null || fileName == '') {
fileName = '数据.xlsx';
}
let exportFileName = fileName; let exportFileName = fileName;
a.setAttribute('download', exportFileName); a.setAttribute('download', exportFileName);
a.click(); a.click();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册