// 封装一个download方法
const downloadExcelFile = (path, name) => {
const x = new window.XMLHttpRequest();
x.open('GET', path, true);
x.responseType = 'blob';
x.onload = () => {
const url = window.URL.createObjectURL(x.response);
const a = document.createElement('a');
a.href = url; // 下载链接
a.download = name + '.xlsx'; // 文件名
a.click();
};
x.send();
};