//第一种文件地址下载
download(row) {
if (row.fileList && row.fileList[0].showUrl) {
fetch(row.fileList[0].showUrl).then(res => res.blob()).then(blob => {
const link = document.createElement('a');
link.href = URL.createObjectURL(blob)
// 下载文件的名称及文件类型后缀
link.download = row.name;
document.body.appendChild(link)
link.click()
//在资源下载完成后 清除 占用的缓存资源
window.URL.revokeObjectURL(link.href);
document.body.removeChild(link);
})
}
},
//第二种接口返回二进制流下载
let [err1,res1] = await financeService.download({fileName:res.msg,delete:true});
if(!err1){
const link = document.createElement('a');
let blob = new Blob([res1],{type:'application/vnd.ms-excel;charset=utf-8'});
link.href = URL.createObjectURL(blob)
// 下载文件的名称及文件类型后缀
link.download = `物业缴费${pagination.current}.xlsx`;
document.body.appendChild(link)
link.click()
//在资源下载完成后 清除 占用的缓存资源
window.URL.revokeObjectURL(link.href);
document.body.removeChild(link);
}
07-19
1246

06-16
8125

04-14
1637

04-26
3561
