From 9a8d4adad3a79a1bd43464ad70f9ca4f9cb80006 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 13:46:51 +0800 Subject: [PATCH 1/5] =?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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index 9569c5174..0cb5ba4f7 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -490,7 +490,7 @@ class TPMDataset extends Component { beforeUpload: (file) => { //上传前的操作 // console.log('beforeUpload', file.name); - this.props.showNotification(`文件上传中`); + // this.props.showNotification(`文件上传中`); const isLt300M = file.size / 1024 / 1024 <= 300; if (!isLt300M) { From 28d322ca91db400dcf5b7bc02ca9440539c04e15 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 13:51:59 +0800 Subject: [PATCH 2/5] =?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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index 0cb5ba4f7..0c380467a 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -491,15 +491,15 @@ class TPMDataset extends Component { //上传前的操作 // console.log('beforeUpload', file.name); // this.props.showNotification(`文件上传中`); - const isLt300M = file.size / 1024 / 1024 <= 300; + const isLt400M = file.size / 1024 / 1024 <= 400; - if (!isLt300M) { + if (!isLt400M) { this.setState({ Buttonloading:false }) - this.props.showNotification('文件大小必须小于等于300MB!'); + this.props.showNotification('文件大小必须小于等于400MB!'); } - return isLt300M; + return isLt400M; }, }; // console.log("showmodelshowmodel"); From 73412c733019eb292e84b2c8a22c786a1f753eda 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:06:40 +0800 Subject: [PATCH 3/5] =?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 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index 0c380467a..ecd004a92 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -459,9 +459,9 @@ class TPMDataset extends Component { } ButtonloadinghandleChange=()=>{ // this.props.showNotification(`zhzzzzz`); - // this.setState({ - // Buttonloading:true - // }) + this.setState({ + Buttonloading:false + }) } render() { const {tpmLoading, shixun, user, match} = this.props; @@ -494,9 +494,7 @@ class TPMDataset extends Component { const isLt400M = file.size / 1024 / 1024 <= 400; if (!isLt400M) { - this.setState({ - Buttonloading:false - }) + this.ButtonloadinghandleChange this.props.showNotification('文件大小必须小于等于400MB!'); } return isLt400M; @@ -548,7 +546,7 @@ class TPMDataset extends Component {
- +
{ data_sets_count>0? From 111cca2965ec29d9dd8c959f502115ebc7822498 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:14:39 +0800 Subject: [PATCH 4/5] =?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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index ecd004a92..fca56b93d 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -311,7 +311,9 @@ class TPMDataset extends Component { //done 成功就会调用这个方法 if(info.file.response){ if(info.file.response.status===-1||info.file.response.status==="-1"){ - + this.setState({ + Buttonloading:false + }) }else{ this.getdatas(); this.setState({ @@ -320,6 +322,10 @@ class TPMDataset extends Component { // this.props.showNotification(`上传成功`); } } + }else{ + this.setState({ + Buttonloading:false + }) } if(info.file.response){ 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 5/5] =?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;