|
|
|
@ -65,7 +65,6 @@ class RepositoryAddFileupload_files extends Component {
|
|
|
|
|
fileList = fileList.map(file => {
|
|
|
|
|
if (file.response) {
|
|
|
|
|
if (file.response.status===0) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return file;
|
|
|
|
@ -76,34 +75,35 @@ class RepositoryAddFileupload_files extends Component {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onAttachmentRemove=(info)=>{
|
|
|
|
|
console.log(info);
|
|
|
|
|
if(info.response){
|
|
|
|
|
let shixunId = this.props.match.params.shixunId;
|
|
|
|
|
let {message,filspath}=this.state;
|
|
|
|
|
if(message===""||message===undefined){
|
|
|
|
|
this.props.showNotification('删除文件请先填写提交信息');
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let shixunId = this.props.match.params.shixunId;
|
|
|
|
|
let {message,filspath}=this.state;
|
|
|
|
|
if(message===""||message===undefined){
|
|
|
|
|
this.props.showNotification('删除文件请先填写提交信息');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let matchpath =this.props.match.path;
|
|
|
|
|
let matchpath =this.props.match.path;
|
|
|
|
|
|
|
|
|
|
let Repositoryflag =undefined;
|
|
|
|
|
let Repositoryflag =undefined;
|
|
|
|
|
|
|
|
|
|
if( matchpath.indexOf("repository")>-1){
|
|
|
|
|
Repositoryflag =undefined;
|
|
|
|
|
}
|
|
|
|
|
if(matchpath.indexOf("secret_repository")>-1){
|
|
|
|
|
Repositoryflag =true;
|
|
|
|
|
}
|
|
|
|
|
if( matchpath.indexOf("repository")>-1){
|
|
|
|
|
Repositoryflag =undefined;
|
|
|
|
|
}
|
|
|
|
|
if(matchpath.indexOf("secret_repository")>-1){
|
|
|
|
|
Repositoryflag =true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let newfilspath=filspath;
|
|
|
|
|
let newfilspath=filspath;
|
|
|
|
|
|
|
|
|
|
if(newfilspath===""){
|
|
|
|
|
newfilspath=info.name
|
|
|
|
|
}else{
|
|
|
|
|
newfilspath=filspath+"/"+info.name
|
|
|
|
|
}
|
|
|
|
|
const url = `/shixuns//${shixunId}/delete_git_file.json`;
|
|
|
|
|
axios.delete(url, { data: {
|
|
|
|
|
if(newfilspath===""){
|
|
|
|
|
newfilspath=info.name
|
|
|
|
|
}else{
|
|
|
|
|
newfilspath=filspath+"/"+info.name
|
|
|
|
|
}
|
|
|
|
|
const url = `/shixuns//${shixunId}/delete_git_file.json`;
|
|
|
|
|
axios.delete(url, { data: {
|
|
|
|
|
path:newfilspath,
|
|
|
|
|
message:message,
|
|
|
|
|
secret_repository:Repositoryflag
|
|
|
|
|