dev_aliyun2
杨树林 5 years ago committed by harry
parent 228b0a9d1c
commit d771065aaa

@ -1,5 +1,6 @@
import React, { Component } from "react";
import { SnackbarHOC } from 'educoder';
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import {
Breadcrumb
@ -26,7 +27,8 @@ class Paperlibraryeditid extends Component {
knowledgepoints: [],
disciplmy: [],
item_banksedit: [],
newmyshixunmodelbool: false,
newmyshixunmodelbool:false,
defaultActiveKey:"0",
}
@ -100,6 +102,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",
})
}
}
}
@ -196,10 +218,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 "
@ -237,7 +259,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>
@ -293,8 +315,8 @@ class Paperlibraryeditid extends Component {
{
newmyshixunmodelbool === true ? "" :
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
}
</div>
)

@ -1,5 +1,6 @@
import React, { Component } from "react";
import { SnackbarHOC } from 'educoder';
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import { Breadcrumb } from "antd";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
@ -14,7 +15,8 @@ class Paperlibraryseeid extends Component {
super(props);
this.contentMdRef = React.createRef();
this.state = {
paperlibrartdata: [],
paperlibrartdata:[],
defaultActiveKey:"0",
}
@ -26,7 +28,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",
})
}
}
}
@ -81,9 +100,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 "
@ -103,7 +123,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>
@ -159,8 +179,8 @@ class Paperlibraryseeid extends Component {
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
</div>
)

@ -70,6 +70,9 @@ class Testpaperlibrary extends Component {
})
}
});
}
paginationonChange = (pages) => {
@ -332,8 +335,13 @@ class Testpaperlibrary extends Component {
})
};
<<<<<<< HEAD
Testpapereditor = (id) => {
this.props.history.push(`/paperlibrary/edit/${id}`);
=======
Testpapereditor=(id)=>{
this.props.history.push(`/paperlibrary/edit/${id}?defaultActiveKey=${this.state.defaultActiveKey}`);
>>>>>>> ae8378b... 调整
}

@ -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