修改
This commit is contained in:
@@ -411,43 +411,46 @@ export default function UserRolePage() {
|
||||
onChange: (selectedRowKeys) => setSelectedUserIds(selectedRowKeys)
|
||||
}}
|
||||
columns={[
|
||||
{ title: '用户账号', dataIndex: 'userName' },
|
||||
{ title: '用户昵称', dataIndex: 'nickName' },
|
||||
{ title: '手机号', dataIndex: 'phonenumber' },
|
||||
{ title: '邮箱', dataIndex: 'email' },
|
||||
// 所属机构
|
||||
{ title: '用户账号', dataIndex: 'userName', ellipsis: true },
|
||||
{ title: '用户昵称', dataIndex: 'nickName', ellipsis: true },
|
||||
{ title: '手机号', dataIndex: 'phonenumber', ellipsis: true },
|
||||
{ title: '邮箱', dataIndex: 'email', ellipsis: true },
|
||||
{
|
||||
title: '所属机构',
|
||||
render: (_, r) => {
|
||||
const org = orgList.find(o => o.id == r.orgId);
|
||||
return org ? org.orgName : '—';
|
||||
}
|
||||
},
|
||||
ellipsis: true
|
||||
},
|
||||
// 所属场站(纯缓存匹配,无接口)
|
||||
{
|
||||
title: '所属场站',
|
||||
render: (_, r) => {
|
||||
if (!r.siteId) return '—';
|
||||
const site = allSiteList.find(s => s.id == r.siteId);
|
||||
return site ? site.siteName : '—';
|
||||
}
|
||||
},
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '角色',
|
||||
render: (_, r) => (r.roles || []).map(i => (
|
||||
<Tag color="blue" key={i.roleId}>{i?.roleKey}</Tag>
|
||||
))
|
||||
)),
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
title: '状态', dataIndex: 'status', width: 80,
|
||||
render: (_, s) => s.status === '0'
|
||||
? <Tag color="green">正常</Tag>
|
||||
: <Tag color="red">停用</Tag>
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 220,
|
||||
fixed: 'right',
|
||||
render: (_, r) => (
|
||||
<Space>
|
||||
<Space wrap>
|
||||
<Button type="text" icon={<EditOutlined style={{ color: '#1890ff' }} />} onClick={() => handleEditUser(r)}>编辑</Button>
|
||||
<Popconfirm onConfirm={() => handleDeleteUser(r.userId)} title="确定删除该用户吗?">
|
||||
<Button type="text" danger icon={<DeleteOutlined />}>删除</Button>
|
||||
@@ -468,6 +471,8 @@ export default function UserRolePage() {
|
||||
onChange={(p) => setUserPagination({ ...userPagination, pageNum: p.current!, pageSize: p.pageSize! })}
|
||||
bordered
|
||||
size="middle"
|
||||
// 👇 下面这行是修复不自适应的关键
|
||||
scroll={{ x: 'max-content' }}
|
||||
/>
|
||||
</TabPane>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user