Przeglądaj źródła

```
refactor(header-bar): 添加版本信息显示并优化用户信息显示逻辑

在header-bar组件中,添加了版本信息的显示,并且将用户信息的显示改为仅在需要时显示。同时调整了相关样式以适应新的布局。

此外,移除了Home和Photography视图中不必要的ota菜单项。
```

panqiuyao 2 miesięcy temu
rodzic
commit
1c61dad4dd

+ 23 - 2
frontend/src/components/header-bar/index.vue

@@ -70,8 +70,15 @@
         <slot name="title">{{ title }}</slot>
       </span>
     </div>
-    <div class="header-bar__buttons" v-if="showUser">
-      <div class="header-bar__button header-bar__button__user">
+    <div class="header-bar__buttons">
+      <!-- 版本信息 - 始终显示 -->
+      <div class="header-bar__button header-bar__button__version">
+        <span class="version-text" @click="openOTA" title="点击查看版本详情">
+          当前版本:{{ currentVersion }}
+        </span>
+      </div>
+      <!-- 用户信息 - 仅在需要时显示 -->
+      <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 }}
@@ -383,6 +390,20 @@ function handleOutsideClick(event: MouseEvent) {
   padding: 0 10px;
 }
 
+.header-bar__button__version {
+  padding: 0 8px;
+  margin-right: 5px;
+}
+
+.version-text {
+  font-size: 12px;
+  color: #666;
+  cursor: pointer;
+  padding: 2px 6px;
+  border-radius: 3px;
+  transition: all 0.2s ease;
+}
+
 .header-bar__button:hover {
   background-color: #e0e0e0;
 }

+ 1 - 6
frontend/src/views/Home/index.vue

@@ -1,10 +1,5 @@
 <template>
-  <headerBar title="首页"
-             :menu="
-              [{
-                type:'ota'
-              }]"
-  >
+  <headerBar title="首页">
 
     <template  #title><div @click="handleSettingClick" v-log="{ describe: { action: '点击首页标题' } }">首页</div></template>
   </headerBar>

+ 0 - 8
frontend/src/views/Photography/shot.vue

@@ -253,9 +253,6 @@ const menu = computed(()=>{
       },
       {
         ...generate
-      },
-      {
-        type:'ota'
       }
     ]
   }
@@ -269,9 +266,6 @@ const menu = computed(()=>{
       },
       {
         ...generate,
-      },
-      {
-        type:'ota'
       }
     ]
   }
@@ -283,8 +277,6 @@ const menu = computed(()=>{
     },
     {
       ...generate
-    },    {
-      type:'ota'
     }
   ]