dev_newshixunModel
杨树明 5 years ago
parent c9e13c644c
commit d9716703f0

@ -299,7 +299,6 @@ class CoursesIndex extends Component{
this.historyArray = [window.location.pathname]; this.historyArray = [window.location.pathname];
this.props.history.listen( location => { this.props.history.listen( location => {
console.log(location);
this.historyArray.unshift(window.location.pathname); this.historyArray.unshift(window.location.pathname);
this.historyArray.length = 2; this.historyArray.length = 2;
//Do your stuff here //Do your stuff here

@ -181,7 +181,7 @@ class Coursesleftnav extends Component{
on('editshixunname',this.editshixunchild) on('editshixunname',this.editshixunchild)
on('editshixunmainname',this.editshixunmainname) on('editshixunmainname',this.editshixunmainname)
this.props.updataleftNavfun(); // this.props.updataleftNavfun();
// this.props.getleftNavid && this.props.getleftNavid("shixun_homework"); // this.props.getleftNavid && this.props.getleftNavid("shixun_homework");
// const position =parseInt(this.props.match.params.position); // const position =parseInt(this.props.match.params.position);
@ -239,50 +239,52 @@ class Coursesleftnav extends Component{
setnavid=(e,key,id,type,url)=>{ setnavid=(e,key,id,type,url)=>{
// this.props.getleftNavid && this.props.getleftNavid(key,type); // this.props.getleftNavid && this.props.getleftNavid(key,type);
let {selectnavid,navid}=this.state; // let {selectnavid,navid}=this.state;
//
if(navidtype===true&&selectnavid===false){ // if(navidtype===true&&selectnavid===false){
//
if(navid===key){ // if(navid===key){
this.setState({ // this.setState({
navid:"", // navid:"",
selectnavid:false, // selectnavid:false,
newselectnavid:id // newselectnavid:id
}) // })
}else{ // }else{
this.setState({ // this.setState({
navid:key, // navid:key,
positiontype:type, // positiontype:type,
selectnavid:false, // selectnavid:false,
newselectnavid:id // newselectnavid:id
}) // })
} // }
}else{ // }else{
// console.log(navidtype) // // console.log(navidtype)
// console.log(selectnavid) // // console.log(selectnavid)
this.setState({ // this.setState({
navid:"", // navid:"",
selectnavid:false, // selectnavid:false,
newselectnavid:id // newselectnavid:id
}) // })
} // }
this.props.updataleftNavfun(); //
this.props.history.replace( url ); // this.props.updataleftNavfun();
e.stopPropagation();//阻止冒泡 // this.props.history.replace( url );
// e.stopPropagation();//阻止冒泡
this.selectnavid(e,key,id,type,url)
} }
selectnavid=(e,key,id,type,urls,index)=>{ selectnavid=(e,key,id,type,urls,index)=>{
let {url}=this.state; let {url}=this.state;
if(urls!=url){ if(urls!=url){
this.props.updataleftNavfun();
this.props.history.replace(urls); this.props.history.replace(urls);
this.props.updataleftNavfun();
}else{ }else{
if (key === this.props.indexs) { if (key === this.props.indexs) {
this.props.unlocationNavfun(undefined) this.props.unlocationNavfun(undefined)
} else { } else {
this.props.updataleftNavfun();
this.props.unlocationNavfun(key) this.props.unlocationNavfun(key)
this.props.history.replace(urls); this.props.history.replace(urls);
} }
@ -304,8 +306,9 @@ class Coursesleftnav extends Component{
url:urls, url:urls,
indexs:index indexs:index
}) })
this.props.updataleftNavfun();
this.props.history.replace(urls); this.props.history.replace(urls);
this.props.updataleftNavfun();
} }
@ -721,24 +724,27 @@ class Coursesleftnav extends Component{
e.stopPropagation();//阻止冒泡 e.stopPropagation();//阻止冒泡
} }
showsandians=(e,key,urls,num)=> { showsandians=(e,key,urls,num,id,type,index)=> {
let {url}=this.state; let {url}=this.state;
if (key === this.props.indexs) { if (key === this.props.indexs) {
this.props.unlocationNavfun(undefined) this.props.unlocationNavfun(undefined)
this.props.history.replace(urls); this.props.history.replace(urls);
} else { } else {
this.props.updataleftNavfun();
this.props.unlocationNavfun(key) this.props.unlocationNavfun(key)
this.props.history.replace(urls); this.props.history.replace(urls);
} }
if(urls!=url){ if(urls!=url){
this.props.updataleftNavfun();
this.props.history.replace(urls); this.props.history.replace(urls);
} }
// if(this.props.indexs===undefined){ this.setState({
// selectnavid:true,
// }else{ newselectnavid:id,
// url:urls,
// } indexs:index
})
} }
maincontent=(item,key)=>{ maincontent=(item,key)=>{
@ -930,8 +936,8 @@ class Coursesleftnav extends Component{
return( return(
<div key={key} > <div key={key} >
<a> <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)}> <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)} 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"}> <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==="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>: 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} ref={provided.innerRef}
{...provided.droppableProps} {...provided.droppableProps}
className={"droppableul"} 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)=>{ {item.second_category===undefined?"":item.second_category.map((iem,index)=>{
if(item.type==="course_group"){ if(item.type==="course_group"){
@ -1039,12 +1045,15 @@ class Coursesleftnav extends Component{
}) })
: course_modules===undefined?"":course_modules.map((item,key)=>{ : course_modules===undefined?"":course_modules.map((item,key)=>{
if(key===this.props.indexs){
console.log(key)
console.log(this.props.indexs)
}
return( return(
<div key={key}> <div key={key}>
{/*<Tooltip placement="bottom" title={"点击空白处展开二级菜单,点击模块名字跳转到对应模块"}>*/} {/*<Tooltip placement="bottom" title={"点击空白处展开二级菜单,点击模块名字跳转到对应模块"}>*/}
<a > <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)} 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} title={item.name.length<7?"":item.name}
> >
@ -1069,11 +1078,8 @@ class Coursesleftnav extends Component{
</a> </a>
</li> </li>
</a> </a>
{/*</Tooltip>*/}
{/*下拉列表*/} <ul style={{display:key===this.props.indexs?"":"none"}} class="droppableul">
{/* 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">
{ {
item.second_category===undefined?"":item.second_category.map((iem,index)=>{ item.second_category===undefined?"":item.second_category.map((iem,index)=>{
@ -1115,72 +1121,3 @@ class Coursesleftnav extends Component{
export default Coursesleftnav; 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> :""}*/}

@ -150,13 +150,13 @@ class ExerciseListItem extends Component{
{ {
item.exercise_status ===2? item.exercise_status ===2?
<Tooltip title="提交剩余时间" placement="bottom"> <Tooltip title="提交剩余时间" placement="bottom">
<span className="mr20 fl">{item.exercise_left_time}</span> <span className="mr20 fl">{"提交剩余时间:"+item.exercise_left_time}</span>
</Tooltip>:"" </Tooltip>:""
} }
{ {
item.exercise_status ===3? item.exercise_left_time===null?"":item.exercise_status ===3?
<Tooltip title="截止剩余时间" placement="bottom"> <Tooltip title="截止剩余时间" placement="bottom">
<span className="mr20 fl">{item.exercise_left_time}</span> <span className="mr20 fl">{"截止剩余时间:"+item.exercise_left_time}</span>
</Tooltip>:"" </Tooltip>:""
} }
{/*{*/} {/*{*/}

@ -256,8 +256,8 @@ class GraduateTaskItem extends Component{
{discussMessage.commit_count===undefined?"":<span className="mr15 color-grey9 font-14">{discussMessage.commit_count} 已交</span>} {discussMessage.commit_count===undefined?"":<span className="mr15 color-grey9 font-14">{discussMessage.commit_count} 已交</span>}
{discussMessage.uncommit_count===undefined?"":<span className="mr15 color-grey9 font-14">{discussMessage.uncommit_count} 未交</span>} {discussMessage.uncommit_count===undefined?"":<span className="mr15 color-grey9 font-14">{discussMessage.uncommit_count} 未交</span>}
{/*<span className="mr15 color-grey9">{discussMessage.replies_count} 3 未评</span>*/} {/*<span className="mr15 color-grey9">{discussMessage.replies_count} 3 未评</span>*/}
<Tooltip title={discussMessage.task_status===1?"提交剩余时间":discussMessage.task_status===2?"补交剩余时间":""} placement="bottom"> <Tooltip title={discussMessage.task_status===1?"提交剩余时间":discussMessage.task_status===2?"补交剩余时间":"交叉评阅剩余时间"} placement="bottom">
<span className="mr15 color-grey9 font-14">{discussMessage.status_time}</span> <span className="mr15 color-grey9 font-14">{discussMessage.task_status===1?"提交剩余时间:"+discussMessage.status_time:discussMessage.task_status===2?"补交剩余时间:"+discussMessage.status_time:"交叉评阅剩余时间:"+discussMessage.status_time}</span>
</Tooltip> </Tooltip>
{/* { discussMessage.replies_count != 0 && <span className="mr15 color-grey9">{discussMessage.replies_count} </span> } {/* { discussMessage.replies_count != 0 && <span className="mr15 color-grey9">{discussMessage.replies_count} </span> }

@ -73,7 +73,7 @@ class PollListItem extends Component{
{ {
item.polls_status ==2 && item.publish_time !=null && item.polls_status ==2 && item.publish_time !=null &&
<Tooltip title="提交剩余时间"> <Tooltip title="提交剩余时间">
<span className="mr20 fl mt3">{formatDuring(t)}</span> <span className="mr20 fl mt3">{"提交剩余时间:"+formatDuring(t)}</span>
</Tooltip> </Tooltip>
} }
{ {

@ -514,8 +514,8 @@ class MessagSub extends Component {
<li className={typeysl && typeysl === "project" ? "active" : ""}><a <li className={typeysl && typeysl === "project" ? "active" : ""}><a
onClick={(s, i) => this.getdata("project", 1)}>项目提醒</a></li> onClick={(s, i) => this.getdata("project", 1)}>项目提醒</a></li>
<li className={typeysl && typeysl === "project_package" ? "active" : ""}><a {/*<li className={typeysl && typeysl === "project_package" ? "active" : ""}><a*/}
onClick={(s, i) => this.getdata("project_package", 1)}>众包提醒</a></li> {/*onClick={(s, i) => this.getdata("project_package", 1)}>众包提醒</a></li>*/}
<li className={typeysl && typeysl === "interaction" ? "active" : ""}><a <li className={typeysl && typeysl === "interaction" ? "active" : ""}><a
onClick={(s, i) => this.getdata("interaction", 1)}>互动提醒</a></li> onClick={(s, i) => this.getdata("interaction", 1)}>互动提醒</a></li>

Loading…
Cancel
Save