mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-08 18:36:43 +08:00
导出作业
This commit is contained in:
@@ -510,14 +510,15 @@ export default {
|
||||
courseName:this.manageStudyData.name,
|
||||
contentId:this.contentId
|
||||
}
|
||||
window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`)
|
||||
apicourseStudy.homeworkExport(params).then(res=>{
|
||||
console.log(res,'res')
|
||||
const link = document.createElement('a');// 创建a标签
|
||||
let blob = new Blob([res], { type: 'application/vnd.ms-excel;charset=UTF-8' }); // 设置文件类型
|
||||
let blob = new Blob([res], { type: 'application/zip' }); // 设置文件类型
|
||||
link.style.display = "none";
|
||||
link.href = URL.createObjectURL(blob); // 创建URL
|
||||
console.log(link.href);
|
||||
link.setAttribute("download", "作业.xlsx");
|
||||
link.setAttribute("download", "作业.zip");
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
URL.revokeObjectURL(link.href)
|
||||
|
||||
Reference in New Issue
Block a user