From 2c2bc8614c8ea0ce386369eb4924da1e6aa052d1 Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Wed, 27 Sep 2023 09:35:57 +0800
Subject: [PATCH] 添加环境配置区分
---
src/components/common/topbar.vue | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/components/common/topbar.vue b/src/components/common/topbar.vue
index 6d9c609..21f54b2 100644
--- a/src/components/common/topbar.vue
+++ b/src/components/common/topbar.vue
@@ -1,7 +1,7 @@
<template>
<div class="width-100 flex-row flex-justify-between flex-align-center" style="height: 60px;">
<div class="height-100">
- <a-avatar :size="40" shape="square" :src="cloudapi" />
+ <!-- <a-avatar :size="40" shape="square" :src="cloudapi" /> -->
<span class="ml10 fontBold">{{ workspaceName }}</span>
</div>
@@ -44,9 +44,16 @@
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
@@ -62,13 +69,11 @@
const workspaceName = ref('')
const options = [
- { key: 0, label: '项目', path: '/' + ERouterName.PROJECT },
+ { key: 0, label: '项目', path: '/' + ERouterName.PROJECT_LIST },
{ key: 1, label: '人员管理', path: '/' + ERouterName.MEMBERS },
- { key: 2, label: '设备管理', path: '/' + ERouterName.DEVICES },
+ // { 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 => {
@@ -81,8 +86,7 @@
}
const logout = async () => {
- const res = await loginOut()
- console.log(res, 'Res')
+ // const res = await loginOut()
localStorage.clear()
root.$router.push(ERouterName.LOGIN)
}
--
Gitblit v1.9.3