diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 01a5a6a05..0b4f42faa 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -62,9 +62,9 @@ class NewHeader extends Component { RadioGroupvalue:undefined, submitapplications:false, isRender:false, - showSearchOpentype:false, + showSearchOpentype:false, showTrial:false, - setevaluatinghides:false + setevaluatinghides:false } // console.log("176") // console.log(props); @@ -152,7 +152,7 @@ class NewHeader extends Component { const url = `/accounts/logout.json` this.delCookie("autologin_trustie") axios.get(url, { - }) + }) .then((response) => { if(response.data.status===1){ this.setState({ @@ -331,136 +331,136 @@ class NewHeader extends Component { }) } -submittojoinclass=(value)=>{ - let {tojoinclasstitle,rolearr,RadioGroupvalue}=this.state; + submittojoinclass=(value)=>{ + let {tojoinclasstitle,rolearr,RadioGroupvalue}=this.state; - if(tojoinclasstitle===undefined){ - this.setState({ - code_notice:true - }) - return - } - let newrolearr=rolearr; - // if(value===1){ + if(tojoinclasstitle===undefined){ + this.setState({ + code_notice:true + }) + return + } + let newrolearr=rolearr; + // if(value===1){ if(tojoinclasstitle.length<6){ this.setState({ code_notice:true }) return } - // }else if(value===0){ - // if(tojoinclasstitle.length<5){ - // this.setState({ - // code_notice:true - // }) - // return - // } - // } - if(tojoinclasstitle===""||tojoinclasstitle===undefined){ - this.setState({ - code_notice:true - }) - return - }else{ - this.setState({ - code_notice:false - }) - } - - let pamst=[]; - let num=0; - for(var i = 0 ; i { - if( response.data.state===0){ - this.submitstatevalue(0,"加入成功",response.data.course_id) - }else if( response.data.state===1){ - }else if( response.data.state===2){ - this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)") - }else if( response.data.state===3){ - this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id) - }else if( response.data.state===4){ - this.submitstatevalue( 0,"您输入的邀请码错误)") - }else if( response.data.state===5){ - this.submitstatevalue( 0,"您还未登录") - }else if( response.data.state===6){ - this.submitstatevalue( 0,"申请已提交,请等待审核") - }else if( response.data.state===7){ - this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待") - }else if( response.data.state===8){ - this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id) - }else if( response.data.state==9){ - this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id) - }else if( response.data.state==10){ - this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id) - }else if( response.data.state==11){ - this.submitstatevalue(0," 该课堂已归档,请联系老师") - }else if( response.data.state==12){ - this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师") - }else if( response.data.state==13){ - this.submitstatevalue(0,"您申请已提交,请等待审核") - }else if( response.data.state==14){ - this.submitstatevalue("此邀请码已停用,请与老师联系") - }else if( response.data.state==15){ - this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行") - }else { - this.submitstatevalue(0," 未知错误,请稍后再试") - } - }) + if(value===1&&RadioGroupvalue===undefined){ + this.setState({ + checked_notice:true + }) + return + } - } + if(value===0){ + let url="/courses/join_course_multi_role.json" + const form = new FormData(); + form.append('invite_code', tojoinclasstitle); + form.append('role', pamst); + form.append('type', 1); + axios.post(url,form,[true] + ).then((response) => { + if( response.data.state===0){ + this.submitstatevalue(0,"加入成功",response.data.course_id) + }else if( response.data.state===1){ + }else if( response.data.state===2){ + this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)") + }else if( response.data.state===3){ + this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id) + }else if( response.data.state===4){ + this.submitstatevalue( 0,"您输入的邀请码错误)") + }else if( response.data.state===5){ + this.submitstatevalue( 0,"您还未登录") + }else if( response.data.state===6){ + this.submitstatevalue( 0,"申请已提交,请等待审核") + }else if( response.data.state===7){ + this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待") + }else if( response.data.state===8){ + this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id) + }else if( response.data.state==9){ + this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id) + }else if( response.data.state==10){ + this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id) + }else if( response.data.state==11){ + this.submitstatevalue(0," 该课堂已归档,请联系老师") + }else if( response.data.state==12){ + this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师") + }else if( response.data.state==13){ + this.submitstatevalue(0,"您申请已提交,请等待审核") + }else if( response.data.state==14){ + this.submitstatevalue("此邀请码已停用,请与老师联系") + }else if( response.data.state==15){ + this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行") + }else { + this.submitstatevalue(0," 未知错误,请稍后再试") + } + }) - if(value===1){ - let url="/applied_project/applied_project_info.json" - const form = new FormData(); - form.append('invite_code', tojoinclasstitle); - form.append('member', RadioGroupvalue); - form.append('type', 1); - axios.post(url,form,[true] - ).then((response) => { - if( response.data.status===1){ - this.submitstatevalue(1,"您输入的邀请码错误") - }else if( response.data.status===2){ - this.submitstatevalue( 1,"您已经是该项目成员",response.data.project) - }else if( response.data.status===3){ - this.submitstatevalue( 1,"请选择一个角色") - }else if( response.data.status===4){ - this.submitstatevalue( 1,"您的申请已提交,请等待项目管理员审批") - }else if( response.data.status===5){ - this.submitstatevalue( 1,"您已经申请加入该项目了,请耐心等待") - }else if( response.data.status===6){ - this.submitstatevalue( 1,"您已成功加入项目",response.data.project) - } - }) + } + + if(value===1){ + let url="/api/applied_project/applied_project_info.json" + const form = new FormData(); + form.append('invite_code', tojoinclasstitle); + form.append('member', RadioGroupvalue); + form.append('type', 1); + axios.post(url,form,[true] + ).then((response) => { + if( response.data.status===1){ + this.submitstatevalue(1,"您输入的邀请码错误") + }else if( response.data.status===2){ + this.submitstatevalue( 1,"您已经是该项目成员",response.data.project) + }else if( response.data.status===3){ + this.submitstatevalue( 1,"请选择一个角色") + }else if( response.data.status===4){ + this.submitstatevalue( 1,"您的申请已提交,请等待项目管理员审批") + }else if( response.data.status===5){ + this.submitstatevalue( 1,"您已经申请加入该项目了,请耐心等待") + }else if( response.data.status===6){ + this.submitstatevalue( 1,"您已成功加入项目",response.data.project) + } + }) + } } -} // trialapplications =()=>{ // console.log("点击了") @@ -486,54 +486,54 @@ submittojoinclass=(value)=>{ }) } - showSearchOpen=(e)=>{ - this.setState({ - showSearchOpentype:true - }) - e.stopPropagation(e);//阻止冒泡 - } - - hideshowSearchOpen=(e)=>{ - let {setevaluatinghides}=this.state; - if(setevaluatinghides===true){ - this.setState({ - showSearchOpentype:false, - setevaluatinghides:false - }) - e.stopPropagation(e);//阻止冒泡 - } - } - - onKeywordSearchKeyDown = (value) => { - let url=`/search?value=${value}`; - this.props.history.push(url) - } - - onKeywordSearchKeyDowns=()=>{ - this.setState( - { - setevaluatinghides:false - } - ) - } - - setevaluatinghides=()=>{ - this.setState( - { - setevaluatinghides:true - } - ) - } - //头部获取是否已经登录了 - getUser=(url)=>{ + showSearchOpen=(e)=>{ + this.setState({ + showSearchOpentype:true + }) + e.stopPropagation(e);//阻止冒泡 + } + + hideshowSearchOpen=(e)=>{ + let {setevaluatinghides}=this.state; + if(setevaluatinghides===true){ + this.setState({ + showSearchOpentype:false, + setevaluatinghides:false + }) + e.stopPropagation(e);//阻止冒泡 + } + } + + onKeywordSearchKeyDown = (value) => { + let url=`/search?value=${value}`; + this.props.history.push(url) + } + + onKeywordSearchKeyDowns=()=>{ + this.setState( + { + setevaluatinghides:false + } + ) + } + + setevaluatinghides=()=>{ + this.setState( + { + setevaluatinghides:true + } + ) + } + //头部获取是否已经登录了 + getUser=(url)=>{ console.log("点击了503") console.log(url); let{user} =this.state; if(user===undefined){ - this.setState({ - isRender:true - }) - return + this.setState({ + isRender:true + }) + return } if(user&&user.login===""){ this.setState({ @@ -572,7 +572,7 @@ submittojoinclass=(value)=>{ submitapplicationsvalue, user, isRender, - showSearchOpentype, + showSearchOpentype, }=this.state; /* 用户名称 用户头像url @@ -603,13 +603,13 @@ submittojoinclass=(value)=>{
- {isRender===true?this.Modifyloginvalue()} - {...this.state} - {...this.props} - />:""} + {isRender===true?this.Modifyloginvalue()} + {...this.state} + {...this.props} + />:""} -
+
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} 高校智能化教学与实训平台 @@ -654,15 +654,15 @@ submittojoinclass=(value)=>{
- {/*
  • 教学案例
  • */} + {/*
  • 教学案例
  • */}
  • - 在线竞赛 - + 在线竞赛 +
  • -
  • 教学案例
  • -
  • 众包创新
  • +
  • 教学案例
  • +
  • 众包创新
  • 交流问答
  • { -