ajax 下載Excel 添加回調函數
this.$axios.get(this.$store.state.debug_server + '/operation/batchBind/exportErrorMac.do ?placeid=' + this.uploadParameter.placeid + '&batchid= ' + this.batchid,
{
responseType: "blob"
})
.then((response) => {
// 转 字节流 为 excel window.open("/operation/static/file/BatchImportDeviceMAC.xlsx");
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'BatchImportDeviceMAC.xlsx'); //or any other extension
document.body.appendChild(link);
link.click();
document.body.removeChild(link); //下载完成移除元素
window.URL.revokeObjectURL(url); //释放掉blob对象
// 刷新 表格
this.selectBatchPlaceBindNo();
})
.catch((error) => {
console.log(error);
this.$Message.error('未成功导出错误列表');
})
點擊查看更多內容
為 TA 點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦