update role frontend
This commit is contained in:
@@ -153,7 +153,7 @@ watch(
|
|||||||
<template>
|
<template>
|
||||||
<a-modal
|
<a-modal
|
||||||
:open="open"
|
:open="open"
|
||||||
:title="`配置权限 - ${role?.description || role?.name || ''}`"
|
:title="`配置权限 - ${role?.label || role?.name || ''}`"
|
||||||
width="720px"
|
width="720px"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
@cancel="handleClose"
|
@cancel="handleClose"
|
||||||
|
|||||||
@@ -33,9 +33,10 @@ import { api } from '@/utils/request'
|
|||||||
const mockRole = {
|
const mockRole = {
|
||||||
id: 2,
|
id: 2,
|
||||||
name: 'editor',
|
name: 'editor',
|
||||||
description: '编辑者',
|
label: '编辑者',
|
||||||
user_count: 3,
|
description: '可以编辑内容的角色',
|
||||||
route_group_count: 2,
|
users_count: 3,
|
||||||
|
route_groups_count: 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
const mockGroups = [
|
const mockGroups = [
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import RolePermissionModal from '@/components/RolePermissionModal.vue'
|
|||||||
const roleStore = useRoleManageStore()
|
const roleStore = useRoleManageStore()
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '角色名称', dataIndex: 'description', key: 'description' },
|
{ title: '角色名称', dataIndex: 'label', key: 'label' },
|
||||||
{ title: '标识', dataIndex: 'name', key: 'name' },
|
{ title: '标识', dataIndex: 'name', key: 'name' },
|
||||||
{ title: '用户数', dataIndex: 'user_count', key: 'user_count', width: 100 },
|
{ title: '用户数', dataIndex: 'users_count', key: 'users_count', width: 100 },
|
||||||
{ title: '路由组数', key: 'route_group_count', width: 120 },
|
{ title: '路由组数', key: 'route_groups_count', width: 120 },
|
||||||
{ title: '操作', key: 'action', width: 120 },
|
{ title: '操作', key: 'action', width: 120 },
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -41,9 +41,15 @@ onMounted(() => {
|
|||||||
size="middle"
|
size="middle"
|
||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'route_group_count'">
|
<template v-if="column.key === 'label'">
|
||||||
|
<div>
|
||||||
|
<div>{{ record.label }}</div>
|
||||||
|
<div class="text-xs text-gray-400">{{ record.description }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'route_groups_count'">
|
||||||
<a-tag v-if="record.name === 'administrator'" color="blue">全部</a-tag>
|
<a-tag v-if="record.name === 'administrator'" color="blue">全部</a-tag>
|
||||||
<span v-else>{{ record.route_group_count }}</span>
|
<span v-else>{{ record.route_groups_count }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-button
|
<a-button
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ import { api } from '@/utils/request'
|
|||||||
export interface RoleRecord {
|
export interface RoleRecord {
|
||||||
id: number
|
id: number
|
||||||
name: string
|
name: string
|
||||||
|
label: string
|
||||||
description: string
|
description: string
|
||||||
user_count: number
|
users_count: number
|
||||||
route_group_count: number
|
route_groups_count: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RouteOverride {
|
export interface RouteOverride {
|
||||||
|
|||||||
Reference in New Issue
Block a user