let pageRouter = [
{
path: '/place/placeCenter',
name: 'placeCenter',
meta: {
title: '场所中心',
icon: 'el-icon-location'
},
redirect: '/place/sceneManagement',
children: [
{
path: '/place/sceneManagement',
name: 'sceneManagement',
meta: {
title: '场景管理',
isRoot: true,
notShowChildren: true
},
component:' SceneList'
},
{
path: '/place/buildingManagement',
name: 'buildingManagement',
meta: {
title: '场所管理',
isRoot: true,
notShowChildren: true
},
component: 'RouteReplaceSelf(BuildingManagementList)',
children: [
{
path: '/place/addBuilding',
name: 'addBuilding',
meta: {
title: '新增场所',
prevLevel: 'buildingManagement',
notShowInMenu: true
},
component:' AddBuilding',
},
{
path: '/place/placeDetail',
name: 'placeDetail',
meta: {
title: '场所详情',
notShowInMenu: true,
prevLevel: 'buildingManagement'
},
component: 'SupspaceList',
}
]
}
]
},
{
path: '/place/locationCenter',
name: 'locationCenter',
meta: {
title: '位置中心',
icon: 'el-icon-location'
},
redirect: '/place/trajectoryTracking',
children: [
{
path: '/place/trajectoryTracking',
name: 'trajectoryTracking',
meta: {
title: '轨迹跟踪',
isRoot: true,
notShowChildren: true
},
component: 'TrajectoryTracking'
},
{
path: '/place/drawMap',
name: 'drawMap',
meta: {
title: '绘制地图',
isRoot: true,
notShowChildren: true
},
component: 'DrawMap'
},
{
path: '/place/pathPlanning',
name: 'pathPlanning',
meta: {
title: '路线规划',
isRoot: true,
notShowChildren: true
},
component:' PathPlanning'
},
{
path: '/place/goodsTransport',
name: 'goodsTransport',
meta: {
title: '危货运输',
isRoot: true,
notShowChildren: true
},
component:' GoodsTransport'
},
{
path: '/place/electronicFence',
name: 'electronicFence',
meta: {
title: '电子围栏',
isRoot: true,
notShowChildren: true
},
component: 'RouteReplaceSelf(ElectronicFence)',
children: [
{
path: '/place/addFence',
name: 'addFence',
meta: {
title: '新增电子围栏',
prevLevel: 'electronicFence',
notShowInMenu: true
},
component:' AddFence',
}
]
},
{
path: '/place/standardAddressLibrary',
name: 'standardAddressLibrary',
meta: {
title: '标准地址库',
},
redirect: '/place/buildingSupervise',
children: [
{
path: '/place/buildingSupervise',
name: 'buildingSupervise',
meta: {
title: '楼栋管理',
isRoot: true,
notShowChildren: true
},
component:' StandardManage '//标准管理
},
{
path: '/place/villageSupervise',
name: 'villageSupervise',
meta: {
title: '小区管理',
isRoot: true,
notShowChildren: true
},
component: 'StandardManage'
},
{
path: '/place/streetSupervise',
name: 'streetSupervise',
meta: {
title: '街道管理',
isRoot: true,
notShowChildren: true
},
component: 'StandardManage'
}
]
}
]
},
{
path: '/place/systemManagement',
name: 'systemManagement',
meta: {
title: '系统管理',
icon: 'el-icon-location'
},
redirect: '/place/systemLog',
children: [
{
path: '/place/systemLog',
name: 'systemLog',
meta: {
title: '系统日志',
isRoot: true,
notShowChildren: true
},
component: 'SystemLog,'
},
]
}
]
let data = [
{
"level": 0, //级别
"resDesc": "string",
"resId": "string",
"resKey": "string",
"resName": "systemManagement", //名字
"resType": "string",
"rsrv1": "string",
"subMenu": [
{}
],
"url": "string"
},
{
"level": 0, //级别
"resDesc": "string",
"resId": "string",
"resKey": "string",
"resName": "locationCenter", //名字
"resType": "string",
"rsrv1": "string",
"subMenu": [
{}
],
"url": "string"
}
];
let result=authMenu(pageRouter,data);
function authMenu(localRouter, interfaceRouter){
if (Array.isArray(localRouter) && Array.isArray(interfaceRouter)) {
return localRouter.filter((item) => {
return interfaceRouter.find((v) => v.resName=== item.name)
})
}
}
console.log(result)
侧边栏权限数据筛选模拟
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
相关阅读更多精彩内容
- 一、首先我的项目是基于vue-element-admin搭建的。该框架会自带处理路由权限部分,不过需要后期根据个人...
- api地址:https://www.showdoc.com.cn/aoaoe?page_id=5696507784...
- 前言:本项目是基于网络上大家都比较熟悉的vue-element-template后台项目模版进行开发的。主要实现了...
- 查看上篇文章通用数据级别权限的框架设计与实现(2)-数据权限的准备工作,我们开始数据列表的权限过滤.原理:我们在做...
- 查看上篇文章通用数据级别权限的框架设计(1)-相关业务场景的分析",我们要继续做一些准备工作。 我们先要设置当前用...