parent
d4e7424deb
commit
94ddf7f11e
File diff suppressed because one or more lines are too long
@ -0,0 +1,130 @@
|
||||
import React , { Component } from 'react';
|
||||
import { Dropdown , Icon , Menu , Table } from 'antd';
|
||||
import {Link} from 'react-router-dom';
|
||||
|
||||
// 点击按钮复制功能
|
||||
function jsCopy(){
|
||||
var e = document.getElementById("copy_rep_content");
|
||||
e.select();
|
||||
document.execCommand("Copy");
|
||||
}
|
||||
class CoderRootDirectory extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
address:"http"
|
||||
}
|
||||
}
|
||||
|
||||
changeAddress=(address)=>{
|
||||
this.setState({
|
||||
address
|
||||
})
|
||||
}
|
||||
|
||||
render(){
|
||||
const menu = (
|
||||
<Menu>
|
||||
<Menu.Item key="0">
|
||||
<a href="http://www.alipay.com/">1st menu item</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="1">
|
||||
<a href="http://www.taobao.com/">2nd menu item</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
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',
|
||||
},
|
||||
];
|
||||
|
||||
const title = () =>{
|
||||
return(
|
||||
<div className="f-wrap-alignCenter">
|
||||
<img src={``} alt=""/>
|
||||
<span>蔡蔡</span>
|
||||
<Link to={``} className="commitKey">asljfowfjoer</Link>
|
||||
<span className="color-blue flex-1 hide-1">first commit</span>
|
||||
<span>3小时前</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const { address } = this.state;
|
||||
return(
|
||||
<div className="main">
|
||||
<p className="branch-wrapper">
|
||||
<span><i className="iconfont icon-tijiaojilu font-18 mr3"></i>提交</span>
|
||||
<span><i className="iconfont icon-fenzhi font-18 mr3"></i>分支</span>
|
||||
</p>
|
||||
|
||||
<div className="f-wrap-between mt20">
|
||||
<div className="branchDropdown">
|
||||
<span className="color-grey-9 mr3"><i className="iconfont icon-fenzhi font-20 color-grey-6 mr3"></i>分支:</span>
|
||||
<Dropdown overlay={menu} trigger={['click']} placement="bottomRight">
|
||||
<a className="ant-dropdown-link">
|
||||
master <Icon type="down" />
|
||||
</a>
|
||||
</Dropdown>
|
||||
</div>
|
||||
<div className="gitAddressClone">
|
||||
<span className={address ==="http" ? "addressType active":"addressType"} onClick={()=>this.changeAddress("http")}>HTTP</span>
|
||||
<span className={address ==="ssh" ? "addressType active":"addressType"} onClick={()=>this.changeAddress("ssh")}>SSH</span>
|
||||
<input type="text" id="copy_rep_content" value={"git@testgitea.trustie.net:sylor/test11.git"}/>
|
||||
<span><i className="iconfont icon-fuzhi"></i></span>
|
||||
<span>
|
||||
<Dropdown overlay={menu} trigger={['click']} placement="bottomRight">
|
||||
<a className="ant-dropdown-link">
|
||||
<Icon type="cloud-download" className="font-18 fl"/>
|
||||
</a>
|
||||
</Dropdown></span>
|
||||
</div>
|
||||
</div>
|
||||
<Table
|
||||
className="mt20 wrap-commit-table"
|
||||
columns={columns}
|
||||
dataSource={data}
|
||||
showHeader={false}
|
||||
size="small"
|
||||
pagination={false}
|
||||
title={() => title()}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CoderRootDirectory;
|
@ -0,0 +1,67 @@
|
||||
import React , { Component } from 'react';
|
||||
import { Link , Route , Switch } from 'react-router-dom';
|
||||
|
||||
import '../css/index.css'
|
||||
import './list.css';
|
||||
|
||||
import Loadable from 'react-loadable';
|
||||
import Loading from '../../Loading';
|
||||
const CoderRootDirectory = Loadable({
|
||||
loader: () => import('./CoderRootDirectory'),
|
||||
loading: Loading,
|
||||
})
|
||||
class Detail extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
currentKey:"coder"
|
||||
}
|
||||
}
|
||||
|
||||
// 切换菜单
|
||||
ChangeMenu=(value)=>{
|
||||
console.log(value);
|
||||
}
|
||||
render(){
|
||||
const { currentKey } = this.state;
|
||||
return(
|
||||
<div>
|
||||
<div className="detailHeader-wrapper">
|
||||
<div className="normal f-wrap-between mb20">
|
||||
<p className="font-18 color-blue df flex-1" style={{alignItems:"center"}}>kosasa胡 / <span className="hide-1 flex-1">test11111111111</span></p>
|
||||
|
||||
<span className="p-r-tags large">
|
||||
<span><label>关注</label><span>11</span></span>
|
||||
<span><label>点赞</label><span>12</span></span>
|
||||
<span><label>Fork</label><span>11</span></span>
|
||||
</span>
|
||||
</div>
|
||||
<div className="normal f-wrap-between">
|
||||
<ul className="headerMenu-wrapper">
|
||||
<li className={currentKey === "coder" ? "active" : ""}><Link to={''}>代码</Link></li>
|
||||
<li className={currentKey === "orders" ? "active" : ""}><Link to={''}>工单</Link></li>
|
||||
<li className={currentKey === "merge" ? "active" : ""}><Link to={''}>合并请求</Link></li>
|
||||
<li className={currentKey === "edition" ? "active" : ""}><Link to={''}>版本发布</Link></li>
|
||||
<li className={currentKey === "trends" ? "active" : ""}><Link to={''}>动态</Link></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Switch {...this.props}>
|
||||
<Route exact path="/projects/:projectsType/coder"
|
||||
render={
|
||||
(props) => (<CoderRootDirectory {...this.props} {...props} {...this.state}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route exact path="/projects/:projectsType"
|
||||
render={
|
||||
(props) => (<CoderRootDirectory {...this.props} {...props} {...this.state}/>)
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Detail;
|
Loading…
Reference in new issue