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