|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="navbar">
|
|
<div class="navbar">
|
|
|
<div class="left-side">
|
|
<div class="left-side">
|
|
|
- <a-space style="cursor: pointer;" @click="$router.push('/')">
|
|
|
|
|
|
|
+ <a-space style="cursor: pointer; -webkit-app-region: no-drag;" @click="$router.push('/')">
|
|
|
<img alt="RunForge" src="/logo.svg" height="35">
|
|
<img alt="RunForge" src="/logo.svg" height="35">
|
|
|
<a-typography-title :style="{ margin: 0, fontSize: '18px' }" :heading="5">
|
|
<a-typography-title :style="{ margin: 0, fontSize: '18px' }" :heading="5">
|
|
|
RunForge
|
|
RunForge
|
|
@@ -10,7 +10,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<ul class="right-side">
|
|
<ul class="right-side">
|
|
|
- <li>
|
|
|
|
|
|
|
+ <li v-if="!isElectron()">
|
|
|
<a-tooltip content="首页">
|
|
<a-tooltip content="首页">
|
|
|
<a-button class="nav-btn" type="outline" :shape="'circle'" @click="$router.push('/')">
|
|
<a-button class="nav-btn" type="outline" :shape="'circle'" @click="$router.push('/')">
|
|
|
<template #icon>
|
|
<template #icon>
|
|
@@ -20,10 +20,9 @@
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
</li>
|
|
</li>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- <li>
|
|
|
|
|
|
|
+ <li v-if="avatar">
|
|
|
<a-dropdown trigger="hover">
|
|
<a-dropdown trigger="hover">
|
|
|
- <a-avatar :size="32" :style="{ marginRight: '8px', cursor: 'pointer' }">
|
|
|
|
|
|
|
+ <a-avatar class="nav-btn" :size="32" :style="{ marginRight: '8px', cursor: 'pointer' }">
|
|
|
<img alt="avatar" :src="avatar" />
|
|
<img alt="avatar" :src="avatar" />
|
|
|
</a-avatar>
|
|
</a-avatar>
|
|
|
<template #content>
|
|
<template #content>
|
|
@@ -46,23 +45,41 @@
|
|
|
</template>
|
|
</template>
|
|
|
</a-dropdown>
|
|
</a-dropdown>
|
|
|
</li>
|
|
</li>
|
|
|
|
|
+
|
|
|
|
|
+ <div v-if="isElectron()">
|
|
|
|
|
+ <a-button class="actions" type="text" @click="minimizeWindow">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <icon-minus />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+
|
|
|
|
|
+ <a-button class="actions" type="text" @click="maximizeWindow">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <icon-fullscreen />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+
|
|
|
|
|
+ <a-button class="actions close" type="text" @click="closeWindow">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <icon-close />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+ </div>
|
|
|
</ul>
|
|
</ul>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { computed, ref } from 'vue'
|
|
|
|
|
|
|
+import { computed } from 'vue'
|
|
|
import { Message, Modal } from '@arco-design/web-vue'
|
|
import { Message, Modal } from '@arco-design/web-vue'
|
|
|
import { useUserStore } from '@/store'
|
|
import { useUserStore } from '@/store'
|
|
|
|
|
+import { isElectron } from '@/utils/electron'
|
|
|
|
|
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
|
|
|
|
|
const avatar = computed(() => {
|
|
const avatar = computed(() => {
|
|
|
return userStore.avatar;
|
|
return userStore.avatar;
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-const refBtn = ref()
|
|
|
|
|
-const triggerBtn = ref()
|
|
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
const handleLogout = () => {
|
|
const handleLogout = () => {
|
|
|
Modal.confirm({
|
|
Modal.confirm({
|
|
@@ -77,12 +94,23 @@ const handleLogout = () => {
|
|
|
onCancel: () => {
|
|
onCancel: () => {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function closeWindow() {
|
|
|
|
|
+ window.electron.closeWindow() // 调用关闭窗口的方法
|
|
|
|
|
+}
|
|
|
|
|
+function minimizeWindow() {
|
|
|
|
|
+ window.electron.minimizeWindow() // 调用最小化窗口的方法
|
|
|
|
|
+}
|
|
|
|
|
+function maximizeWindow() {
|
|
|
|
|
+ window.electron.maximizeWindow() // 调用最大化窗口的方法
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
|
.navbar {
|
|
.navbar {
|
|
|
|
|
+ -webkit-app-region: drag;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
@@ -122,6 +150,7 @@ const handleLogout = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.nav-btn {
|
|
.nav-btn {
|
|
|
|
|
+ -webkit-app-region: no-drag;
|
|
|
border-color: rgb(var(--gray-2));
|
|
border-color: rgb(var(--gray-2));
|
|
|
color: rgb(var(--gray-8));
|
|
color: rgb(var(--gray-8));
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
@@ -137,4 +166,14 @@ const handleLogout = () => {
|
|
|
margin-left: 14px;
|
|
margin-left: 14px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.actions {
|
|
|
|
|
+ color: rgb(var(--gray-8));
|
|
|
|
|
+ -webkit-app-region: no-drag;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.close:hover {
|
|
|
|
|
+ background-color: rgb(var(--red-5));
|
|
|
|
|
+ color: white;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|