|
@@ -51,12 +51,10 @@
|
|
|
<!-- 路由出口 -->
|
|
<!-- 路由出口 -->
|
|
|
<router-layout />
|
|
<router-layout />
|
|
|
<!-- logo 图标 -->
|
|
<!-- logo 图标 -->
|
|
|
- <template v-slot:logo >
|
|
|
|
|
- <el-image v-if="logoImg" fit="contain" :src="logoImg" alt="logo" />
|
|
|
|
|
|
|
+ <template v-slot:logo>
|
|
|
|
|
+ <el-image v-if="logoImg" fit="contain" :src="logoImg" alt="logo" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<!-- 顶栏右侧区域 -->
|
|
<!-- 顶栏右侧区域 -->
|
|
|
<template v-slot:right>
|
|
<template v-slot:right>
|
|
|
<header-tools :fullscreen="fullscreen" @fullscreen="onFullscreen" />
|
|
<header-tools :fullscreen="fullscreen" @fullscreen="onFullscreen" />
|
|
@@ -93,9 +91,9 @@
|
|
|
import RouterLayout from '@/components/RouterLayout/index.vue';
|
|
import RouterLayout from '@/components/RouterLayout/index.vue';
|
|
|
import HeaderTools from './components/header-tools.vue';
|
|
import HeaderTools from './components/header-tools.vue';
|
|
|
// import PageFooter from './components/page-footer.vue';
|
|
// import PageFooter from './components/page-footer.vue';
|
|
|
|
|
+ import { getToken } from '@/utils/token-util';
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-import { logoByCode } from '@/api/login/index'
|
|
|
|
|
|
|
+ import { logoByCode } from '@/api/login/index';
|
|
|
import {
|
|
import {
|
|
|
PROJECT_NAME,
|
|
PROJECT_NAME,
|
|
|
HIDE_SIDEBARS,
|
|
HIDE_SIDEBARS,
|
|
@@ -126,7 +124,7 @@ import { logoByCode } from '@/api/login/index'
|
|
|
HeaderTools
|
|
HeaderTools
|
|
|
// PageFooter
|
|
// PageFooter
|
|
|
},
|
|
},
|
|
|
- data () {
|
|
|
|
|
|
|
+ data() {
|
|
|
return {
|
|
return {
|
|
|
// PROJECT_NAME,
|
|
// PROJECT_NAME,
|
|
|
HIDE_SIDEBARS,
|
|
HIDE_SIDEBARS,
|
|
@@ -139,60 +137,60 @@ import { logoByCode } from '@/api/login/index'
|
|
|
// 是否全屏
|
|
// 是否全屏
|
|
|
fullscreen: false,
|
|
fullscreen: false,
|
|
|
|
|
|
|
|
- logoImg: null,
|
|
|
|
|
- projectName: null,
|
|
|
|
|
|
|
+ logoImg: null,
|
|
|
|
|
+ projectName: null
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
// 当前语言
|
|
// 当前语言
|
|
|
- locale () {
|
|
|
|
|
|
|
+ locale() {
|
|
|
return this.$i18n.locale;
|
|
return this.$i18n.locale;
|
|
|
},
|
|
},
|
|
|
// 菜单数据
|
|
// 菜单数据
|
|
|
- menus () {
|
|
|
|
|
|
|
+ menus() {
|
|
|
return this.$store.state.user.menus;
|
|
return this.$store.state.user.menus;
|
|
|
},
|
|
},
|
|
|
// 主题状态
|
|
// 主题状态
|
|
|
...mapGetters(['theme'])
|
|
...mapGetters(['theme'])
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getLogo()
|
|
|
|
|
|
|
+ if(getToken()){
|
|
|
|
|
+ this.getLogo();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
-
|
|
|
|
|
getLogo() {
|
|
getLogo() {
|
|
|
- logoByCode('logoCode').then(res => {
|
|
|
|
|
- this.logoImg = res.logoUrl
|
|
|
|
|
- this.projectName = res.logoName
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ logoByCode('logoCode').then((res) => {
|
|
|
|
|
+ this.logoImg = res.logoUrl;
|
|
|
|
|
+ this.projectName = res.logoName;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
/* 侧栏折叠切换 */
|
|
/* 侧栏折叠切换 */
|
|
|
- updateCollapse (value) {
|
|
|
|
|
|
|
+ updateCollapse(value) {
|
|
|
// console.log('value:', this.$store.state.user.menus);
|
|
// console.log('value:', this.$store.state.user.menus);
|
|
|
this.$store.dispatch('theme/setCollapse', value);
|
|
this.$store.dispatch('theme/setCollapse', value);
|
|
|
},
|
|
},
|
|
|
/* 双侧栏一级折叠切换 */
|
|
/* 双侧栏一级折叠切换 */
|
|
|
- updateSideNavCollapse (value) {
|
|
|
|
|
|
|
+ updateSideNavCollapse(value) {
|
|
|
this.$store.dispatch('theme/setSideNavCollapse', value);
|
|
this.$store.dispatch('theme/setSideNavCollapse', value);
|
|
|
},
|
|
},
|
|
|
/* 内容区域全屏切换 */
|
|
/* 内容区域全屏切换 */
|
|
|
- updateBodyFullscreen (value) {
|
|
|
|
|
|
|
+ updateBodyFullscreen(value) {
|
|
|
this.$store.dispatch('theme/setBodyFullscreen', value);
|
|
this.$store.dispatch('theme/setBodyFullscreen', value);
|
|
|
},
|
|
},
|
|
|
/* logo 点击事件 */
|
|
/* logo 点击事件 */
|
|
|
- onLogoClick (isHome) {
|
|
|
|
|
|
|
+ onLogoClick(isHome) {
|
|
|
isHome || this.$router.push(LAYOUT_PATH);
|
|
isHome || this.$router.push(LAYOUT_PATH);
|
|
|
},
|
|
},
|
|
|
/* 监听屏幕尺寸改变 */
|
|
/* 监听屏幕尺寸改变 */
|
|
|
- screenSizeChange () {
|
|
|
|
|
|
|
+ screenSizeChange() {
|
|
|
this.$store.dispatch('theme/updateScreenSize');
|
|
this.$store.dispatch('theme/updateScreenSize');
|
|
|
this.fullscreen = isFullscreen();
|
|
this.fullscreen = isFullscreen();
|
|
|
},
|
|
},
|
|
|
/* 全屏切换 */
|
|
/* 全屏切换 */
|
|
|
- onFullscreen () {
|
|
|
|
|
|
|
+ onFullscreen() {
|
|
|
try {
|
|
try {
|
|
|
this.fullscreen = toggleFullscreen();
|
|
this.fullscreen = toggleFullscreen();
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -200,7 +198,7 @@ import { logoByCode } from '@/api/login/index'
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
/* 页签右键菜单点击事件 */
|
|
/* 页签右键菜单点击事件 */
|
|
|
- onTabContextMenu ({ key, tabKey, item, active }) {
|
|
|
|
|
|
|
+ onTabContextMenu({ key, tabKey, item, active }) {
|
|
|
switch (key) {
|
|
switch (key) {
|
|
|
case 'reload': // 刷新
|
|
case 'reload': // 刷新
|
|
|
reloadPageTab({
|
|
reloadPageTab({
|
|
@@ -235,7 +233,7 @@ import { logoByCode } from '@/api/login/index'
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
/* 菜单标题国际化 */
|
|
/* 菜单标题国际化 */
|
|
|
- i18n (_path, key) {
|
|
|
|
|
|
|
+ i18n(_path, key) {
|
|
|
if (!I18N_ENABLE || !key) {
|
|
if (!I18N_ENABLE || !key) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -359,10 +357,10 @@ import { logoByCode } from '@/api/login/index'
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .ele-admin-layout .ele-admin-logo img {
|
|
|
|
|
|
|
+ .ele-admin-layout .ele-admin-logo img {
|
|
|
height: auto !important;
|
|
height: auto !important;
|
|
|
width: 80px !important;
|
|
width: 80px !important;
|
|
|
margin-right: 5px;
|
|
margin-right: 5px;
|
|
|
- max-height: 35px
|
|
|
|
|
|
|
+ max-height: 35px;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|