Преглед на файлове

fix: 完善多语言内容,优化右键菜单图标

jiaxing.liao преди 6 дни
родител
ревизия
393989688f

+ 14 - 5
apps/web-velofex-b/src/components/home-dashboard-tab.vue

@@ -92,6 +92,7 @@ const overviewItems = computed(() => [
 const quickFeatures = ref<
   Array<{ iconClass: string; menuKey: string; title: string }>
 >([]);
+const announcementTime = '2026-04-20 18:32:37';
 
 type FileStatsTabKey = 'today' | 'week';
 type FileChangeTypeKey = 'added' | 'deleted' | 'edited';
@@ -541,7 +542,8 @@ function mapEnterpriseUser(item: EnterpriseUserItem): TeamMemberItem {
     jobNo: item.employeeNumber,
     mobile: item.cellPhone,
     name: item.chineseName,
-    status: item.activeStatus || '异常',
+    status:
+      item.activeStatus || $t('home.dashboardTab.teamMembers.status.abnormal'),
   };
 }
 
@@ -704,9 +706,13 @@ watch(
           <strong class="shrink-0 truncate text-[18px] text-black">
             {{ $t('home.dashboardTab.announcement.title') }}
           </strong>
-          <span class="truncate">张小明</span>
-          <span class="truncate">2026-04-20 18:32:37</span>
-          <span class="truncate">发布了新版本</span>
+          <span class="truncate">
+            {{ $t('home.dashboardTab.announcement.publisher') }}
+          </span>
+          <span class="truncate">{{ announcementTime }}</span>
+          <span class="truncate">
+            {{ $t('home.dashboardTab.announcement.content') }}
+          </span>
         </div>
         <button class="shrink-0 text-[14px] text-black/60">
           {{ $t('home.dashboardTab.announcement.more') }}
@@ -744,7 +750,10 @@ watch(
             </span>
           </button>
         </div>
-        <Empty v-else :description="$t('common.noData')" />
+        <Empty
+          v-else
+          :description="$t('home.dashboardTab.commonFeature.noData')"
+        />
       </div>
 
       <div

+ 21 - 21
apps/web-velofex-b/src/locales/langs/en-US/page.json

@@ -1,36 +1,21 @@
 {
   "home": {
+    "content": {
+      "empty": "No content available"
+    },
     "dashboard": {
-      "cards": {
-        "locale": {
-          "description": "The home tab title and placeholder content now switch immediately with locale changes, ready for future modules.",
-          "title": "Locale Ready"
-        },
-        "navigation": {
-          "description": "The left tree menu keeps its current behavior and opens business tabs next to the home tab when clicked.",
-          "title": "Navigation"
-        },
-        "workspace": {
-          "description": "This area now provides the shell for a homepage so statistics, announcements, and shortcuts can be added next.",
-          "title": "Homepage Shell"
-        }
-      },
       "crumb": "Home",
-      "hero": {
-        "description": "The home tab and its content container are in place, so the next step is wiring real business widgets into this area.",
-        "eyebrow": "Enterprise Workspace",
-        "title": "Home Is Ready"
-      },
       "tab": "Home"
     },
     "dashboardTab": {
       "announcement": {
-        "content": "A new version has been released",
+        "content": "released a new version",
         "more": "View more >",
-        "placeholder": "xxxxx",
+        "publisher": "Zhang Xiaoming",
         "title": "Collaboration Notice"
       },
       "commonFeature": {
+        "noData": "No data",
         "title": "Common Features"
       },
       "emptyPermission": {
@@ -89,10 +74,25 @@
         "title": "Project Team Members"
       }
     },
+    "sidebar": {
+      "menu": "Menu"
+    },
+    "tabContext": {
+      "closeAll": "Close All",
+      "closeCurrent": "Close Current",
+      "closeOther": "Close Others",
+      "refreshCurrent": "Refresh Current"
+    },
     "userMenu": {
+      "avatarAlt": "Avatar",
       "logout": "Logout"
     }
   },
+  "error": {
+    "badge": "ERROR",
+    "sessionTimeoutDescription": "Your current login session has expired. Please re-enter the system to complete authentication.",
+    "sessionTimeoutTitle": "Session timed out. Please sign in again."
+  },
   "userProfile": {
     "avatar": "Avatar",
     "birthday": "Birthday",

+ 21 - 0
apps/web-velofex-b/src/locales/langs/zh-CN/page.json

@@ -1,15 +1,21 @@
 {
   "home": {
+    "content": {
+      "empty": "暂无可显示内容"
+    },
     "dashboard": {
       "crumb": "首页",
       "tab": "首页"
     },
     "dashboardTab": {
       "announcement": {
+        "content": "发布了新版本",
         "more": "查看更多 >",
+        "publisher": "张小明",
         "title": "协作公告"
       },
       "commonFeature": {
+        "noData": "暂无数据",
         "title": "常用功能"
       },
       "emptyPermission": {
@@ -68,10 +74,25 @@
         "title": "项目组成员"
       }
     },
+    "sidebar": {
+      "menu": "菜单"
+    },
+    "tabContext": {
+      "closeAll": "关闭全部",
+      "closeCurrent": "关闭当前",
+      "closeOther": "关闭其他",
+      "refreshCurrent": "刷新当前"
+    },
     "userMenu": {
+      "avatarAlt": "头像",
       "logout": "退出"
     }
   },
+  "error": {
+    "badge": "ERROR",
+    "sessionTimeoutDescription": "当前登录态已失效,请重新进入系统完成身份验证。",
+    "sessionTimeoutTitle": "会话超时!请重新登录!"
+  },
   "userProfile": {
     "avatar": "头像",
     "birthday": "生日",

+ 7 - 3
apps/web-velofex-b/src/views/error.vue

@@ -1,10 +1,14 @@
+<script setup lang="ts">
+import { $t } from '#/locales';
+</script>
+
 <template>
   <main class="error-page">
     <section class="error-card">
-      <div class="error-badge">ERROR</div>
-      <h1 class="error-title">会话超时!请重新登录!(ERROR)</h1>
+      <div class="error-badge">{{ $t('error.badge') }}</div>
+      <h1 class="error-title">{{ $t('error.sessionTimeoutTitle') }}</h1>
       <p class="error-subtitle">
-        当前登录态已失效,请重新进入系统完成身份验证。
+        {{ $t('error.sessionTimeoutDescription') }}
       </p>
     </section>
   </main>

+ 14 - 7
apps/web-velofex-b/src/views/home.vue

@@ -12,6 +12,7 @@ import {
   watch,
 } from 'vue';
 
+import { IconifyIcon } from '@velofex/icons';
 import {
   loadLocaleMessages,
   type SupportedLanguagesType,
@@ -622,7 +623,8 @@ function createTabContextMenus(tab: { key?: string }) {
         refreshTabByKey(tabKey);
       },
       key: 'refresh-current',
-      text: '刷新当前',
+      text: $t('home.tabContext.refreshCurrent'),
+      icon: h(IconifyIcon, { icon: 'lucide:refresh-cw' }),
     },
     {
       disabled: !isCurrentTabClosable,
@@ -630,7 +632,8 @@ function createTabContextMenus(tab: { key?: string }) {
         handleTabClose(tabKey);
       },
       key: 'close-current',
-      text: '关闭当前',
+      text: $t('home.tabContext.closeCurrent'),
+      icon: h(IconifyIcon, { icon: 'lucide:x' }),
     },
     {
       disabled: !tabKey || iframeTabs.value.length <= 1,
@@ -638,13 +641,15 @@ function createTabContextMenus(tab: { key?: string }) {
         closeOtherTabsByKey(tabKey);
       },
       key: 'close-other',
-      text: '关闭其他',
+      text: $t('home.tabContext.closeOther'),
+      icon: h(IconifyIcon, { icon: 'lucide:fold-horizontal' }),
     },
     {
       disabled: !hasTabs,
       handler: closeAllTabs,
       key: 'close-all',
-      text: '关闭全部',
+      text: $t('home.tabContext.closeAll'),
+      icon: h(IconifyIcon, { icon: 'lucide:x-line-top' }),
     },
   ];
 
@@ -756,7 +761,7 @@ function handleIframeLoad(event: Event) {
               type="button"
               @click="openMobileSidebar"
             >
-              Menu
+              {{ $t('home.sidebar.menu') }}
             </button>
             <SelectLang />
             <Dropdown
@@ -767,7 +772,7 @@ function handleIframeLoad(event: Event) {
               @menu-click="(info: any) => handleUserMenuClick(info)"
             >
               <div class="user-avatar cursor-pointer">
-                <img :src="avatarSrc" alt="avatar" />
+                <img :alt="$t('home.userMenu.avatarAlt')" :src="avatarSrc" />
               </div>
             </Dropdown>
           </div>
@@ -817,7 +822,9 @@ function handleIframeLoad(event: Event) {
             </div>
           </template>
 
-          <div v-else class="content-empty">暂无可显示内容</div>
+          <div v-else class="content-empty">
+            {{ $t('home.content.empty') }}
+          </div>
         </div>
       </section>
     </div>