diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js index f20f9ab1a..4e3132ab9 100644 --- a/public/react/src/modules/question/NewMyShixunModel.js +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -163,11 +163,22 @@ class NewMyShixunModel extends Component { //初始化 componentDidMount() { - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; + let isysladmins=false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; let {defaultActiveKey} = this.props; var defaultActiveKeys=defaultActiveKey; + if(this.props){ + if(this.props.current_user){ + if(this.props.current_user.admin){ + isysladmins=true; + } + else if(this.props.current_user.business){ + isysladmins=true; + } + } + } + if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ defaultActiveKeys="0" }else{ @@ -207,12 +218,22 @@ class NewMyShixunModel extends Component { componentDidUpdate(prevProps) { if(prevProps.current_user !== this.props.current_user) { - debugger - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; + let isysladmins=false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; let {defaultActiveKey} = this.props; var defaultActiveKeys=defaultActiveKey; + if(this.props){ + if(this.props.current_user){ + if(this.props.current_user.admin){ + isysladmins=true; + } + else if(this.props.current_user.business){ + isysladmins=true; + } + } + } + if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ defaultActiveKeys="0" }else{ diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index 9881bdc0e..b7a96d956 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -853,10 +853,19 @@ class Question extends Component { + program_questions_count + single_questions_count + subjective_questions_count; - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; + let isysladmins=false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; - + if(this.props){ + if(this.props.current_user){ + if(this.props.current_user.admin){ + isysladmins=true; + } + else if(this.props.current_user.business){ + isysladmins=true; + } + } + } return (
@@ -923,19 +932,7 @@ class Question extends Component { ` } - { - isysladmins===true? - this.showDrawer()} - Headertop={Headertop} - - /> - : - is_teacher===true&&professional_certification===true? + - : - - "" - } - {/*顶部*/} diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 4ccab5e14..142e34ccc 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -42,11 +42,22 @@ class Contentpart extends Component { componentDidUpdate(prevProps) { if(prevProps.current_user !== this.props.current_user) { - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; + let isysladmins=false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; let {defaultActiveKey} = this.props; var defaultActiveKeys=defaultActiveKey; + if(this.props){ + if(this.props.current_user){ + if(this.props.current_user.admin){ + isysladmins=true; + } + else if(this.props.current_user.business){ + isysladmins=true; + } + } + } + if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ defaultActiveKeys="0" }else{ @@ -120,10 +131,19 @@ class Contentpart extends Component { let {page,mydisplay}=this.state; let {defaultActiveKey,item_type,booljupyterurls}=this.props; const defaultActiveKeys=defaultActiveKey+''; - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; + let isysladmins=false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; - + if(this.props){ + if(this.props.current_user){ + if(this.props.current_user.admin){ + isysladmins=true; + } + else if(this.props.current_user.business){ + isysladmins=true; + } + } + } const content = (
0?"-task-sidebar mystask-sidebars":"-task-sidebar mystask-sidebarss"} > @@ -101,7 +117,7 @@ class SiderBars extends Component { {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?
{ - mypath&&mypath==="/question"? + mypath&&mypath==="/question"&&swsilan===true?
this.props.showDrawer()} > @@ -117,7 +133,7 @@ class SiderBars extends Component { -

试题库

+

试题篮

:"" diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index 9aa4cf2ea..eac80dad4 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -63,11 +63,21 @@ class Contentpart extends Component { componentDidUpdate(prevProps) { if(prevProps.current_user !== this.props.current_user) { - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; + let isysladmins=false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; let {defaultActiveKey} = this.props; let defaultActiveKeys=defaultActiveKey; + if(this.props){ + if(this.props.current_user){ + if(this.props.current_user.admin){ + isysladmins=true; + } + else if(this.props.current_user.business){ + isysladmins=true; + } + } + } if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ defaultActiveKeys="0" }else{ @@ -117,9 +127,19 @@ class Contentpart extends Component { let {defaultActiveKey,defaultActiveKeybool}=this.props; let defaultActiveKeys=defaultActiveKey+''; - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; + let isysladmins=false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; + if(this.props){ + if(this.props.current_user){ + if(this.props.current_user.admin){ + isysladmins=true; + } + else if(this.props.current_user.business){ + isysladmins=true; + } + } + } const contents = (