|
|
|
@ -181,7 +181,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
on('editshixunname',this.editshixunchild)
|
|
|
|
|
on('editshixunmainname',this.editshixunmainname)
|
|
|
|
|
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
|
// this.props.updataleftNavfun();
|
|
|
|
|
// this.props.getleftNavid && this.props.getleftNavid("shixun_homework");
|
|
|
|
|
// const position =parseInt(this.props.match.params.position);
|
|
|
|
|
|
|
|
|
@ -239,50 +239,52 @@ class Coursesleftnav extends Component{
|
|
|
|
|
|
|
|
|
|
setnavid=(e,key,id,type,url)=>{
|
|
|
|
|
// this.props.getleftNavid && this.props.getleftNavid(key,type);
|
|
|
|
|
let {selectnavid,navid}=this.state;
|
|
|
|
|
|
|
|
|
|
if(navidtype===true&&selectnavid===false){
|
|
|
|
|
|
|
|
|
|
if(navid===key){
|
|
|
|
|
this.setState({
|
|
|
|
|
navid:"",
|
|
|
|
|
selectnavid:false,
|
|
|
|
|
newselectnavid:id
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
navid:key,
|
|
|
|
|
positiontype:type,
|
|
|
|
|
selectnavid:false,
|
|
|
|
|
newselectnavid:id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
// console.log(navidtype)
|
|
|
|
|
// console.log(selectnavid)
|
|
|
|
|
this.setState({
|
|
|
|
|
navid:"",
|
|
|
|
|
selectnavid:false,
|
|
|
|
|
newselectnavid:id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
|
this.props.history.replace( url );
|
|
|
|
|
e.stopPropagation();//阻止冒泡
|
|
|
|
|
// let {selectnavid,navid}=this.state;
|
|
|
|
|
//
|
|
|
|
|
// if(navidtype===true&&selectnavid===false){
|
|
|
|
|
//
|
|
|
|
|
// if(navid===key){
|
|
|
|
|
// this.setState({
|
|
|
|
|
// navid:"",
|
|
|
|
|
// selectnavid:false,
|
|
|
|
|
// newselectnavid:id
|
|
|
|
|
// })
|
|
|
|
|
// }else{
|
|
|
|
|
// this.setState({
|
|
|
|
|
// navid:key,
|
|
|
|
|
// positiontype:type,
|
|
|
|
|
// selectnavid:false,
|
|
|
|
|
// newselectnavid:id
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// }else{
|
|
|
|
|
// // console.log(navidtype)
|
|
|
|
|
// // console.log(selectnavid)
|
|
|
|
|
// this.setState({
|
|
|
|
|
// navid:"",
|
|
|
|
|
// selectnavid:false,
|
|
|
|
|
// newselectnavid:id
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// this.props.updataleftNavfun();
|
|
|
|
|
// this.props.history.replace( url );
|
|
|
|
|
// e.stopPropagation();//阻止冒泡
|
|
|
|
|
this.selectnavid(e,key,id,type,url)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
selectnavid=(e,key,id,type,urls,index)=>{
|
|
|
|
|
|
|
|
|
|
let {url}=this.state;
|
|
|
|
|
if(urls!=url){
|
|
|
|
|
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
|
this.props.history.replace(urls);
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
if (key === this.props.indexs) {
|
|
|
|
|
this.props.unlocationNavfun(undefined)
|
|
|
|
|
} else {
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
|
this.props.unlocationNavfun(key)
|
|
|
|
|
this.props.history.replace(urls);
|
|
|
|
|
}
|
|
|
|
@ -304,8 +306,9 @@ class Coursesleftnav extends Component{
|
|
|
|
|
url:urls,
|
|
|
|
|
indexs:index
|
|
|
|
|
})
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
|
this.props.history.replace(urls);
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -721,24 +724,27 @@ class Coursesleftnav extends Component{
|
|
|
|
|
e.stopPropagation();//阻止冒泡
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showsandians=(e,key,urls,num)=> {
|
|
|
|
|
showsandians=(e,key,urls,num,id,type,index)=> {
|
|
|
|
|
|
|
|
|
|
let {url}=this.state;
|
|
|
|
|
if (key === this.props.indexs) {
|
|
|
|
|
this.props.unlocationNavfun(undefined)
|
|
|
|
|
this.props.history.replace(urls);
|
|
|
|
|
} else {
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
|
this.props.unlocationNavfun(key)
|
|
|
|
|
this.props.history.replace(urls);
|
|
|
|
|
}
|
|
|
|
|
if(urls!=url){
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
|
this.props.history.replace(urls);
|
|
|
|
|
}
|
|
|
|
|
// if(this.props.indexs===undefined){
|
|
|
|
|
//
|
|
|
|
|
// }else{
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
this.setState({
|
|
|
|
|
selectnavid:true,
|
|
|
|
|
newselectnavid:id,
|
|
|
|
|
url:urls,
|
|
|
|
|
indexs:index
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
maincontent=(item,key)=>{
|
|
|
|
@ -930,8 +936,8 @@ class Coursesleftnav extends Component{
|
|
|
|
|
return(
|
|
|
|
|
<div key={key} >
|
|
|
|
|
<a>
|
|
|
|
|
<li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
|
|
|
|
|
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
|
|
|
|
|
<li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1,item.id,item.type)} className={this.props.mainurl===item.category_url?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
|
|
|
|
|
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1,item.id,item.type)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
|
|
|
|
|
{
|
|
|
|
|
item.type==="announcement"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-xiaoxi1 mr10 fl":"iconfont icon-xiaoxi1 mr10 fl"}></i>:
|
|
|
|
|
item.type==="online_learning"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-kecheng mr10 fl font-16":"iconfont icon-kecheng mr10 fl font-16"}></i>:
|
|
|
|
@ -976,7 +982,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
ref={provided.innerRef}
|
|
|
|
|
{...provided.droppableProps}
|
|
|
|
|
className={"droppableul"}
|
|
|
|
|
style={{display: this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}}
|
|
|
|
|
style={{display: key===this.props.indexs?"":"none"}}
|
|
|
|
|
>
|
|
|
|
|
{item.second_category===undefined?"":item.second_category.map((iem,index)=>{
|
|
|
|
|
if(item.type==="course_group"){
|
|
|
|
@ -1039,12 +1045,15 @@ class Coursesleftnav extends Component{
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
: course_modules===undefined?"":course_modules.map((item,key)=>{
|
|
|
|
|
|
|
|
|
|
if(key===this.props.indexs){
|
|
|
|
|
console.log(key)
|
|
|
|
|
console.log(this.props.indexs)
|
|
|
|
|
}
|
|
|
|
|
return(
|
|
|
|
|
<div key={key}>
|
|
|
|
|
{/*<Tooltip placement="bottom" title={"点击空白处展开二级菜单,点击模块名字跳转到对应模块"}>*/}
|
|
|
|
|
<a >
|
|
|
|
|
<li className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"}
|
|
|
|
|
<li className={this.props.mainurl===item.category_url?"liactive":"clearfix active"}
|
|
|
|
|
onClick={(e)=>this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)}
|
|
|
|
|
title={item.name.length<7?"":item.name}
|
|
|
|
|
>
|
|
|
|
@ -1069,11 +1078,8 @@ class Coursesleftnav extends Component{
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</a>
|
|
|
|
|
{/*</Tooltip>*/}
|
|
|
|
|
|
|
|
|
|
{/*下拉列表*/}
|
|
|
|
|
{/* className={this.props.location.pathname===item.category_url||this.props.location.pathname===this.state.url&&key===this.state.indexs?"":""}*/}
|
|
|
|
|
<ul style={{display:this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}} class="droppableul">
|
|
|
|
|
<ul style={{display:key===this.props.indexs?"":"none"}} class="droppableul">
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
item.second_category===undefined?"":item.second_category.map((iem,index)=>{
|
|
|
|
@ -1115,72 +1121,3 @@ class Coursesleftnav extends Component{
|
|
|
|
|
export default Coursesleftnav;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// sandianshow=(e,key)=>{
|
|
|
|
|
// this.setState({
|
|
|
|
|
// sandiantype:key
|
|
|
|
|
// })
|
|
|
|
|
// e.stopPropagation();//阻止冒泡
|
|
|
|
|
// }
|
|
|
|
|
// hidesandian=(e,key)=>{
|
|
|
|
|
// this.setState({
|
|
|
|
|
// sandiantypes:undefined
|
|
|
|
|
// })
|
|
|
|
|
// e.stopPropagation();//阻止冒泡
|
|
|
|
|
// }
|
|
|
|
|
// sandianshow=(e,key)=>{
|
|
|
|
|
// this.setState({
|
|
|
|
|
// sandiantype:key
|
|
|
|
|
// })
|
|
|
|
|
// e.stopPropagation();//阻止冒泡
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sandianhide=(e)=>{
|
|
|
|
|
// this.setState({
|
|
|
|
|
// sandiantype:undefined,
|
|
|
|
|
//
|
|
|
|
|
// })
|
|
|
|
|
// e.stopPropagation();//阻止冒泡
|
|
|
|
|
// }
|
|
|
|
|
// twosandianshows=(e,key,type)=>{
|
|
|
|
|
//
|
|
|
|
|
// this.setState({
|
|
|
|
|
// twosandiantypenum:key,
|
|
|
|
|
// toopvisible:false,
|
|
|
|
|
// toopvisibleindex:undefined,
|
|
|
|
|
// twosandiantypes:type
|
|
|
|
|
// })
|
|
|
|
|
// e.stopPropagation();//阻止冒泡
|
|
|
|
|
// }
|
|
|
|
|
// twoMouseLeave=(e)=>{
|
|
|
|
|
// this.setState({
|
|
|
|
|
// toopvisible:false,
|
|
|
|
|
// })
|
|
|
|
|
// e.stopPropagation();//阻止冒泡
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*{ is_teacher===true?*/}
|
|
|
|
|
{/* <div className={hidden_modules.length===0?"none":""}>*/}
|
|
|
|
|
{/* <li className="clearfix addjia ebebeb">*/}
|
|
|
|
|
{/* <span className="addtaskmodle">*/}
|
|
|
|
|
{/* <i className={addGroup===true?"iconfont icon-jia mr5 ml110 fl martop1":"none"} onClick={this.addGroupmodel}></i>*/}
|
|
|
|
|
{/* <div className={addGroup===false?"ml100":"none"} onClick={this.addGroupmodelsave}>确定</div>*/}
|
|
|
|
|
{/* </span>*/}
|
|
|
|
|
{/* </li>*/}
|
|
|
|
|
{/* </div> :""}*/}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*{ is_teacher===true?<div className={addGroup===false?"CheckboxGroup":"none"}>*/}
|
|
|
|
|
{/* <CheckboxGroup style={{ width: '100%' }} value={addCheckboxGroup} onChange={this.addCheckboxGroupID}>*/}
|
|
|
|
|
{/* {hidden_modules.length===0?"":hidden_modules.map((list,key)=>{*/}
|
|
|
|
|
{/* return(*/}
|
|
|
|
|
{/* <li className="clearfix pl20" key={key}>*/}
|
|
|
|
|
{/* <Checkbox value={list.id} className="fl "></Checkbox>*/}
|
|
|
|
|
{/* <span className="task-hide activity-left-name ml3">{list.name}</span>*/}
|
|
|
|
|
{/* </li>*/}
|
|
|
|
|
{/* )*/}
|
|
|
|
|
{/* })}*/}
|
|
|
|
|
{/* </CheckboxGroup>*/}
|
|
|
|
|
{/* </div> :""}*/}
|