|
|
@@ -47,7 +47,7 @@
|
|
|
<router-link to="/user/profile">
|
|
|
<el-dropdown-item>个人中心</el-dropdown-item>
|
|
|
</router-link>
|
|
|
- <el-dropdown-item @click.native="companySetting()" v-loading.fullscreen.lock="fullscreenLoading">
|
|
|
+ <el-dropdown-item v-if="userInfo.manageMenuId" @click.native="companySetting()" v-loading.fullscreen.lock="fullscreenLoading">
|
|
|
<span>企业管理</span>
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item divided @click.native="logout">
|
|
|
@@ -117,6 +117,9 @@ export default {
|
|
|
get() {
|
|
|
return this.$store.state.settings.topNav
|
|
|
}
|
|
|
+ },
|
|
|
+ userInfo() {
|
|
|
+ return JSON.parse(this.$store.getters.userInfo);
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -131,108 +134,13 @@ export default {
|
|
|
},
|
|
|
async companySetting() {
|
|
|
let item = {
|
|
|
- id: 6,
|
|
|
+ id: this.userInfo.manageMenuId,
|
|
|
parentId: 5,
|
|
|
path: "/system/companyInfo",
|
|
|
}
|
|
|
this.fullscreenLoading = true;
|
|
|
getListByMenuId(item.id).then(response => {
|
|
|
let menuList = response.data;
|
|
|
- const menus = [
|
|
|
- {
|
|
|
- "id": 6,
|
|
|
- "parentId": 5,
|
|
|
- "name": "企业管理",
|
|
|
- "path": "/system",
|
|
|
- "component": null,
|
|
|
- "componentName": null,
|
|
|
- "icon": "system",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": [
|
|
|
- {
|
|
|
- "id": 109,
|
|
|
- "parentId": 6,
|
|
|
- "name": "企业信息",
|
|
|
- "path": "companyInfo",
|
|
|
- "component": "system/companyInfo/index",
|
|
|
- "componentName": "SystemCompanyInfo",
|
|
|
- "icon": "tree-table",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 102,
|
|
|
- "parentId": 6,
|
|
|
- "name": "菜单管理",
|
|
|
- "path": "menu",
|
|
|
- "component": "system/menu/index",
|
|
|
- "componentName": "SystemMenu",
|
|
|
- "icon": "tree-table",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 103,
|
|
|
- "parentId": 6,
|
|
|
- "name": "部门管理",
|
|
|
- "path": "dept",
|
|
|
- "component": "system/dept/index",
|
|
|
- "componentName": "SystemDept",
|
|
|
- "icon": "tree",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 100,
|
|
|
- "parentId": 6,
|
|
|
- "name": "用户管理",
|
|
|
- "path": "user",
|
|
|
- "component": "system/user/index",
|
|
|
- "componentName": "SystemUser",
|
|
|
- "icon": "user",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 101,
|
|
|
- "parentId": 6,
|
|
|
- "name": "角色管理",
|
|
|
- "path": "role",
|
|
|
- "component": "system/role/index",
|
|
|
- "componentName": "SystemRole",
|
|
|
- "icon": "peoples",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- "id": 105,
|
|
|
- "parentId": 6,
|
|
|
- "name": "字典管理",
|
|
|
- "path": "dict",
|
|
|
- "component": "system/dict/index",
|
|
|
- "componentName": "SystemDictType",
|
|
|
- "icon": "dict",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
localStorage.setItem("parentId", item.parentId)
|
|
|
localStorage.setItem("menus", JSON.stringify(menuList))
|
|
|
this.$store.dispatch('GenerateRoutes', menuList).then(accessRoutes => {
|