@ -496,6 +496,15 @@ class Coursesleftnav extends Component{
saveNavmoda = ( ) => {
saveNavmoda = ( ) => {
let { Navmodaltypename , setnavid , NavmodalValue } = this . state ;
let { Navmodaltypename , setnavid , NavmodalValue } = this . state ;
let id = setnavid ;
let id = setnavid ;
if ( Navmodaltypename === 5 && NavmodalValue === "未分班" || Navmodaltypename === 2 && NavmodalValue === "未分班" ) {
this . setState ( {
NavmodalValuetype : true ,
NavmodalValues : "名称不能和未分班一样"
} )
return
}
if ( NavmodalValue === "" ) {
if ( NavmodalValue === "" ) {
this . setState ( {
this . setState ( {
NavmodalValuetype : true ,
NavmodalValuetype : true ,
@ -639,6 +648,7 @@ class Coursesleftnav extends Component{
}
}
onDragEnd = ( result ) => {
onDragEnd = ( result ) => {
debugger
// console.log(result)
// console.log(result)
// let {course_modules}=this.props;
// let {course_modules}=this.props;
// let newcourse_modules=course_modules;
// let newcourse_modules=course_modules;
@ -681,10 +691,10 @@ class Coursesleftnav extends Component{
this . droppablepost ( url , result . destination . index + 1 )
this . droppablepost ( url , result . destination . index + 1 )
} else if ( result . source . droppableId === "course_group" ) {
} else if ( result . source . droppableId === "course_group" ) {
if ( result . draggableId != 1 ) {
let url = "/course_groups/" + result . draggableId + "/move_category.json"
let url = "/course_groups/" + result . draggableId + "/move_category.json"
this . droppablepost ( url , result . destination . index )
this . droppablepost ( url , result . destination . index + 1 )
}
}
}
}
}
@ -825,8 +835,16 @@ class Coursesleftnav extends Component{
onInput = { this . setNavmodalValue }
onInput = { this . setNavmodalValue }
/ >
/ >
< / d i v >
< / d i v >
< style >
{ this . state . NavmodalValuetype === true ? < span className = { "color-red" } >
{
`
. ml70 {
margin - left : 70 px ;
}
`
}
< / s t y l e >
{ this . state . NavmodalValuetype === true ? < span className = { "ml70 color-red" } >
{ this . state . NavmodalValues }
{ this . state . NavmodalValues }
< / s p a n > : " " }
< / s p a n > : " " }
< div className = { this . state . NavmodalValuetype === true ? "clearfix mt20 edu-txt-center" : "clearfix mt50 edu-txt-center" } >
< div className = { this . state . NavmodalValuetype === true ? "clearfix mt20 edu-txt-center" : "clearfix mt50 edu-txt-center" } >
@ -842,7 +860,7 @@ class Coursesleftnav extends Component{
. droppableul {
. droppableul {
max - height : 500 px ;
max - height : 500 px ;
overflow - y : auto ;
overflow - y : auto ;
overflow :hidden auto ;
overflow -x :hidden ;
}
}
. mr13 {
. mr13 {
@ -858,8 +876,8 @@ class Coursesleftnav extends Component{
< 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 ) } 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" } >
< 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" } >
{
{
item . type === "announcement" ? < i className = { this . props . location . pathname === item . category _url ? "color-blue iconfont icon- daima mr10 fl": "iconfont icon-daima 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- daima mr10 fl": "iconfont icon-daima mr10 fl"} > < / i > :
item . type === "online_learning" ? < i className = { this . props . location . pathname === item . category _url ? "color-blue iconfont icon- xuexizhongxin mr10 fl": "iconfont icon-xuexizhongxin mr10 fl"} > < / i > :
item . type === "shixun_homework" ? < i className = { this . props . location . pathname === item . category _url ? "color-blue iconfont icon-daima mr10 fl" : "iconfont icon-daima mr10 fl" } > < / i > :
item . type === "shixun_homework" ? < i className = { this . props . location . pathname === item . category _url ? "color-blue iconfont icon-daima mr10 fl" : "iconfont icon-daima mr10 fl" } > < / i > :
item . type === "common_homework" ? < i className = { this . props . location . pathname === item . category _url ? "color-blue iconfont icon-putongzuoye mr10 fl" : "iconfont icon-putongzuoye mr10 fl" } > < / i > :
item . type === "common_homework" ? < i className = { this . props . location . pathname === item . category _url ? "color-blue iconfont icon-putongzuoye mr10 fl" : "iconfont icon-putongzuoye mr10 fl" } > < / i > :
item . type === "group_homework" ? < i className = { this . props . location . pathname === item . category _url ? "color-blue iconfont icon-fenzuzuoye mr10 fl" : "iconfont icon-fenzuzuoye mr10 fl" } > < / i > :
item . type === "group_homework" ? < i className = { this . props . location . pathname === item . category _url ? "color-blue iconfont icon-fenzuzuoye mr10 fl" : "iconfont icon-fenzuzuoye mr10 fl" } > < / i > :
@ -935,8 +953,9 @@ class Coursesleftnav extends Component{
< a className = "fl pl46 pd0 Draggablelichild" >
< a className = "fl pl46 pd0 Draggablelichild" >
< span className = { this . props . location . pathname === iem . second _category _url ? "color-blue fl ml38 maxwidth155 task-hide Draggablelichild" : "fl ml38 maxwidth155 task-hide Draggablelichild" } > { iem . category _name } < / s p a n >
< span className = { this . props . location . pathname === iem . second _category _url ? "color-blue fl ml38 maxwidth155 task-hide Draggablelichild" : "fl ml38 maxwidth155 task-hide Draggablelichild" } > { iem . category _name } < / s p a n >
< span className = { twosandiantype === undefined ? this . props . location . pathname === iem . second _category _url ? "fr mr20 color-blue Draggablelichild font-14" : "fr mr20 color999 Draggablelichild font-14" : item . type === twosandiantypes && twosandiantype === index ?"none" : this . props . location . pathname === iem . second _category _url ? "fr mr20 color-blue Draggablelichild font-14" : "fr mr20 color999 Draggablelichild font-14" } > { iem . category _count === 0 ? "" : iem . category _count } < / s p a n >
< span className = { twosandiantype === undefined ? this . props . location . pathname === iem . second _category _url ? "fr mr20 color-blue Draggablelichild font-14" : "fr mr20 color999 Draggablelichild font-14" : item . type === twosandiantypes && twosandiantype === index &&iem . category _id != 0 ?"none" : this . props . location . pathname === iem . second _category _url ? "fr mr20 color-blue Draggablelichild font-14" : "fr mr20 color999 Draggablelichild font-14" } > { iem . category _count === 0 ? "" : iem . category _count } < / s p a n >
{ item . type === twosandiantypes && twosandiantype === index ?
{ item . type === twosandiantypes && twosandiantype === index ?
iem . category _id === 0 ? "" :
iem . category _type === "graduation_topics" || iem . category _type === "graduation_tasks" ?
iem . category _type === "graduation_topics" || iem . category _type === "graduation_tasks" ?
< span className = { "fr mr20 color999 Draggablelichild font-14" } > { iem . category _count === 0 ? "" : iem . category _count } < / s p a n >
< span className = { "fr mr20 color999 Draggablelichild font-14" } > { iem . category _count === 0 ? "" : iem . category _count } < / s p a n >
: < Popover placement = "right" content = { this . content ( item , iem , index ) } trigger = "hover" key = { index } >
: < Popover placement = "right" content = { this . content ( item , iem , index ) } trigger = "hover" key = { index } >