fix(admin): 用户列表角色列改为中文显示(roleLabel 映射)
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
import { computed, onMounted, reactive, ref } from 'vue'
|
import { computed, onMounted, reactive, ref } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import type { AdminUser } from '@/types/admin'
|
import type { AdminUser } from '@/types/admin'
|
||||||
|
import { roleLabel } from '@/types/admin'
|
||||||
import { deleteUser, fetchUserList } from '@/api/users'
|
import { deleteUser, fetchUserList } from '@/api/users'
|
||||||
import { createUserFilterState, toUserListParams } from './users-filter'
|
import { createUserFilterState, toUserListParams } from './users-filter'
|
||||||
import { totalPageCount } from './user-pagination'
|
import { totalPageCount } from './user-pagination'
|
||||||
@@ -108,7 +109,11 @@ onMounted(loadUsers)
|
|||||||
<el-table v-loading="loading" :data="rows" stripe>
|
<el-table v-loading="loading" :data="rows" stripe>
|
||||||
<el-table-column prop="id" label="ID" width="90" />
|
<el-table-column prop="id" label="ID" width="90" />
|
||||||
<el-table-column prop="username" label="用户名" min-width="180" />
|
<el-table-column prop="username" label="用户名" min-width="180" />
|
||||||
<el-table-column prop="role" label="角色" width="140" />
|
<el-table-column label="角色" width="140">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span>{{ roleLabel(row.role) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="creatorUsername" label="所属管理员" width="160" />
|
<el-table-column prop="creatorUsername" label="所属管理员" width="160" />
|
||||||
<el-table-column prop="createdAt" label="创建时间" width="180" />
|
<el-table-column prop="createdAt" label="创建时间" width="180" />
|
||||||
<el-table-column label="操作" width="120" fixed="right">
|
<el-table-column label="操作" width="120" fixed="right">
|
||||||
|
|||||||
Reference in New Issue
Block a user