dev_aliyun2
杨树林 5 years ago committed by harry
parent 8a2a1d0faf
commit 2e2903ebb3

@ -28,6 +28,8 @@ class Contentpart extends Component {
defaultActiveKeyss:"0", defaultActiveKeyss:"0",
mydisplay:false, mydisplay:false,
occupation:2, occupation:2,
isysladmins:false,
} }
} }
@ -53,6 +55,20 @@ class Contentpart extends Component {
} }
} }
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;
}
}
}
this.setState({
isysladmins:isysladmins
})
} }
//跳转人工组卷 //跳转人工组卷
@ -64,10 +80,11 @@ class Contentpart extends Component {
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) { if(prevProps.current_user !== this.props.current_user) {
let isysladmins=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; 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; 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 {defaultActiveKey} = this.props;
let defaultActiveKeys=defaultActiveKey; let defaultActiveKeys=defaultActiveKey;
try {
if(this.props){ if(this.props){
if(this.props.current_user){ if(this.props.current_user){
if(this.props.current_user.admin){ if(this.props.current_user.admin){
@ -77,6 +94,16 @@ class Contentpart extends Component {
isysladmins=true; 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)){ if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0" defaultActiveKeys="0"
@ -114,7 +141,7 @@ class Contentpart extends Component {
} }
xinzenw=(url)=>{ xinzenw=(url)=>{
//只限制了教师 //只限制了教师
if(this.props.current_user.professional_certification===false){ if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2); this.HideAddcoursestypess(2);
return return
} }
@ -122,14 +149,76 @@ class Contentpart extends Component {
this.props.history.push(url); this.props.history.push(url);
} }
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
Testpapereditor=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.Testpapereditor(e)
}
showmodels=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodels(e)
}
showmodelysl=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelysl(e)
}
showmodelsInaudit=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelsInaudit(e)
}
render() { render() {
let {page,defaultActiveKeyss,mydisplay}=this.state; let {page,defaultActiveKeyss,mydisplay}=this.state;
let {defaultActiveKey,defaultActiveKeybool}=this.props; let {defaultActiveKey,defaultActiveKeybool}=this.props;
let defaultActiveKeys=defaultActiveKey+''; let defaultActiveKeys=defaultActiveKey+'';
let isysladmins=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; 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; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
try {
if(this.props){ if(this.props){
if(this.props.current_user){ if(this.props.current_user){
if(this.props.current_user.admin){ if(this.props.current_user.admin){
@ -141,6 +230,17 @@ class Contentpart extends Component {
} }
} }
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
const contents = ( const contents = (
<div className="questiontypes" style={{ <div className="questiontypes" style={{
width:'93px', width:'93px',
@ -215,7 +315,7 @@ class Contentpart extends Component {
</style> </style>
{ {
isysladmins===true||(is_teacher===true&&professional_certification===true)? isysladmins===true||is_teacher===true?
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e,true)}> <Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e,true)}>
<TabPane tab="公共" key="1"> <TabPane tab="公共" key="1">
</TabPane> </TabPane>
@ -252,7 +352,7 @@ class Contentpart extends Component {
` `
} }
</style> </style>
<div className={isysladmins===true||(is_teacher===true&&professional_certification===true)?"sortinxdirection":"xaxisreverseorder"}> <div className={isysladmins===true||is_teacher===true?"sortinxdirection":"xaxisreverseorder"}>
<Search <Search
style={{ width: "347px",marginRight:"60px",}} style={{ width: "347px",marginRight:"60px",}}
placeholder="请输入题目名称、内容" placeholder="请输入题目名称、内容"
@ -264,7 +364,7 @@ class Contentpart extends Component {
/> />
{ {
isysladmins===true||(is_teacher===true&&professional_certification===true)? isysladmins===true||is_teacher===true?
<div className="xaxisreverseorder" style={{ <div className="xaxisreverseorder" style={{
width:"50%" width:"50%"
}}> }}>
@ -326,9 +426,9 @@ class Contentpart extends Component {
: this.props.Contentdata.exams.map((object, index) => { : this.props.Contentdata.exams.map((object, index) => {
return ( return (
<Listjihe {...this.state} {...this.props} items={object} key={index} <Listjihe {...this.state} {...this.props} items={object} key={index}
Testpapereditor={(e)=>this.props.Testpapereditor(e)} Testpapereditor={(e)=>this.Testpapereditor(e)}
showmodels={(e)=>this.props.showmodels(e)} showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)} showmodelysl={(e)=>this.showmodelysl(e)}
Isitapopup={this.props.Isitapopup} Isitapopup={this.props.Isitapopup}
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)} showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)}
> >

@ -10,6 +10,7 @@ import {
Radio Radio
} from "antd"; } from "antd";
import './../testioncss/testioncss.css'; import './../testioncss/testioncss.css';
import Certifiedprofessional from "../../modals/Certifiedprofessional";
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
@ -23,12 +24,27 @@ class Listjihe extends Component {
name:"单选题", name:"单选题",
nd:"简单", nd:"简单",
chakanjiexibool:false, chakanjiexibool:false,
mydisplay:false,
occupation:2,
isysladmins:false,
} }
} }
//初始化 //初始化
componentDidMount(){ componentDidMount(){
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;
}
}
}
this.setState({
isysladmins:isysladmins
})
} }
chakanjiexibool=()=>{ chakanjiexibool=()=>{
@ -55,15 +71,31 @@ class Listjihe extends Component {
this.props.getitem_basketss(id); this.props.getitem_basketss(id);
} }
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
gotoseesj=(id)=>{ gotoseesj=(id)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.push(`/paperlibrary/see/${id}?defaultActiveKey=${this.props.defaultActiveKey}`); this.props.history.push(`/paperlibrary/see/${id}?defaultActiveKey=${this.props.defaultActiveKey}`);
} }
render() { render() {
let {page,name,nd,chakanjiexibool}=this.state; let {page,name,nd,chakanjiexibool,mydisplay}=this.state;
let {defaultActiveKey,items}=this.props; let {defaultActiveKey,items}=this.props;
const names= items&&items.name&&items.name; const names= items&&items.name&&items.name;
@ -77,6 +109,27 @@ class Listjihe extends Component {
return ( return (
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} > <div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
<div className="sortinxdirection w100s"> <div className="sortinxdirection w100s">
<div className="sjimg intermediatecenter"> <div className="sjimg intermediatecenter">
<img src={getImageUrl("images/educoder/shijuans.png")} className="imgtp"/> <img src={getImageUrl("images/educoder/shijuans.png")} className="imgtp"/>

Loading…
Cancel
Save