Merge branch 'dev_item_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_new_shixunsrepository

dev_new_shixunsrepository
杨树林 5 years ago
commit 2c3f48c1a6

@ -163,16 +163,30 @@ class Question 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; let {defaultActiveKey} = this.state;
var defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="1"
}
var data = { var data = {
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: defaultActiveKey, public: defaultActiveKeys,
page:1, page:1,
per_page:10, per_page:10,
}; };
this.getdata(data); this.getdata(data);
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) => {
@ -816,7 +830,9 @@ class Question extends Component {
+ program_questions_count + program_questions_count
+ single_questions_count + single_questions_count
+ subjective_questions_count; + subjective_questions_count;
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 (
@ -878,15 +894,33 @@ class Question extends Component {
` `
} }
</style> </style>
<SiderBars {
Datacount={Datacount} isysladmins===true?
myvisible={visible} <SiderBars
{...this.props} Datacount={Datacount}
{...this.state} myvisible={visible}
showDrawer={() => this.showDrawer()} {...this.props}
Headertop={Headertop} {...this.state}
showDrawer={() => this.showDrawer()}
Headertop={Headertop}
/>
:
is_teacher===true&&professional_certification===true?
<SiderBars
Datacount={Datacount}
myvisible={visible}
{...this.props}
{...this.state}
showDrawer={() => this.showDrawer()}
Headertop={Headertop}
/>
:
""
}
/>
{/*顶部*/} {/*顶部*/}

@ -82,6 +82,11 @@ class Contentpart extends Component {
render() { render() {
let {page}=this.state; let {page}=this.state;
let {defaultActiveKey,item_type,booljupyterurls}=this.props; let {defaultActiveKey,item_type,booljupyterurls}=this.props;
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;
const content = ( const content = (
<div className="questiontypes" style={{ <div className="questiontypes" style={{
width:'93px', width:'93px',
@ -115,8 +120,6 @@ class Contentpart extends Component {
); );
const buttonWidth = 70; const buttonWidth = 70;
//console.log("Contentpart");
//console.log(this.props);
return ( return (
<div className=" clearfix mt25"> <div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s"> <div className="educontent mt10 pb20 w1200s">
@ -141,12 +144,23 @@ class Contentpart extends Component {
` `
} }
</style> </style>
<Tabs defaultActiveKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane> {
<TabPane tab="我的" key="0"> isysladmins===true||(is_teacher===true&&professional_certification===true)?
</TabPane> <Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
</Tabs> <TabPane tab="公共" key="1">
</TabPane>
<TabPane tab="我的" key="0">
</TabPane>
</Tabs>
:
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
</Tabs>
}
<div className=" mt19" style={{ <div className=" mt19" style={{
position:"absolute", position:"absolute",
@ -181,11 +195,13 @@ class Contentpart extends Component {
<div className="xaxisreverseorder"> <div className="xaxisreverseorder">
{ {
defaultActiveKey===0||defaultActiveKey==="0"? defaultActiveKey===0||defaultActiveKey==="0"?
<a onClick={(e)=>this.xinzenw(e)}> isysladmins===true||(is_teacher===true&&professional_certification===true)?
<div className="newbutoon"> <a onClick={(e)=>this.xinzenw(e)}>
<p className="newbutoontes" >新增</p> <div className="newbutoon">
</div> <p className="newbutoontes" >新增</p>
</a> </div>
</a>
:""
:"" :""
} }
@ -208,7 +224,7 @@ class Contentpart extends Component {
{ {
defaultActiveKey===0||defaultActiveKey==="0"? defaultActiveKey===0||defaultActiveKey==="0"?
<Search <Search
style={{ marginRight:"30px"}} style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"30px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"} className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容" placeholder="请输入题目名称、内容"
enterButton enterButton

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

@ -41,6 +41,12 @@ class Contentpart extends Component {
render() { render() {
let {page}=this.state; let {page}=this.state;
let {defaultActiveKey}=this.props; let {defaultActiveKey}=this.props;
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;
const contents = ( const contents = (
<div className="questiontypes" style={{ <div className="questiontypes" style={{
width:'93px', width:'93px',
@ -82,12 +88,20 @@ class Contentpart extends Component {
} }
</style> </style>
<Tabs defaultActiveKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}> {
<TabPane tab="公共" key="1"> isysladmins===true||(is_teacher===true&&professional_certification===true)?
</TabPane> <Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="我的" key="0"> <TabPane tab="公共" key="1">
</TabPane> </TabPane>
</Tabs> <TabPane tab="我的" key="0">
</TabPane>
</Tabs>
:
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
</Tabs>
}
<div className=" mt19" style={{ <div className=" mt19" style={{
position:"absolute", position:"absolute",
top: "0px", top: "0px",
@ -112,7 +126,7 @@ class Contentpart extends Component {
` `
} }
</style> </style>
<div className="sortinxdirection"> <div className={isysladmins===true||(is_teacher===true&&professional_certification===true)?"sortinxdirection":"xaxisreverseorder"}>
<Search <Search
style={{ width: "347px",marginRight:"60px",}} style={{ width: "347px",marginRight:"60px",}}
placeholder="请输入题目名称、内容" placeholder="请输入题目名称、内容"
@ -123,26 +137,26 @@ class Contentpart extends Component {
value={this.props.keywords} value={this.props.keywords}
/> />
{
<div className="xaxisreverseorder" style={{ isysladmins===true||(is_teacher===true&&professional_certification===true)?
width:"50%" <div className="xaxisreverseorder" style={{
}}> width:"50%"
}}>
<a href={'/question/newitem'}>
<div className="newbutoonss"> <a href={'/question/newitem'}>
<p className="newbutoontess" >智能组卷</p> <div className="newbutoonss">
</div> <p className="newbutoontess" >智能组卷</p>
</a> </div>
</a>
<a href={'/question'} >
<div className="newbutoons mr39"> <a href={'/question'} >
<p className="newbutoontess" >人工组卷</p> <div className="newbutoons mr39">
<p className="newbutoontess" >人工组卷</p>
</div>
</a>
</div> </div>
</a> :""
</div> }
</div> </div>

Loading…
Cancel
Save