|
|
|
@ -75,6 +75,7 @@ class TPMDataset extends Component {
|
|
|
|
|
mylistansum:30,
|
|
|
|
|
collaboratorList:[],
|
|
|
|
|
fileList:[],
|
|
|
|
|
fileListimg:[],
|
|
|
|
|
file:null,
|
|
|
|
|
datalist:[],
|
|
|
|
|
data_sets_count:0,
|
|
|
|
@ -263,18 +264,18 @@ 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)
|
|
|
|
|
// }
|
|
|
|
|
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'){
|
|
|
|
|
//done 成功就会调用这个方法
|
|
|
|
|
this.getdatas();
|
|
|
|
|
// this.props.showNotification(`上传文件成功`);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -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!');
|
|
|
|
|