diff --git a/public/react/src/modules/courses/busyWork/CommonWorkPost.js b/public/react/src/modules/courses/busyWork/CommonWorkPost.js index 9a8e47daa..5e01b21a1 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkPost.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkPost.js @@ -138,13 +138,14 @@ class CommonWorkPost extends Component{ let {fileList,selectmemberslist,workslist, memberNumMin, memberNumMax}=this.state; let userids=[]; + if(selectmemberslist!=undefined&&selectmemberslist.length>0) { + for (var list of selectmemberslist) { - for(var list of selectmemberslist){ + if (list.user_id != undefined && list.user_id != null) { + userids.push(list.user_id) + } - if(list.user_id!=undefined&&list.user_id!=null){ - userids.push(list.user_id) } - } const isGroup = this.props.isGroup() if(!isGroup){ @@ -152,11 +153,11 @@ class CommonWorkPost extends Component{ } let listid=[]; - - for(var list of fileList){ - listid.push(list.id || list.response.id) + if(fileList!=undefined&&fileList.length>0) { + for (var list of fileList) { + listid.push(list.id || list.response.id) + } } - e.preventDefault(); if( true ){ this.props.form.validateFields((err, values) => { diff --git a/public/react/src/modules/courses/coursesPublic/AccessoryModal.js b/public/react/src/modules/courses/coursesPublic/AccessoryModal.js index aadfa770f..3b9563dbc 100644 --- a/public/react/src/modules/courses/coursesPublic/AccessoryModal.js +++ b/public/react/src/modules/courses/coursesPublic/AccessoryModal.js @@ -125,10 +125,11 @@ class AccessoryModal extends Component{ let {fileList,description} =this.state; let newfileList=[]; - for(var list of fileList){ + if(fileList!=undefined&&fileList.length>0) { + for (var list of fileList) { newfileList.push(list.response.id) } - + } if (newfileList.length == 0) { // this.props.showNotification('请先上传附件') if(this.props.modalname === "补交附件"){ @@ -194,8 +195,10 @@ class AccessoryModal extends Component{ let {fileList,description} =this.state; let newfileList=[]; - for(var list of fileList){ - newfileList.push(list.response.id) + if(fileList!=undefined&&fileList.length>0) { + for (var list of fileList) { + newfileList.push(list.response.id) + } } let url= this.props.reviseAttachmentUrl || "/graduation_works/"+id+"/revise_attachment.json" axios.post(url,{ diff --git a/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js b/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js index 1f5dea3e8..43c14f909 100644 --- a/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js +++ b/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js @@ -127,8 +127,10 @@ class AccessoryModal2 extends Component{ // debugger let {fileList,description} =this.state; let newfileList=[]; - for(var list of fileList){ - newfileList.push(list.response.id) + if(fileList!=undefined&&fileList.length>0) { + for (var list of fileList) { + newfileList.push(list.response.id) + } } this.props.Saves && this.props.Saves(newfileList, description) return; diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js index 1a9c1490e..e5431d55e 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js @@ -205,13 +205,15 @@ class GraduationTasksedit extends Component{ Commoninterface=(fileList)=>{ let listid=[] let graduation_id=this.state.data.graduation_id; - for(var list of fileList){ - if(list.response!=undefined){ - listid.push(list.response.id) - }else{ - listid.push(list.uid) - } + if(fileList!=undefined&&fileList.length>0) { + for (var list of fileList) { + if (list.response != undefined) { + listid.push(list.response.id) + } else { + listid.push(list.uid) + } + } } // console.log(listid) diff --git a/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js b/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js index afbe8de58..03e1429e5 100644 --- a/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js +++ b/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js @@ -35,10 +35,11 @@ class CreateGroupByImportModal extends Component{ return; } let newfileList=[]; - for(var list of fileList){ + if(fileList!=undefined&&fileList.length>0) { + for (var list of fileList) { newfileList.push(list.response.id) + } } - axios.post(url, { attachment_ids: newfileList })