master
杨树林 5 years ago
parent 4a05ab8d33
commit 64cab73cf7

@ -104,7 +104,14 @@ class CommonWorkDetailIndex extends Component{
} }
/// 确认是否下载 /// 确认是否下载
confirmysl(url,params){ confirmysl(url,child){
let params = {}
if (isListModule) {
// TODO
if(child!=undefined) {
params = child._getRequestParams() !== undefined ? child._getRequestParams() : {};
}
}
axios.get(url+ '&export=true',{ axios.get(url+ '&export=true',{
params params
}).then((response) => { }).then((response) => {
@ -131,7 +138,7 @@ class CommonWorkDetailIndex extends Component{
this.setState({ donwloading: true }) this.setState({ donwloading: true })
downloadFile({ downloadFile({
url: url, url: url,
params:params, params,
successCallback: (url) => { successCallback: (url) => {
this.setState({ donwloading: false }) this.setState({ donwloading: false })
console.log('successCallback') console.log('successCallback')
@ -317,13 +324,13 @@ class CommonWorkDetailIndex extends Component{
<li> <li>
<a href={"javascript:void(0)"} className="color-dark" <a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.confirmysl(exportResultUrl, exportParams)} onClick={() => this.confirmysl(exportResultUrl,this.child)}
>导出成绩</a> >导出成绩</a>
</li> </li>
<li> <li>
<a href={"javascript:void(0)"} className="color-dark" <a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.confirmysl(exportUrl, exportParams)} onClick={() => this.confirmysl(exportUrl,this.child)}
>导出作品附件</a> >导出作品附件</a>
</li> </li>
</ul> </ul>

@ -1389,7 +1389,8 @@ class Studentshavecompletedthelist extends Component {
loadingstate: true, loadingstate: true,
}) })
} }
console.log(response);
console.log(1393);
thiss.Generatenewdatasy(response.data.exercise_users, response); thiss.Generatenewdatasy(response.data.exercise_users, response);
} }
}).catch((error) => { }).catch((error) => {
@ -1992,6 +1993,8 @@ class Studentshavecompletedthelist extends Component {
this.setState({ this.setState({
loadingstate: false, loadingstate: false,
}) })
console.log(response);
console.log(1997);
this.Generatenewdatasy(response.data.exercise_users, response); this.Generatenewdatasy(response.data.exercise_users, response);
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -2306,13 +2309,13 @@ class Studentshavecompletedthelist extends Component {
}; };
_getRequestParams() { _getRequestParams() {
const { order, course_groups,searchtext, page ,limit} = this.state const { order, checkedValuesineinfo,searchtext, page ,limit} = this.state
return { return {
page, page,
search:searchtext, search:searchtext,
order, group_id:checkedValuesineinfo,
limit: limit, limit: limit,
group_id:course_groups, order,
} }
} }

@ -163,9 +163,15 @@ class Testpapersettinghomepage extends Component{
} }
/// 确认是否下载 /// 确认是否下载
confirmysl(url,params){ confirmysl(url,child){
let params ={}
if(child!=undefined){
params =child._getRequestParams()!==undefined?child._getRequestParams():{};
}
console.log("170");
console.log(params);
axios.get(url,{ axios.get(url,{
params params
}).then((response) => { }).then((response) => {
if(response.data.status&&response.data.status===-1){ if(response.data.status&&response.data.status===-1){
@ -240,12 +246,7 @@ class Testpapersettinghomepage extends Component{
const isAdmin =this.props.isAdmin(); const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent(); const isStudent = this.props.isStudent();
// TODO // TODO
let params ={}
if(this.child!=undefined){
params =this.child._getRequestParams()!==undefined?this.child._getRequestParams():{};
}
// console.log("246");
// console.log(this.child);
return( return(
<div className="newMain clearfix "> <div className="newMain clearfix ">
{/*<DownloadMessage*/} {/*<DownloadMessage*/}
@ -354,7 +355,7 @@ class Testpapersettinghomepage extends Component{
{isAdmin === true? <li className="li_line drop_down fr color-blue font-15" style={{"paddingLeft":"0px"}}> {isAdmin === true? <li className="li_line drop_down fr color-blue font-15" style={{"paddingLeft":"0px"}}>
导出<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":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`,params)}>学生成绩</a></li> <li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`,this.child)}>学生成绩</a></li>
{/*<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/export_exercise`)} >空白试卷</a></li>*/} {/*<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/export_exercise`)} >空白试卷</a></li>*/}
{/*<li><a onClick={()=>this.confirmysl(`/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval===null||this.state.groupyslsval===undefined?null:this.state.groupyslsval}`)}>学生答题试卷</a></li>*/} {/*<li><a onClick={()=>this.confirmysl(`/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval===null||this.state.groupyslsval===undefined?null:this.state.groupyslsval}`)}>学生答题试卷</a></li>*/}
</ul> </ul>

Loading…
Cancel
Save