diff --git a/mock/users.js b/mock/users.js index 37e60e4..8d5b7ec 100644 --- a/mock/users.js +++ b/mock/users.js @@ -17,7 +17,7 @@ if (!global.tableListData) { isMale:'@boolean', email:'@email', createTime:'@datetime', - avatar:mockjs.Random.image('100x100'), + avatar:mockjs.Random.image('100x100',mockjs.Random.color()), }], page: { total: 100, diff --git a/package.json b/package.json index 4c10c1a..71e63dc 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "devDependencies": { "atool-build": "^0.7.6", "babel-eslint": "^6.0.4", + "babel-plugin-dev-expression": "^0.2.1", "babel-plugin-dva-hmr": "^0.1.0", "babel-plugin-import": "^1.0.1", "babel-plugin-transform-runtime": "^6.9.0", diff --git a/src/components/users/list.jsx b/src/components/users/list.jsx index 059506a..0da39c4 100644 --- a/src/components/users/list.jsx +++ b/src/components/users/list.jsx @@ -2,7 +2,7 @@ import React, {PropTypes} from 'react' import {Table, Popconfirm, Pagination} from 'antd' import styles from './list.less' -function UserList({ +function list({ loading, dataSource, pagination, @@ -85,7 +85,7 @@ function UserList({ ) } -UserList.propTypes = { +list.propTypes = { onPageChange: PropTypes.func, onDeleteItem: PropTypes.func, onEditItem: PropTypes.func, @@ -94,4 +94,4 @@ UserList.propTypes = { pagination: PropTypes.any } -export default UserList +export default list diff --git a/src/components/users/list.less b/src/components/users/list.less index 3e3a65a..dc9fcb7 100644 --- a/src/components/users/list.less +++ b/src/components/users/list.less @@ -1,3 +1,6 @@ .avatar{ line-height: 1; + img{ + border-radius: 50%; + } } diff --git a/src/components/users/modal.jsx b/src/components/users/modal.jsx index 116126e..78e3dc1 100644 --- a/src/components/users/modal.jsx +++ b/src/components/users/modal.jsx @@ -11,7 +11,7 @@ const formItemLayout = { }, } -const UserModal = ({ +const modal = ({ visible, item = {}, onOk, @@ -98,7 +98,7 @@ const UserModal = ({ ) } -UserModal.propTypes = { +modal.propTypes = { visible: PropTypes.any, form: PropTypes.object, item: PropTypes.object, @@ -106,4 +106,4 @@ UserModal.propTypes = { onCancel: PropTypes.func, } -export default Form.create()(UserModal) +export default Form.create()(modal) diff --git a/src/components/users/search.jsx b/src/components/users/search.jsx index 861d08d..0a64388 100644 --- a/src/components/users/search.jsx +++ b/src/components/users/search.jsx @@ -2,7 +2,7 @@ import React, {PropTypes} from 'react' import {Form, Input, Button, Select} from 'antd' import styles from './search.less' -const UserSearch = ({ +const search = ({ field, keyword, onSearch, @@ -40,11 +40,9 @@ const UserSearch = ({