|
|
@@ -2,27 +2,27 @@
|
|
|
<template>
|
|
|
<div class="top-navbar">
|
|
|
<div class="logo-area">
|
|
|
- <span class="logo-text">水利工程信息服务系统</span>
|
|
|
+ <img src="@/assets/images/tba-slgc-logo.png" alt="logo"/>
|
|
|
</div>
|
|
|
|
|
|
<div class="menu-area">
|
|
|
<!-- 首页菜单 -->
|
|
|
<div
|
|
|
- :class="[
|
|
|
+ :class="[
|
|
|
'menu-link',
|
|
|
{ active: activeMenu === '/' || activeMenu === '/index' },
|
|
|
]"
|
|
|
- @click="handleMenuClick('/index')"
|
|
|
+ @click="handleMenuClick('/index')"
|
|
|
>
|
|
|
首页
|
|
|
</div>
|
|
|
|
|
|
<!-- 动态菜单 -->
|
|
|
<div
|
|
|
- v-for="item in topMenus"
|
|
|
- :key="item.path"
|
|
|
- :class="['menu-link', { active: activeMenu === item.path }]"
|
|
|
- @click="handleMenuClick(item.path)"
|
|
|
+ v-for="item in topMenus"
|
|
|
+ :key="item.path"
|
|
|
+ :class="['menu-link', { active: activeMenu === item.path }]"
|
|
|
+ @click="handleMenuClick(item.path)"
|
|
|
>
|
|
|
{{ item.meta?.title }}
|
|
|
</div>
|
|
|
@@ -30,23 +30,23 @@
|
|
|
|
|
|
<div class="right-menu">
|
|
|
<el-dropdown
|
|
|
- @command="handleCommand"
|
|
|
- class="avatar-container"
|
|
|
- trigger="hover"
|
|
|
+ @command="handleCommand"
|
|
|
+ class="avatar-container"
|
|
|
+ trigger="hover"
|
|
|
>
|
|
|
<div class="avatar-wrapper">
|
|
|
<!-- 用户图标 -->
|
|
|
- <svg-icon icon-class="user" class="user-icon" />
|
|
|
+ <svg-icon icon-class="user" class="user-icon"/>
|
|
|
<!-- 用户名 - 添加溢出处理 -->
|
|
|
<span
|
|
|
- class="user-nickname"
|
|
|
- :title="userStore.nickName || userStore.name"
|
|
|
+ class="user-nickname"
|
|
|
+ :title="userStore.nickName || userStore.name"
|
|
|
>
|
|
|
{{ userStore.nickName || userStore.name }}
|
|
|
</span>
|
|
|
<!-- 下拉箭头 -->
|
|
|
<el-icon class="dropdown-icon">
|
|
|
- <ArrowDown />
|
|
|
+ <ArrowDown/>
|
|
|
</el-icon>
|
|
|
</div>
|
|
|
<template #dropdown>
|
|
|
@@ -55,8 +55,8 @@
|
|
|
<el-dropdown-item>个人中心</el-dropdown-item>
|
|
|
</router-link>
|
|
|
<el-dropdown-item
|
|
|
- command="setLayout"
|
|
|
- v-if="settingsStore.showSettings"
|
|
|
+ command="setLayout"
|
|
|
+ v-if="settingsStore.showSettings"
|
|
|
>
|
|
|
<span>布局设置</span>
|
|
|
</el-dropdown-item>
|
|
|
@@ -74,10 +74,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { computed, ref } from "vue";
|
|
|
-import { useRoute, useRouter } from "vue-router";
|
|
|
-import { ElMessageBox } from "element-plus";
|
|
|
-import { ArrowDown } from "@element-plus/icons-vue";
|
|
|
+import {computed, ref} from "vue";
|
|
|
+import {useRoute, useRouter} from "vue-router";
|
|
|
+import {ElMessageBox} from "element-plus";
|
|
|
+import {ArrowDown} from "@element-plus/icons-vue";
|
|
|
import usePermissionStore from "@/store/modules/permission";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
import useSettingsStore from "@/store/modules/settings";
|
|
|
@@ -95,7 +95,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
emits: ["menu-click", "setLayout"],
|
|
|
- setup(props, { emit }) {
|
|
|
+ setup(props, {emit}) {
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
const permissionStore = usePermissionStore();
|
|
|
@@ -142,12 +142,13 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- userStore.logOut().then(() => {
|
|
|
- location.href = "/slgc/index";
|
|
|
+ .then(() => {
|
|
|
+ userStore.logOut().then(() => {
|
|
|
+ location.href = "/slgc/index";
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
});
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
@@ -175,9 +176,14 @@ export default {
|
|
|
}
|
|
|
|
|
|
.logo-area {
|
|
|
+ flex-shrink: 0;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- flex-shrink: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.logo-area img {
|
|
|
+ height: 45px;
|
|
|
+ width: auto;
|
|
|
}
|
|
|
|
|
|
.logo-text {
|