Commit 4d3172436071ea00e55db97aac684d07494df1c3
1 parent
fe98fc42
角色搜索优化
Showing
2 changed files
with
9 additions
and
3 deletions
src/pages/admin/Role/components/RoleFilter.tsx
... | ... | @@ -24,7 +24,14 @@ export default function RoleFilter() { |
24 | 24 | <RadioButton value={0}>禁用</RadioButton> |
25 | 25 | {/* <RadioButton value={-1}>已删除</RadioButton> */} |
26 | 26 | </RadioGroup> |
27 | - <Select allowClear placeholder="请选择系统" style={{ width: 200, marginRight: 10, marginBottom: 10 }} onChange={sysId => setParams({ ...innerParams, sysId, current: 1 }, true)}> | |
27 | + <Select | |
28 | + allowClear | |
29 | + showSearch | |
30 | + optionFilterProp="children" | |
31 | + placeholder="请选择系统" | |
32 | + style={{ width: 200, marginRight: 10, marginBottom: 10 }} | |
33 | + onChange={sysId => setParams({ ...innerParams, sysId, current: 1 }, true)} | |
34 | + > | |
28 | 35 | {(systems || []).map((i: Privilege.SystemListVO) => (<Option value={i.id || 0} key={i.id}>{i.sysName || '--'}</Option>))} |
29 | 36 | </Select> |
30 | 37 | <Search | ... | ... |
src/pages/admin/Role/components/RoleList.tsx
... | ... | @@ -37,8 +37,7 @@ export default function RoleList() { |
37 | 37 | message.success(record.status ? "禁用成功" : "启用成功") |
38 | 38 | const tempList = list.map((item: any) => { |
39 | 39 | if (item.id === record.id) { |
40 | - item.status = record.status === 0 ? 1 : 0 | |
41 | - return item; | |
40 | + return { ...item, status: record.status === 0 ? 1 : 0 }; | |
42 | 41 | } |
43 | 42 | return item; |
44 | 43 | }); | ... | ... |