|
|
|
@ -14,23 +14,32 @@ class ShixunWorkModal extends Component{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
|
|
let {group_list}=this.state;
|
|
|
|
|
let url="/homework_commons/"+this.props.match.params.homeworkid+"/group_list.json";
|
|
|
|
|
|
|
|
|
|
axios.get(url,{params:{
|
|
|
|
|
limit:10,
|
|
|
|
|
page:1,
|
|
|
|
|
}
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
console.log(response);
|
|
|
|
|
if(response.data.group_list===undefined){
|
|
|
|
|
this.setState({
|
|
|
|
|
course_groups:response.data,
|
|
|
|
|
group_list:undefined
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
let newgroup_list=group_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);
|
|
|
|
|
})
|
|
|
|
|
this.setState({
|
|
|
|
|
course_groups:response.data,
|
|
|
|
|
group_list:response.data.group_list
|
|
|
|
|
group_list:newgroup_list,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -44,6 +53,7 @@ class ShixunWorkModal extends Component{
|
|
|
|
|
//勾选实训
|
|
|
|
|
shixunhomeworkedit=(checkedValues)=>{
|
|
|
|
|
let{group_list}=this.state;
|
|
|
|
|
|
|
|
|
|
if(checkedValues.length===group_list.length){
|
|
|
|
|
this.setState({
|
|
|
|
|
onChangetype:true,
|
|
|
|
@ -71,10 +81,10 @@ class ShixunWorkModal extends Component{
|
|
|
|
|
page:newpage,
|
|
|
|
|
}
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
response.data. course_groups.group_list&&response.data.group_list.map((item,key)=>{
|
|
|
|
|
response.data.group_list&&response.data.group_list.map((item,key)=>{
|
|
|
|
|
newgroup_list.push(item)
|
|
|
|
|
})
|
|
|
|
|
response.data. course_groups.ungroup_list&&response.data.ungroup_list.map((items,keys)=>{
|
|
|
|
|
response.data.ungroup_list&&response.data.ungroup_list.map((items,keys)=>{
|
|
|
|
|
newgroup_list.push(items)
|
|
|
|
|
})
|
|
|
|
|
this.setState({
|
|
|
|
|