feat: 用户管理页面增加角色列展示
在用户列表中增加"角色"列,显示在用户名和邮箱之间。 用户角色使用蓝色标签样式展示,支持多个角色同时显示。 同时在移动端卡片视图中也增加了角色展示。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -632,6 +632,24 @@ export default function AdminUsersPage() {
|
||||
dataIndex: "username",
|
||||
width: 140,
|
||||
},
|
||||
{
|
||||
title: "角色",
|
||||
dataIndex: "role_codes",
|
||||
width: 180,
|
||||
render: (roleCodes: string[]) => (
|
||||
<Space wrap size={[4, 4]}>
|
||||
{roleCodes && roleCodes.length > 0 ? (
|
||||
roleCodes.map((code) => (
|
||||
<Tag key={code} color="blue">
|
||||
{code}
|
||||
</Tag>
|
||||
))
|
||||
) : (
|
||||
<Typography.Text type="secondary">-</Typography.Text>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "邮箱",
|
||||
dataIndex: "email",
|
||||
@@ -782,6 +800,20 @@ export default function AdminUsersPage() {
|
||||
{userItem.email || "-"}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="admin-users-user-card-field">
|
||||
<Typography.Text type="secondary">角色</Typography.Text>
|
||||
<Space wrap size={[4, 4]}>
|
||||
{userItem.role_codes && userItem.role_codes.length > 0 ? (
|
||||
userItem.role_codes.map((code) => (
|
||||
<Tag key={code} color="blue">
|
||||
{code}
|
||||
</Tag>
|
||||
))
|
||||
) : (
|
||||
<Typography.Text type="secondary">-</Typography.Text>
|
||||
)}
|
||||
</Space>
|
||||
</div>
|
||||
<div className="admin-users-user-card-actions">
|
||||
<Space wrap>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user