|
|
|
@ -29,12 +29,27 @@ class Contentpart extends Component {
|
|
|
|
|
chakanjiexibool:false,
|
|
|
|
|
mydisplay:false,
|
|
|
|
|
occupation:2,
|
|
|
|
|
url: ""
|
|
|
|
|
url: "",
|
|
|
|
|
isysladmins:false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//初始化
|
|
|
|
|
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
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
handleShowUploadImage = (url) => {
|
|
|
|
@ -51,7 +66,7 @@ class Contentpart extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chakanjiexibool=(index)=>{
|
|
|
|
|
if(this.props.current_user.professional_certification===false){
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -59,7 +74,7 @@ class Contentpart extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showmodels=(e)=>{
|
|
|
|
|
if(this.props.current_user.professional_certification===false){
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -67,7 +82,7 @@ class Contentpart extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showmodelsInaudit=(e)=>{
|
|
|
|
|
if(this.props.current_user.professional_certification===false){
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -75,7 +90,7 @@ class Contentpart extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showmodelysl=(e)=>{
|
|
|
|
|
if(this.props.current_user.professional_certification===false){
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -91,10 +106,11 @@ class Contentpart extends Component {
|
|
|
|
|
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;
|
|
|
|
|
try {
|
|
|
|
|
if(this.props){
|
|
|
|
|
if(this.props.current_user){
|
|
|
|
|
if(this.props.current_user.admin){
|
|
|
|
@ -106,6 +122,19 @@ class Contentpart extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(is_teacher===false){
|
|
|
|
|
if(this.props.current_user.user_identity !=="学生"){
|
|
|
|
|
//专业人士
|
|
|
|
|
is_teacher=true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
isysladmins:isysladmins
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
|
|
|
|
|
defaultActiveKeys="0"
|
|
|
|
|
}else{
|
|
|
|
@ -130,7 +159,7 @@ class Contentpart extends Component {
|
|
|
|
|
|
|
|
|
|
xinzenw=(e)=>{
|
|
|
|
|
//只限制了教师
|
|
|
|
|
if(this.props.current_user.professional_certification===false){
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -180,8 +209,15 @@ class Contentpart extends Component {
|
|
|
|
|
let {defaultActiveKey,item_type,booljupyterurls}=this.props;
|
|
|
|
|
const 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;
|
|
|
|
|
try {
|
|
|
|
|
if(is_teacher===false){
|
|
|
|
|
if(this.props.current_user.user_identity !=="学生"){
|
|
|
|
|
//专业人士
|
|
|
|
|
is_teacher=true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(this.props){
|
|
|
|
|
if(this.props.current_user){
|
|
|
|
|
if(this.props.current_user.admin){
|
|
|
|
@ -192,6 +228,9 @@ class Contentpart extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const content = (
|
|
|
|
|
<div className="questiontypes" style={{
|
|
|
|
|