Merge branch 'newVersion_forge' into dev_devOps

This commit is contained in:
caishi 2020-10-10 15:55:58 +08:00
commit 46097ee5e1
1 changed files with 22 additions and 19 deletions

View File

@ -223,15 +223,8 @@ class Index extends Component {
this.getListData(page, limit, undefined, sort, project_type, category_id ,e === 0 ?undefined:e);
}
filterOption=(input,option)=>{
// console.log(input,option);
let o = option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
console.log(o);
}
render() {
const { current_user } = this.props;
const menu = (
menu =()=> {
return(
<Menu onClick={this.ChangeSoryBy}>
<Menu.Item key="updated_on">更新时间排序</Menu.Item>
<Menu.Item key="created_on">创建时间排序</Menu.Item>
@ -239,22 +232,32 @@ class Index extends Component {
<Menu.Item key="praises_count">点赞数量排序</Menu.Item>
</Menu>
)
const newItem = (
}
newItem = ()=>{
return(
<Menu>
<Menu.Item key="created_mirror"><Link to={`/projects/mirror/new`}>新建镜像项目</Link></Menu.Item>
<Menu.Item key="created_deposit"><Link to={`/projects/deposit/new`}>新建托管项目</Link></Menu.Item>
</Menu>
)
}
pagination=(total,limit,page)=>{
return(
total && total > limit &&
<div className="edu-txt-center pt30 mb30 border-top-grey">
<Pagination simple defaultCurrent={page} total={total} pageSize={limit} onChange={this.ChangePage}></Pagination>
</div>
)
}
render() {
const { current_user } = this.props;
const { projectsList , recommendList , languageList , languageId ,
isSpin, total, search, limit, page, typeList, categoryList } = this.state;
const pagination = (
total && total > limit ?
<div className="edu-txt-center pt30 mb30 border-top-grey">
<Pagination simple defaultCurrent={page} total={total} pageSize={limit} onChange={this.ChangePage}></Pagination>
</div> : ""
)
return (
<div>
<p className="t_project_banner">
@ -333,14 +336,14 @@ class Index extends Component {
<div>
{
current_user && current_user.login &&
<Popover content={newItem} trigger={["click"]} placement='bottom' className="mr50">
<Popover content={this.newItem()} trigger={["click"]} placement='bottom' className="mr50">
<a className="ant-dropdown-link">
<span className="color-blue font-16"><img src={img_new} alt="" width="13px" /> 新建</span>
</a>
</Popover>
}
<Popover content={menu} trigger={['click']} placement='bottom'>
<Popover content={this.menu()} trigger={['click']} placement='bottom'>
<a className="ant-dropdown-link">
<span className="color-blue font-16">排序 <img src={img_array} alt="" width="10px" /></span>
</a>
@ -348,7 +351,7 @@ class Index extends Component {
</div>
</div>
<ListItem {...this.props} {...this.state} projects={projectsList}></ListItem>
{pagination}
{this.pagination(total,limit,page)}
</Spin>
</div>
</div>