From 35937ad3c4fb96ac06a9eaf5e9ad91d9c026a718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 9 Oct 2019 11:46:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B7=A6=E4=BE=A7=E8=AF=BE?= =?UTF-8?q?=E5=A0=82=E5=AF=BC=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 90 +++++++++++++++---- .../react/src/modules/courses/css/Courses.css | 1 + 2 files changed, 76 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 70794be19..a97a827b6 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -57,6 +57,7 @@ class Coursesleftnav extends Component{ positiontype:undefined, toopvisible:false, toopvisibleindex:undefined, + toopvisibleindexs:undefined, sandiantypes:undefined, antIcon:false, chapterupdate:false, @@ -314,7 +315,11 @@ class Coursesleftnav extends Component{ twosandianshow=(e,key,type)=>{ + // console.log("twosandianshow"); + // console.log(key); + // console.log(type); this.setState({ + toopvisibleindexs:key, twosandiantype:key, toopvisible:false, toopvisibleindex:undefined, @@ -322,11 +327,29 @@ class Coursesleftnav extends Component{ }) e.stopPropagation();//阻止冒泡 } - + twosandianshowys=(e,key,type)=>{ + // console.log("twosandianshow"); + // console.log(key); + // console.log(type); + this.setState({ + toopvisibleindexs:key, + }) + e.stopPropagation();//阻止冒泡 + } + twosandianshowyss=(e,key,type)=>{ + // console.log("twosandianshow"); + // console.log(key); + // console.log(type); + this.setState({ + toopvisibleindexs:undefined, + }) + e.stopPropagation();//阻止冒泡 + } twosandianhide=(e,index,type)=>{ // console.log(index) this.setState({ + toopvisibleindexs:undefined, twosandiantype:undefined, twosandiantypenum:undefined, toopvisible:true, @@ -336,6 +359,13 @@ class Coursesleftnav extends Component{ e.stopPropagation();//阻止冒泡 } + twosandianhideys=(e,index,type)=>{ + // console.log(index) + this.setState({ + toopvisibleindexs:undefined, + }) + e.stopPropagation();//阻止冒泡 + } //置顶 editSetup=(e,id)=>{ @@ -820,6 +850,7 @@ class Coursesleftnav extends Component{ ModalSave, loadtype, twosandiantypes, + toopvisibleindexs }=this.state; let {course_modules,hidden_modules,is_teacher} =this.props; @@ -992,6 +1023,8 @@ class Coursesleftnav extends Component{ } } } + // console.log(iem.category_name); + // console.log(iem.category_name.length); return( {(provided, snapshot) => ( {/*"/courses/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/} - -
  • this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)} + +
  • this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)} key={index} ref={provided.innerRef} {...provided.draggableProps} {...provided.dragHandleProps} - title={iem.category_name.length<10?"":iem.category_name} + // title={iem.category_name.length<10?"":iem.category_name} > - - {iem.category_name} + this.twosandianshowys(e,index,item.type)}>{iem.category_name} + {iem.category_count===0?"":iem.category_count} {item.type===twosandiantypes&&twosandiantype===index? iem.category_id===0?"": iem.category_type==="graduation_topics"||iem.category_type==="graduation_tasks"? - {iem.category_count===0?"":iem.category_count} - : + ( + iem.category_name.length<13? + {iem.category_count===0?"":iem.category_count} + : + + {iem.category_count===0?"":iem.category_count} + + ) + : + ( + iem.category_name.length<13? + this.twosandianshowyss(e)}> + + + : + + this.twosandianshowyss(e)}> - :""} + + + ) + :""} - {provided.placeholder} +
  • +
    )} @@ -1087,17 +1140,24 @@ class Coursesleftnav extends Component{ } } } + // console.log(iem.category_name); + // console.log(iem.category_name.length);一开始是10 显示是13 return( -
  • - this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > - - {/*{iem.category_name}*/} - {iem.category_name} + {/*title={iem.category_name.length<10?"":iem.category_name}*/} +
  • + + this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > + {/*{iem.category_name}*/} + {/*{iem.category_name.length<10?"":*/} + {/* iem.category_name}*/} + {iem.category_name} {iem.category_count===0?"":iem.category_count} +
  • + ) }) diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index 305c9f5f1..12c4e8d3e 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -427,6 +427,7 @@ a.white-btn.use_scope-btn:hover{ .ebebeb{border-bottom: 1px solid #EBEBEB;} .CheckboxGroup{background:rgba(249,249,249,1);} .maxwidth155{max-width: 155px; color:#666666;font-size: 14px;} +.maxwidth170{max-width: 170px; color:#666666;font-size: 14px;} .pl46{ margin-left: 46px !important; border-bottom: 1px solid #eeee; width: 90% !important;} .hidden{overflow: hidden;} .pd0{padding: 0px !important;}