hjm 5 years ago
commit 1212d6329a

@ -1336,23 +1336,19 @@ class Listofworks extends Component {
} }
// 导出实习报告批量 // 导出实习报告批量
internshipreport = ()=>{ internshipreport = (url)=>{
console.log("internshipreport"); console.log("internshipreport");
let url = "/zip/shixun_report"; // params: {
let homeworkid = this.props.match.params.homeworkid; // homework_common_id: homeworkid,
axios.get((url),{ // work_status: this.state.course_groupyslstwo,
params: { // course_group: this.state.checkedValuesineinfo,
homework_common_id: homeworkid, // search: this.state.searchtext,
work_status: this.state.course_groupyslstwo, // }
course_group: this.state.checkedValuesineinfo, // let url = "/zip/shixun_report";
search: this.state.searchtext, // let homeworkid = this.props.match.params.homeworkid;
} axios.get(url).then((response) => {
},{responseType: 'blob'}).then((response) => {
console.log("1342");
console.log(response);
if(response.status === 200){ if(response.status === 200){
window.open(url, '_blank'); window.open(url, '_blank');
}else{
} }
}).catch((error) => { }).catch((error) => {
@ -1361,21 +1357,19 @@ class Listofworks extends Component {
} }
// 课堂学生成绩的导出下载 // 课堂学生成绩的导出下载
Classstudentachievement=()=>{ Classstudentachievement=(url)=>{
console.log("Classstudentachievement"); console.log("Classstudentachievement");
const course_id = this.props.match.params.coursesId; // const course_id = this.props.match.params.coursesId;
let url = "/courses/"+course_id+"/export_member_scores_excel.xlsx"; // let url = "/courses/"+course_id+"/export_member_scores_excel.xlsx";
axios.get((url),{ // ,{
params: { // params: {
group_id: this.state.checkedValuesineinfo, // group_id: this.state.checkedValuesineinfo,
search: this.state.searchtext, // search: this.state.searchtext,
} // }
},{responseType: 'blob'}).then((response) => { // },{responseType: 'blob'})
console.log("1306"); axios.get(url).then((response) => {
console.log(response);
if(response.status === 200){ if(response.status === 200){
window.open(url, '_blank'); window.open(url, '_blank');
}else{
} }
}).catch((error) => { }).catch((error) => {
@ -1531,8 +1525,8 @@ class Listofworks extends Component {
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}> {this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.internshipreport()}>实训报告</a></li> <li><a onClick={()=>this.internshipreport(`/api/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a></li>
<li><a onClick={()=>this.Classstudentachievement()} >学生成绩</a></li> <li><a onClick={()=>this.Classstudentachievement(`/api/courses/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)} >学生成绩</a></li>
</ul> </ul>
</li>:""} </li>:""}
{this.props.isAdmin() ? {this.props.isAdmin() ?

Loading…
Cancel
Save