能源bug
This commit is contained in:
@@ -74,29 +74,12 @@ export default {
|
||||
},
|
||||
// 导出excel
|
||||
exportExl(params) {
|
||||
exportTrend({ ...params }).then((res) => {
|
||||
// let fileName = '';
|
||||
// const contentDisposition = res.headers['content-disposition'];
|
||||
// if (contentDisposition) {
|
||||
// fileName = decodeURIComponent(
|
||||
// contentDisposition.slice(
|
||||
// contentDisposition.indexOf('filename=') + 9
|
||||
// )
|
||||
// );
|
||||
// }
|
||||
const blob = new Blob([res.data]);
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(blob);
|
||||
reader.onload = (e) => {
|
||||
const a = document.createElement('a');
|
||||
a.download = '走势分析';
|
||||
a.href = e.target.result;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
exportTrend({ ...params })
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '走势分析.xls');
|
||||
this.$message.success('导出成功');
|
||||
};
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user