// 导出日志
async outData() {
const { data: res } = await this.$http.post(
"system/handleExportLog",
qs.stringify(this.logIdsss),
{
responseType: "blob"
}
);
console.log(res);
const link = document.createElement("a");
let blob = new Blob([res], { type: "application/vnd.ms-excel" });
link.style.display = "none";
link.href = URL.createObjectURL(blob);
let num = "";
for (let i = 0; i < 10; i++) {
num += Math.ceil(Math.random() * 10);
}
link.setAttribute("download", "操作日志_" + num + ".xlsx");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
网友评论