mast_item_banktwo
杨树林 5 years ago
parent f35e9eb7ab
commit ae8378bf51

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import {
notification,
@ -37,6 +37,7 @@ class Paperlibraryeditid extends Component {
disciplmy: [],
item_banksedit: [],
newmyshixunmodelbool:false,
defaultActiveKey:"0",
}
@ -110,6 +111,26 @@ class Paperlibraryeditid extends Component {
}
});
const query = this.props.location.search;
const parsed = queryString.parse(query);
if(JSON.stringify(parsed)==="{}"){
this.setState({
defaultActiveKey:"0",
})
}else {
if(parsed.defaultActiveKey==="0"){
this.setState({
defaultActiveKey:"0",
})
}else{
this.setState({
defaultActiveKey:"1",
})
}
}
}
@ -206,10 +227,10 @@ class Paperlibraryeditid extends Component {
}
render() {
let {paperlibrartdata,newmyshixunmodelbool} = this.state;
let {paperlibrartdata,newmyshixunmodelbool,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log("newmyshixunmodelbool");
// //console.log(newmyshixunmodelbool);
let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
@ -247,7 +268,7 @@ class Paperlibraryeditid extends Component {
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item className={"shubiao"} >试卷库</Breadcrumb.Item>
<Breadcrumb.Item href="/paperlibrary">公开试卷库</Breadcrumb.Item>
<Breadcrumb.Item href={urlsysl}>{defaultActiveKey==="1"?"公开试卷库":"我的试卷库"}</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷编辑</Breadcrumb.Item>
</Breadcrumb>
</div>
@ -304,7 +325,7 @@ class Paperlibraryeditid extends Component {
newmyshixunmodelbool === true ? "" :
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
}
</div>
)

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import {
notification,
@ -26,6 +26,7 @@ class Paperlibraryseeid extends Component {
this.contentMdRef = React.createRef();
this.state = {
paperlibrartdata:[],
defaultActiveKey:"0",
}
@ -37,7 +38,24 @@ class Paperlibraryseeid extends Component {
componentDidMount() {
////console.log("Paperlibraryseeid");
this.getdata();
const query = this.props.location.search;
const parsed = queryString.parse(query);
if(JSON.stringify(parsed)==="{}"){
this.setState({
defaultActiveKey:"0",
})
}else {
if(parsed.defaultActiveKey==="0"){
this.setState({
defaultActiveKey:"0",
})
}else{
this.setState({
defaultActiveKey:"1",
})
}
}
}
@ -92,9 +110,10 @@ class Paperlibraryseeid extends Component {
this.contentMdRef = Ref;
}
render() {
let {paperlibrartdata} = this.state;
let {paperlibrartdata,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params);
let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
@ -114,7 +133,7 @@ class Paperlibraryseeid extends Component {
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item className={"shubiao"} >试卷库</Breadcrumb.Item>
<Breadcrumb.Item href="/paperlibrary">公开试卷库</Breadcrumb.Item>
<Breadcrumb.Item href={urlsysl}>{defaultActiveKey==="1"?"公开试卷库":"我的试卷库"}</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷查看</Breadcrumb.Item>
</Breadcrumb>
</div>
@ -171,7 +190,7 @@ class Paperlibraryseeid extends Component {
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
</div>
)

@ -77,6 +77,9 @@ class Testpaperlibrary extends Component {
})
}
});
}
paginationonChange=(pages)=>{
@ -340,7 +343,7 @@ class Testpaperlibrary extends Component {
};
Testpapereditor=(id)=>{
this.props.history.push(`/paperlibrary/edit/${id}`);
this.props.history.push(`/paperlibrary/edit/${id}?defaultActiveKey=${this.state.defaultActiveKey}`);
}

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import {
notification,
@ -24,12 +24,32 @@ class Contentpart extends Component {
super(props);
this.state = {
page:1,
defaultActiveKeyss:"0",
}
}
//初始化
componentDidMount(){
const query = this.props.location.search;
const parsed = queryString.parse(query);
console.log("Contentpart");
console.log(parsed);
if(JSON.stringify(parsed)==="{}"){
this.setState({
defaultActiveKeyss:"0",
})
}else {
if(parsed.defaultActiveKey==="0"){
this.setState({
defaultActiveKeyss:"0",
})
}else{
this.setState({
defaultActiveKeyss:"1",
})
}
}
}
//跳转人工组卷
@ -50,14 +70,19 @@ class Contentpart extends Component {
}else{
defaultActiveKeys="1"
}
if (this.state.defaultActiveKeyss==="0"){
defaultActiveKeys="0"
} else {
defaultActiveKeys="1"
}
this.props.callback(defaultActiveKeys);
}
}
render() {
let {page}=this.state;
let {page,defaultActiveKeyss}=this.state;
let {defaultActiveKey}=this.props;
const defaultActiveKeys=defaultActiveKey+'';
let defaultActiveKeys=defaultActiveKey+'';
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;
@ -79,6 +104,12 @@ class Contentpart extends Component {
</div>
);
if(defaultActiveKeyss==="0"){
defaultActiveKeys="0";
}else {
defaultActiveKeys="1";
}
return (
<div className=" clearfix mt25">

@ -58,7 +58,7 @@ class Listjihe extends Component {
gotoseesj=(id)=>{
this.props.history.push(`/paperlibrary/see/${id}`);
this.props.history.push(`/paperlibrary/see/${id}?defaultActiveKey=${this.props.defaultActiveKey}`);
}
@ -73,6 +73,8 @@ class Listjihe extends Component {
const update_times=items&&items.update_time&&items.update_time;
const quotess =items&&items.quotes&&items.quotes;
const authors=items&&items.author&&items.author.name;
return (
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
<div className="sortinxdirection w100s">

Loading…
Cancel
Save