Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
muidea committed Oct 15, 2018
1 parent e9d33ce commit 4dbe0e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
17 changes: 2 additions & 15 deletions src/routes/content/link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,12 @@ const Link = ({ location, dispatch, link, loading }) => {
onFilterChange(value) {
dispatch(routerRedux.push({
pathname: location.pathname,
query: {
search: qs.stringify({
...value,
pageSize,
},
}),
}))
},
onSearch(fieldsValue) {
if (fieldsValue.keyword.length) {
dispatch(routerRedux.push({
pathname: '/link',
query: {
field: fieldsValue.field,
keyword: fieldsValue.keyword,
},
}))
} else {
dispatch(routerRedux.push({ pathname: '/link' }))
}
},
onAdd() {
dispatch({
type: 'link/showModal',
Expand Down
2 changes: 1 addition & 1 deletion src/routes/content/media/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Filter = ({
return (
<Row gutter={24}>
<Col {...ColProps} xl={{ span: 14 }} md={{ span: 14 }}>
{getFieldDecorator('filterValue', { initialValue: name })(<Search placeholder="分类名" size="large" onSearch={handleSubmit} />)}
{getFieldDecorator('filterValue', { initialValue: name })(<Search placeholder="查找文件" size="large" onSearch={handleSubmit} />)}
</Col>
<Col {...TwoColProps} xl={{ span: 10 }} md={{ span: 10 }} sm={{ span: 10 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
Expand Down
17 changes: 2 additions & 15 deletions src/routes/content/media/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,12 @@ const Media = ({ location, dispatch, media, loading }) => {
onFilterChange(value) {
dispatch(routerRedux.push({
pathname: location.pathname,
query: {
search: qs.stringify({
...value,
pageSize,
},
}),
}))
},
onSearch(fieldsValue) {
if (fieldsValue.keyword.length) {
dispatch(routerRedux.push({
pathname: '/media',
query: {
field: fieldsValue.field,
keyword: fieldsValue.keyword,
},
}))
} else {
dispatch(routerRedux.push({ pathname: '/media' }))
}
},
onAdd() {
dispatch({ type: 'media/showModal' })
},
Expand Down

0 comments on commit 4dbe0e1

Please sign in to comment.