async downloadFile(index) {
try {
if (true) {
// 构造要下载的文件URL
const fileUrl =this.report.fileUrls[index]
// "http://aes.aes-iot.com:8301/file/img/06a07e11-e0d0-4fe1-bae2-086acbf11674.3.jpg"; // 替换为实际要下载的文件URL
// var suffix = fileUrl.substring(fileUrl.lastIndexOf("."));
// 创建一个a标签
let response = await fetch(fileUrl);
// 内容转变成blob地址
let blob = await response.blob();
// 创建隐藏的可下载链接
let objectUrl = window.URL.createObjectURL(blob);
let a = document.createElement("a");
//地址
a.href = objectUrl;
//修改文件名
a.download = this.report.fileNames[index];
// 触发点击
document.body.appendChild(a);
a.click();
//移除
setTimeout(() => document.body.removeChild(a), 1000);
}
} catch (error) {
console.error(error);
} finally {
}
},