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

chromesetting
杨树明 5 years ago
commit 09633ebf3e

@ -300,6 +300,11 @@ class TPMDataset extends Component {
this.setState({ this.setState({
Buttonloading:true Buttonloading:true
}) })
if(!info.file.status){
this.setState({
Buttonloading:false
})
}
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;
@ -311,7 +316,9 @@ class TPMDataset extends Component {
//done 成功就会调用这个方法 //done 成功就会调用这个方法
if(info.file.response){ if(info.file.response){
if(info.file.response.status===-1||info.file.response.status==="-1"){ if(info.file.response.status===-1||info.file.response.status==="-1"){
this.setState({
Buttonloading:false
})
}else{ }else{
this.getdatas(); this.getdatas();
this.setState({ this.setState({
@ -320,6 +327,10 @@ class TPMDataset extends Component {
// this.props.showNotification(`上传成功`); // this.props.showNotification(`上传成功`);
} }
} }
}else{
// this.setState({
// Buttonloading:false
// })
} }
if(info.file.response){ if(info.file.response){
@ -460,7 +471,7 @@ class TPMDataset extends Component {
ButtonloadinghandleChange=()=>{ ButtonloadinghandleChange=()=>{
// this.props.showNotification(`zhzzzzz`); // this.props.showNotification(`zhzzzzz`);
// this.setState({ // this.setState({
// Buttonloading:true // Buttonloading:false
// }) // })
} }
render() { render() {
@ -489,17 +500,14 @@ class TPMDataset extends Component {
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file) => { beforeUpload: (file) => {
//上传前的操作 //上传前的操作
// console.log('beforeUpload', file.name); console.log('beforeUpload', file);
this.props.showNotification(`文件上传中`); // this.props.showNotification(`文件上传中`);
const isLt300M = file.size / 1024 / 1024 <= 300; const isLt400M = file.size / 1024 / 1024 <= 1;
if (!isLt300M) { if (!isLt400M) {
this.setState({ this.props.showNotification('文件大小必须小于等于400MB!');
Buttonloading:false
})
this.props.showNotification('文件大小必须小于等于300MB!');
} }
return isLt300M; return isLt400M;
}, },
}; };
// console.log("showmodelshowmodel"); // console.log("showmodelshowmodel");
@ -548,7 +556,7 @@ class TPMDataset extends Component {
</style> </style>
<div className="intermediatecenter deletebuttom"> <div className="intermediatecenter deletebuttom">
<Upload {...uploadProps}> <Upload {...uploadProps}>
<Button className={"deletebuttom"} loading={this.state.Buttonloading} onClick={ this.ButtonloadinghandleChange}>{this.state.Buttonloading===true?"上传中":"上传文件"}</Button> <Button className={"deletebuttom"} loading={this.state.Buttonloading}>{this.state.Buttonloading===true?"上传中":"上传文件"}</Button>
</Upload></div> </Upload></div>
{ {
data_sets_count>0? data_sets_count>0?

Loading…
Cancel
Save