|
|
|
@ -14,7 +14,9 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
super(props);
|
|
|
|
|
this.state={
|
|
|
|
|
address:"http",
|
|
|
|
|
ref:"master"
|
|
|
|
|
ref:"master",
|
|
|
|
|
|
|
|
|
|
rootList:undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -26,8 +28,23 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
|
|
|
|
|
componentDidMount=()=>{
|
|
|
|
|
this.getProjectRoot();
|
|
|
|
|
this.getBranch();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取分支列表
|
|
|
|
|
getBranch=()=>{
|
|
|
|
|
const { login } = this.props.current_user;
|
|
|
|
|
const { projectsId } = this.props.match.params;
|
|
|
|
|
|
|
|
|
|
const url =`/projects/${login}/${projectsId}/branches.json`;
|
|
|
|
|
axios.get(url).then((result)=>{
|
|
|
|
|
if(result){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取分支文件
|
|
|
|
|
getProjectRoot=(ref)=>{
|
|
|
|
|
const { login } = this.props.current_user;
|
|
|
|
|
const { projectsId } = this.props.match.params;
|
|
|
|
@ -38,12 +55,25 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
ref
|
|
|
|
|
}
|
|
|
|
|
}).then((result)=>{
|
|
|
|
|
if(result){
|
|
|
|
|
|
|
|
|
|
if(result && result.data && result.data.length > 0){
|
|
|
|
|
this.renderData(result.data)
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
renderData=(data)=>{
|
|
|
|
|
const rootList = [];
|
|
|
|
|
data && data.map((item,key)=>{
|
|
|
|
|
rootList.push({
|
|
|
|
|
key,
|
|
|
|
|
...item
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.setState({
|
|
|
|
|
rootList:rootList
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
const menu = (
|
|
|
|
|
<Menu>
|
|
|
|
@ -59,39 +89,11 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'name',
|
|
|
|
|
width:"33%",
|
|
|
|
|
render: text => <a>{text}</a>,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
className: 'column-money',
|
|
|
|
|
width:"34%",
|
|
|
|
|
dataIndex: 'money',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'address',
|
|
|
|
|
width:"33%",
|
|
|
|
|
className:"edu-txt-right color-grey-9"
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
const data = [
|
|
|
|
|
{
|
|
|
|
|
key: '1',
|
|
|
|
|
name: 'John Brown',
|
|
|
|
|
money: '¥300,000.00',
|
|
|
|
|
address: 'New York No. 1 Lake Park',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: '2',
|
|
|
|
|
name: 'Jim Green',
|
|
|
|
|
money: '¥1,256,000.00',
|
|
|
|
|
address: 'London No. 1 Lake Park',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: '3',
|
|
|
|
|
name: 'Joe Black',
|
|
|
|
|
money: '¥120,000.00',
|
|
|
|
|
address: 'Sidney No. 1 Lake Park',
|
|
|
|
|
},
|
|
|
|
|
width:"100%",
|
|
|
|
|
render: (text,item) => (
|
|
|
|
|
<a><i className={ item.type === "file" ? "iconfont icon-zuoye font-15 color-blue mr5":"iconfont icon-wenjian font-15 color-blue mr5"}></i>{text}</a>
|
|
|
|
|
),
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const title = () =>{
|
|
|
|
@ -106,7 +108,7 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const { address , ref } = this.state;
|
|
|
|
|
const { address , ref , rootList } = this.state;
|
|
|
|
|
return(
|
|
|
|
|
<div className="main">
|
|
|
|
|
<p className="branch-wrapper">
|
|
|
|
@ -139,7 +141,7 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
<Table
|
|
|
|
|
className="mt20 wrap-commit-table"
|
|
|
|
|
columns={columns}
|
|
|
|
|
dataSource={data}
|
|
|
|
|
dataSource={rootList}
|
|
|
|
|
showHeader={false}
|
|
|
|
|
size="small"
|
|
|
|
|
pagination={false}
|
|
|
|
|