From 2a613bd6386f09527fcff34e7349383c3e8e1e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 5 Jul 2019 10:24:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/shixunHomework.js | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index ec2f5e4c0..9bf782d48 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -878,6 +878,7 @@ class ShixunHomework extends Component{ if(response.data&&response.data){ this.setState({ course_modules:response.data, + homework_categorys:response.data.homework_category }) } } @@ -1128,19 +1129,31 @@ class ShixunHomework extends Component{ {this.setState({dirSearchValue: e.target.value})}}/>

} - {/*{course_modules&&course_modules.main_category.map((item,key)=>{*/} - {/*return(*/} - {/*
  • this.moveTos(item.main_category_id)}>{item.main_category_name}
  • */} - {/*)*/} - {/*})}*/} + {course_modules&&course_modules.main_category.map((item,key)=>{ + return( + datas&&datas.category_id===null?datas.main_category_id===item.main_category_id?"":
  • this.moveTos(item.main_category_id)}>{item.main_category_name}
  • :"" + ) + })} - { course_modules&&course_modules.homework_category.filter((item)=> { + { course_modules&&course_modules.homework_category.filter((item,key)=> { return (!this.state.dirSearchValue || item.category_name.indexOf(this.state.dirSearchValue) != -1) }).map( (item,key) => { - return
  • this.moveTos(item.category_id )}>{item.category_name}
  • - })} - + return + datas&&datas.category_id!=null?datas.category_id===item.category_id?"":
  • this.moveTos(item.category_id )}>{item.category_name}
  • :"" + })} + + + + {course_modules&&course_modules.homework_category.length===0? +
    暂无数据
    :""} {/*{course_modules&&course_modules.homework_category.map((item,key)=>{*/} {/*return(*/}