1、文件流格式: 

exportPreSumData(this.params)
.then(res => {
const blob = new Blob([res]);
const fileName = '累积降水量统计.xls';
const elink = document.createElement('a');
elink.download = fileName;
elink.style.display = 'none';
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // 释放URL 对象
document.body.removeChild(elink);

})
.catch(res => {

});
export function exportPreSumData(data) {
return request({
url: '/support/GzGrid/exportPreSumData',
method: 'post',
data,
responseType: 'blob'
});
}

2、普通格式(直接导出)

方法一:

let link = document.createElement('a');
link.style.display = 'none';
link.href = url;
link.target = '_blank';
document.body.appendChild(link);
link.click();

方法二:

window.open(url, '_blank')

方法三:

<a href="url" download></a>