|
|
|
@ -5,6 +5,7 @@ import TraineetraininginformationModal from './TraineetraininginformationModal';
|
|
|
|
|
import ModulationModal from "../coursesPublic/ModulationModal";
|
|
|
|
|
import HomeworkModal from "../coursesPublic/HomeworkModal";
|
|
|
|
|
import {Base64} from 'js-base64';
|
|
|
|
|
import {Internshipreportsy} from './Httpdownloads'
|
|
|
|
|
import {
|
|
|
|
|
Form,
|
|
|
|
|
Select,
|
|
|
|
@ -1336,7 +1337,7 @@ class Listofworks extends Component {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/// 确认是否下砸
|
|
|
|
|
/// 确认是否下载
|
|
|
|
|
confirmysl(url,type){
|
|
|
|
|
var struy="";
|
|
|
|
|
try {
|
|
|
|
@ -1348,6 +1349,7 @@ class Listofworks extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
if(response !== undefined){
|
|
|
|
|
if(response.data.status&&response.data.status===-1){
|
|
|
|
|
console.log("1352");
|
|
|
|
|
console.log(response);
|
|
|
|
@ -1357,60 +1359,61 @@ class Listofworks extends Component {
|
|
|
|
|
console.log(response);
|
|
|
|
|
}else {
|
|
|
|
|
if(type === 1){
|
|
|
|
|
this.internshipreport(url,struy)
|
|
|
|
|
Internshipreportsy(url,struy,".zip",'application/zip');
|
|
|
|
|
}else{
|
|
|
|
|
this.Classstudentachievement(url,struy);
|
|
|
|
|
Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 导出实习报告批量
|
|
|
|
|
internshipreport = (url,struy)=>{
|
|
|
|
|
console.log("internshipreport");
|
|
|
|
|
|
|
|
|
|
axios.get((url),{responseType: 'blob'}).then((response) => {
|
|
|
|
|
console.log("1350");
|
|
|
|
|
console.log(response);
|
|
|
|
|
const type='application/zip'//ZIP文件
|
|
|
|
|
const blob = new Blob([response.data], { type: type });
|
|
|
|
|
const downloadElement = document.createElement('a');
|
|
|
|
|
const href = window.URL.createObjectURL(blob);
|
|
|
|
|
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
|
|
|
|
|
console.log(response.headers['content-disposition'].split('=')[1]);
|
|
|
|
|
downloadElement.href = href;
|
|
|
|
|
downloadElement.download = string+struy+".zip";
|
|
|
|
|
document.body.appendChild(downloadElement);
|
|
|
|
|
downloadElement.click();
|
|
|
|
|
document.body.removeChild(downloadElement) ;// 下载完成移除元素
|
|
|
|
|
window.URL.revokeObjectURL(href) // 释放掉blob对象
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 课堂学生成绩的导出下载
|
|
|
|
|
Classstudentachievement=(url,struy)=>{
|
|
|
|
|
console.log("Classstudentachievement");
|
|
|
|
|
axios.get((url),{responseType: 'blob'}).then((response) => {
|
|
|
|
|
console.log("1374");
|
|
|
|
|
console.log(response);
|
|
|
|
|
const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
|
|
|
|
|
const blob = new Blob([response.data], { type: type });
|
|
|
|
|
const downloadElement = document.createElement('a');
|
|
|
|
|
const href = window.URL.createObjectURL(blob);
|
|
|
|
|
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
|
|
|
|
|
console.log(response.headers['content-disposition'].split('=')[1]);
|
|
|
|
|
downloadElement.href = href;
|
|
|
|
|
downloadElement.download =string+struy+".xlsx";
|
|
|
|
|
document.body.appendChild(downloadElement);
|
|
|
|
|
downloadElement.click();
|
|
|
|
|
document.body.removeChild(downloadElement); // 下载完成移除元素
|
|
|
|
|
window.URL.revokeObjectURL(href) // 释放掉blob对象
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 导出实习报告批量
|
|
|
|
|
// internshipreport = (url,struy,types,stingtype)=>{
|
|
|
|
|
// console.log("internshipreport");
|
|
|
|
|
//
|
|
|
|
|
// axios.get((url),{responseType: 'blob'}).then((response) => {
|
|
|
|
|
// console.log("1350");
|
|
|
|
|
// console.log(response);
|
|
|
|
|
// const type='application/zip'//ZIP文件
|
|
|
|
|
// const blob = new Blob([response.data], { type: stingtype });
|
|
|
|
|
// const downloadElement = document.createElement('a');
|
|
|
|
|
// const href = window.URL.createObjectURL(blob);
|
|
|
|
|
// const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
|
|
|
|
|
// console.log(response.headers['content-disposition'].split('=')[1]);
|
|
|
|
|
// downloadElement.href = href;
|
|
|
|
|
// downloadElement.download = string+struy+types;
|
|
|
|
|
// document.body.appendChild(downloadElement);
|
|
|
|
|
// downloadElement.click();
|
|
|
|
|
// document.body.removeChild(downloadElement) ;// 下载完成移除元素
|
|
|
|
|
// window.URL.revokeObjectURL(href) // 释放掉blob对象
|
|
|
|
|
// }).catch((error) => {
|
|
|
|
|
// console.log(error)
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// // 课堂学生成绩的导出下载
|
|
|
|
|
// Classstudentachievement=(url,struy)=>{
|
|
|
|
|
// console.log("Classstudentachievement");
|
|
|
|
|
// axios.get((url),{responseType: 'blob'}).then((response) => {
|
|
|
|
|
// console.log("1374");
|
|
|
|
|
// console.log(response);
|
|
|
|
|
// const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
|
|
|
|
|
// const blob = new Blob([response.data], { type: type });
|
|
|
|
|
// const downloadElement = document.createElement('a');
|
|
|
|
|
// const href = window.URL.createObjectURL(blob);
|
|
|
|
|
// const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
|
|
|
|
|
// console.log(response.headers['content-disposition'].split('=')[1]);
|
|
|
|
|
// downloadElement.href = href;
|
|
|
|
|
// downloadElement.download =string+struy+".xlsx";
|
|
|
|
|
// document.body.appendChild(downloadElement);
|
|
|
|
|
// downloadElement.click();
|
|
|
|
|
// document.body.removeChild(downloadElement); // 下载完成移除元素
|
|
|
|
|
// window.URL.revokeObjectURL(href) // 释放掉blob对象
|
|
|
|
|
// }).catch((error) => {
|
|
|
|
|
// console.log(error)
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
// console.log("Listofworks.js000")
|
|
|
|
|