From 249a434b87940b5b648382be64473a3822de4707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 13 Dec 2019 14:11:33 +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/config/webpack.config.prod.js | 4 +-- public/react/src/modules/tpm/TPMDataset.js | 33 +++++++++++++--------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 1fe7a6c93..596843f5f 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -326,8 +326,8 @@ module.exports = { comments: false }, compress: { - drop_debugger: true, - drop_console: true + drop_debugger: false, + drop_console: false } } }), diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index 918868392..dd15fd553 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -75,6 +75,7 @@ class TPMDataset extends Component { mylistansum:30, collaboratorList:[], fileList:[], + fileListimg:[], file:null, datalist:[], data_sets_count:0, @@ -263,19 +264,19 @@ class TPMDataset extends Component { handleChange = (info) => { if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){ let fileList = info.fileList; - - // for(var list of fileList ){ - // console.log(list) - // } - this.setState({ - fileList: appendFileSizeToUploadFileAll(fileList), - }); - if(info.file.status === 'done'){ - //done 成功就会调用这个方法 - this.getdatas(); - // this.props.showNotification(`上传文件成功`); - - } + if(info.file.status == "done"){ + for(var list of fileList ){ + console.log(list) + this.state.fileListimg.push(list); + } + this.setState({ + fileList: appendFileSizeToUploadFileAll(fileList), + fileListimg:this.state.fileListimg, + }); + if(info.file.status === 'done'){ + this.getdatas(); + } + } } } @@ -377,7 +378,7 @@ class TPMDataset extends Component { render() { const {tpmLoading, shixun, user, match} = this.props; - const {columns, page, limit, selectedRowKeys,mylistansum,fileList,datalist,data_sets_count,loadingstate} = this.state; + const {columns, page, limit, selectedRowKeys,mylistansum,fileList,datalist,data_sets_count,loadingstate,fileListimg} = this.state; const rowSelection = { selectedRowKeys, onChange: this.onSelectChange, @@ -400,10 +401,14 @@ class TPMDataset extends Component { // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList: false, action: `${getUploadActionUrl()}`, + showUploadList:false, onChange: this.handleChange, onRemove: this.onAttachmentRemove, beforeUpload: (file) => { + //上传前的操作 console.log('beforeUpload', file.name); + console.log("TPMDatasetTPMDatasetTPMDataset"); + console.log(fileListimg); const isLt150M = file.size / 1024 / 1024 < 150; if (!isLt150M) { this.props.showNotification('文件大小必须小于150MB!');