PCqiandao
杨树明 5 years ago
parent 8435bd7d1d
commit cfa86f295b

@ -35,28 +35,28 @@ class Signedinlist extends Component {
componentDidMount() { componentDidMount() {
let {attendanceslist}=this.state; let {attendanceslist}=this.state;
let listattendanceslist=attendanceslist if(this.props.headdata){
let url=`/weapps/attendances/${this.props&&this.props.switattendance_id}.json`; let listattendanceslist=attendanceslist;
axios.get(url).then((response) => { if(headdata.course_groups){
if(response.data){
if(response.data.course_groups.length>0){ if(headdata.course_groups.length>0){
response.data.course_groups.map((item,key)=>{ headdata.course_groups.map((item,key)=>{
listattendanceslist.push(item) 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.getdatas(this.props&&this.props.switattendance_id,1,[],undefined)
// this.getpath()
} }
getdatas=(id,page,group_ids,attendance_status)=>{ getdatas=(id,page,group_ids,attendance_status)=>{
@ -90,7 +90,7 @@ class Signedinlist extends Component {
}); });
} }
handleChangegroup_ids=(e)=>{ handleChangegroup_ids=(value)=>{
let neval let neval
if(!value){ if(!value){
neval=[] neval=[]
@ -107,7 +107,7 @@ class Signedinlist extends Component {
let {page,attendance_status}=this.state; let {page,attendance_status}=this.state;
this.getdatas(this.props&&this.props.switattendance_id,page,neval,attendance_status) this.getdatas(this.props&&this.props.switattendance_id,page,neval,attendance_status)
if(this.props.defaultActiveKey==="1"){ if(this.props.defaultActiveKey==="1"){
this.getpath(e) this.getpath(value)
} }
} }
@ -123,7 +123,7 @@ class Signedinlist extends Component {
listattendanceslist.push(item) listattendanceslist.push(item)
}) })
} }
if(e){ if(id){
response.data.course_groups.map((item,key)=>{ response.data.course_groups.map((item,key)=>{
if(item.id===id){ if(item.id===id){
this.setState({ this.setState({
@ -240,7 +240,7 @@ class Signedinlist extends Component {
]; ];
return( return(
<div> <React.Fragment>
<Row className={"mt20"}> <Row className={"mt20"}>
<Col span={12}> <Col span={12}>
<Row gutter={[{ xs: 8, sm: 16, md: 24, lg: 32 }, 20]}> <Row gutter={[{ xs: 8, sm: 16, md: 24, lg: 32 }, 20]}>
@ -301,7 +301,7 @@ class Signedinlist extends Component {
pageSize={this.state.limit} pageSize={this.state.limit}
total={this.state.members_count}></Pagination> total={this.state.members_count}></Pagination>
</div> </div>
</div> </React.Fragment>
) )
} }

Loading…
Cancel
Save