This commit is contained in:
menxipeng
2025-10-24 23:24:29 +08:00
parent f63bd1f626
commit ea6996ca6d

View File

@@ -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>