From 50e95b985a72fcec4a93a2470e9efdfb2620148a Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 02 四月 2026 15:46:09 +0800
Subject: [PATCH] #i18n

---
 rsf-design/src/views/basic-info/warehouse-areas/index.vue |   58 ++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/rsf-design/src/views/basic-info/warehouse-areas/index.vue b/rsf-design/src/views/basic-info/warehouse-areas/index.vue
index e9ad55b..c6fd0de 100644
--- a/rsf-design/src/views/basic-info/warehouse-areas/index.vue
+++ b/rsf-design/src/views/basic-info/warehouse-areas/index.vue
@@ -12,7 +12,9 @@
       <ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
         <template #left>
           <ElSpace wrap>
-            <ElButton v-auth="'add'" @click="openWarehouseAreasDialog('add')" v-ripple>鏂板搴撳尯</ElButton>
+            <ElButton v-auth="'add'" @click="openWarehouseAreasDialog('add')" v-ripple>
+              {{ t('common.actions.add') + t('pages.basicInfo.warehouseAreas.entity') }}
+            </ElButton>
             <ElButton
               v-auth="'delete'"
               type="danger"
@@ -20,7 +22,7 @@
               @click="handleBatchDelete"
               v-ripple
             >
-              鎵归噺鍒犻櫎
+              {{ t('common.actions.batchDelete') }}
             </ElButton>
             <ListExportPrint
               class="inline-flex"
@@ -74,6 +76,7 @@
 <script setup>
   import { computed, onMounted, ref } from 'vue'
   import { ElMessage } from 'element-plus'
+  import { useI18n } from 'vue-i18n'
   import ListExportPrint from '@/components/biz/list-export-print/index.vue'
   import { useAuth } from '@/hooks/core/useAuth'
   import { useTable } from '@/hooks/core/useTable'
@@ -105,9 +108,9 @@
     buildWarehouseAreasSavePayload,
     buildWarehouseAreasSearchParams,
     createWarehouseAreasSearchState,
+    getWarehouseAreasReportTitle,
     getWarehouseAreasPaginationKey,
     WAREHOUSE_AREAS_REPORT_STYLE,
-    WAREHOUSE_AREAS_REPORT_TITLE,
     getWarehouseAreasStatusOptions,
     normalizeWarehouseAreasDetailRecord,
     normalizeWarehouseAreasListRow
@@ -115,6 +118,7 @@
 
   defineOptions({ name: 'WarehouseAreas' })
 
+  const { t } = useI18n()
   const { hasAuth } = useAuth()
   const userStore = useUserStore()
 
@@ -132,16 +136,16 @@
 
   const searchItems = computed(() => [
     {
-      label: '鍏抽敭瀛�',
+      label: t('table.keyword'),
       key: 'condition',
       type: 'input',
       props: {
         clearable: true,
-        placeholder: '璇疯緭鍏ュ簱鍖哄悕绉�/缂栫爜/澶囨敞'
+        placeholder: t('pages.basicInfo.warehouseAreas.search.conditionPlaceholder')
       }
     },
     {
-      label: '浠撳簱',
+      label: t('pages.basicInfo.warehouseAreas.table.warehouseName'),
       key: 'warehouseId',
       type: 'select',
       props: {
@@ -151,25 +155,25 @@
       }
     },
     {
-      label: '搴撳尯缂栫爜',
+      label: t('pages.basicInfo.warehouseAreas.table.code'),
       key: 'code',
       type: 'input',
       props: {
         clearable: true,
-        placeholder: '璇疯緭鍏ュ簱鍖虹紪鐮�'
+        placeholder: t('pages.basicInfo.warehouseAreas.search.codePlaceholder')
       }
     },
     {
-      label: '搴撳尯鍚嶇О',
+      label: t('pages.basicInfo.warehouseAreas.table.name'),
       key: 'name',
       type: 'input',
       props: {
         clearable: true,
-        placeholder: '璇疯緭鍏ュ簱鍖哄悕绉�'
+        placeholder: t('pages.basicInfo.warehouseAreas.search.namePlaceholder')
       }
     },
     {
-      label: '涓氬姟绫诲瀷',
+      label: t('pages.basicInfo.warehouseAreas.table.type'),
       key: 'type',
       type: 'select',
       props: {
@@ -179,17 +183,17 @@
       }
     },
     {
-      label: '鐘舵��',
+      label: t('table.status'),
       key: 'status',
       type: 'select',
       props: {
         clearable: true,
-        options: getWarehouseAreasStatusOptions()
+        options: getWarehouseAreasStatusOptions(t)
       }
     }
   ])
 
-  const reportTitle = WAREHOUSE_AREAS_REPORT_TITLE
+  const reportTitle = computed(() => getWarehouseAreasReportTitle(t))
   const reportQueryParams = computed(() => buildWarehouseAreasSearchParams(searchForm.value))
 
   async function openDetail(row) {
@@ -197,13 +201,13 @@
     detailLoading.value = true
     try {
       const detail = await guardRequestWithMessage(fetchWarehouseAreasDetail(row.id), {}, {
-        timeoutMessage: '搴撳尯璇︽儏鍔犺浇瓒呮椂锛屽凡鍋滄绛夊緟'
+        timeoutMessage: t('pages.basicInfo.warehouseAreas.messages.detailTimeout')
       })
       detailData.value = normalizeWarehouseAreasDetailRecord(detail)
     } catch (error) {
       detailDrawerVisible.value = false
       detailData.value = {}
-      ElMessage.error(error?.message || '鑾峰彇搴撳尯璇︽儏澶辫触')
+      ElMessage.error(error?.message || t('pages.basicInfo.warehouseAreas.messages.detailFailed'))
     } finally {
       detailLoading.value = false
     }
@@ -213,11 +217,11 @@
     try {
       await ensureCompanyOptions()
       const detail = await guardRequestWithMessage(fetchWarehouseAreasDetail(row.id), {}, {
-        timeoutMessage: '搴撳尯璇︽儏鍔犺浇瓒呮椂锛屽凡鍋滄绛夊緟'
+        timeoutMessage: t('pages.basicInfo.warehouseAreas.messages.detailTimeout')
       })
       showDialog('edit', detail)
     } catch (error) {
-      ElMessage.error(error?.message || '鑾峰彇搴撳尯璇︽儏澶辫触')
+      ElMessage.error(error?.message || t('pages.basicInfo.warehouseAreas.messages.detailFailed'))
     }
   }
 
@@ -234,6 +238,7 @@
         paginationKey: getWarehouseAreasPaginationKey(),
         columnsFactory: () =>
           createWarehouseAreasTableColumns({
+            t,
             handleView: openDetail,
             handleEdit: hasAuth('update') ? openEditDialog : null,
             handleDelete: hasAuth('delete') ? (row) => handleDeleteAction?.(row) : null,
@@ -268,7 +273,7 @@
     saveRequest: fetchSaveWarehouseAreas,
     updateRequest: fetchUpdateWarehouseAreas,
     deleteRequest: fetchDeleteWarehouseAreas,
-    entityName: '搴撳尯',
+    entityName: t('pages.basicInfo.warehouseAreas.entity'),
     resolveRecordLabel: (record) => record?.name || record?.code || record?.id,
     refreshCreate,
     refreshUpdate,
@@ -283,6 +288,7 @@
       printedAt: now.toLocaleString('zh-CN', { hour12: false }),
       operator: userStore.getUserInfo?.name || userStore.getUserInfo?.username || '',
       count: rows.length,
+      reportTitle: reportTitle.value,
       reportStyle: { ...WAREHOUSE_AREAS_REPORT_STYLE }
     }
   }
@@ -322,7 +328,7 @@
 
   const resolvedPreviewMeta = computed(() => ({
     ...previewMeta.value,
-    reportTitle,
+    reportTitle: reportTitle.value,
     count: previewRows.value.length || previewMeta.value?.count || 0,
     reportStyle: {
       ...WAREHOUSE_AREAS_REPORT_STYLE,
@@ -352,19 +358,19 @@
 
     companyOptionsLoading.value = (async () => {
       const records = await guardRequestWithMessage(fetchCompanysList(), [], {
-        timeoutMessage: '寰�鏉ヤ紒涓氶�夐」鍔犺浇瓒呮椂锛屽凡鍋滄绛夊緟'
+        timeoutMessage: t('pages.basicInfo.warehouseAreas.messages.companyOptionsTimeout')
       })
       const normalizedRecords = defaultResponseAdapter(records).records
       shipperOptions.value = normalizedRecords
         .filter((item) => item.type === 'shipper')
         .map((item) => ({
-          label: item.name || item.code || `璐т富 ${item.id}`,
+          label: item.name || item.code || `${t('pages.basicInfo.warehouseAreas.table.shipperName')} ${item.id}`,
           value: item.id
         }))
       supplierOptions.value = normalizedRecords
         .filter((item) => item.type === 'supplier')
         .map((item) => ({
-          label: item.name || item.code || `渚涘簲鍟� ${item.id}`,
+          label: item.name || item.code || `${t('pages.basicInfo.warehouseAreas.table.supplierName')} ${item.id}`,
           value: item.id
         }))
       companyOptionsLoaded.value = true
@@ -379,10 +385,10 @@
 
   async function loadWarehouseOptions() {
     const records = await guardRequestWithMessage(fetchWarehouseList(), [], {
-      timeoutMessage: '浠撳簱閫夐」鍔犺浇瓒呮椂锛屽凡鍋滄绛夊緟'
+      timeoutMessage: t('pages.basicInfo.warehouseAreas.messages.warehouseOptionsTimeout')
     })
     warehouseOptions.value = defaultResponseAdapter(records).records.map((item) => ({
-      label: item.name || item.code || `浠撳簱 ${item.id}`,
+      label: item.name || item.code || `${t('pages.basicInfo.warehouseAreas.table.warehouseName')} ${item.id}`,
       value: item.id
     }))
   }
@@ -396,7 +402,7 @@
         status: 1
       }),
       { records: [] },
-      { timeoutMessage: '涓氬姟绫诲瀷鍔犺浇瓒呮椂锛屽凡鍋滄绛夊緟' }
+      { timeoutMessage: t('pages.basicInfo.warehouseAreas.messages.typeOptionsTimeout') }
     )
     typeOptions.value = defaultResponseAdapter(response).records.map((item) => ({
       label: item.label || item.name || item.value,

--
Gitblit v1.9.1