Kaynağa Gözat

动态多语言

yanghao 4 gün önce
ebeveyn
işleme
a8eb0d54b5

+ 1 - 0
src/i18n/lang/en.json

@@ -29,6 +29,7 @@
     "banner3": "Smart Platform, Empowering Efficient Collaboration"
   },
    "flow": {
+    "all": "All",
     "palceholder": "Please enter the task name to search",
     "todo":"My Pending",
     "done":"My Completed",

+ 1 - 0
src/i18n/lang/ru.json

@@ -29,6 +29,7 @@
     "banner3": "Платформа для совместной работы"
   },
   "flow": {
+    "all": "Все задачи",
     "palceholder": "Поиск процессов/приложений",
     "todo": "Мои задачи",
     "done": "Выполнено",

+ 1 - 0
src/i18n/lang/zh.json

@@ -29,6 +29,7 @@
     "banner3": "智慧平台,赋能高效协同"
   },
   "flow": {
+    "all": "全部",
     "palceholder": "搜索应用、流程",
     "todo":"我的待办",
     "done":"我的已办",

+ 8 - 2
src/views/flow/index.vue

@@ -132,7 +132,7 @@
             :aria-selected="activeKey === 'all'"
             @click="setAll"
           >
-            <span class="tab-label">全部</span>
+            <span class="tab-label">{{ $t("flow.all") }}</span>
           </button>
           <button
             v-for="tab in tabs"
@@ -220,6 +220,7 @@ import {
   onMounted,
   onBeforeUnmount,
   nextTick,
+  watch,
 } from "vue";
 import { CountTo } from "vue3-count-to";
 import { Icon } from "@iconify/vue";
@@ -250,7 +251,7 @@ import { ElLoading, ElMessage } from "element-plus";
 const userStore = useUserStore();
 const themeStore = useThemeStore();
 
-const { t } = useI18n();
+const { t, locale } = useI18n();
 
 // 1. 定义 Ref
 const tabsContainerRef = ref(null);
@@ -873,6 +874,11 @@ onMounted(async () => {
   }
 });
 
+watch(locale, async () => {
+  activeKey.value = "all";
+  await getAll();
+});
+
 // 组件卸载时移除监听,防止内存泄漏
 onBeforeUnmount(() => {
   if (tabsContainerRef.value) {