|
|
@ -37,17 +37,17 @@ class Contentpart extends Component {
|
|
|
|
this.props.chakanjiexibool(index);
|
|
|
|
this.props.chakanjiexibool(index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
if (prevProps.current_user !== this.props.current_user) {
|
|
|
|
if(prevProps.current_user !== this.props.current_user) {
|
|
|
|
debugger
|
|
|
|
|
|
|
|
const isysladmins = this.props && this.props.current_user && this.props.current_user.admin ? this.props.current_user.admin : false;
|
|
|
|
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
|
|
|
|
const is_teacher = this.props && this.props.current_user && this.props.current_user.is_teacher ? this.props.current_user.is_teacher : 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;
|
|
|
|
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;
|
|
|
|
var defaultActiveKeys = defaultActiveKey;
|
|
|
|
var defaultActiveKeys=defaultActiveKey;
|
|
|
|
if (isysladmins === true || (is_teacher === true && professional_certification === true)) {
|
|
|
|
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
|
|
|
|
defaultActiveKeys = "0"
|
|
|
|
defaultActiveKeys="0"
|
|
|
|
} else {
|
|
|
|
}else{
|
|
|
|
defaultActiveKeys = "1"
|
|
|
|
defaultActiveKeys="1"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.props.callback(defaultActiveKeys);
|
|
|
|
this.props.callback(defaultActiveKeys);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -95,11 +95,12 @@ class Contentpart extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let { page } = this.state;
|
|
|
|
let {page}=this.state;
|
|
|
|
let { defaultActiveKey, item_type, booljupyterurls } = this.props;
|
|
|
|
let {defaultActiveKey,item_type,booljupyterurls}=this.props;
|
|
|
|
const isysladmins = this.props && this.props.current_user && this.props.current_user.admin ? this.props.current_user.admin : false;
|
|
|
|
const defaultActiveKeys=defaultActiveKey+'';
|
|
|
|
const is_teacher = this.props && this.props.current_user && this.props.current_user.is_teacher ? this.props.current_user.is_teacher : false;
|
|
|
|
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
|
|
|
|
const professional_certification = this.props && this.props.current_user && this.props.current_user.professional_certification ? this.props.current_user.professional_certification : 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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const content = (
|
|
|
|
const content = (
|
|
|
@ -165,15 +166,15 @@ class Contentpart extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
isysladmins === true || (is_teacher === true && professional_certification === true) ?
|
|
|
|
isysladmins===true||(is_teacher===true&&professional_certification===true)?
|
|
|
|
<Tabs activeKey={defaultActiveKey} onChange={(e) => this.props.callback(e)}>
|
|
|
|
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e)}>
|
|
|
|
<TabPane tab="公共" key="1">
|
|
|
|
<TabPane tab="公共" key="1">
|
|
|
|
</TabPane>
|
|
|
|
</TabPane>
|
|
|
|
<TabPane tab="我的" key="0">
|
|
|
|
<TabPane tab="我的" key="0">
|
|
|
|
</TabPane>
|
|
|
|
</TabPane>
|
|
|
|
</Tabs>
|
|
|
|
</Tabs>
|
|
|
|
:
|
|
|
|
:
|
|
|
|
<Tabs activeKey={1} onChange={(e) => this.props.callback(e)}>
|
|
|
|
<Tabs activeKey={"1"} onChange={(e)=>this.props.callback(e)}>
|
|
|
|
<TabPane tab="公共" key="1">
|
|
|
|
<TabPane tab="公共" key="1">
|
|
|
|
</TabPane>
|
|
|
|
</TabPane>
|
|
|
|
</Tabs>
|
|
|
|
</Tabs>
|
|
|
|