杨树明 5 years ago
commit 6f7fa18f11

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

Loading…
Cancel
Save