From aec00ecc093be803860c8675cbe1c4c776a7cb4e Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Tue, 19 Mar 2024 17:49:21 +0800
Subject: [PATCH] update: 新建航线、事件编辑、kmz文件问题修改
---
src/components/common/topbar.vue | 81 ++++++++++++++++++++++++++--------------
1 files changed, 53 insertions(+), 28 deletions(-)
diff --git a/src/components/common/topbar.vue b/src/components/common/topbar.vue
index 4f0bff3..59aa84d 100644
--- a/src/components/common/topbar.vue
+++ b/src/components/common/topbar.vue
@@ -1,33 +1,48 @@
<template>
- <div class="width-100 flex-row flex-justify-between flex-align-center" style="height: 60px;">
+ <div class="width-100 flex-row flex-justify-between flex-align-center" style="height: 58px;">
<div class="height-100">
- <a-avatar :size="40" shape="square" :src="cloudapi" />
- <span class="ml10 fontBold">{{ workspaceName }}</span>
+ <!-- <a-avatar :size="40" shape="square" :src="cloudapi" /> -->
+ <!-- <span class="ml10 fontBold">{{ workspaceName }}</span> -->
</div>
<a-space class="fz16 height-100" size="large">
- <router-link
+ <router-link
v-for="item in options"
:key="item.key"
:to="item.path"
:class="{
'menu-item': true,
- }">
- <span @click="selectedRoute(item.path)" :style="selected === item.path ? 'color: #2d8cf0;' : 'color: white'">{{ item.label }}</span>
- </router-link>
+ }"
+ >
+ <span
+ @click="selectedRoute(item.path)"
+ :style="selected === item.path ? 'color: #2d8cf0;' : 'color: white'"
+ >{{ item.label }}</span>
+ </router-link>
</a-space>
<div class="height-100 fz16 flex-row flex-justify-between flex-align-center">
<a-dropdown>
- <div class="height-100">
- <span class="fz20 mt20" style="border: 2px solid white; border-radius: 50%; display: inline-flex;"><UserOutlined /></span>
- <span class="ml10 mr10" style="float: right;">{{ username }}</span>
+ <div class="height-100 flex-display flex-align-center" style="height:58px;">
+ <span
+ class="fz18"
+ style="border: 2px solid white; border-radius: 50%; display: inline-flex;"
+ >
+ <UserOutlined />
+ </span>
+ <span class="ml5 mr5 fz14" style="float: right;">{{ username }}</span>
</div>
<template #overlay>
- <a-menu theme="dark" class="flex-column flex-justify-between flex-align-center">
+ <a-menu
+ theme="dark"
+ class="flex-column flex-justify-between flex-align-center"
+ style="margin-top:-15px;background:black"
+ >
<a-menu-item>
- <span class="mr10" style="font-size: 16px;"><ExportOutlined /></span>
- <span @click="logout">Log Out</span>
+ <span class="mr10" style="font-size: 16px;">
+ <ExportOutlined />
+ </span>
+ <span @click="logout">退出登录</span>
</a-menu-item>
</a-menu>
</template>
@@ -40,13 +55,24 @@
import { message } from 'ant-design-vue'
import { defineComponent, onMounted, ref } from 'vue'
import { getRoot } from '/@/root'
-import { getPlatformInfo } from '/@/api/manage'
+import { getPlatformInfo, loginOut } from '/@/api/manage'
import { ELocalStorageKey, ERouterName } from '/@/types'
import { UserOutlined, ExportOutlined } from '@ant-design/icons-vue'
import cloudapi from '/@/assets/icons/cloudapi.png'
-
const root = getRoot()
-
+const selected = ref<string>(root.$route.path)
+const route = useRoute()
+watch(
+ route,
+ (newVal) => {
+ if (newVal) {
+ selected.value = newVal.path
+ }
+ },
+ {
+ immediate: true,
+ },
+)
interface IOptions {
key: number
label: string
@@ -60,28 +86,28 @@
}
const username = ref(localStorage.getItem(ELocalStorageKey.Username))
const workspaceName = ref('')
+
const options = [
- { key: 0, label: ERouterName.WORKSPACE.charAt(0).toUpperCase() + ERouterName.WORKSPACE.substr(1), path: '/' + ERouterName.WORKSPACE },
- { key: 1, label: ERouterName.MEMBERS.charAt(0).toUpperCase() + ERouterName.MEMBERS.substr(1), path: '/' + ERouterName.MEMBERS },
- { key: 2, label: ERouterName.DEVICES.charAt(0).toUpperCase() + ERouterName.DEVICES.substr(1), path: '/' + ERouterName.DEVICES },
- { key: 3, label: ERouterName.FIRMWARES.charAt(0).toUpperCase() + ERouterName.FIRMWARES.substr(1), path: '/' + ERouterName.FIRMWARES },
+ { key: 0, label: '项目', path: '/' + ERouterName.PROJECT_LIST },
+ { key: 1, label: '人员管理', path: '/' + ERouterName.MEMBERS },
+ // { key: 2, label: '设备管理', path: '/' + ERouterName.DEVICES },
+ // { key: 3, label: ERouterName.FIRMWARES.charAt(0).toUpperCase() + ERouterName.FIRMWARES.substr(1), path: '/' + ERouterName.FIRMWARES },
]
-const selected = ref<string>(root.$route.path)
-
onMounted(() => {
- getPlatformInfo().then(res => {
- workspaceName.value = res.data.workspace_name
- })
+ // getPlatformInfo().then(res => {
+ // workspaceName.value = res.data.workspace_name
+ // })
})
function selectedRoute (path: string) {
selected.value = path
}
-const logout = () => {
+const logout = async () => {
+ // const res = await loginOut()
localStorage.clear()
- root.$router.push(ERouterName.PROJECT)
+ root.$router.push(ERouterName.LOGIN)
}
</script>
@@ -92,5 +118,4 @@
font-weight: 500;
font-size: 18px;
}
-
</style>
--
Gitblit v1.9.3