调整
This commit is contained in:
parent
3206bc349f
commit
0802a32395
|
@ -6,6 +6,7 @@
|
|||
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
|
||||
|
||||
<div class="right-menu">
|
||||
<span class="dept-name">{{deptName}}</span>
|
||||
<template v-if="device!=='mobile'">
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
|
||||
|
@ -64,6 +65,7 @@ export default {
|
|||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'deptName',
|
||||
'device'
|
||||
]),
|
||||
setting: {
|
||||
|
@ -138,10 +140,17 @@ export default {
|
|||
}
|
||||
|
||||
.right-menu {
|
||||
display: flex;
|
||||
align-items: center; /* 垂直居中对齐 */
|
||||
float: right;
|
||||
height: 100%;
|
||||
line-height: 50px;
|
||||
|
||||
.dept-name {
|
||||
font-size: 14px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ const getters = {
|
|||
cachedViews: state => state.tagsView.cachedViews,
|
||||
token: state => state.user.token,
|
||||
avatar: state => state.user.avatar,
|
||||
deptName: state => state.user.deptName,
|
||||
name: state => state.user.name,
|
||||
introduction: state => state.user.introduction,
|
||||
roles: state => state.user.roles,
|
||||
|
|
|
@ -7,6 +7,7 @@ const user = {
|
|||
id: '',
|
||||
name: '',
|
||||
avatar: '',
|
||||
deptName: '',
|
||||
roles: [],
|
||||
permissions: []
|
||||
},
|
||||
|
@ -24,6 +25,9 @@ const user = {
|
|||
SET_AVATAR: (state, avatar) => {
|
||||
state.avatar = avatar
|
||||
},
|
||||
SET_DEPTNAME: (state, deptName) => {
|
||||
state.deptName = deptName
|
||||
},
|
||||
SET_ROLES: (state, roles) => {
|
||||
state.roles = roles
|
||||
},
|
||||
|
@ -65,6 +69,7 @@ const user = {
|
|||
commit('SET_ID', user.userId)
|
||||
commit('SET_NAME', user.userName)
|
||||
commit('SET_AVATAR', avatar)
|
||||
commit('SET_DEPTNAME', user.dept.deptName)
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
|
Loading…
Reference in New Issue
Block a user