diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index cf47cae00..b568a003a 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -1017,6 +1017,7 @@ class Coursesleftnav extends Component{ return(
+ {item.type!="statistics"?
  • this.showsandians(e,key,item.category_url,1,item.id,item.type)} className={this.props.mainurl===item.category_url&&this.props.location.pathname===item.category_url?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}> 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"}> { @@ -1050,7 +1051,7 @@ class Coursesleftnav extends Component{ :""} -
  • + :""} {/*下拉列表*/} @@ -1154,6 +1155,7 @@ class Coursesleftnav extends Component{
    {/**/} + {item.type!="statistics"?
  • this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)} title={item.name.length<7?"":item.name} @@ -1177,7 +1179,7 @@ class Coursesleftnav extends Component{ {item.task_count===0?"":item.task_count} -
  • + :""}
      diff --git a/public/react/src/modules/courses/statistics/Statistics.js b/public/react/src/modules/courses/statistics/Statistics.js index 9f53b14b2..c4d5ddfa6 100644 --- a/public/react/src/modules/courses/statistics/Statistics.js +++ b/public/react/src/modules/courses/statistics/Statistics.js @@ -12,42 +12,138 @@ class Statistics extends Component{ nd1:60, nd2:40, nd3:20, - data:undefined + data:undefined, + bomdata:undefined, + topisSpin:true, + bomisSpin:true, + sort:'desc', + course_groups:[], + page:1 } } componentDidMount() { - this.setState({ - isSpin:true, - }) + let {page,group_ids,sort}=this.state; let courseId=this.props.match.params.coursesId; let url=`/courses/${courseId}/statistics.json`; axios.get(url).then((result) => { if (result) { this.setState({ - data:result.data.top_scores + data:result.data.top_scores, + topisSpin:false }) } }).catch((error) => { console.log(error); this.setState({ - isSpins:false, + topisSpin:false, }) }) + + let courseurl=`/courses/${courseId}/all_course_groups.json`; + axios.get(courseurl).then((result) => { + if (result) { + this.setState({ + course_groups:result.data.course_groups + }) + let list=result.data.course_groups; + if(list.length>0){ + this.setState({ + group_ids:[list[0].id], + }) + this.getwork_scoredata(page,[list[0].id],sort); + } + } + }).catch((error) => { + console.log(error); + + }) } + getwork_scoredata=(page,group_ids,sort)=>{ + let courseId=this.props.match.params.coursesId; + let url=`/courses/${courseId}/work_score.json`; + let data={ + limit:20, + page:page, + group_ids:group_ids, + sort:sort + } + axios.get(url,{params: + data + }).then((result) => { + if (result) { + this.setState({ + bomdata:result.data.course_members, + bomisSpin:false + }) + } + }).catch((error) => { + console.log(error); + this.setState({ + bomisSpin:false, + }) + }) + } + + callback=(key)=>{ console.log(key); } render(){ - let {nd1,nd2,nd3,data}=this.state; + let {nd1,nd2,nd3,data,bomdata,course_groups}=this.state; + let course_grouptype=false + if(this.props&&this.props.course_modules!=undefined){ + {this.props&&this.props.course_modules.map((item,key)=>{ + if(item.type==="course_group"){ + course_grouptype=true + } + })} + } + + // const columns = [ + // { + // title: 'Name', + // dataIndex: 'name', + // sorter: true, + // render: name => `${name.first} ${name.last}`, + // width: '20%', + // }, + // { + // title: 'Gender', + // dataIndex: 'gender', + // filters: course_groups, + // width: '20%', + // }, + // { + // title: 'Email', + // dataIndex: 'email', + // }, + // ]; + + + // console.log(bomdata) + + + //common_score: 0 + // course_group: "威风威风急急急" + // exercise_score: "0.0" + // graduation_score: 0 + // group_score: 0 + // practice_score: 3232 + // total_score: 3232 + // user_login: "p40793521" + // user_name: "李明霞" + return(
      +
      +

      @@ -200,18 +296,26 @@ class Statistics extends Component{

      +
      + - Content of Tab Pane 1 + {/**/} Content of Tab Pane 2 +
      +
      )