From 1108d180b3c44e25477d41cc785d7d963543b05c 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 11:09:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E4=B8=8A=E4=BC=A0=E5=A4=A7=E5=B0=8F?= 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 55cd8c746..685324a46 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -473,11 +473,11 @@ class TPMDataset extends Component { beforeUpload: (file) => { //上传前的操作 // console.log('beforeUpload', file.name); - const isLt150M = file.size / 1024 / 1024 < 150; - if (!isLt150M) { - this.props.showNotification('文件大小必须小于150MB!'); + const isLt300M = file.size / 1024 / 1024 <= 300; + if (!isLt300M) { + this.props.showNotification('文件大小必须小于等于300MB!'); } - return isLt150M; + return isLt300M; }, }; // console.log("showmodelshowmodel"); From 699a3d35be51295a1143686fb891fcfc035bfa3d 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:03:12 +0800 Subject: [PATCH 2/2] =?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 | 46 +++++++++++++++---- .../src/modules/tpm/tpmmodel/tpmmodel.css | 2 +- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index 685324a46..9569c5174 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -1,6 +1,6 @@ import React, {Component} from 'react'; import {Redirect} from 'react-router'; -import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,notification} from 'antd'; +import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,Button} from 'antd'; import { NoneData } from 'educoder' import TPMRightSection from './component/TPMRightSection'; @@ -85,6 +85,7 @@ class TPMDataset extends Component { checked: false, showmodel:false, itemtypebool:false, + Buttonloading:false } } @@ -295,8 +296,12 @@ class TPMDataset extends Component { handleChange = (info) => { // console.log("handleChange123123"); // console.log(info); -// debugger + //debugger + this.setState({ + Buttonloading:true + }) if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){ + let fileList = info.fileList; this.setState({ fileList: appendFileSizeToUploadFileAll(fileList), @@ -309,7 +314,10 @@ class TPMDataset extends Component { }else{ this.getdatas(); - + this.setState({ + Buttonloading:false + }) + // this.props.showNotification(`上传成功`); } } } @@ -329,9 +337,13 @@ class TPMDataset extends Component { showmodel:true, tittest:info.file.response.message, itemtypebool:itemtype>-1?true:itemtype<=-1?false:false, + Buttonloading:false }) - }else{ + }else{ + this.setState({ + Buttonloading:false + }) } } @@ -445,7 +457,12 @@ class TPMDataset extends Component { showmodel: false, }) } - + ButtonloadinghandleChange=()=>{ + // this.props.showNotification(`zhzzzzz`); + // this.setState({ + // Buttonloading:true + // }) + } render() { const {tpmLoading, shixun, user, match} = this.props; const {columns, page, limit, selectedRowKeys,mylistansum,fileList,datalist,data_sets_count,loadingstate} = this.state; @@ -473,8 +490,13 @@ class TPMDataset extends Component { beforeUpload: (file) => { //上传前的操作 // console.log('beforeUpload', file.name); + this.props.showNotification(`文件上传中`); const isLt300M = file.size / 1024 / 1024 <= 300; + if (!isLt300M) { + this.setState({ + Buttonloading:false + }) this.props.showNotification('文件大小必须小于等于300MB!'); } return isLt300M; @@ -514,12 +536,20 @@ class TPMDataset extends Component { .ant-upload-list{ display:none } + .deletebuttom{ + color: #fff !important; + } + .deletebuttom:hover{ + color: #fff !important; + background: #29BD8B !important; + } ` } -
- - 上传文件