|
|
@@ -9,13 +9,21 @@
|
|
|
<div class="header-bar__title">
|
|
|
<span class="header-bar__text">{{ title }}</span>
|
|
|
</div>
|
|
|
- <div class="header-bar__buttons">
|
|
|
-<!-- <div class="header-bar__button" @click="minimizeWindow">
|
|
|
- <img :src="iconMinimize" class="header-bar__button-icon" />
|
|
|
+ <div class="header-bar__buttons" >
|
|
|
+ <div class="header-bar__button header-bar__button__user" v-if="showUser">
|
|
|
+
|
|
|
+
|
|
|
+ <el-dropdown>
|
|
|
+ <span class="el-dropdown-link">
|
|
|
+ {{useUserInfoStore.userInfo.account_name || useUserInfoStore.userInfo.real_name || useUserInfoStore.userInfo.login_name}}
|
|
|
+ </span>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item @click="loginOut">退出登录</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
</div>
|
|
|
- <div class="header-bar__button" @click="closeWindow">
|
|
|
- <img :src="iconClose" class="header-bar__button-icon" />
|
|
|
- </div>-->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="header-bar_blank"></div>
|
|
|
@@ -23,6 +31,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { defineProps, reactive } from 'vue';
|
|
|
+import useUserInfo from "@/stores/modules/user";
|
|
|
import { useRouter} from "vue-router";
|
|
|
import iconsz from './assets/shezhi@2x.png'
|
|
|
import iconykq from './assets/yaokong@2x.png'
|
|
|
@@ -32,6 +41,7 @@ import icpList from '@/utils/ipc'
|
|
|
import { getRouterUrl } from '@/utils/appfun'
|
|
|
import client from "@/stores/modules/client";
|
|
|
const clientStore = client();
|
|
|
+const useUserInfoStore = useUserInfo();
|
|
|
|
|
|
// 定义 menu 项的类型
|
|
|
interface MenuItem {
|
|
|
@@ -50,6 +60,10 @@ const props = defineProps({
|
|
|
menu: {
|
|
|
type: Array as () => MenuItem[],
|
|
|
default: () => []
|
|
|
+ },
|
|
|
+ showUser:{
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
});
|
|
|
const Router = useRouter()
|
|
|
@@ -104,6 +118,11 @@ function openSetting() {
|
|
|
clientStore.ipc.send(icpList.utils.openMain, params);
|
|
|
}
|
|
|
|
|
|
+function loginOut(){
|
|
|
+ useUserInfoStore.loginOut();
|
|
|
+ useUserInfoStore.updateLoginShow(true)
|
|
|
+}
|
|
|
+
|
|
|
// 新增
|
|
|
function minimizeWindow() {
|
|
|
clientStore.ipc.send(icpList.utils.minimizeWindow);
|
|
|
@@ -196,7 +215,7 @@ function closeWindow() {
|
|
|
}
|
|
|
|
|
|
.header-bar__button {
|
|
|
- width: 30px;
|
|
|
+ min-width: 30px;
|
|
|
height: 30px;
|
|
|
border: none;
|
|
|
cursor: pointer;
|
|
|
@@ -205,6 +224,9 @@ function closeWindow() {
|
|
|
justify-content: center;
|
|
|
}
|
|
|
|
|
|
+.header-bar__button__user {
|
|
|
+ padding: 0 10px;
|
|
|
+}
|
|
|
.header-bar__button:hover {
|
|
|
background-color: #e0e0e0;
|
|
|
}
|