|
|
@ -3,8 +3,7 @@ import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 导出实习报告批量zip 、xlsx 类型
|
|
|
|
// 导出实习报告批量zip 、xlsx 类型
|
|
|
|
export function Internshipreportsy (url,struy,types,stingtype){
|
|
|
|
export function Internshipreportsy (url,struy,types,stingtype,response){
|
|
|
|
axios.get((url),{responseType: 'blob'}).then((response) => {
|
|
|
|
|
|
|
|
const blob = new Blob([response.data], { type: stingtype });
|
|
|
|
const blob = new Blob([response.data], { type: stingtype });
|
|
|
|
const downloadElement = document.createElement('a');
|
|
|
|
const downloadElement = document.createElement('a');
|
|
|
|
const href = window.URL.createObjectURL(blob);
|
|
|
|
const href = window.URL.createObjectURL(blob);
|
|
|
@ -15,7 +14,4 @@ export function Internshipreportsy (url,struy,types,stingtype){
|
|
|
|
downloadElement.click();
|
|
|
|
downloadElement.click();
|
|
|
|
document.body.removeChild(downloadElement) ;// 下载完成移除元素
|
|
|
|
document.body.removeChild(downloadElement) ;// 下载完成移除元素
|
|
|
|
window.URL.revokeObjectURL(href) // 释放掉blob对象
|
|
|
|
window.URL.revokeObjectURL(href) // 释放掉blob对象
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
console.log(error)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|