题库信息

dev_jupyter
杨树林 5 years ago
parent dd3e26a319
commit 4fee0697ad

@ -163,16 +163,30 @@ class Question extends Component {
//初始化
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"
}
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
public: defaultActiveKey,
public: defaultActiveKeys,
page:1,
per_page:10,
};
this.getdata(data);
this.setState({
defaultActiveKey:defaultActiveKeys
})
let url = `/users/get_navigation_info.json`;
axios.get(url, {}).then((response) => {

@ -120,8 +120,6 @@ class Contentpart extends Component {
);
const buttonWidth = 70;
//console.log("Contentpart");
//console.log(this.props);
return (
<div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s">
@ -146,20 +144,23 @@ class Contentpart extends Component {
`
}
</style>
<Tabs defaultActiveKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
{
isysladmins===true?
<TabPane tab="我的" key="0">
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
:is_teacher===true&&professional_certification===true?
<TabPane tab="我的" key="0">
</TabPane>
:""
}
</Tabs>
:
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
</Tabs>
}
</Tabs>
<div className=" mt19" style={{
position:"absolute",
@ -194,14 +195,7 @@ class Contentpart extends Component {
<div className="xaxisreverseorder">
{
defaultActiveKey===0||defaultActiveKey==="0"?
isysladmins===true?
<a onClick={(e)=>this.xinzenw(e)}>
<div className="newbutoon">
<p className="newbutoontes" >新增</p>
</div>
</a>
:
is_teacher===true&&professional_certification===true?
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<a onClick={(e)=>this.xinzenw(e)}>
<div className="newbutoon">
<p className="newbutoontes" >新增</p>

@ -51,6 +51,17 @@ class Testpaperlibrary extends Component {
//初始化
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`;
axios.get(url, {}).then((response) => {
// ////console.log("开始请求/get_navigation_info.json");
@ -80,7 +91,7 @@ class Testpaperlibrary extends Component {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
public: defaultActiveKeys,
difficulty: this.state.difficulty,
keywords: this.state.keywords,
page: 1,
@ -417,6 +428,12 @@ class Testpaperlibrary extends Component {
render() {
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 (
<div className="newMain clearfix" ref={this.saveContainer}>
{

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

Loading…
Cancel
Save