mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-03 16:06:13 +00:00
perf: 修改 nav view switch
This commit is contained in:
@@ -77,8 +77,8 @@ export default {
|
|||||||
.menu-main.el-menu {
|
.menu-main.el-menu {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
::v-deep .el-submenu .el-submenu__title {
|
::v-deep .el-submenu .el-submenu__title {
|
||||||
height: 50px;
|
height: 55px;
|
||||||
line-height: 50px;
|
line-height: 55px;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
&.el-menu--horizontal {
|
&.el-menu--horizontal {
|
||||||
@@ -93,16 +93,19 @@ export default {
|
|||||||
}
|
}
|
||||||
.el-menu--horizontal .el-menu .el-menu-item {
|
.el-menu--horizontal .el-menu .el-menu-item {
|
||||||
display: inline-block!important;
|
display: inline-block!important;
|
||||||
|
padding: 10px 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 8px 15px 20px 15px;
|
height: 70px;
|
||||||
|
width: 85px;
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #303133;
|
color: #303133;
|
||||||
|
//background-color: #e6e6e6;
|
||||||
}
|
}
|
||||||
&:first-child {
|
&:first-child {
|
||||||
margin-left: 15px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-right: 15px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.el-submenu.is-opened {
|
.el-submenu.is-opened {
|
||||||
@@ -121,10 +124,12 @@ export default {
|
|||||||
}
|
}
|
||||||
.icons-title {
|
.icons-title {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-bottom: 10px;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.el-menu--popup-bottom-start {
|
.el-menu--popup-bottom-start {
|
||||||
margin-top: 0!important;
|
margin-top: 0!important;
|
||||||
}
|
}
|
||||||
|
.el-menu-item.is-active {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -15,10 +15,6 @@ function reject(msg) {
|
|||||||
return new Promise((resolve, reject) => reject(msg))
|
return new Promise((resolve, reject) => reject(msg))
|
||||||
}
|
}
|
||||||
|
|
||||||
// function setHeadTitle({ to, from, next }) {
|
|
||||||
// document.title = getPageTitle(to.meta.title)
|
|
||||||
// }
|
|
||||||
|
|
||||||
async function checkLogin({ to, from, next }) {
|
async function checkLogin({ to, from, next }) {
|
||||||
if (whiteList.indexOf(to.path) !== -1) {
|
if (whiteList.indexOf(to.path) !== -1) {
|
||||||
next()
|
next()
|
||||||
@@ -69,12 +65,11 @@ async function changeCurrentOrgIfNeed({ to, from, next }) {
|
|||||||
await refreshCurrentOrg()
|
await refreshCurrentOrg()
|
||||||
const currentOrg = store.getters.currentOrg
|
const currentOrg = store.getters.currentOrg
|
||||||
if (!currentOrg || typeof currentOrg !== 'object') {
|
if (!currentOrg || typeof currentOrg !== 'object') {
|
||||||
// console.log('Not has current org')
|
|
||||||
orgUtil.change2PropOrg()
|
orgUtil.change2PropOrg()
|
||||||
return reject('Change prop org')
|
return reject('Change prop org')
|
||||||
}
|
}
|
||||||
if (!orgUtil.hasCurrentOrgPermission()) {
|
if (!orgUtil.hasCurrentOrgPermission()) {
|
||||||
console.debug('Not has current org permission')
|
console.error('Not has current org permission')
|
||||||
orgUtil.change2PropOrg()
|
orgUtil.change2PropOrg()
|
||||||
return reject('Change prop org')
|
return reject('Change prop org')
|
||||||
}
|
}
|
||||||
@@ -109,11 +104,6 @@ export async function generatePageRoutes({ to, from, next }) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// try get user profile
|
// try get user profile
|
||||||
// note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
|
|
||||||
// 不能改名 current_org_roles, 里面返回的就是这个
|
|
||||||
// const currentRole = store.getters.currentRole
|
|
||||||
// console.log('Current org role: ', currentRole, rolec.getRolesDisplay(currentRole))
|
|
||||||
|
|
||||||
// generate accessible routes map based on roles
|
// generate accessible routes map based on roles
|
||||||
const accessRoutes = await store.dispatch('permission/generateRoutes', { to, from })
|
const accessRoutes = await store.dispatch('permission/generateRoutes', { to, from })
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user