|
|
@ -51,6 +51,17 @@ class Testpaperlibrary extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
//初始化
|
|
|
|
//初始化
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
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 professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
|
|
|
|
|
|
|
|
let {defaultActiveKey} = this.state;
|
|
|
|
|
|
|
|
var defaultActiveKeys=defaultActiveKey;
|
|
|
|
|
|
|
|
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
|
|
|
|
|
|
|
|
defaultActiveKeys="1"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
defaultActiveKey:defaultActiveKeys
|
|
|
|
|
|
|
|
})
|
|
|
|
let url = `/users/get_navigation_info.json`;
|
|
|
|
let url = `/users/get_navigation_info.json`;
|
|
|
|
axios.get(url, {}).then((response) => {
|
|
|
|
axios.get(url, {}).then((response) => {
|
|
|
|
// ////console.log("开始请求/get_navigation_info.json");
|
|
|
|
// ////console.log("开始请求/get_navigation_info.json");
|
|
|
@ -80,7 +91,7 @@ class Testpaperlibrary extends Component {
|
|
|
|
discipline_id:this.state.discipline_id,
|
|
|
|
discipline_id:this.state.discipline_id,
|
|
|
|
sub_discipline_id:this.state.sub_discipline_id,
|
|
|
|
sub_discipline_id:this.state.sub_discipline_id,
|
|
|
|
tag_discipline_id:this.state.tag_discipline_id,
|
|
|
|
tag_discipline_id:this.state.tag_discipline_id,
|
|
|
|
public: this.state.defaultActiveKey,
|
|
|
|
public: defaultActiveKeys,
|
|
|
|
difficulty: this.state.difficulty,
|
|
|
|
difficulty: this.state.difficulty,
|
|
|
|
keywords: this.state.keywords,
|
|
|
|
keywords: this.state.keywords,
|
|
|
|
page: 1,
|
|
|
|
page: 1,
|
|
|
@ -417,6 +428,12 @@ class Testpaperlibrary extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state;
|
|
|
|
let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="newMain clearfix" ref={this.saveContainer}>
|
|
|
|
<div className="newMain clearfix" ref={this.saveContainer}>
|
|
|
|
{
|
|
|
|
{
|
|
|
|