|
|
|
@ -14,9 +14,8 @@ 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,
|
|
|
|
@ -28,9 +27,16 @@ class ShixunWorkModal extends Component{
|
|
|
|
|
group_list:undefined
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
const newgroup_list=[];
|
|
|
|
|
response.data.group_list.map((item,key)=>{
|
|
|
|
|
newgroup_list.push(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:response.data.group_list
|
|
|
|
|
group_list:newgroup_list,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -43,7 +49,22 @@ class ShixunWorkModal extends Component{
|
|
|
|
|
|
|
|
|
|
//勾选实训
|
|
|
|
|
shixunhomeworkedit=(checkedValues)=>{
|
|
|
|
|
let types=false
|
|
|
|
|
let{group_list}=this.state;
|
|
|
|
|
group_list.map((item,key)=>{
|
|
|
|
|
checkedValues.map((list,li)=>{
|
|
|
|
|
if(item.id===list){
|
|
|
|
|
if(item.works_count<2){
|
|
|
|
|
this.props.showNotification(`有效作品数少于2个,无法查重`)
|
|
|
|
|
types=true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if(types===false){
|
|
|
|
|
if(checkedValues.length===group_list.length){
|
|
|
|
|
this.setState({
|
|
|
|
|
onChangetype:true,
|
|
|
|
@ -57,6 +78,8 @@ class ShixunWorkModal extends Component{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
contentViewScroll=(e)=>{
|
|
|
|
|
//滑动到底判断
|
|
|
|
|
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
|
|
|
|
@ -71,17 +94,33 @@ class ShixunWorkModal extends Component{
|
|
|
|
|
page:newpage,
|
|
|
|
|
}
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
response.data. course_groups.group_list&&response.data.group_list.map((item,key)=>{
|
|
|
|
|
newgroup_list.push(item)
|
|
|
|
|
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
|
|
|
|
|
})
|
|
|
|
|
response.data. course_groups.ungroup_list&&response.data.ungroup_list.map((items,keys)=>{
|
|
|
|
|
newgroup_list.push(items)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
});
|
|
|
|
@ -130,10 +169,10 @@ class ShixunWorkModal extends Component{
|
|
|
|
|
this.props.showNotification(`请先选择分班`);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(group_ids&&group_ids.length < 2){
|
|
|
|
|
this.props.showNotification(`有效作品数少于2个,无法查重`);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// if(group_ids&&group_ids.length < 2){
|
|
|
|
|
// this.props.showNotification(`有效作品数少于2个,无法查重`);
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
let url="/homework_commons/"+this.props.match.params.homeworkid+"/homework_code_repeat.json";
|
|
|
|
|
axios.post(url, {
|
|
|
|
@ -247,17 +286,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>
|
|
|
|
|
)
|
|
|
|
|