dev_new_shixunsrepository
杨树明 5 years ago
parent 5aaa47c3c5
commit a3781ec3ea

@ -46,7 +46,7 @@ class RepositoryAddFileupload_files extends Component {
fileList = fileList.map(file => { fileList = fileList.map(file => {
if (file.response) { if (file.response) {
if (file.response.status===0) { if (file.response.status===0) {
this.props.showNotification("上传成功")
} }
} }
return file; return file;
@ -178,6 +178,8 @@ class RepositoryAddFileupload_files extends Component {
this.props.showNotification("上传文件请先填写提交信息") this.props.showNotification("上传文件请先填写提交信息")
return false return false
} }
console.log(file)
this.props.showNotification("上传成功")
}, },
}; };

@ -79,22 +79,21 @@ class Repositoryfile extends Component{
} }
let ary=main; let ary=main;
let paths=path; let paths=path;
let mainpath;
this.setState({ this.setState({
selectpatharr:[], selectpatharr:[],
}) })
mainpath=newpath;
if(paths===""&&type==="tree"){ if(paths===""&&type==="tree"){
newpath=newpath;
paths="";
if(main.length===0){ if(main.length===0){
ary.push({val:"根目录",path:""},{val:"/"+newpath,path:paths+newpath}); ary.push({val:"根目录",path:""},{val:"/"+mainpath,path:mainpath});
}else{ }else{
ary.push({val:"/"+newpath,path:paths+newpath}); ary.push({val:"/"+mainpath,path:mainpath});
} }
}else if(paths!=""&&type==="tree"){ }else if(paths!=""&&type==="tree"){
newpath=paths+"/"+newpath; newpath=paths+"/"+newpath;
ary.push({val:"/"+newpath,path:paths+newpath}); ary.push({val:"/"+mainpath,path:mainpath});
} }
axios.post(url,{ axios.post(url,{
@ -105,7 +104,7 @@ class Repositoryfile extends Component{
}else{ }else{
this.setState({ this.setState({
trees:response.data.trees, trees:response.data.trees,
path:paths+newpath, path:newpath,
main:ary, main:ary,
// selectpath:"" // selectpath:""
}) })
@ -220,7 +219,7 @@ class Repositoryfile extends Component{
{ {
main.length===0?"":main.map((item,key)=>{ main.length===0?"":main.map((item,key)=>{
return( return(
<a className="f14 fb" onClick={()=>this.goblakepath(item.path,key,item)}>{item.val}</a> <a className="f14 fb" key={key} onClick={()=>this.goblakepath(item.path,key,item)}>{item.val}</a>
) )
}) })
} }

Loading…
Cancel
Save