From 9b2effffe3fbf4456830cd722976b48d201d75d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 21 Feb 2020 15:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/question/component/Contentpart.js | 53 +++++++++++++++++-- .../testpaper/component/Contentpart.js | 52 ++++++++++++++++-- .../modules/testpaper/component/Listjihe.js | 27 +++++----- 3 files changed, 111 insertions(+), 21 deletions(-) diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index e1d0f0bef..e01922af8 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -17,14 +17,17 @@ import NoneDatas from '../component/NoneDatas'; import LoadingSpin from '../../../common/LoadingSpin'; import Contentquestionbank from "./Contentquestionbank"; import Listjihe from "./Listjihe"; +import Certifiedprofessional from "../../modals/Certifiedprofessional"; const { TabPane } = Tabs; const Search = Input.Search; class Contentpart extends Component { constructor(props) { super(props); this.state = { - page: 1, - chakanjiexibool: false, + page:1, + chakanjiexibool:false, + mydisplay:false, + occupation:2, } } //初始化 @@ -52,7 +55,26 @@ class Contentpart extends Component { this.props.callback(defaultActiveKeys); } } + HideAddcoursestypess=(i)=>{ + console.log("调用了"); + this.setState({ + mydisplay:true, + occupation:i, + }) + } + + mydisplayHidedel=()=>{ + this.setState({ + mydisplay:false, + }) + } + xinzenw=(e)=>{ + //只限制了教师 + if(this.props.current_user.professional_certification===false){ + this.HideAddcoursestypess(2); + return + } var urls=""; if(this.props.discipline_id){ // if(urls==="?"){ @@ -95,7 +117,7 @@ class Contentpart extends Component { } render() { - let {page}=this.state; + 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; @@ -136,12 +158,33 @@ class Contentpart extends Component { ); - //console.log("Contentpart.js"); - //console.log(this.props.defaultActiveKey); + // console.log("Contentpart.js"); + // console.log(this.props.current_user.professional_certification); return (
+ { + mydisplay===true? + + + :"" + } + { + mydisplay===true? + + + :"" + }
diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index b73da225f..9aa4cf2ea 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -17,6 +17,7 @@ import NoneDatas from '../component/NoneDatas'; import Contentquestionbank from "./Contentquestionbank"; import LoadingSpin from '../../../common/LoadingSpin'; import Listjihe from "./Listjihe"; +import Certifiedprofessional from "../../modals/Certifiedprofessional"; const { TabPane } = Tabs; const Search = Input.Search; class Contentpart extends Component { @@ -25,6 +26,8 @@ class Contentpart extends Component { this.state = { page:1, defaultActiveKeyss:"0", + mydisplay:false, + occupation:2, } } @@ -86,9 +89,31 @@ class Contentpart extends Component { this.props.callback(defaultActiveKeys,false); } } + HideAddcoursestypess=(i)=>{ + console.log("调用了"); + this.setState({ + mydisplay:true, + occupation:i, + }) + } + + mydisplayHidedel=()=>{ + this.setState({ + mydisplay:false, + }) + } + xinzenw=(url)=>{ + //只限制了教师 + if(this.props.current_user.professional_certification===false){ + this.HideAddcoursestypess(2); + return + } + + this.props.history.push(url); + } render() { - let {page,defaultActiveKeyss}=this.state; + let {page,defaultActiveKeyss,mydisplay}=this.state; let {defaultActiveKey,defaultActiveKeybool}=this.props; let defaultActiveKeys=defaultActiveKey+''; @@ -125,6 +150,27 @@ class Contentpart extends Component { return (
+ { + mydisplay===true? + + + :"" + } + { + mydisplay===true? + + + :"" + }
@@ -203,13 +249,13 @@ class Contentpart extends Component { width:"50%" }}> - + this.xinzenw('/Integeneration')}>

智能组卷

- + this.xinzenw('/question')}>

人工组卷

diff --git a/public/react/src/modules/testpaper/component/Listjihe.js b/public/react/src/modules/testpaper/component/Listjihe.js index c6b83eafa..8dc398e4e 100644 --- a/public/react/src/modules/testpaper/component/Listjihe.js +++ b/public/react/src/modules/testpaper/component/Listjihe.js @@ -135,21 +135,22 @@ class Listjihe extends Component { } { - items.apply===false? -

this.props.showmodels(items.id)}> - - 公开 -

- : - ( items.public==true? - "" - : -

this.props.showmodelsInaudit(e)}> - - 公开审核中 +

+ + 已公开

- ) + : + items.apply===false? +

this.props.showmodels(items.id)}> + + 公开 +

+ : +

this.props.showmodelsInaudit(e)}> + + 公开审核中 +

}
:""}