fix: 新增个人中心
This commit is contained in:
parent
b01cc1bb17
commit
e9f255ca3c
|
@ -47,3 +47,5 @@ export const SystemConst = {
|
|||
VERSION_CODE: 'version_code',
|
||||
AMAP_KEY : 'amap_key',
|
||||
}
|
||||
|
||||
export const USER_CENTER_MENU_CODE = 'account-center'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import USER_CENTER_MENU_DATA from './baseMenu'
|
||||
/**
|
||||
* 内置角色数据
|
||||
*/
|
||||
|
@ -9,6 +10,33 @@ export enum ROLEKEYS {
|
|||
|
||||
export type roleKeysType = keyof typeof ROLEKEYS;
|
||||
|
||||
export const ROLE_USER_CENTER = {
|
||||
...USER_CENTER_MENU_DATA,
|
||||
buttons: [
|
||||
{
|
||||
id: 'passwd-update',
|
||||
name: '密码修改',
|
||||
enabled: true,
|
||||
granted: true
|
||||
},
|
||||
{
|
||||
id: 'info-update',
|
||||
name: '基本信息修改',
|
||||
enabled: true,
|
||||
granted: true
|
||||
},
|
||||
{
|
||||
id: 'message',
|
||||
name: '消息订阅',
|
||||
enabled: true,
|
||||
granted: true
|
||||
}
|
||||
],
|
||||
assetAccesses: [],
|
||||
granted: true,
|
||||
owner: 'iot'
|
||||
}
|
||||
|
||||
export const RoleData = {
|
||||
[ROLEKEYS.device]: {
|
||||
name: '设备接入岗',
|
||||
|
@ -217,6 +245,7 @@ export default {
|
|||
createTime: 1659344075524,
|
||||
granted: true,
|
||||
},
|
||||
ROLE_USER_CENTER
|
||||
],
|
||||
[ROLEKEYS.link]: [
|
||||
{
|
||||
|
@ -958,5 +987,6 @@ export default {
|
|||
accessDescription: '此菜单不支持数据权限控制',
|
||||
granted: true,
|
||||
},
|
||||
ROLE_USER_CENTER
|
||||
],
|
||||
};
|
||||
|
|
|
@ -1,3 +1,44 @@
|
|||
import { USER_CENTER_MENU_CODE } from '@/utils/consts'
|
||||
|
||||
export const USER_CENTER_MENU_DATA = {
|
||||
id: '19a1f2c763e1231f1e1',
|
||||
accessSupport: { value: 'unsupported', label: '不支持'},
|
||||
supportDataAccess: false,
|
||||
code: USER_CENTER_MENU_CODE,
|
||||
buttons: [
|
||||
{
|
||||
id: 'passwd-update',
|
||||
name: '密码修改',
|
||||
permissions: [
|
||||
{
|
||||
permission: 'user',
|
||||
action: ['update-self-pwd']
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'info-update',
|
||||
name: '基本信息修改',
|
||||
permissions: [
|
||||
{
|
||||
permission: 'user',
|
||||
action: ['update-self-info']
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'message',
|
||||
name: '消息订阅',
|
||||
permissions: [
|
||||
{
|
||||
permission: 'alarm-config',
|
||||
action: ['query']
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export default [
|
||||
// 物联网
|
||||
{
|
||||
|
@ -4015,6 +4056,10 @@ export default [
|
|||
permission: 'network-card',
|
||||
actions: ['save'],
|
||||
},
|
||||
{
|
||||
permission: 'device-instance',
|
||||
actions: ['query'],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -4219,4 +4264,6 @@ export default [
|
|||
},
|
||||
],
|
||||
},
|
||||
// 用户中心
|
||||
USER_CENTER_MENU_DATA
|
||||
];
|
||||
|
|
|
@ -73,6 +73,7 @@ import BaseMenu from '@/views/init-home/data/baseMenu';
|
|||
import type { AntTreeNodeDropEvent } from 'ant-design-vue/es/tree';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { onlyMessage } from '@/utils/comm';
|
||||
import { USER_CENTER_MENU_CODE } from '@/utils/consts'
|
||||
|
||||
const selectedKeys: any = ref([]);
|
||||
const treeData = ref<any>([]);
|
||||
|
@ -185,7 +186,7 @@ onMounted(() => {
|
|||
);
|
||||
getMenuTree_api(params).then((resp: any) => {
|
||||
if (resp.status == 200) {
|
||||
systemMenu.value = resp.result;
|
||||
systemMenu.value = resp.result?.filter((item: { code: string }) => item.code !== USER_CENTER_MENU_CODE);
|
||||
//初始化菜单
|
||||
const baseMenuData = developArrToMap(baseMenu.value);
|
||||
const systemMenuData = developArrToMap(systemMenu.value, true);
|
||||
|
|
|
@ -84,7 +84,7 @@ import { getMenuTree_api, delMenuInfo_api } from '@/api/system/menu';
|
|||
import { message } from 'jetlinks-ui-components';
|
||||
import dayjs from 'dayjs';
|
||||
import { useUserInfo } from '@/store/userInfo';
|
||||
|
||||
import { USER_CENTER_MENU_CODE } from '@/utils/consts'
|
||||
const admin = useUserInfo().userInfos?.type.id === 'admin';
|
||||
|
||||
const permission = 'system/Menu';
|
||||
|
@ -206,7 +206,7 @@ const table = reactive({
|
|||
return {
|
||||
code: resp.message,
|
||||
result: {
|
||||
data: resp.result,
|
||||
data: resp.result?.filter((item: { code: string }) => item.code !== USER_CENTER_MENU_CODE),
|
||||
pageIndex: resp.pageIndex,
|
||||
pageSize: resp.pageSize,
|
||||
total: resp.total,
|
||||
|
|
Loading…
Reference in New Issue