This commit is contained in:
zuiidea
2017-09-11 09:53:22 +08:00
parent 782bf214e5
commit e42c21f0eb
2 changed files with 10 additions and 11 deletions
+4 -5
View File
@@ -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
@@ -25,11 +24,11 @@ const Index = ({ post, dispatch, loading, location }) => {
onChange (page) {
dispatch(routerRedux.push({
pathname,
search: queryString.stringify({
query: {
...query,
page: page.current,
pageSize: page.pageSize,
}),
},
}))
},
}
@@ -37,9 +36,9 @@ const Index = ({ post, dispatch, loading, location }) => {
const handleTabClick = (key) => {
dispatch(routerRedux.push({
pathname,
search: queryString.stringify({
query: {
status: key,
}),
},
}))
}
+6 -6
View File
@@ -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) {
@@ -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',
}))