diff --git a/src/api/jurisdiction.js b/src/api/jurisdiction.js index fe36440..4e212af 100644 --- a/src/api/jurisdiction.js +++ b/src/api/jurisdiction.js @@ -1,5 +1,6 @@ import request from '@/utils/request' const admin = '/back/admin' +const home = '/back/home' const role = '/back/role' const permission = '/back/permission' @@ -157,3 +158,14 @@ export function GET_ALL_HAVE(params) { data: params }).then(res => res.data) } + +/** + * 获取当前角色展示的菜单 + */ +export function GET_ALL_MENUS(params) { + return request({ + url: `${home}/menus`, + method: 'post', + data: params + }).then(res => res.data) +} diff --git a/src/router/menus/approval.js b/src/router/menus/approval.js index 6af8039..414c1fd 100644 --- a/src/router/menus/approval.js +++ b/src/router/menus/approval.js @@ -3,6 +3,7 @@ import Layout from '@/views/layout/Layout' const approval = { path: '/approval', component: Layout, + code: '0700', meta: {title: '审批事项', icon: 'dingdan', noCache: true, affix: false}, children: [ { diff --git a/src/router/menus/building.js b/src/router/menus/building.js index 9eaf41c..07e2b37 100644 --- a/src/router/menus/building.js +++ b/src/router/menus/building.js @@ -3,6 +3,7 @@ import Layout from '@/views/layout/Layout' const building = { path: '/building', component: Layout, + code: '0300', meta: {title: '党的建设', icon: 'dingdan', noCache: true, affix: false}, children: [ { diff --git a/src/router/menus/department.js b/src/router/menus/department.js index 778c5ae..4a4f356 100644 --- a/src/router/menus/department.js +++ b/src/router/menus/department.js @@ -3,6 +3,7 @@ import Layout from '@/views/layout/Layout' const department = { path: '/department', component: Layout, + code: '0900', meta: {title: '部门首页', icon: 'dingdan', noCache: true, affix: false}, children: [ { diff --git a/src/router/menus/index.js b/src/router/menus/index.js index fb6e485..d792b15 100644 --- a/src/router/menus/index.js +++ b/src/router/menus/index.js @@ -3,12 +3,14 @@ import Layout from '@/views/layout/Layout' const commodityManagement = { path: '/index', component: Layout, + code: '0000', meta: {title: '首页', icon: 'yemian-copy', noCache: true, affix: false}, children: [ { path: '/index/index', component: () => import('@/views/index/index'), name: '首页', + code: '0000', meta: {title: '首页', noCache: false, affix: false} }, ] diff --git a/src/router/menus/information.js b/src/router/menus/information.js index e8e78ff..c184509 100644 --- a/src/router/menus/information.js +++ b/src/router/menus/information.js @@ -3,6 +3,7 @@ import Layout from '@/views/layout/Layout' const commodityManagement = { path: '/information', component: Layout, + code: '0600', meta: {title: '信息公开', icon: 'dingdan', noCache: true, affix: false}, children: [ { diff --git a/src/router/menus/news.js b/src/router/menus/news.js index f48c2f4..182f9df 100644 --- a/src/router/menus/news.js +++ b/src/router/menus/news.js @@ -3,6 +3,7 @@ import Layout from '@/views/layout/Layout' const commodityManagement = { path: '/news', component: Layout, + code: '0200', meta: {title: '新闻中心', icon: 'dingdan', noCache: true, affix: false}, children: [ { diff --git a/src/router/menus/notice.js b/src/router/menus/notice.js index e473e5f..336bb35 100644 --- a/src/router/menus/notice.js +++ b/src/router/menus/notice.js @@ -3,6 +3,7 @@ import Layout from '@/views/layout/Layout' const commodityManagement = { path: '/notice', component: Layout, + code: '0500', meta: {title: '通知公告', icon: 'dingdan', noCache: true, affix: false}, children: [ { diff --git a/src/router/menus/others.js b/src/router/menus/others.js index b07ae5a..5f08056 100644 --- a/src/router/menus/others.js +++ b/src/router/menus/others.js @@ -3,8 +3,8 @@ import Layout from '@/views/layout/Layout' const others = { path: '/others', component: Layout, - meta: {title: '其他', icon: 'dingdan', noCache: true, affix: false}, code: '9900', + meta: {title: '其他', icon: 'dingdan', noCache: true, affix: false}, children: [ { path: '/configuration', diff --git a/src/router/menus/production.js b/src/router/menus/production.js index 4ce0318..3ad75e8 100644 --- a/src/router/menus/production.js +++ b/src/router/menus/production.js @@ -3,6 +3,7 @@ import Layout from '@/views/layout/Layout' const commodityManagement = { path: '/production', component: Layout, + code: '0400', meta: {title: '安全生产', icon: 'dingdan', noCache: true, affix: false}, children: [ { diff --git a/src/router/menus/profile.js b/src/router/menus/profile.js index 10efcb2..5b47975 100644 --- a/src/router/menus/profile.js +++ b/src/router/menus/profile.js @@ -3,6 +3,7 @@ import Layout from '@/views/layout/Layout' const commodityManagement = { path: '/profile', component: Layout, + code: '0100', meta: {title: '公司概况', icon: 'dingdan', noCache: true, affix: false}, children: [ { diff --git a/src/router/menus/system.js b/src/router/menus/system.js index f453684..7656c83 100644 --- a/src/router/menus/system.js +++ b/src/router/menus/system.js @@ -3,6 +3,7 @@ import Layout from '@/views/layout/Layout' const commodityManagement = { path: '/system', component: Layout, + code: '0800', meta: {title: '制度资料', icon: 'dingdan', noCache: true, affix: false}, children: [ { diff --git a/src/router/modules/privilegeManagement.js b/src/router/modules/privilegeManagement.js index 17ecec0..7561223 100644 --- a/src/router/modules/privilegeManagement.js +++ b/src/router/modules/privilegeManagement.js @@ -3,8 +3,8 @@ import Layout from '@/views/layout/Layout' const commodityManagement = { path: '/privilegeManagement', component: Layout, - meta: {title: '权限管理', icon: 'shouquanguanli', noCache: true, affix: false}, code: '6600', + meta: {title: '权限管理', icon: 'shouquanguanli', noCache: true, affix: false}, children: [ { path: '/privilegeManagement/account', diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue index 40b02be..ceb71e7 100644 --- a/src/views/layout/components/Sidebar/SidebarItem.vue +++ b/src/views/layout/components/Sidebar/SidebarItem.vue @@ -1,19 +1,19 @@