提交 5d7ecda0 编写于 作者: bo.dang's avatar bo.dang

下载优化

上级 aceecab6
...@@ -1133,13 +1133,9 @@ export default { ...@@ -1133,13 +1133,9 @@ export default {
downlodExcel(){ downlodExcel(){
let params = { let params = {
// rtcId: this.rtcId rtcId: this.rtcId
rtcId: 372 // rtcId: 372
} };
downloadSigninfo(params).then((res) => { downloadSigninfo(params).then((res) => {
// vm.GET(`rtc/liveAdmin/download/signInfo/` + params.rtcId, { responseType: 'blob' }).then((res) => { // vm.GET(`rtc/liveAdmin/download/signInfo/` + params.rtcId, { responseType: 'blob' }).then((res) => {
closeLoading(this); closeLoading(this);
...@@ -1152,17 +1148,17 @@ export default { ...@@ -1152,17 +1148,17 @@ export default {
// aLink.click(); // aLink.click();
// this.$refs.loadElement.appendChild(aLink); // this.$refs.loadElement.appendChild(aLink);
this.downloadExcelFile(res.data, 2);
// setTimeout(() => { // setTimeout(() => {
// window.open(downloadUrl); // window.open(downloadUrl);
// }, 500); // }, 500);
// if(res.code == "000000") {
// this.$message.success("下载成功"); if(res.code == "000000") {
// // vm.getLiveList("", ""); this.downloadExcelFile(res.data);
// } else { this.$message.success("下载成功");
// this.$message.error("下载失败,请重试"); // vm.getLiveList("", "");
// } } else {
this.$message.error("下载失败,请重试");
}
}).catch((error) => { }).catch((error) => {
this.$message.error("请重试"); this.$message.error("请重试");
}) })
...@@ -1170,7 +1166,7 @@ export default { ...@@ -1170,7 +1166,7 @@ export default {
}, },
/* 文件下载*/ /* 文件下载*/
downloadExcelFile(base64, flag) { downloadExcelFile(base64) {
let a = document.createElement('a'); let a = document.createElement('a');
vm.uploadHref = 'data:application/xls;base64,' + base64; vm.uploadHref = 'data:application/xls;base64,' + base64;
a.setAttribute('href',vm.uploadHref); a.setAttribute('href',vm.uploadHref);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册