//导出
Iexport(row) {
// console.log(row,'导出');
this.$confirm("Export?").then((_) => {
this.$axios({
method: "get",
url: "/recording/api/business/reportzip",
params: {
projectId: 1,
batch: row.batch,
},
responseType: "blob", //服务器返回的数据类型
})
.then((res) => {
const blob = new Blob([res.data], { type: "application/zip" });
const fname = row.batch;
const url = window.URL.createObjectURL(blob);
const link = document.createElement("a"); // 创建a标签
link.href = url;
link.download = fname; // 文件重命名,若无需重命名,将该行删去
link.click();
URL.revokeObjectURL(url); // 释放内存
})
.catch((err) => {
console.log(err);
});
});
},
2021/10/13 导出zip
最新推荐文章于 2024-07-26 11:41:15 发布