From cfa86f295bff5a02f79187bf311b39f53687868e 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, 13 Mar 2020 23:30:20 +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/signin/student/Signedinlist.js | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/public/react/src/modules/courses/signin/student/Signedinlist.js b/public/react/src/modules/courses/signin/student/Signedinlist.js index 9a3060f27..17de0cabc 100644 --- a/public/react/src/modules/courses/signin/student/Signedinlist.js +++ b/public/react/src/modules/courses/signin/student/Signedinlist.js @@ -35,28 +35,28 @@ class Signedinlist extends Component { componentDidMount() { let {attendanceslist}=this.state; - let listattendanceslist=attendanceslist - let url=`/weapps/attendances/${this.props&&this.props.switattendance_id}.json`; - axios.get(url).then((response) => { - if(response.data){ + if(this.props.headdata){ + let listattendanceslist=attendanceslist; + if(headdata.course_groups){ - if(response.data.course_groups.length>0){ - response.data.course_groups.map((item,key)=>{ - listattendanceslist.push(item) - }) - } + if(headdata.course_groups.length>0){ + headdata.course_groups.map((item,key)=>{ + listattendanceslist.push(item) + }) + } + } + this.setState({ + listattendanceslist:listattendanceslist, + data:response.data, + course_members_count:headdata.all_count, + attendance_count:headdata.normal_count + }) + } - this.setState({ - listattendanceslist:attendanceslist, - data:response.data, - course_members_count:response.data.all_count, - attendance_count: response.data.normal_count - }) - } - }) this.getdatas(this.props&&this.props.switattendance_id,1,[],undefined) + // this.getpath() } getdatas=(id,page,group_ids,attendance_status)=>{ @@ -90,7 +90,7 @@ class Signedinlist extends Component { }); } - handleChangegroup_ids=(e)=>{ + handleChangegroup_ids=(value)=>{ let neval if(!value){ neval=[] @@ -107,7 +107,7 @@ class Signedinlist extends Component { let {page,attendance_status}=this.state; this.getdatas(this.props&&this.props.switattendance_id,page,neval,attendance_status) if(this.props.defaultActiveKey==="1"){ - this.getpath(e) + this.getpath(value) } } @@ -123,7 +123,7 @@ class Signedinlist extends Component { listattendanceslist.push(item) }) } - if(e){ + if(id){ response.data.course_groups.map((item,key)=>{ if(item.id===id){ this.setState({ @@ -240,7 +240,7 @@ class Signedinlist extends Component { ]; return( -
+ @@ -301,7 +301,7 @@ class Signedinlist extends Component { pageSize={this.state.limit} total={this.state.members_count}>
- + ) }