导出excel表
<button @click="exportList">导出</button>
const exportList = () => {
exportRoster();
};
const exportRoster = () => {
let params = {
};
http.watchList.exportRoster(params).then((res: any) => {
ElMessage.success("导出成功");
let data = res;
let url = window.URL.createObjectURL(new Blob([data]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
const name = new Date().getTime();
link.setAttribute("download", "值班表" + ".xlsx");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
});
};