diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index a5e51a81c..5b5942f22 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,9 +42,9 @@ if (isDev) { window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } // 超管 -debugType="admin"; +// debugType="admin"; // 老师 -// debugType="teacher"; +debugType="teacher"; // 学生 // debugType="student"; diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js index 4e3132ab9..cce7be87d 100644 --- a/public/react/src/modules/question/NewMyShixunModel.js +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -164,20 +164,30 @@ class NewMyShixunModel extends Component { //初始化 componentDidMount() { 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; + let 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; - } - } - } + try { + 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(is_teacher===false){ + if(this.props.current_user.user_identity !=="学生"){ + //专业人士 + is_teacher=true + } + } + }catch (e) { + + } if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ defaultActiveKeys="0" @@ -219,21 +229,32 @@ class NewMyShixunModel extends Component { componentDidUpdate(prevProps) { if(prevProps.current_user !== this.props.current_user) { 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; + let 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; + try { + 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; + } } - else if(this.props.current_user.business){ - isysladmins=true; + } + if(is_teacher===false){ + if(this.props.current_user.user_identity !=="学生"){ + //专业人士 + is_teacher=true } } + }catch (e) { + } + 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 b7a96d956..bdb808047 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -21,6 +21,7 @@ import NoneData from './component/NoneData'; import './questioncss/questioncom.css'; import SiderBars from "../question/component/SiderBars"; import QuestionModalys from "./component/QuestionModalys"; +import Certifiedprofessional from "../modals/Certifiedprofessional"; var Undoclickable=true; class Question extends Component { @@ -70,6 +71,8 @@ class Question extends Component { isVisible: false, selectionbools:false, chakanjiexiboolindex:"无", + mydisplay:false, + occupation:2, @@ -806,11 +809,38 @@ class Question extends Component { }); } + HideAddcoursestypess=(i)=>{ + console.log("调用了"); + this.setState({ + mydisplay:true, + occupation:i, + }) + } + mydisplayHidedel=()=>{ + this.setState({ + mydisplay:false, + }) + } //跳转 gotopaperreview=()=>{ + let isysladmins=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; + } + } + } + if(this.props.current_user.professional_certification===false&&isysladmins===false){ + this.HideAddcoursestypess(2); + return + } this.props.history.replace("/paperreview/artificial"); } @@ -845,7 +875,7 @@ class Question extends Component { page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list, completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count, program_questions_count, single_questions_count, subjective_questions_count,selectionbools, - modalsTypeInaudit + modalsTypeInaudit,mydisplay } = this.state; const Datacount = completion_questions_count + judgement_questions_count @@ -856,19 +886,44 @@ class Question extends Component { 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; + try { + 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; + } } } + }catch (e) { + } return (
+ { + mydisplay===true? + + + :"" + } + { + mydisplay===true? + + + :"" + } { visible===true?