|
|
|
@ -64,24 +64,32 @@ class Contentpart extends Component {
|
|
|
|
|
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;
|
|
|
|
|
let {defaultActiveKey} = this.props;
|
|
|
|
|
var defaultActiveKeys=defaultActiveKey;
|
|
|
|
|
let defaultActiveKeys=defaultActiveKey;
|
|
|
|
|
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
|
|
|
|
|
defaultActiveKeys="0"
|
|
|
|
|
}else{
|
|
|
|
|
defaultActiveKeys="1"
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
if(this.props.defaultActiveKeybool===false){
|
|
|
|
|
if (this.state.defaultActiveKeyss==="0"){
|
|
|
|
|
defaultActiveKeys="0"
|
|
|
|
|
} else {
|
|
|
|
|
defaultActiveKeys="1"
|
|
|
|
|
}
|
|
|
|
|
this.props.callback(defaultActiveKeys);
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.props.callback(defaultActiveKeys,false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {page,defaultActiveKeyss}=this.state;
|
|
|
|
|
let {defaultActiveKey}=this.props;
|
|
|
|
|
let {defaultActiveKey,defaultActiveKeybool}=this.props;
|
|
|
|
|
let defaultActiveKeys=defaultActiveKey+'';
|
|
|
|
|
|
|
|
|
|
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
|
|
|
|
@ -104,11 +112,14 @@ class Contentpart extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if(defaultActiveKeybool===false){
|
|
|
|
|
if(defaultActiveKeyss==="0"){
|
|
|
|
|
defaultActiveKeys="0";
|
|
|
|
|
}else {
|
|
|
|
|
defaultActiveKeys="1";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
@ -139,14 +150,14 @@ class Contentpart extends Component {
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
isysladmins===true||(is_teacher===true&&professional_certification===true)?
|
|
|
|
|
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e)}>
|
|
|
|
|
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e,true)}>
|
|
|
|
|
<TabPane tab="公共" key="1">
|
|
|
|
|
</TabPane>
|
|
|
|
|
<TabPane tab="我的" key="0">
|
|
|
|
|
</TabPane>
|
|
|
|
|
</Tabs>
|
|
|
|
|
:
|
|
|
|
|
<Tabs activeKey={"1"} onChange={(e)=>this.props.callback(e)}>
|
|
|
|
|
<Tabs activeKey={"1"} onChange={(e)=>this.props.callback(e,true)}>
|
|
|
|
|
<TabPane tab="公共" key="1">
|
|
|
|
|
</TabPane>
|
|
|
|
|
</Tabs>
|
|
|
|
|