mast_item_banktwo
杨树林 5 years ago
parent ae8378bf51
commit 8e4f47887f

@ -42,6 +42,7 @@ class Testpaperlibrary extends Component {
modalsType:false,
timuid:0,
modalsTypeInaudit:false,
defaultActiveKeybool:false,
}
}
getContainer = () => {
@ -122,12 +123,21 @@ class Testpaperlibrary extends Component {
}
this.getdata(data);
}
callback = (key) => {
callback = (key,bool) => {
try {
var currenturl = window.location.href;
var newUrl = (currenturl.split("?"))[0];
window.history.pushState('','',newUrl+'?defaultActiveKey='+key);
}catch (e) {
}
this.setState({
defaultActiveKey: key,
difficulty:null,
keyword:null,
page:1,
defaultActiveKeybool:bool,
})
var data={
page:1,
@ -477,7 +487,7 @@ class Testpaperlibrary extends Component {
showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.showmodelysl(e)}
setdatafuns={(key)=>this.setdatafuns(key)}
callback={(key)=>this.callback(key)}
callback={(key,bool)=>this.callback(key,bool)}
setdatafunsval={(key)=>this.setdatafunsval(key)}
setdifficulty={(bool)=>this.setdifficulty(bool)}
showmodelsInaudit={(e)=>this.showmodelsInaudit(e)}

@ -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"
}
if (this.state.defaultActiveKeyss==="0"){
defaultActiveKeys="0"
} else {
defaultActiveKeys="1"
try {
if(this.props.defaultActiveKeybool===false){
if (this.state.defaultActiveKeyss==="0"){
defaultActiveKeys="0"
} else {
defaultActiveKeys="1"
}
}
}catch (e) {
}
this.props.callback(defaultActiveKeys);
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,13 +112,16 @@ class Contentpart extends Component {
</div>
);
if(defaultActiveKeyss==="0"){
defaultActiveKeys="0";
}else {
defaultActiveKeys="1";
if(defaultActiveKeybool===false){
if(defaultActiveKeyss==="0"){
defaultActiveKeys="0";
}else {
defaultActiveKeys="1";
}
}
return (
<div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s">
@ -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>

Loading…
Cancel
Save