Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zuiidea committed Sep 11, 2017
1 parent 782bf21 commit e42c21f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/routes/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'
import { connect } from 'dva'
import { Tabs } from 'antd'
import { routerRedux } from 'dva/router'
import queryString from 'query-string'
import List from './List'

const TabPane = Tabs.TabPane
Expand All @@ -25,21 +24,21 @@ const Index = ({ post, dispatch, loading, location }) => {
onChange (page) {
dispatch(routerRedux.push({
pathname,
search: queryString.stringify({
query: {
...query,
page: page.current,
pageSize: page.pageSize,
}),
},
}))
},
}

const handleTabClick = (key) => {
dispatch(routerRedux.push({
pathname,
search: queryString.stringify({
query: {
status: key,
}),
},
}))
}

Expand Down
12 changes: 6 additions & 6 deletions src/routes/user/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const User = ({ location, dispatch, user, loading }) => {
const { query, pathname } = location
dispatch(routerRedux.push({
pathname,
search: queryString.stringify({
query: {
...query,
page: page.current,
pageSize: page.pageSize,
}),
},
}))
},
onDeleteItem (id) {
Expand Down Expand Up @@ -88,20 +88,20 @@ const User = ({ location, dispatch, user, loading }) => {
onFilterChange (value) {
dispatch(routerRedux.push({
pathname: location.pathname,
search: queryString.stringify({
query: {
...value,
page: 1,
pageSize,
}),
},
}))
},
onSearch (fieldsValue) {
fieldsValue.keyword.length ? dispatch(routerRedux.push({
pathname: '/user',
search: queryString.stringify({
query: {
field: fieldsValue.field,
keyword: fieldsValue.keyword,
}),
},
})) : dispatch(routerRedux.push({
pathname: '/user',
}))
Expand Down

0 comments on commit e42c21f

Please sign in to comment.