From 118af129571f726e8b96f3b7eceecd65ec8cdf6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 24 Dec 2019 09:36:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesHome/CoursesHome.js | 18 +++++++++- .../courses/exercise/Exercisesetting.js | 4 ++- .../courses/poll/PollDetailTabForth.js | 4 +-- .../modules/paths/PathDetail/Addshixuns.js | 16 ++++----- .../src/modules/paths/ShixunPathSearch.js | 35 ++++++++++++++++++- public/react/src/modules/tpm/TPMBanner.js | 2 +- public/react/src/modules/tpm/jupyter/index.js | 12 +++---- 7 files changed, 71 insertions(+), 20 deletions(-) diff --git a/public/react/src/modules/courses/coursesHome/CoursesHome.js b/public/react/src/modules/courses/coursesHome/CoursesHome.js index c02c49ee9..f6b6d7303 100644 --- a/public/react/src/modules/courses/coursesHome/CoursesHome.js +++ b/public/react/src/modules/courses/coursesHome/CoursesHome.js @@ -102,11 +102,26 @@ class CoursesHome extends Component{ }) } + getUser=(url,type)=>{ + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + + if(url !== undefined || url!==""){ + this.props.history.push(url); + } + + } render() { let { order,search,page,coursesHomelist }=this.state; - + //console.log(this.props) return (
{this.state.updata===undefined?"": this.changeStatus("created_at")}>最新 this.changeStatus("visits")}>最热 + {this.props.user&&this.props.user.user_identity==="学生"?"":this.getUser("/courses/new")}>+新建翻转课堂} {/*
*/} {/*/!* 截止时间:
+ +

{ unit_e_tip && unit_e_tip != "" ? { unit_e_tip }:"" diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js index aa9038d9b..17284a8fc 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForth.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js @@ -584,7 +584,7 @@ class PollDetailTabForth extends Component{

截止时间:
- + diff --git a/public/react/src/modules/paths/PathDetail/Addshixuns.js b/public/react/src/modules/paths/PathDetail/Addshixuns.js index a4819ed76..9e7766e32 100644 --- a/public/react/src/modules/paths/PathDetail/Addshixuns.js +++ b/public/react/src/modules/paths/PathDetail/Addshixuns.js @@ -93,14 +93,14 @@ class Addshixuns extends Component { :""}
- {/*
*/} - {/* */} - {/* */} - {/* 普通实训*/} - {/* jupyter实训*/} - {/* */} - {/* */} - {/*
*/} +
+ + + 普通实训 + jupyter实训 + + +

实训名称: diff --git a/public/react/src/modules/paths/ShixunPathSearch.js b/public/react/src/modules/paths/ShixunPathSearch.js index a473c5149..adadc306b 100644 --- a/public/react/src/modules/paths/ShixunPathSearch.js +++ b/public/react/src/modules/paths/ShixunPathSearch.js @@ -124,10 +124,39 @@ class ShixunPathSearch extends Component{ this.props.history.push(url) } + //头部获取是否已经登录了 + getUser=(url,type)=>{ + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + + if(url !== undefined || url!==""){ + this.props.history.push(url); + } + + + } render() { let { order,sortList,search,page,total_count,select }=this.state; + let pathstype=false; + if(this.props&&this.props.mygetHelmetapi!=null){ + let paths="/paths"; + this.props.mygetHelmetapi.navbar.map((item,key)=>{ + var reg = RegExp(item.link); + if(paths.match(reg)){ + if(item.hidden===true){ + pathstype=true + } + } - // console.log() + }) + } + // console.log(this.props) return (

{this.state.updata===undefined?"": this.changeStatus("mine")}>我的*/} this.changeStatus("updated_at")}>最新 this.changeStatus("myshixun_count")}>最热 + {this.props.user&&this.props.user.main_site===false?"":this.props.Headertop===undefined?"":this.getUser("/paths/new")}>+新建实践课程} + {this.props.user&&this.props.user.main_site===true?"":this.props.Headertop===undefined?"": + pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?this.getUser("/paths/new")}>+新建实践课程:"" + } {/*
*/} {/*/!*

{/*sync | poweroff */} - {/*重置实训*/} +