|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import { Form , Upload , Input , notification, message } from 'antd';
|
|
|
|
|
import { Form , Upload , Input} from 'antd';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import { getupload_git_file } from 'educoder';
|
|
|
|
|
import Repositoryfile from './Repositoryfile';
|
|
|
|
@ -29,17 +29,14 @@ class RepositoryAddFileupload_files extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleChange = (info) => {
|
|
|
|
|
console.log(info)
|
|
|
|
|
|
|
|
|
|
if (info.file.status === 'done'||info.file.status === "uploading") {
|
|
|
|
|
|
|
|
|
|
let fileList = [...info.fileList];
|
|
|
|
|
|
|
|
|
|
if(info.file.response){
|
|
|
|
|
if(info.file.response.status===-1) {
|
|
|
|
|
notification.open({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: info.file.response.message,
|
|
|
|
|
})
|
|
|
|
|
this.props.showNotification(info.file.response.message)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -51,6 +48,7 @@ class RepositoryAddFileupload_files extends Component {
|
|
|
|
|
}
|
|
|
|
|
return file;
|
|
|
|
|
});
|
|
|
|
|
this.props.showNotification("上传成功")
|
|
|
|
|
this.setState({ fileList });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -59,10 +57,7 @@ class RepositoryAddFileupload_files extends Component {
|
|
|
|
|
let shixunId = this.props.match.params.shixunId;
|
|
|
|
|
let {message,filspath}=this.state;
|
|
|
|
|
if(message===""||message===undefined){
|
|
|
|
|
notification.open({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '删除文件请先填写提交信息',
|
|
|
|
|
});
|
|
|
|
|
this.props.showNotification('删除文件请先填写提交信息');
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -177,10 +172,7 @@ class RepositoryAddFileupload_files extends Component {
|
|
|
|
|
beforeUpload: (file) => {
|
|
|
|
|
let {message}=this.state;
|
|
|
|
|
if(message===""||message===undefined){
|
|
|
|
|
notification.open({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '上传文件请先填写提交信息',
|
|
|
|
|
});
|
|
|
|
|
this.props.showNotification("上传文件请先填写提交信息")
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|