diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index e9770e969..9f4d49a04 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -297,43 +297,49 @@ class DetailCardsEditAndAdd extends Component{ contentViewScrolladd=(e)=>{ + const {ChooseShixunList}=this.state; //滑动到底判断 if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ - // console.log("到达底部"); - this.setState({ - hometypepvisible:true - }) - let pathId=this.props.pathid; - let {search,page,type,ChooseShixunListshixun_list}=this.state; - let newpage=page+1; - let newChooseShixunListshixun_list=ChooseShixunListshixun_list; - let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage - if(search!="" && search!=undefined){ - url+="&search="+search; - } - if(type!=0){ - url+="&type="+type; - } - axios.get(url).then((result)=>{ - if(result.status===200){ - let list =result.data.shixun_list; - - for(var i=0; i{ - console.log(error); - }) + if(ChooseShixunList.shixun_list.length===0){ + return + }else{ + // console.log("到达底部"); + this.setState({ + hometypepvisible:true + }) + let pathId=this.props.pathid; + let {search,page,type,ChooseShixunListshixun_list}=this.state; + let newpage=page+1; + let newChooseShixunListshixun_list=ChooseShixunListshixun_list; + let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage + if(search!="" && search!=undefined){ + url+="&search="+search; + } + if(type!=0){ + url+="&type="+type; + } + axios.get(url).then((result)=>{ + if(result.status===200){ + let list =result.data.shixun_list; + + for(var i=0; i{ + console.log(error); + }) + + } } diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js index 719994fdf..b6c7e53b2 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js @@ -338,50 +338,59 @@ class DetailCardsEditAndEdit extends Component{ contentViewScrolledit=(e)=>{ //滑动到底判断 - + const {ChooseShixunList}=this.state; if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ - this.setState({ - hometypepvisible:true - }) - // console.log("到达底部"); - let {page,type,search,ChooseShixunListshixun_list}=this.state; + if(ChooseShixunList.shixun_list.length===0){ + return + }else{ + this.setState({ + hometypepvisible:true + }) + // console.log("到达底部"); - let newpage=page+1; + let {page,type,search,ChooseShixunListshixun_list}=this.state; - let pathId=this.props.pathid; + let newpage=page+1; - let newChooseShixunListshixun_list=ChooseShixunListshixun_list; + let pathId=this.props.pathid; - let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage + let newChooseShixunListshixun_list=ChooseShixunListshixun_list; - if(search!="" && search!=undefined){ - url+="&search="+search; - } + let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage - if(type!=0){ - url+="&type="+type; - } - axios.get(url).then((result)=>{ - if(result.status===200){ + if(search!="" && search!=undefined){ + url+="&search="+search; + } + + if(type!=0){ + url+="&type="+type; + } + axios.get(url).then((result)=>{ + if(result.status===200){ + + let list =result.data.shixun_list; + + for(var i=0; i{ + console.log(error); + }) + + + } - let list =result.data.shixun_list; - for(var i=0; i{ - console.log(error); - }) } diff --git a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js index 985a838fb..4787f2e70 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js +++ b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js @@ -475,7 +475,10 @@ export default class TPMevaluation extends Component { } handpathoptionvalue=(value)=>{ this.setState({ - pathoptionvalue:value + pathoptionvalue:value, + shixunfileexpectpicturepath:undefined, + shixunfilestandardpicturepath:undefined, + shixunfilepicturepath:undefined }) } showrepositoryurltip=(type)=>{ @@ -640,19 +643,20 @@ export default class TPMevaluation extends Component { let id = this.props.match.params.shixunId; let{checkpointId}=this.state; let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; + let newchallenge={ + path:shixunfilepath, + exec_path:shixunfilepathplay, + show_type:pathoptionvalue===-1?undefined:pathoptionvalue, + original_picture_path:pathoptionvalue===-1?undefined:shixunfileexpectpicturepath, + expect_picture_path:pathoptionvalue===-1?undefined:shixunfilestandardpicturepath, + picture_path:pathoptionvalue===-1?undefined:shixunfilepicturepath, + test_set_score:newscorevalue, + test_set_average:markvalue, + web_route:web_route===null?undefined:web_route + } axios.put(url,{ tab:1, - challenge:{ - path:shixunfilepath, - exec_path:shixunfilepathplay, - show_type:pathoptionvalue, - original_picture_path:shixunfileexpectpicturepath, - expect_picture_path:shixunfilestandardpicturepath, - picture_path:shixunfilepicturepath, - test_set_score:newscorevalue, - test_set_average:markvalue, - web_route:web_route===null?undefined:web_route - }, + challenge:newchallenge, test_set:evaluationlist } ).then((response) => {