qqq
This commit is contained in:
@@ -36,6 +36,8 @@ interface UserData {
|
||||
phonenumber: string
|
||||
status: string
|
||||
loginDate: string
|
||||
password: string
|
||||
provinceName: string
|
||||
dept: {
|
||||
deptName: string
|
||||
}
|
||||
@@ -211,6 +213,7 @@ export default function CompanyPermissionsPage() {
|
||||
<TableRow>
|
||||
<TableHead>用户信息</TableHead>
|
||||
<TableHead>角色</TableHead>
|
||||
<TableHead>所属省份</TableHead>
|
||||
<TableHead>部门/机构</TableHead>
|
||||
<TableHead>联系方式</TableHead>
|
||||
<TableHead>最后登录</TableHead>
|
||||
@@ -221,13 +224,13 @@ export default function CompanyPermissionsPage() {
|
||||
<TableBody>
|
||||
{loading ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={7} className="text-center py-8">
|
||||
<TableCell colSpan={8} className="text-center py-8">
|
||||
<div className="text-gray-500">加载中...</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : users.length === 0 ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={7} className="text-center py-8">
|
||||
<TableCell colSpan={8} className="text-center py-8">
|
||||
<div className="text-gray-500">暂无数据</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
@@ -238,6 +241,10 @@ export default function CompanyPermissionsPage() {
|
||||
const roleInfo = getRoleInfo(roleKey)
|
||||
const RoleIcon = roleInfo.icon
|
||||
|
||||
// 判断是否显示"总公司":总公司管理员(admin)或总商户
|
||||
const showHeadquarters = roleKey === 'admin' || (roleKey === 'merchant' && user.admin)
|
||||
const provinceDisplay = showHeadquarters ? '总公司' : (user.provinceName || '-')
|
||||
|
||||
return (
|
||||
<TableRow key={`${user.userId}-${user.userName}-${index}`}>
|
||||
<TableCell>
|
||||
@@ -252,6 +259,9 @@ export default function CompanyPermissionsPage() {
|
||||
<Badge className={roleInfo.color}>{userRole?.roleName || '未知角色'}</Badge>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div className="text-sm">{provinceDisplay}</div>
|
||||
</TableCell>
|
||||
<TableCell>{user.dept?.deptName || '-'}</TableCell>
|
||||
<TableCell>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user