PCqiandao
杨树明 5 years ago
parent 35b8a229bd
commit f1d262847f

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

Loading…
Cancel
Save