From 5eab10b7968e2862a6cca386a994186f0a5516f0 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Wed, 8 May 2024 15:33:01 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E4=B8=AD=E8=8B=B1=E6=96=87=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Form/src/components/useRenderSelect.tsx | 8 +- src/components/ImportForm/src/ImportForm.vue | 33 +- src/components/SearchHigh/src/SearchHigh.vue | 57 +- .../SearchTable/src/SearchTable.vue | 7 +- src/components/TableForm/src/TableForm.vue | 21 +- src/components/rowDrop/index.vue | 14 +- src/hooks/web/useI18n.ts | 2 +- src/locales/en-US.ts | 497 +++++++++++------- src/locales/zh-CN.ts | 404 ++++++++++---- .../supplierManage/purchaseprice/index.vue | 6 +- .../supplierManage/supplier/index.vue | 4 +- .../supplierManage/supplieritem/index.vue | 4 +- .../demandforecastingMain/index.vue | 14 +- .../supplierdeliver/purchaseMain/index.vue | 20 +- .../purchaseMain/purchaseMain.data.ts | 12 +- .../purchasePlanMain/index.vue | 30 +- .../supplierdeliverRequestMain/index.vue | 8 +- .../purchaseclaimRequestMain/index.vue | 8 +- .../supplierinvoiceRequestMain/index.vue | 8 +- 19 files changed, 752 insertions(+), 405 deletions(-) diff --git a/src/components/Form/src/components/useRenderSelect.tsx b/src/components/Form/src/components/useRenderSelect.tsx index 59b72e687..4a8a18a79 100644 --- a/src/components/Form/src/components/useRenderSelect.tsx +++ b/src/components/Form/src/components/useRenderSelect.tsx @@ -3,6 +3,7 @@ import { ComponentOptions } from '@/types/components' import { ElOption, ElOptionGroup } from 'element-plus' import { getSlot } from '@/utils/tsxHelper' import { Slots } from 'vue' +const { t } = useI18n() export const useRenderSelect = (slots: Slots) => { // 渲染 select options @@ -33,11 +34,16 @@ export const useRenderSelect = (slots: Slots) => { const valueAlias = item?.componentProps?.optionsAlias?.valueField const { label, value, ...other } = option + const zhName = labelAlias ? option[labelAlias] : label;//中文名称 + let labelName = t(`ts.${zhName}`) + if(labelName === 'ts.' + zhName){ + labelName = zhName + } return ( {{ diff --git a/src/components/ImportForm/src/ImportForm.vue b/src/components/ImportForm/src/ImportForm.vue index 29ed5d067..03c91faa9 100644 --- a/src/components/ImportForm/src/ImportForm.vue +++ b/src/components/ImportForm/src/ImportForm.vue @@ -1,6 +1,6 @@