From c2962c961231478f1842d429b603b4e624a9a68f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 20 Jul 2019 15:31:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 8 +++---- .../courses/coursesPublic/ShixunModal.js | 22 ++++++++++--------- .../src/modules/courses/new/CoursesNew.js | 8 ++++++- public/react/src/modules/home/shixunsHome.js | 16 +++++++------- public/react/src/modules/tpm/TPMBanner.js | 19 ++++++++++++---- 5 files changed, 46 insertions(+), 27 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 3f34ee7a6..b8e98fd8e 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -26,10 +26,9 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -const debugType ="" -// window.location.search.indexOf('debug=t') != -1 ? 'teacher' : -// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' -// window._debugType = debugType; +const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : + window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' +window._debugType = debugType; export function initAxiosInterceptors(props) { @@ -44,6 +43,7 @@ export function initAxiosInterceptors(props) { proxy="http://47.96.87.25:48080" + // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; // 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制 const requestMap = {}; diff --git a/public/react/src/modules/courses/coursesPublic/ShixunModal.js b/public/react/src/modules/courses/coursesPublic/ShixunModal.js index f0caef87b..1fc218908 100644 --- a/public/react/src/modules/courses/coursesPublic/ShixunModal.js +++ b/public/react/src/modules/courses/coursesPublic/ShixunModal.js @@ -146,12 +146,22 @@ class ShixunModal extends Component{ } savecouseShixunModal=()=>{ + this.setState({ hometypepvisible:true }) let {coursesId,patheditarry,datas}=this.props; - let{category_id}=this.state; + if(patheditarry.length===0){ + this.setState({ + shixunmodelchke:true, + chekicmessage:"请先选择实训", + hometypepvisible:false + }) + + return + } + if (this.props.chooseShixun) { this.props.chooseShixun(patheditarry) this.setState({ @@ -159,15 +169,7 @@ class ShixunModal extends Component{ }) return; } - if(patheditarry.length===0){ - this.setState({ - shixunmodelchke:true, - chekicmessage:"请先选择实训", - hometypepvisible:false - }) - return - } let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; axios.post(url, { category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), @@ -378,7 +380,7 @@ class ShixunModal extends Component{ - {this.state.chekicmessage} + {this.state.chekicmessage}
取消 确定 diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index e052ed1e3..eb1627e83 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -257,7 +257,13 @@ class CoursesNew extends Component { } goback = () => { - window.history.go(-1) + + if(this.props.match.params.coursesId===undefined){ + this.props.history.push("/courses"); + }else{ + this.props.history.push(`/courses/${this.props.match.params.coursesId}`); + } + // window.history.go(-1) } onCheckAllChange = (e) => { diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index 780691e6c..5400368ec 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -361,7 +361,7 @@ class ShixunsHome extends Component { - {item.name} + {item.username} ) @@ -375,7 +375,7 @@ class ShixunsHome extends Component { - {item.name} + {item.username} ) @@ -389,7 +389,7 @@ class ShixunsHome extends Component { - {item.name} + {item.username} ) @@ -405,7 +405,7 @@ class ShixunsHome extends Component {
  • - {item.name} + {item.username}
  • ) @@ -437,7 +437,7 @@ class ShixunsHome extends Component { - {item.name} + {item.username} ) @@ -451,7 +451,7 @@ class ShixunsHome extends Component { - {item.name} + {item.username} ) @@ -465,7 +465,7 @@ class ShixunsHome extends Component { - {item.name} + {item.username} ) @@ -481,7 +481,7 @@ class ShixunsHome extends Component {
  • - {item.name} + {item.username}
  • ) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index c9404a792..68113f133 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -39,7 +39,7 @@ class TPMBanner extends Component { this.state={ Forkvisible: false, Senttothetype:false, - Senttothevcalue:1, + Senttothevcalue:undefined, courses_count:1, course_list:[], pagenum:1, @@ -62,6 +62,7 @@ class TPMBanner extends Component { isIE:false, Forkvisibletype: false, isSpin:false, + Senttothevcaluetype:false } } @@ -233,12 +234,21 @@ class TPMBanner extends Component { }); } sendeSenttothevcalue=()=>{ + let {Senttothevcalue}=this.state; + + if(Senttothevcalue===undefined){ + this.setState({ + Senttothevcaluetype:true + }) + return + } let id = this.props.match.params.shixunId; let url="/shixuns/" + id +"/send_to_course.json"; axios.post(url,{ course_id:Senttothevcalue }).then((response) => { + this.props.showSnackbar(response.data.message); this.setState({ Senttothetype:false, @@ -466,6 +476,7 @@ class TPMBanner extends Component { shixunsreplace, hidestartshixunsreplacevalue, Forkvisibletype, + Senttothevcaluetype, isIE} = this.state; let {shixunsDetails, shixunId, star_info, star_infos} = this.props; let challengeBtnTipText = ''; @@ -839,7 +850,7 @@ class TPMBanner extends Component { />
    -
    12?"cdefault mb20":"cdefault mb50"}> +
    12?"cdefault ":"cdefault "}>
      @@ -855,8 +866,8 @@ class TPMBanner extends Component {
    - -
    + {this.state.Senttothevcaluetype===true?
    请选择你要发送的课堂
    :""} +
    12 ? "block" : "none"}} showQuickJumper defaultCurrent={1} current={pages} pageSize={12} total={courses_count} onChange={this.onChangesendeSenttothe}/> From bb1f8dccaaa109978042fda577aa840a0217ba57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 20 Jul 2019 16:02:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/images/educoder/roundedRectangle.png | Bin 0 -> 720 bytes public/react/src/AppConfig.js | 31 +++++++------------- public/react/src/modules/tpm/NewHeader.js | 19 +++++++----- public/react/src/modules/tpm/TPMIndex.css | 6 ++++ 4 files changed, 28 insertions(+), 28 deletions(-) create mode 100755 public/images/educoder/roundedRectangle.png diff --git a/public/images/educoder/roundedRectangle.png b/public/images/educoder/roundedRectangle.png new file mode 100755 index 0000000000000000000000000000000000000000..0d2d0b0dcdb359def884705254f050d1fbdcb3fb GIT binary patch literal 720 zcmV;>0x$iEP)7i5*ItXH}O~epQUU@HhV58rh1Hvd($Uc{~fs`t{WtAox?*xd!!y}DOtA`$57 zLY|)^QYobCBD`;Yr82JGz!@)1cQ*z z!_W{i5J0S~ToGY^e4O2hiAqE@{{u?X1RqfE4-ODpTgdr&7#@aj7_q*NY;5GXwUtBQ z)G&Bv+iaUAztw#}LwrviVMS9fBDu5#jsq<%2+KkNMRPMOEFk;(5Xq#LCpS7u{q!_n z+Sa7-)NP@?@QOwQd_d*ESt3Dxb(Ok-0n!^A)P_QYdwMt+ z8{=?tQX5pj$F_~*0sU2^QcweFQGi+Ct@c34W?2xAmvR`1P_Qgc;&FaC4ld9%I7mZ# zJF-|Lv$Mm=+FGRw1Ca<1EsLXgT(?8HHi}*!O8BITCRi+uwpRke7flH{;0QPd&VX94 z+LUwUb4nTYu8gYXGp@gT|J(vBK7jYWaaXz^;VbamyT1m!5Rkpir19Uq4!94r0-u4` zq7+=!)^$KNiDG)P`&*_;$V)&8_kcG7rmJNCikZJnpcOq`ZNy>#0000 diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index c404aa8d5..6f3a7d4c2 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -676,9 +676,12 @@ submittojoinclass=(value)=>{ {/*
  • 教学案例
  • */} -
  • 在线竞赛
  • +
  • + 在线竞赛 + +
  • 教学案例
  • -
  • 众包社区
  • +
  • 众包创新
  • 交流问答
  • { // onSearch={value => console.log(value)} onPressEnter={this.onKeywordSearchKeyDown} - style={{ width: 295 }} + style={{ width: 300 }} />
  • @@ -736,11 +739,11 @@ submittojoinclass=(value)=>{ <%= link_to '注册', user_join_path, :className => "ml5" %> */} { user===undefined? - + this.educoderlogin()} className="mr5 color-white">登录 注册 - :user.login===""? + :user.login===""? this.educoderlogin()} className="mr5 color-white">登录 注册 @@ -773,7 +776,7 @@ submittojoinclass=(value)=>{
    } {/*href="https://www.educoder.net/login"*/} - { user===undefined?"":user.login===""?"":
    +
    { loadHeader()} {/*"/images/educoder/icon/search.svg" @@ -861,7 +864,7 @@ submittojoinclass=(value)=>{
    -
    +
    { user===undefined?"":user.login===""?"": {
    -
    } +
    diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index 655f58637..94d7cb0d7 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -191,4 +191,10 @@ body>.-task-title { .HeaderSearch .ant-input-search .ant-input-suffix{ background: transparent !important; +} + +.roundedRectangles{ + position: absolute; + top: 10px; + right: -22px; } \ No newline at end of file