|
|
|
@ -28,6 +28,8 @@ class Contentpart extends Component {
|
|
|
|
|
defaultActiveKeyss:"0",
|
|
|
|
|
mydisplay:false,
|
|
|
|
|
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) {
|
|
|
|
|
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;
|
|
|
|
|
let defaultActiveKeys=defaultActiveKey;
|
|
|
|
|
try {
|
|
|
|
|
if(this.props){
|
|
|
|
|
if(this.props.current_user){
|
|
|
|
|
if(this.props.current_user.admin){
|
|
|
|
@ -78,6 +95,16 @@ class Contentpart extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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{
|
|
|
|
@ -114,7 +141,7 @@ class Contentpart extends Component {
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -122,23 +149,96 @@ class Contentpart extends Component {
|
|
|
|
|
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() {
|
|
|
|
|
let {page,defaultActiveKeyss,mydisplay}=this.state;
|
|
|
|
|
let {defaultActiveKey,defaultActiveKeybool}=this.props;
|
|
|
|
|
let defaultActiveKeys=defaultActiveKey+'';
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
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) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const contents = (
|
|
|
|
@ -215,7 +315,7 @@ class Contentpart extends Component {
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
isysladmins===true||(is_teacher===true&&professional_certification===true)?
|
|
|
|
|
isysladmins===true||is_teacher===true?
|
|
|
|
|
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e,true)}>
|
|
|
|
|
<TabPane tab="公共" key="1">
|
|
|
|
|
</TabPane>
|
|
|
|
@ -252,7 +352,7 @@ class Contentpart extends Component {
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<div className={isysladmins===true||(is_teacher===true&&professional_certification===true)?"sortinxdirection":"xaxisreverseorder"}>
|
|
|
|
|
<div className={isysladmins===true||is_teacher===true?"sortinxdirection":"xaxisreverseorder"}>
|
|
|
|
|
<Search
|
|
|
|
|
style={{ width: "347px",marginRight:"60px",}}
|
|
|
|
|
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={{
|
|
|
|
|
width:"50%"
|
|
|
|
|
}}>
|
|
|
|
@ -326,9 +426,9 @@ class Contentpart extends Component {
|
|
|
|
|
: this.props.Contentdata.exams.map((object, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<Listjihe {...this.state} {...this.props} items={object} key={index}
|
|
|
|
|
Testpapereditor={(e)=>this.props.Testpapereditor(e)}
|
|
|
|
|
showmodels={(e)=>this.props.showmodels(e)}
|
|
|
|
|
showmodelysl={(e)=>this.props.showmodelysl(e)}
|
|
|
|
|
Testpapereditor={(e)=>this.Testpapereditor(e)}
|
|
|
|
|
showmodels={(e)=>this.showmodels(e)}
|
|
|
|
|
showmodelysl={(e)=>this.showmodelysl(e)}
|
|
|
|
|
Isitapopup={this.props.Isitapopup}
|
|
|
|
|
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)}
|
|
|
|
|
>
|
|
|
|
|