From 8613995658c9668ba268dbafd73a379f94719b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 5 Sep 2019 09:39:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=8A=E4=BC=A0=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/AccessoryModal2.js | 15 +++++++----- .../courses/coursesPublic/SelectSetting.js | 24 +++++++++---------- .../courses/coursesPublic/sendResource.js | 23 +++++++++--------- .../src/modules/tpm/newshixuns/Newshixuns.js | 20 +++++++++------- 4 files changed, 44 insertions(+), 38 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js b/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js index a15cb0617..1f5dea3e8 100644 --- a/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js +++ b/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js @@ -34,12 +34,15 @@ class AccessoryModal2 extends Component{ } // 附件相关 START handleChange = (info) => { - let fileList = info.fileList; - console.log(fileList) - // for(var list of fileList ){ - // console.log(fileList) - // } - this.setState({ fileList }); + if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed'){ + let fileList = info.fileList; + console.log(fileList) + // for(var list of fileList ){ + // console.log(fileList) + // } + this.setState({ fileList }); + } + } onAttachmentRemove = (file) => { diff --git a/public/react/src/modules/courses/coursesPublic/SelectSetting.js b/public/react/src/modules/courses/coursesPublic/SelectSetting.js index 1a18513e7..37b22c205 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectSetting.js +++ b/public/react/src/modules/courses/coursesPublic/SelectSetting.js @@ -253,19 +253,19 @@ class Selectsetting extends Component{ // 附件相关 START handleChange = (info) => { - - let fileList = info.fileList; - if(info.file.status!="removed"){ - this.setState({ - fileList: appendFileSizeToUploadFileAll(fileList), - fileListtype:true - }); - }else{ - this.setState({ - fileList: appendFileSizeToUploadFileAll(fileList), - }); + if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + let fileList = info.fileList; + if (info.file.status != "removed") { + this.setState({ + fileList: appendFileSizeToUploadFileAll(fileList), + fileListtype: true + }); + } else { + this.setState({ + fileList: appendFileSizeToUploadFileAll(fileList), + }); + } } - } // onAttachmentRemove = (file) => { diff --git a/public/react/src/modules/courses/coursesPublic/sendResource.js b/public/react/src/modules/courses/coursesPublic/sendResource.js index a9ceb6405..fbc2ebeb2 100644 --- a/public/react/src/modules/courses/coursesPublic/sendResource.js +++ b/public/react/src/modules/courses/coursesPublic/sendResource.js @@ -86,17 +86,18 @@ class Sendresource extends Component{ } // 附件相关 START handleChange = (info) => { - - let fileList = info.fileList; - if(info.file.status!="removed"){ - this.setState({ - fileList: appendFileSizeToUploadFileAll(fileList), - fileListtype:true - }); - }else{ - this.setState({ - fileList: appendFileSizeToUploadFileAll(fileList), - }); + if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + let fileList = info.fileList; + if (info.file.status != "removed") { + this.setState({ + fileList: appendFileSizeToUploadFileAll(fileList), + fileListtype: true + }); + } else { + this.setState({ + fileList: appendFileSizeToUploadFileAll(fileList), + }); + } } } diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index d7b2b7d26..d2e26d58b 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -759,19 +759,21 @@ class Newshixuns extends Component { // 附件相关 START handleChange = (info) => { - let {fileList}=this.state; + if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + let {fileList} = this.state; - if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - console.log("handleChange1"); - // if(fileList.length===0){ + if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + console.log("handleChange1"); + // if(fileList.length===0){ let fileLists = info.fileList; this.setState({ // fileList:appendFileSizeToUploadFileAll(fileList), - fileList:fileLists, - deleteisnot:false}); - // } - } - + fileList: fileLists, + deleteisnot: false + }); + // } + } + } } onAttachmentRemove = (file) => { if(!file.percent || file.percent == 100){