From e5e2e2d4261b6720190a333de62d45a8d6b2a05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 29 Jun 2019 09:37:24 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' # Conflicts: # public/react/src/modules/courses/shixunHomework/Listofworks.js --- .../Shixunworkdetails/ShixunWorkModal.js | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index 55f44d971..572bc5715 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -21,7 +21,6 @@ class ShixunWorkModal extends Component{ page:1, } }).then((response) => { - console.log(response); if(response.data.group_list===undefined){ this.setState({ course_groups:response.data, @@ -50,19 +49,35 @@ 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, + group_ids:checkedValues + }) + }else{ + this.setState({ + group_ids:checkedValues, + onChangetype:false + }) + } + } - if(checkedValues.length===group_list.length){ - this.setState({ - onChangetype:true, - group_ids:checkedValues - }) - }else{ - this.setState({ - group_ids:checkedValues, - onChangetype:false - }) - } } contentViewScroll=(e)=>{