feat(sj_1.0.0): 菜单添加权限
This commit is contained in:
parent
d64b691345
commit
9ae1d86031
2
.env
2
.env
@ -41,7 +41,7 @@ VITE_SERVICE_MODAL_LOGOUT_CODES=5001
|
|||||||
VITE_SERVICE_EXPIRED_TOKEN_CODES=9999,9998
|
VITE_SERVICE_EXPIRED_TOKEN_CODES=9999,9998
|
||||||
|
|
||||||
# when the route mode is static, the defined super role
|
# when the route mode is static, the defined super role
|
||||||
VITE_STATIC_SUPER_ROLE=R_SUPER
|
VITE_STATIC_SUPER_ROLE=R_ADMIN
|
||||||
|
|
||||||
# sourcemap
|
# sourcemap
|
||||||
VITE_SOURCE_MAP=N
|
VITE_SOURCE_MAP=N
|
||||||
|
@ -41,8 +41,8 @@ export const menuIconTypeRecord: Record<Api.SystemManage.IconType, App.I18n.I18n
|
|||||||
export const menuIconTypeOptions = transformRecordToOption(menuIconTypeRecord);
|
export const menuIconTypeOptions = transformRecordToOption(menuIconTypeRecord);
|
||||||
|
|
||||||
export const roleTypeRecord: Record<string, string> = {
|
export const roleTypeRecord: Record<string, string> = {
|
||||||
'1': 'R_ADMIN',
|
'1': 'R_USER',
|
||||||
'2': 'R_SUPER'
|
'2': 'R_ADMIN'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const podsType: Record<Api.Dashboard.DashboardPodsType, App.I18n.I18nKey> = {
|
export const podsType: Record<Api.Dashboard.DashboardPodsType, App.I18n.I18nKey> = {
|
||||||
|
@ -385,7 +385,8 @@ export const generatedRoutes: GeneratedRoute[] = [
|
|||||||
title: 'namespace',
|
title: 'namespace',
|
||||||
i18nKey: 'route.namespace',
|
i18nKey: 'route.namespace',
|
||||||
icon: 'eos-icons:namespace',
|
icon: 'eos-icons:namespace',
|
||||||
order: 20
|
order: 20,
|
||||||
|
roles: ['R_ADMIN']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -497,7 +498,8 @@ export const generatedRoutes: GeneratedRoute[] = [
|
|||||||
title: 'user',
|
title: 'user',
|
||||||
i18nKey: 'route.user',
|
i18nKey: 'route.user',
|
||||||
order: 900,
|
order: 900,
|
||||||
icon: 'material-symbols:manage-accounts'
|
icon: 'material-symbols:manage-accounts',
|
||||||
|
roles: ['R_ADMIN']
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
@ -508,7 +510,8 @@ export const generatedRoutes: GeneratedRoute[] = [
|
|||||||
title: 'user_manager',
|
title: 'user_manager',
|
||||||
i18nKey: 'route.user_manager',
|
i18nKey: 'route.user_manager',
|
||||||
icon: 'streamline:interface-user-multiple-close-geometric-human-multiple-person-up-user',
|
icon: 'streamline:interface-user-multiple-close-geometric-human-multiple-person-up-user',
|
||||||
order: 900
|
order: 900,
|
||||||
|
roles: ['R_ADMIN']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -9,10 +9,11 @@ import { useTable, useTableOperate } from '@/hooks/common/table';
|
|||||||
import { groupConfigIdModeRecord, yesOrNoRecord } from '@/constants/business';
|
import { groupConfigIdModeRecord, yesOrNoRecord } from '@/constants/business';
|
||||||
import { tagColor } from '@/utils/common';
|
import { tagColor } from '@/utils/common';
|
||||||
import StatusSwitch from '@/components/common/status-switch.vue';
|
import StatusSwitch from '@/components/common/status-switch.vue';
|
||||||
|
import { useAuth } from '@/hooks/business/auth';
|
||||||
import GroupOperateDrawer from './modules/group-operate-drawer.vue';
|
import GroupOperateDrawer from './modules/group-operate-drawer.vue';
|
||||||
import GroupDetailDrawer from './modules/group-detail-drawer.vue';
|
import GroupDetailDrawer from './modules/group-detail-drawer.vue';
|
||||||
import GroupSearch from './modules/group-search.vue';
|
import GroupSearch from './modules/group-search.vue';
|
||||||
|
const { hasAuth } = useAuth();
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
/** 详情页属性数据 */
|
/** 详情页属性数据 */
|
||||||
@ -166,6 +167,7 @@ function edit(id: string) {
|
|||||||
:disabled-delete="checkedRowKeys.length === 0"
|
:disabled-delete="checkedRowKeys.length === 0"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:show-delete="false"
|
:show-delete="false"
|
||||||
|
:show-add="hasAuth('R_ADMIN')"
|
||||||
@add="handleAdd"
|
@add="handleAdd"
|
||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user