//导出
onExport() {
// this.$message("敬请期待");
this.$confirm("Export?").then((_) => {
this.$axios({
method: "get",
url: "/api/tasks/infoExport",
params: {
tcUsername: this.username,
projectId: this.project,
batch: this.batch,
status: this.status,
lang: this.lang,
},
responseType: "blob", //服务器返回的数据类型
})
.then((res) => {
// this.$message("aaa");
const fname = this.batch;
let url = window.URL.createObjectURL(res.data);
let a = document.createElement("a");
a.setAttribute("download", fname);
a.href = url;
a.click();
window.URL.revokeObjectURL(url);
})
.catch((err) => {
console.log(err);
});
});
},
2021/9/2 导出文件Exel
最新推荐文章于 2024-07-26 18:35:26 发布