提交 3c1fb1a6 authored 作者: CRS's avatar CRS

new

上级 0bc94be1
......@@ -908,13 +908,20 @@ export default {
this.$server.getEvaDownload(val).then(res=>{
console.log(res)
if (res.status === 200) {
let name = this.sysName + '系统' + this.type === 2 ? '适配' : '改造' + '报告';
let link = document.createElement('a');
link.setAttribute('download', 'test');
link.href = res.data;
document.body.appendChild(link); // 添加到页面中,为兼容Firefox浏览器
link.click();
document.body.removeChild(link); // 从页面移除
let name = this.type === 2 ? '适配' : '改造' + '报告';
name = this.sysName + '系统' + name
let x = new XMLHttpRequest();
x.open('GET', res.data, true);
x.responseType = 'blob';
x.onload = (e) =>{
console.log(e)
let url = window.URL.createObjectURL(x.response)
let a = document.createElement('a');
a.href = url
a.download = name
a.click()
}
x.send();
}
})
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论