Merge branches 'dev_aliyun' and 'develop' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

chromesetting
杨树明 5 years ago
commit ec0375c7c0

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Redirect} from 'react-router'; 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 { NoneData } from 'educoder'
import TPMRightSection from './component/TPMRightSection'; import TPMRightSection from './component/TPMRightSection';
@ -85,6 +85,7 @@ class TPMDataset extends Component {
checked: false, checked: false,
showmodel:false, showmodel:false,
itemtypebool:false, itemtypebool:false,
Buttonloading:false
} }
} }
@ -295,8 +296,12 @@ class TPMDataset extends Component {
handleChange = (info) => { handleChange = (info) => {
// console.log("handleChange123123"); // console.log("handleChange123123");
// console.log(info); // console.log(info);
// debugger //debugger
this.setState({
Buttonloading:true
})
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){ if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ this.setState({
fileList: appendFileSizeToUploadFileAll(fileList), fileList: appendFileSizeToUploadFileAll(fileList),
@ -309,7 +314,10 @@ class TPMDataset extends Component {
}else{ }else{
this.getdatas(); this.getdatas();
this.setState({
Buttonloading:false
})
// this.props.showNotification(`上传成功`);
} }
} }
} }
@ -329,9 +337,13 @@ class TPMDataset extends Component {
showmodel:true, showmodel:true,
tittest:info.file.response.message, tittest:info.file.response.message,
itemtypebool:itemtype>-1?true:itemtype<=-1?false:false, 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, showmodel: false,
}) })
} }
ButtonloadinghandleChange=()=>{
// this.props.showNotification(`zhzzzzz`);
// this.setState({
// Buttonloading:true
// })
}
render() { render() {
const {tpmLoading, shixun, user, match} = this.props; 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} = this.state;
@ -473,11 +490,16 @@ class TPMDataset extends Component {
beforeUpload: (file) => { beforeUpload: (file) => {
//上传前的操作 //上传前的操作
// console.log('beforeUpload', file.name); // console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; this.props.showNotification(`文件上传中`);
if (!isLt150M) { const isLt300M = file.size / 1024 / 1024 <= 300;
this.props.showNotification('文件大小必须小于150MB!');
if (!isLt300M) {
this.setState({
Buttonloading:false
})
this.props.showNotification('文件大小必须小于等于300MB!');
} }
return isLt150M; return isLt300M;
}, },
}; };
// console.log("showmodelshowmodel"); // console.log("showmodelshowmodel");
@ -514,12 +536,20 @@ class TPMDataset extends Component {
.ant-upload-list{ .ant-upload-list{
display:none display:none
} }
.deletebuttom{
color: #fff !important;
}
.deletebuttom:hover{
color: #fff !important;
background: #29BD8B !important;
}
` `
} }
</style> </style>
<div className="deletebuttom intermediatecenter "> <Upload {...uploadProps}><p className="deletebuttomtest" type="upload"> <div className="intermediatecenter deletebuttom">
<Upload {...uploadProps}>
上传文件</p> </Upload></div> <Button className={"deletebuttom"} loading={this.state.Buttonloading} onClick={ this.ButtonloadinghandleChange}>{this.state.Buttonloading===true?"上传中":"上传文件"}</Button>
</Upload></div>
{ {
data_sets_count>0? data_sets_count>0?
<div <div

@ -80,7 +80,7 @@
.deletebuttom{ .deletebuttom{
width:85px; width:85px;
height:30px; height:30px;
background:#29BD8B; background:#29BD8B !important;
border-radius:3px; border-radius:3px;
cursor:pointer cursor:pointer
} }

Loading…
Cancel
Save