Skip to content

Commit

Permalink
add:users-motion
Browse files Browse the repository at this point in the history
  • Loading branch information
zuiidea committed Feb 10, 2017
1 parent c97cf3e commit 46ff98b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 49 deletions.
27 changes: 3 additions & 24 deletions src/components/layout/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,13 @@ body {
background-color: #f8f8f8;
}
// scrollbar

::-webkit-scrollbar-corner {
background-color: transparent;
}

::-webkit-scrollbar-button {
width: 0;
height: 0;
display: none;
}

::-webkit-scrollbar-thumb {
width: 2px;
background-color: rgba(0,0,0,.2);
border-radius: 2px;
background-color: #e6e6e6;
}

::-webkit-scrollbar {
width: 2px;
height: 2px;
}

::-webkit-scrollbar-track {
width: 5px;
}

::-webkit-scrollbar:hover {
background-color: transparent;
width: 8px;
height: 8px;
}

:global .ant-breadcrumb {
Expand Down
1 change: 0 additions & 1 deletion src/components/layout/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@

.ant-menu-root {
height: ~"calc(100vh - 144px)";
overflow-y: scroll;
overflow-x: hidden;

&::-webkit-scrollbar-thumb {
Expand Down
10 changes: 6 additions & 4 deletions src/components/users/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ class list extends React.Component {
ease: 'easeOutQuad'
}
]
this.currentPage = 1
this.newPage = 1
const {current} = this.props.pagination
this.currentPage = current
this.newPage = current
}

getBodyWrapper = (body) => {
Expand Down Expand Up @@ -133,8 +134,9 @@ class list extends React.Component {
<Table className={styles.table} bordered scroll={{
x: 1200
}} columns={columns} dataSource={dataSource} loading={loading} onChange={(page) => {
self.newPage = page.current
onPageChange(page)
onPageChange(page, () => {
self.newPage = page.current
})
}} pagination={pagination} simple rowKey={record => record.id} getBodyWrapper={this.getBodyWrapper} />
</div>
}
Expand Down
15 changes: 6 additions & 9 deletions src/components/users/list.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
.table {
td.avatar {
line-height: 1;
height: 59px;

img {
border-radius: 50%;
}
Expand All @@ -11,6 +8,8 @@
:global {
.ant-table-tbody > tr > td,
.ant-table-thead > tr > th {
height: 60px;

&:nth-child(1) {
width: 6%;
}
Expand All @@ -28,7 +27,7 @@
}

&:nth-child(5) {
width: 4%;
width: 6%;
}

&:nth-child(6) {
Expand All @@ -40,22 +39,20 @@
}

&:nth-child(8) {
width: 18%;
width: 20%;
}

&:nth-child(9) {
width: 15%;
width: 14%;
}

&:nth-child(10) {
width: 11%;
width: 8%;
}
}

.ant-table-thead {
& > tr {
height: 60px;
line-height: 60px;
transition: none;
display: block;

Expand Down
11 changes: 5 additions & 6 deletions src/routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ function Users ({ location, dispatch, users }) {
dataSource: list,
loading,
pagination: pagination,
onPageChange (page) {
async onPageChange (page, callback) {
const query = location.query
dispatch(routerRedux.push({
await dispatch(routerRedux.push({
pathname: '/users',
query: {
...query,
page: page.current,
pageSize: page.pageSize
}
}))
await callback && callback()
},
onDeleteItem (id) {
dispatch({
Expand All @@ -62,15 +63,13 @@ function Users ({ location, dispatch, users }) {
field,
keyword,
onSearch (fieldsValue) {
!!fieldsValue.keyword.length ?
dispatch(routerRedux.push({
fieldsValue.keyword.length ? dispatch(routerRedux.push({
pathname: '/users',
query: {
field: fieldsValue.field,
keyword: fieldsValue.keyword
}
})) :
dispatch(routerRedux.push({
})) : dispatch(routerRedux.push({
pathname: '/users'
}))
},
Expand Down
5 changes: 0 additions & 5 deletions src/utils/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ module.exports = [
name: '用户管理',
icon: 'user'
},
{
key: 'usersMotion',
name: '用户管理-动效',
icon: 'user'
},
{
key: 'ui',
name: 'UI组件',
Expand Down

0 comments on commit 46ff98b

Please sign in to comment.