|
|
@@ -1,35 +1,30 @@
|
|
|
<template>
|
|
|
<div class="navbar">
|
|
|
<div class="left-menu">
|
|
|
- <el-popover
|
|
|
- popper-class="down-popover"
|
|
|
- placement="bottom"
|
|
|
- width="360"
|
|
|
- :visible-arrow="false"
|
|
|
- trigger="click">
|
|
|
- <div class="corp-switch">
|
|
|
- <div class="current-corp">{{ tenantName }}</div>
|
|
|
- <el-button type="text" style="color: #00B899;" @click="showProcessInstance()">
|
|
|
- <i class="el-icon-s-operation"></i>
|
|
|
- 切换企业/团队
|
|
|
- </el-button>
|
|
|
-
|
|
|
- </div>
|
|
|
- <i class="el-icon-s-grid icon-menu" slot="reference"></i>
|
|
|
- </el-popover>
|
|
|
- <div class="divider"></div>
|
|
|
- <a class="text" href="/">
|
|
|
- <img :src="logo" class="menu-icon dashboard" />
|
|
|
- <!-- <div class="menu-icon dashboard" style="background-image: url("https://g.jdycdn.com/app/pc/311a8e2b1ed9.png");"></div> -->
|
|
|
- 工作台
|
|
|
- </a>
|
|
|
+ <el-popover popper-class="down-popover" placement="bottom" width="360" :visible-arrow="false" trigger="click">
|
|
|
+ <div class="corp-switch">
|
|
|
+ <div class="current-corp">{{ tenantName }}</div>
|
|
|
+ <el-button type="text" style="color: #00B899;" @click="showProcessInstance()">
|
|
|
+ <i class="el-icon-s-operation"></i>
|
|
|
+ 切换企业/团队
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <i class="el-icon-s-grid icon-menu" slot="reference"></i>
|
|
|
+ </el-popover>
|
|
|
+ <div class="divider"></div>
|
|
|
+ <a class="text" href="/">
|
|
|
+ <img :src="logo" class="menu-icon dashboard" />
|
|
|
+ <!-- <div class="menu-icon dashboard" style="background-image: url("https://g.jdycdn.com/app/pc/311a8e2b1ed9.png");"></div> -->
|
|
|
+ 工作台
|
|
|
+ </a>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<div class="right-menu">
|
|
|
- <template v-if="device!=='mobile'">
|
|
|
+ <template v-if="device !== 'mobile'">
|
|
|
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
|
|
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
|
|
|
</el-tooltip>
|
|
|
@@ -52,7 +47,7 @@
|
|
|
<router-link to="/user/profile">
|
|
|
<el-dropdown-item>个人中心</el-dropdown-item>
|
|
|
</router-link>
|
|
|
- <el-dropdown-item @click.native="companySetting('/system/companyInfo')">
|
|
|
+ <el-dropdown-item @click.native="companySetting()">
|
|
|
<span>企业管理</span>
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item divided @click.native="logout">
|
|
|
@@ -61,7 +56,7 @@
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -76,9 +71,11 @@ import Search from '@/components/HeaderSearch'
|
|
|
import RuoYiGit from '@/components/RuoYi/Git'
|
|
|
import RuoYiDoc from '@/components/RuoYi/Doc'
|
|
|
import NotifyMessage from '@/layout/components/Message'
|
|
|
-import {getPath} from "@/utils/ruoyi";
|
|
|
+import { getPath } from "@/utils/ruoyi";
|
|
|
import logoImg from '@/assets/logo/work.png'
|
|
|
import router from '@/router'
|
|
|
+import {getListByMenuId} from "@/api/home";
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -126,124 +123,132 @@ export default {
|
|
|
this.$parent.showTeamWork();
|
|
|
},
|
|
|
childMethod() {
|
|
|
- this.$parent.fatherMethod();
|
|
|
+ this.$parent.fatherMethod();
|
|
|
},
|
|
|
toggleSideBar() {
|
|
|
this.$store.dispatch('app/toggleSideBar')
|
|
|
},
|
|
|
- async companySetting(item){
|
|
|
- let key = item;
|
|
|
- const menus = [
|
|
|
- {
|
|
|
- "id": 1,
|
|
|
- "parentId": 0,
|
|
|
- "name": "企业管理",
|
|
|
- "path": "/system",
|
|
|
- "component": null,
|
|
|
- "componentName": null,
|
|
|
- "icon": "system",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": [
|
|
|
+ async companySetting() {
|
|
|
+ let item = {
|
|
|
+ id: 6,
|
|
|
+ parentId: 5,
|
|
|
+ path: "/system/companyInfo",
|
|
|
+ }
|
|
|
+ getListByMenuId(item.id).then(response => {
|
|
|
+ let menuList = response.data;
|
|
|
+ const menus = [
|
|
|
{
|
|
|
- "id": 109,
|
|
|
- "parentId": 1,
|
|
|
- "name": "企业信息",
|
|
|
- "path": "companyInfo",
|
|
|
- "component": "system/companyInfo/index",
|
|
|
- "componentName": "SystemCompanyInfo",
|
|
|
- "icon": "tree-table",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 102,
|
|
|
- "parentId": 1,
|
|
|
- "name": "菜单管理",
|
|
|
- "path": "menu",
|
|
|
- "component": "system/menu/index",
|
|
|
- "componentName": "SystemMenu",
|
|
|
- "icon": "tree-table",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 103,
|
|
|
- "parentId": 1,
|
|
|
- "name": "部门管理",
|
|
|
- "path": "dept",
|
|
|
- "component": "system/dept/index",
|
|
|
- "componentName": "SystemDept",
|
|
|
- "icon": "tree",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 100,
|
|
|
- "parentId": 1,
|
|
|
- "name": "用户管理",
|
|
|
- "path": "user",
|
|
|
- "component": "system/user/index",
|
|
|
- "componentName": "SystemUser",
|
|
|
- "icon": "user",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 101,
|
|
|
- "parentId": 1,
|
|
|
- "name": "角色管理",
|
|
|
- "path": "role",
|
|
|
- "component": "system/role/index",
|
|
|
- "componentName": "SystemRole",
|
|
|
- "icon": "peoples",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- "id": 105,
|
|
|
- "parentId": 1,
|
|
|
- "name": "字典管理",
|
|
|
- "path": "dict",
|
|
|
- "component": "system/dict/index",
|
|
|
- "componentName": "SystemDictType",
|
|
|
- "icon": "dict",
|
|
|
- "visible": true,
|
|
|
- "keepAlive": true,
|
|
|
- "alwaysShow": true,
|
|
|
- "children": null
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
- localStorage.setItem("menus", JSON.stringify(menus))
|
|
|
- this.$store.dispatch('GenerateRoutes', menus).then(accessRoutes => {
|
|
|
+ "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 => {
|
|
|
console.log(accessRoutes);
|
|
|
// 根据 roles 权限生成可访问的路由表
|
|
|
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
|
|
})
|
|
|
setTimeout(() => {
|
|
|
- this.$router.push({ path: key });
|
|
|
+ this.$router.push({ path: item.path });
|
|
|
}, 200);
|
|
|
+ });
|
|
|
},
|
|
|
async logout() {
|
|
|
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
|
|
|
this.$store.dispatch('LogOut').then(() => {
|
|
|
location.href = getPath('/index');
|
|
|
})
|
|
|
- }).catch(() => {});
|
|
|
+ }).catch(() => { });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -258,28 +263,31 @@ a {
|
|
|
outline: none;
|
|
|
text-decoration: none;
|
|
|
}
|
|
|
-.corp-switch{
|
|
|
+
|
|
|
+.corp-switch {
|
|
|
align-items: center;
|
|
|
display: flex;
|
|
|
height: 65px;
|
|
|
justify-content: space-between;
|
|
|
padding-left: 20px;
|
|
|
+
|
|
|
.current-corp {
|
|
|
- color: #141e31;
|
|
|
- font-size: 18px;
|
|
|
- line-height: 32px;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
- width: 240px;
|
|
|
- }
|
|
|
+ color: #141e31;
|
|
|
+ font-size: 18px;
|
|
|
+ line-height: 32px;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ width: 240px;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
.navbar {
|
|
|
height: 60px;
|
|
|
overflow: hidden;
|
|
|
position: relative;
|
|
|
background: #fff;
|
|
|
- box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
|
|
+ box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
|
|
|
|
|
|
.hamburger-container {
|
|
|
line-height: 46px;
|
|
|
@@ -287,7 +295,7 @@ a {
|
|
|
float: left;
|
|
|
cursor: pointer;
|
|
|
transition: background .3s;
|
|
|
- -webkit-tap-highlight-color:transparent;
|
|
|
+ -webkit-tap-highlight-color: transparent;
|
|
|
|
|
|
&:hover {
|
|
|
background: rgba(0, 0, 0, .025)
|
|
|
@@ -307,7 +315,7 @@ a {
|
|
|
display: inline-block;
|
|
|
vertical-align: top;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.left-menu {
|
|
|
font-size: 16px;
|
|
|
padding: 0px 15px;
|
|
|
@@ -318,11 +326,13 @@ a {
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
cursor: pointer;
|
|
|
+
|
|
|
.icon-menu:hover {
|
|
|
- background: #e6e8ed;
|
|
|
- border-radius: 3px;
|
|
|
+ background: #e6e8ed;
|
|
|
+ border-radius: 3px;
|
|
|
}
|
|
|
- .icon-menu{
|
|
|
+
|
|
|
+ .icon-menu {
|
|
|
color: #525967;
|
|
|
cursor: pointer;
|
|
|
display: inline-block;
|
|
|
@@ -332,7 +342,8 @@ a {
|
|
|
text-align: center;
|
|
|
width: 30px;
|
|
|
}
|
|
|
- .divider{
|
|
|
+
|
|
|
+ .divider {
|
|
|
height: 20px;
|
|
|
margin: 0 5px;
|
|
|
border: solid #EBECEE;
|
|
|
@@ -342,10 +353,12 @@ a {
|
|
|
// margin: 0 15px;
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
+
|
|
|
.text:hover {
|
|
|
- background: #e6e8ed;
|
|
|
+ background: #e6e8ed;
|
|
|
}
|
|
|
- .text{
|
|
|
+
|
|
|
+ .text {
|
|
|
height: 30px;
|
|
|
align-items: center;
|
|
|
border-radius: 4px;
|
|
|
@@ -353,7 +366,8 @@ a {
|
|
|
display: flex;
|
|
|
padding: 0 5px;
|
|
|
transition: background .2s ease;
|
|
|
- .menu-icon{
|
|
|
+
|
|
|
+ .menu-icon {
|
|
|
background-size: 100px 20px;
|
|
|
height: 20px;
|
|
|
margin-right: 5px;
|
|
|
@@ -361,7 +375,7 @@ a {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.right-menu {
|
|
|
float: right;
|
|
|
height: 100%;
|
|
|
@@ -404,7 +418,8 @@ a {
|
|
|
height: 35px;
|
|
|
border-radius: 50%;
|
|
|
}
|
|
|
- .user-nickname{
|
|
|
+
|
|
|
+ .user-nickname {
|
|
|
margin-left: 5px;
|
|
|
font-size: 14px;
|
|
|
}
|