dev_aliyun_beta
杨树明 6 years ago
parent 65ff658790
commit 1aa713a895

@ -1,8 +1,9 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {WordsBtn,markdownToHTML} from 'educoder'; import {WordsBtn,markdownToHTML,ActionBtn,queryString,downloadFile} from 'educoder';
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom'; import {Link,Switch,Route,Redirect} from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
import ConclusionEvaluation from './shixunreport/ConclusionEvaluation'; import ConclusionEvaluation from './shixunreport/ConclusionEvaluation';
import OfficialAcademicTranscript from './shixunreport/OfficialAcademicTranscript'; import OfficialAcademicTranscript from './shixunreport/OfficialAcademicTranscript';
import Coursesshixundetails from './shixunreport/Coursesshixundetails'; import Coursesshixundetails from './shixunreport/Coursesshixundetails';
@ -32,9 +33,19 @@ class ShixunWorkReport extends Component {
} }
/// 确认是否下载 /// 确认是否下载
confirmysl(url){ confirmysl(url,child){
axios.get(url).then((response) => { let params ={}
if(child!=undefined){
params =child._getRequestParams()!==undefined?child._getRequestParams():{};
}
console.log("170");
console.log(params);
const urll=url+`?${queryString.stringify(params)}`;
axios.get(urll+ '&export=true').then((response) => {
if(response===undefined){
return
}
if(response.data.status&&response.data.status===-1){ if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){ }else if(response.data.status&&response.data.status===-2){
@ -53,17 +64,16 @@ class ShixunWorkReport extends Component {
}) })
} }
}else { }else {
this.setState({ donwloading: true })
this.props.showNotification(`正在下载中`); this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
window.open("/api"+url+'?&export=true', '_blank');
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
//打开pdf
confpdf = (url) =>{
window.open(url);
}
Downloadcal=()=>{ Downloadcal=()=>{
this.setState({ this.setState({
DownloadType:false, DownloadType:false,
@ -163,8 +173,8 @@ class ShixunWorkReport extends Component {
<a onClick={this.goback} className="color-grey-6 fr font-16 ml30 mt15 mr20">返回</a> <a onClick={this.goback} className="color-grey-6 fr font-16 ml30 mt15 mr20">返回</a>
{this.props.isAdmin() ? <a {this.props.isAdmin() ? <a
className=" color-blue font-16 fr ml30 mt15 mr20" className=" color-blue font-16 fr ml30 mt15 mr20"
// onClick={()=>this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} onClick={()=>this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)}
onClick={()=>this.confpdf(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)}
>导出实训报告数据</a> : ""} >导出实训报告数据</a> : ""}
</div> </div>

Loading…
Cancel
Save