diff --git a/package.json b/package.json
index 47eefa5..4b57e93 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,7 @@
"eslint-plugin-react": "^5.1.1",
"glob": "^7.0.5",
"mockjs": "^1.0.1-beta3",
+ "rc-tween-one": "^1.0.0",
"redbox-react": "^1.2.10",
"robe-ajax": "^1.0.0",
"watchjs": "^0.0.0"
diff --git a/src/router.js b/src/router.js
index 1a6d457..033ab69 100644
--- a/src/router.js
+++ b/src/router.js
@@ -29,6 +29,14 @@ export default function ({history, app}) {
cb(null, require('./routes/users'))
})
}
+ }, {
+ path: 'usersMotion',
+ name: 'usersMotion',
+ getComponent (nextState, cb) {
+ require.ensure([], require => {
+ cb(null, require('./routes/usersMotion'))
+ })
+ }
}, {
path: 'ui/ico',
name: 'ui/ico',
diff --git a/src/routes/usersMotion.js b/src/routes/usersMotion.js
new file mode 100644
index 0000000..9823ad1
--- /dev/null
+++ b/src/routes/usersMotion.js
@@ -0,0 +1,109 @@
+import React, { PropTypes } from 'react'
+import { routerRedux } from 'dva/router'
+import { connect } from 'dva'
+import UserList from '../components/users/list'
+import UserSearch from '../components/users/search'
+import UserModal from '../components/users/modal'
+
+function Users ({ location, dispatch, users }) {
+ const { loading, list, pagination, currentItem, modalVisible, modalType } = users
+ const { field, keyword } = location.query
+
+ const userModalProps = {
+ item: modalType === 'create' ? {} : currentItem,
+ type: modalType,
+ visible: modalVisible,
+ onOk (data) {
+ dispatch({
+ type: `users/${modalType}`,
+ payload: data
+ })
+ },
+ onCancel () {
+ dispatch({
+ type: 'users/hideModal'
+ })
+ }
+ }
+
+ const userListProps = {
+ dataSource: list,
+ loading,
+ pagination: pagination,
+ onPageChange (page) {
+ const query = location.query
+ dispatch(routerRedux.push({
+ pathname: '/users',
+ query: {
+ ...query,
+ page: page.current,
+ pageSize: page.pageSize
+ }
+ }))
+ },
+ onDeleteItem (id) {
+ dispatch({
+ type: 'users/delete',
+ payload: id
+ })
+ },
+ onEditItem (item) {
+ dispatch({
+ type: 'users/showModal',
+ payload: {
+ modalType: 'update',
+ currentItem: item
+ }
+ })
+ }
+ }
+
+ const userSearchProps = {
+ field,
+ keyword,
+ onSearch (fieldsValue) {
+ !!fieldsValue.keyword.length ?
+ dispatch(routerRedux.push({
+ pathname: '/users',
+ query: {
+ field: fieldsValue.field,
+ keyword: fieldsValue.keyword
+ }
+ })) :
+ dispatch(routerRedux.push({
+ pathname: '/users'
+ }))
+ },
+ onAdd () {
+ dispatch({
+ type: 'users/showModal',
+ payload: {
+ modalType: 'create'
+ }
+ })
+ }
+ }
+
+ const UserModalGen = () =>
+