杨树明 5 years ago
commit 6f7fa18f11

@ -28,15 +28,13 @@ class ShixunWorkModal extends Component{
group_list:undefined group_list:undefined
}) })
}else{ }else{
let newgroup_list=group_list; const newgroup_list=[];
response.data.group_list.map((item,key)=>{ response.data.group_list.map((item,key)=>{
newgroup_list.push(item) newgroup_list.push(item)
console.log(item);
}) })
response.data.ungroup_list.map((items,keys)=>{ if( response.data.ungroup_list!== undefined || response.data.ungroup_list !== null){
newgroup_list.push(item) newgroup_list.push(response.data.ungroup_list)
console.log(item); }
})
this.setState({ this.setState({
course_groups:response.data, course_groups:response.data,
group_list:newgroup_list, group_list:newgroup_list,
@ -81,17 +79,33 @@ class ShixunWorkModal extends Component{
page:newpage, page:newpage,
} }
}).then((response) => { }).then((response) => {
response.data.group_list&&response.data.group_list.map((item,key)=>{ if(response!==null || response!==undefined){
newgroup_list.push(item) if(response.data.group_list.length>0){
}) console.log("84");
response.data.ungroup_list&&response.data.ungroup_list.map((items,keys)=>{ response.data.group_list.map((item,key)=>{
newgroup_list.push(items) newgroup_list.push(item);
}) this.setState({
this.setState({ course_groups:response.data,
course_groups:response.data, group_list:newgroup_list,
group_list:newgroup_list, page:newpage
page:newpage })
}) })
}
if(response.data.ungroup_list===undefined || response.data.ungroup_list === null) {
}else {
console.log("95");
console.log(response.data.ungroup_list);
newgroup_list.push(response.data.ungroup_list);
this.setState({
course_groups:response.data,
group_list:newgroup_list,
page:newpage
})
}
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -257,17 +271,17 @@ class ShixunWorkModal extends Component{
<Checkbox <Checkbox
className="fl task-hide edu-txt-left" className="fl task-hide edu-txt-left"
name="shixun_homework[]" name="shixun_homework[]"
value={item.id} value={item=== undefined?"":item.id}
> >
<label style={{"textAlign": "left", "color": "#05101A"}} <label style={{"textAlign": "left", "color": "#05101A"}}
className="task-hide color-grey-name" title="frerere">{item.name}</label> className="task-hide color-grey-name" title="frerere">{item===undefined?"":item.name}</label>
</Checkbox> </Checkbox>
</li> </li>
<li className="fl" style={{width: '150px'}}> <li className="fl" style={{width: '150px'}}>
{item.works_count} {item===undefined?"":item.works_count}
</li> </li>
<li className="fl" style={{width: '160px'}}> <li className="fl" style={{width: '160px'}}>
{item.last_review_time} {item===undefined?"":item.last_review_time}
</li> </li>
</div> </div>
) )

Loading…
Cancel
Save