|
|
|
@ -14,7 +14,7 @@ class Signedinlist extends Component {
|
|
|
|
|
limit:5,
|
|
|
|
|
page:1,
|
|
|
|
|
loading:false,
|
|
|
|
|
attendanceslist:[{id:undefined,name:"全部分班"}],
|
|
|
|
|
attendanceslist:[],
|
|
|
|
|
data:null,
|
|
|
|
|
group_ids:[],
|
|
|
|
|
members_count:0,
|
|
|
|
@ -42,9 +42,9 @@ class Signedinlist extends Component {
|
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
|
if(prevProps.headdata!=this.props.headdata){
|
|
|
|
|
|
|
|
|
|
let {attendanceslist}=this.state;
|
|
|
|
|
if(this.props.headdata){
|
|
|
|
|
let listattendanceslist=attendanceslist;
|
|
|
|
|
let listattendanceslist=[];
|
|
|
|
|
listattendanceslist.push({id:undefined,name:"全部分班"})
|
|
|
|
|
if(this.props.headdata.course_groups){
|
|
|
|
|
|
|
|
|
|
if(this.props.headdata.course_groups.length>0){
|
|
|
|
@ -54,7 +54,7 @@ class Signedinlist extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
listattendanceslist:listattendanceslist,
|
|
|
|
|
attendanceslist:listattendanceslist,
|
|
|
|
|
data:this.props.headdata,
|
|
|
|
|
course_members_count:this.props.headdata.normal_count,
|
|
|
|
|
attendance_count:this.props.headdata.all_count
|
|
|
|
@ -126,7 +126,7 @@ class Signedinlist extends Component {
|
|
|
|
|
let url=`/weapps/attendances/${this.props&&this.props.switattendance_id}.json`;
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
if(response.data){
|
|
|
|
|
|
|
|
|
|
listattendanceslist.push({id:undefined,name:"全部分班"})
|
|
|
|
|
if(response.data.course_groups.length>0){
|
|
|
|
|
response.data.course_groups.map((item,key)=>{
|
|
|
|
|
listattendanceslist.push(item)
|
|
|
|
@ -149,7 +149,7 @@ class Signedinlist extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
listattendanceslist:listattendanceslist,
|
|
|
|
|
attendanceslist:listattendanceslist,
|
|
|
|
|
data:response.data
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|