|
1 | 1 | import { AnyAction, Dispatch } from 'redux'; |
2 | 2 | import { Badge, Button, Card, Col, Form, Input, Modal, Radio, Row, Table } from 'antd'; |
3 | | -import { ConnectState, UserModelState } from '@/models/connect'; |
4 | 3 | import React, { PureComponent } from 'react'; |
5 | 4 |
|
6 | 5 | import { FormComponentProps } from 'antd/lib/form'; |
7 | | -import PButton from '@/components/PermButton'; |
8 | 6 | import { connect } from 'dva'; |
| 7 | +import PButton from '@/components/PermButton'; |
| 8 | +import { ConnectState, UserModelState } from '@/models/connect'; |
9 | 9 | import PageHeaderLayout from '../../layouts/PageHeaderLayout'; |
10 | 10 | import RoleSelect from './RoleSelect'; |
11 | 11 | import UserCard from './UserCard'; |
@@ -147,16 +147,14 @@ class UserList extends PureComponent<UserListProps, UserListState> { |
147 | 147 | return; |
148 | 148 | } |
149 | 149 |
|
150 | | - let roleIDs = ''; |
151 | | - if (values.role_ids) { |
152 | | - roleIDs = values.role_ids.map((v: any) => v.role_id).join(','); |
| 150 | + const search = { ...values }; |
| 151 | + if (search.roleIDs) { |
| 152 | + search.roleIDs = search.roleIDs.map((v: any) => v.role_id).join(','); |
153 | 153 | } |
| 154 | + |
154 | 155 | this.dispatch({ |
155 | 156 | type: 'user/fetch', |
156 | | - search: { |
157 | | - ...values, |
158 | | - role_ids: roleIDs, |
159 | | - }, |
| 157 | + search, |
160 | 158 | pagination: {}, |
161 | 159 | }); |
162 | 160 | this.clearSelectRows(); |
@@ -196,16 +194,16 @@ class UserList extends PureComponent<UserListProps, UserListState> { |
196 | 194 | <Row gutter={16}> |
197 | 195 | <Col span={8}> |
198 | 196 | <Form.Item label="用户名"> |
199 | | - {getFieldDecorator('user_name')(<Input placeholder="请输入" />)} |
| 197 | + {getFieldDecorator('userName')(<Input placeholder="请输入" />)} |
200 | 198 | </Form.Item> |
201 | 199 | </Col> |
202 | 200 | <Col span={8}> |
203 | 201 | <Form.Item label="真实姓名"> |
204 | | - {getFieldDecorator('real_name')(<Input placeholder="请输入" />)} |
| 202 | + {getFieldDecorator('realName')(<Input placeholder="请输入" />)} |
205 | 203 | </Form.Item> |
206 | 204 | </Col> |
207 | 205 | <Col span={8}> |
208 | | - <Form.Item label="所属角色">{getFieldDecorator('role_ids')(<RoleSelect />)}</Form.Item> |
| 206 | + <Form.Item label="所属角色">{getFieldDecorator('roleIDs')(<RoleSelect />)}</Form.Item> |
209 | 207 | </Col> |
210 | 208 | </Row> |
211 | 209 | <Row gutter={16}> |
|
0 commit comments