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

@ -1,5 +1,6 @@
import React, { Component } from "react"; import React, {Component} from "react";
import { SnackbarHOC } from 'educoder'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
Breadcrumb Breadcrumb
@ -26,7 +27,8 @@ class Paperlibraryeditid extends Component {
knowledgepoints: [], knowledgepoints: [],
disciplmy: [], disciplmy: [],
item_banksedit: [], 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() { render() {
let { paperlibrartdata, newmyshixunmodelbool } = this.state; let {paperlibrartdata,newmyshixunmodelbool,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params; const params = this.props && this.props.match && this.props.match.params;
// //console.log("newmyshixunmodelbool"); let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
// //console.log(newmyshixunmodelbool);
return ( return (
<div> <div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter " <div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
@ -237,7 +259,7 @@ class Paperlibraryeditid extends Component {
<div className="w100s mt30"> <div className="w100s mt30">
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item className={"shubiao"} >试卷库</Breadcrumb.Item> <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.Item className={"shubiao"}>试卷编辑</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
</div> </div>
@ -293,8 +315,8 @@ class Paperlibraryeditid extends Component {
{ {
newmyshixunmodelbool === true ? "" : newmyshixunmodelbool === true ? "" :
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"} <Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)} setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit> onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
} }
</div> </div>
) )

@ -1,5 +1,6 @@
import React, { Component } from "react"; import React, {Component} from "react";
import { SnackbarHOC } from 'educoder'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { Breadcrumb } from "antd"; import { Breadcrumb } from "antd";
import TPMIndexHOC from "../tpm/TPMIndexHOC"; import TPMIndexHOC from "../tpm/TPMIndexHOC";
@ -14,7 +15,8 @@ class Paperlibraryseeid extends Component {
super(props); super(props);
this.contentMdRef = React.createRef(); this.contentMdRef = React.createRef();
this.state = { this.state = {
paperlibrartdata: [], paperlibrartdata:[],
defaultActiveKey:"0",
} }
@ -26,7 +28,24 @@ class Paperlibraryseeid extends Component {
componentDidMount() { componentDidMount() {
////console.log("Paperlibraryseeid"); ////console.log("Paperlibraryseeid");
this.getdata(); 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; this.contentMdRef = Ref;
} }
render() { render() {
let { paperlibrartdata } = this.state; let {paperlibrartdata,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params; const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params); // ////console.log(params);
let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
return ( return (
<div> <div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter " <div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
@ -103,7 +123,7 @@ class Paperlibraryseeid extends Component {
<div className="w100s mt30"> <div className="w100s mt30">
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item className={"shubiao"} >试卷库</Breadcrumb.Item> <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.Item className={"shubiao"}>试卷查看</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
</div> </div>
@ -159,8 +179,8 @@ class Paperlibraryseeid extends Component {
</div> </div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"} <Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)} setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit> onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
</div> </div>
) )

@ -70,6 +70,9 @@ class Testpaperlibrary extends Component {
}) })
} }
}); });
} }
paginationonChange = (pages) => { paginationonChange = (pages) => {
@ -332,8 +335,13 @@ class Testpaperlibrary extends Component {
}) })
}; };
<<<<<<< HEAD
Testpapereditor = (id) => { Testpapereditor = (id) => {
this.props.history.push(`/paperlibrary/edit/${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 React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; 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 axios from 'axios';
import { import {
notification, notification,
@ -24,12 +24,32 @@ class Contentpart extends Component {
super(props); super(props);
this.state = { this.state = {
page:1, page:1,
defaultActiveKeyss:"0",
} }
} }
//初始化 //初始化
componentDidMount(){ 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{ }else{
defaultActiveKeys="1" defaultActiveKeys="1"
} }
if (this.state.defaultActiveKeyss==="0"){
defaultActiveKeys="0"
} else {
defaultActiveKeys="1"
}
this.props.callback(defaultActiveKeys); this.props.callback(defaultActiveKeys);
} }
} }
render() { render() {
let {page}=this.state; let {page,defaultActiveKeyss}=this.state;
let {defaultActiveKey}=this.props; 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 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;
@ -79,6 +104,12 @@ class Contentpart extends Component {
</div> </div>
); );
if(defaultActiveKeyss==="0"){
defaultActiveKeys="0";
}else {
defaultActiveKeys="1";
}
return ( return (
<div className=" clearfix mt25"> <div className=" clearfix mt25">

@ -58,7 +58,7 @@ class Listjihe extends Component {
gotoseesj=(id)=>{ 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 update_times=items&&items.update_time&&items.update_time;
const quotess =items&&items.quotes&&items.quotes; const quotess =items&&items.quotes&&items.quotes;
const authors=items&&items.author&&items.author.name; const authors=items&&items.author&&items.author.name;
return ( return (
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} > <div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
<div className="sortinxdirection w100s"> <div className="sortinxdirection w100s">

Loading…
Cancel
Save