From 639440c1e8864c5936d59ba46a72dc85bb4bfd96 Mon Sep 17 00:00:00 2001 From: "wenbo.dong" Date: Fri, 28 Jul 2017 12:04:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?opti:=20=E4=B8=A4=E5=88=97=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=88=86=E5=88=AB=E8=AE=BE=E7=BD=AE=E6=9C=80=E5=B0=8F?= =?UTF-8?q?=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/containers/ProjectGroups/GroupList/GroupList.js | 2 +- client/containers/ProjectGroups/GroupList/GroupList.scss | 3 +++ client/containers/ProjectGroups/ProjectGroups.scss | 1 - client/containers/ProjectGroups/ProjectList/ProjectList.scss | 1 + client/containers/User/index.scss | 4 +++- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/containers/ProjectGroups/GroupList/GroupList.js b/client/containers/ProjectGroups/GroupList/GroupList.js index a13c8675..8dbc7ed0 100644 --- a/client/containers/ProjectGroups/GroupList/GroupList.js +++ b/client/containers/ProjectGroups/GroupList/GroupList.js @@ -192,7 +192,7 @@ export default class GroupList extends Component { const { currGroup } = this.props; return ( -
+
diff --git a/client/containers/ProjectGroups/GroupList/GroupList.scss b/client/containers/ProjectGroups/GroupList/GroupList.scss index 7db3c95f..f4756b8f 100644 --- a/client/containers/ProjectGroups/GroupList/GroupList.scss +++ b/client/containers/ProjectGroups/GroupList/GroupList.scss @@ -1,6 +1,8 @@ .group-bar { box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20); border-radius: 4px; + background-color: #fff; + min-height: 5rem; .curr-group { background: #34495E; border-radius: 4px 4px 0 0; @@ -54,6 +56,7 @@ border-bottom: 1px solid #e9e9e9; padding-bottom: 24px; border-radius: 0 0 4px 4px; + border: none; .group-item { // height: 48px; // line-height: 48px; diff --git a/client/containers/ProjectGroups/ProjectGroups.scss b/client/containers/ProjectGroups/ProjectGroups.scss index 3a9b6198..e57e92c8 100644 --- a/client/containers/ProjectGroups/ProjectGroups.scss +++ b/client/containers/ProjectGroups/ProjectGroups.scss @@ -2,6 +2,5 @@ .g-doc { @include row-width-limit; - min-height: 5rem; margin: .24rem auto; } diff --git a/client/containers/ProjectGroups/ProjectList/ProjectList.scss b/client/containers/ProjectGroups/ProjectList/ProjectList.scss index 1fefd8a1..d787db6b 100644 --- a/client/containers/ProjectGroups/ProjectList/ProjectList.scss +++ b/client/containers/ProjectGroups/ProjectList/ProjectList.scss @@ -3,6 +3,7 @@ padding: 24px; box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20); border-radius: 4px; + min-height: 5rem; } .m-table { diff --git a/client/containers/User/index.scss b/client/containers/User/index.scss index 620b521a..8ce9544f 100644 --- a/client/containers/User/index.scss +++ b/client/containers/User/index.scss @@ -2,7 +2,6 @@ .g-doc { margin: .24rem auto; - min-height: 5rem; } /* .user-box.css */ @@ -23,6 +22,7 @@ box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20); background: #FFF; border-radius:4px; + min-height: 5rem; margin-top: 15px; .search{ padding: 5px; @@ -55,6 +55,7 @@ box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20); background: #FFF; margin-top: 15px; + min-height: 5rem; .ant-table-wrapper table { // font-size: .14rem; @@ -72,6 +73,7 @@ box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20); background: #FFF; border-radius: .04rem; + min-height: 5rem; .user-item { min-height:35px; line-height:35px; From 76dbd122d2f863c23dfc10d3d6e718774cd82b7b Mon Sep 17 00:00:00 2001 From: "yhui.yang" Date: Fri, 28 Jul 2017 14:56:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dheader=E4=B8=AD?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A1=86=E8=B7=B3=E8=BD=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Header/Search/Search.js | 51 +++++++++++++++------ client/components/Header/Search/Search.scss | 1 - 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/client/components/Header/Search/Search.js b/client/components/Header/Search/Search.js index 84f5f1d3..4755acbb 100644 --- a/client/components/Header/Search/Search.js +++ b/client/components/Header/Search/Search.js @@ -5,12 +5,18 @@ import { Icon, Input, AutoComplete } from 'antd' import './Search.scss' import { withRouter } from 'react-router'; import axios from 'axios'; +import { setCurrGroup } from '../../../actions/group' +import { changeMenuItem } from '../../../actions/menu' +const Option = AutoComplete.Option; @connect( state => ({ groupList: state.group.groupList, projectList: state.project.projectList - }) + }),{ + setCurrGroup, + changeMenuItem + } ) @withRouter @@ -27,14 +33,18 @@ export default class Srch extends Component{ projectList: PropTypes.array, router: PropTypes.object, history: PropTypes.object, - location: PropTypes.object + location: PropTypes.object, + setCurrGroup: PropTypes.func, + changeMenuItem : PropTypes.func } - onSelect = (value) => { - if( value.split(":")[0] == "分组" ){ - this.props.history.push('/group/'+value.split(":")[1].trim()); + onSelect = (value,option) => { + if( option.props.tpye == "分组" ){ + this.props.changeMenuItem('/group'); + this.props.history.push('/group/'+value); + this.props.setCurrGroup({"group_name":value,"_id":option.props['id']}); } else { - this.props.history.push('/project/'+value.split("(")[1].slice(0,-1)); + this.props.history.push('/project/'+option.props['id']); } } @@ -43,9 +53,27 @@ export default class Srch extends Component{ .then((res) => { if(res.data && res.data.errcode === 0){ const dataSource = []; - for(let title in res.data.data){ + for(let title in res.data.data) { res.data.data[title].map(item => { - title == "group" ? dataSource.push( "分组"+": "+item.groupName ): dataSource.push( "项目"+": "+item.name+"("+item._id+")" ); + dataSource.push( + title == "group" ? + ( ) : + () + ) }) } this.setState({ @@ -70,6 +98,7 @@ export default class Srch extends Component{ render(){ const { dataSource } = this.state; + return(
} size="large" - style={{ - // width: 200, - // borderColor:"#AAA", - // borderWidth:"1px", - }} + style={{}} placeholder="搜索分组/项目" className="search-input" /> diff --git a/client/components/Header/Search/Search.scss b/client/components/Header/Search/Search.scss index 610ccf7f..3aa71480 100644 --- a/client/components/Header/Search/Search.scss +++ b/client/components/Header/Search/Search.scss @@ -3,7 +3,6 @@ $color-grey:#979DA7; .search-wrapper{ .search-input{ width: 2rem; - //transition: width 2s; } .srch-icon{ }