From 49c76d14626d893643a52f7268263bcb327c0abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 23 Dec 2019 14:29:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMDataset.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index fca56b93d..1cb64df36 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -300,6 +300,11 @@ class TPMDataset extends Component { this.setState({ Buttonloading:true }) + if(!info.file.status){ + this.setState({ + Buttonloading:false + }) + } if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){ let fileList = info.fileList; @@ -323,9 +328,9 @@ class TPMDataset extends Component { } } }else{ - this.setState({ - Buttonloading:false - }) + // this.setState({ + // Buttonloading:false + // }) } if(info.file.response){ @@ -465,9 +470,9 @@ class TPMDataset extends Component { } ButtonloadinghandleChange=()=>{ // this.props.showNotification(`zhzzzzz`); - this.setState({ - Buttonloading:false - }) + // this.setState({ + // Buttonloading:false + // }) } render() { const {tpmLoading, shixun, user, match} = this.props; @@ -495,12 +500,11 @@ class TPMDataset extends Component { onRemove: this.onAttachmentRemove, beforeUpload: (file) => { //上传前的操作 - // console.log('beforeUpload', file.name); + console.log('beforeUpload', file); // this.props.showNotification(`文件上传中`); - const isLt400M = file.size / 1024 / 1024 <= 400; + const isLt400M = file.size / 1024 / 1024 <= 1; if (!isLt400M) { - this.ButtonloadinghandleChange this.props.showNotification('文件大小必须小于等于400MB!'); } return isLt400M;