From f22b2279aee41afb8f36f583a470cfcbc8287882 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Thu, 16 May 2024 14:22:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E8=8B=B1=E6=96=87=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Annex/src/Annex.vue | 2 +- .../Descriptions/src/Descriptions.vue | 7 +++--- src/components/Detail/src/Detail.vue | 4 ++-- src/components/DictTag/src/DictTag.vue | 5 ++-- src/components/Remarks/src/Remarks.vue | 5 ++-- src/components/Tabs/src/Tabs.vue | 3 ++- src/components/UploadFile/src/UploadFile.vue | 15 ++++++------ src/locales/en-US.ts | 24 +++++++++++++++++++ src/locales/zh-CN.ts | 24 +++++++++++++++++++ src/views/home/components/supplierIndex.vue | 3 ++- 10 files changed, 73 insertions(+), 19 deletions(-) diff --git a/src/components/Annex/src/Annex.vue b/src/components/Annex/src/Annex.vue index 7d5f0e142..5f5f144d6 100644 --- a/src/components/Annex/src/Annex.vue +++ b/src/components/Annex/src/Annex.vue @@ -3,7 +3,7 @@
-
diff --git a/src/components/Descriptions/src/Descriptions.vue b/src/components/Descriptions/src/Descriptions.vue index 6f00f10c2..f81f8f35a 100644 --- a/src/components/Descriptions/src/Descriptions.vue +++ b/src/components/Descriptions/src/Descriptions.vue @@ -5,6 +5,7 @@ import { useDesign } from '@/hooks/web/useDesign' import { propTypes } from '@/utils/propTypes' import { useAppStore } from '@/store/modules/app' import { DescriptionsSchema } from '@/types/descriptions' +const { t } = useI18n() // 国际化 defineOptions({ name: 'Descriptions' }) @@ -99,7 +100,7 @@ const showAll = () =>{ >
- {{ title }} + {{ t(`ts.${title}`).replace('ts.', '') }} @@ -119,7 +120,7 @@ const showAll = () =>{ - { :row="{ label: item.label }" - >{{ item.label }} + >{{ t(`ts.${item.label}`).replace('ts.', '') }} diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 3ebe261c5..af528c603 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -2,14 +2,14 @@
diff --git a/src/components/DictTag/src/DictTag.vue b/src/components/DictTag/src/DictTag.vue index b72b2b9ec..35920d91e 100644 --- a/src/components/DictTag/src/DictTag.vue +++ b/src/components/DictTag/src/DictTag.vue @@ -3,6 +3,7 @@ import { defineComponent, PropType, ref } from 'vue' import { isHexColor } from '@/utils/color' import { ElTag } from 'element-plus' import { DictDataType, getDictOptions } from '@/utils/dict' +const { t } = useI18n() // 国际化 export default defineComponent({ name: 'DictTag', @@ -55,7 +56,7 @@ export default defineComponent({ } disableTransitions={true} > - {dictData.value?.label} + {t(`ts.${dictData.value?.label}`).replace('ts.', '')} ) } else { @@ -71,7 +72,7 @@ export default defineComponent({ } disableTransitions={true} > - {item?.label} + {t(`ts.${item?.label}`).replace('ts.', '')} }) ) diff --git a/src/components/Remarks/src/Remarks.vue b/src/components/Remarks/src/Remarks.vue index 35423c454..857d91027 100644 --- a/src/components/Remarks/src/Remarks.vue +++ b/src/components/Remarks/src/Remarks.vue @@ -20,9 +20,9 @@
- + - 确定 + {{t('ts.确定')}}
@@ -32,6 +32,7 @@ const message = useMessage() // 消息弹窗 import * as RemarkApi from '@/api/wms/remark' import { formatDate } from '@/utils/formatTime' +const { t } = useI18n() // 国际化 defineComponent({ name: 'Annex' diff --git a/src/components/Tabs/src/Tabs.vue b/src/components/Tabs/src/Tabs.vue index 8c66168a9..8c22163f6 100644 --- a/src/components/Tabs/src/Tabs.vue +++ b/src/components/Tabs/src/Tabs.vue @@ -1,7 +1,7 @@ @@ -9,6 +9,7 @@ // const message = useMessage() // 消息弹窗 import { emit } from "process"; +const { t } = useI18n() // 国际化 // const { t } = useI18n() // 国际化 defineComponent({ diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index 05ce5f239..bf3cc4895 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -42,6 +42,7 @@ import { PropType } from 'vue' import { propTypes } from '@/utils/propTypes' import { getAccessToken, getTenantId } from '@/utils/auth' import type { UploadInstance, UploadUserFile, UploadProps, UploadRawFile } from 'element-plus' +const { t } = useI18n() // 国际化 defineOptions({ name: 'UploadFile' }) @@ -78,7 +79,7 @@ const uploadHeaders = ref({ // 文件上传之前判断 const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { if (fileList.value.length >= props.limit) { - message.error(`上传文件数量不能超过${props.limit}个!`) + message.error(`${t('ts.上传文件数量不能超过')}${props.limit}!`) return false } let fileExtension = '' @@ -91,14 +92,14 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { }) const isLimit = file.size < props.fileSize * 1024 * 1024 if (!isImg) { - message.error(`文件格式不正确, 请上传${props.fileType.join('/')}格式!`) + message.error(`${t(`ts.${'文件格式不正确, 请上传'}`)}${props.fileType.join('/')}${t('ts.格式')}!`) return false } if (!isLimit) { - message.error(`上传文件大小不能超过${props.fileSize}MB!`) + message.error(`${t('ts.上传文件大小不能超过')}${props.fileSize}MB!`) return false } - message.success('正在上传文件,请稍候...') + message.success(t(`ts.${'正在上传文件,请稍候'}`)) uploadNumber.value++ } // 处理上传的文件发生变化 @@ -107,7 +108,7 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { // } // 文件上传成功 const handleFileSuccess: UploadProps['onSuccess'] = (res: any,uploadFile: any): void => { - message.success('上传成功') + message.success(t('ts.上传成功')) const fileListNew = fileList.value fileListNew.pop() fileList.value = fileListNew @@ -121,11 +122,11 @@ const handleFileSuccess: UploadProps['onSuccess'] = (res: any,uploadFile: any): } // 文件数超出提示 const handleExceed: UploadProps['onExceed'] = (): void => { - message.error(`上传文件数量不能超过${props.limit}个!`) + message.error(`${t('ts.上传文件数量不能过')}${props.limit}!`) } // 上传错误提示 const excelUploadError: UploadProps['onError'] = (): void => { - message.error('导入数据失败,请您重新上传!') + message.error(t(`ts.导入数据失败,请您重新上传`)) } // 删除上传文件 const handleRemove = (file) => { diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index d426530a5..c8a4ee393 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1063,6 +1063,30 @@ export default { 采购价格审批人:'Purchasing price approver', 供应商发货单号:'Supplier\'s invoice number', 加载中:'loading', + 请输入备注:'Please enter remarks', + '正在上传文件,请稍候':'Please wait while uploading files', + 上传成功:'upload successful', + 上传文件数量不能超过:'The number of uploaded files cannot exceed', + '导入数据失败,请您重新上传':'Failed to import data, please upload again!', + 上传文件大小不能超过:'The size of the uploaded file cannot exceed', + '文件格式不正确, 请上传':'The file format is incorrect. Please upload it in', + 格式:'format', + 收货人:'consignee', + 联系电话:'phone', + 送达日期:'delivery date', + 月台代码:'Platform code', + 截止日期:'Deadline', + 仓库代码:'Warehouse code', + 'ERP单据号(无用)':'ERP document number (useless)', + 供应商审批人:'Supplier approver', + 供应商审批时间:'Supplier approval time', + 快递单号:'courier number', + 开票日历管理:'Invoicing calendar management', + 描述:'description' + + + + }, diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 73699f76a..65f4ded05 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1063,6 +1063,30 @@ export default { 采购价格审批人:'采购价格审批人', 供应商发货单号:'供应商发货单号', 加载中:'加载中', + 请输入备注:'请输入备注', + '正在上传文件,请稍候':'正在上传文件,请稍候...', + 上传成功:'上传成功', + 上传文件数量不能超过:'上传文件数量不能超过', + '导入数据失败,请您重新上传':'导入数据失败,请您重新上传!', + 上传文件大小不能超过:'上传文件大小不能超过', + '文件格式不正确, 请上传':'文件格式不正确, 请上传', + 格式:'格式', + 收货人:'收货人', + 联系电话:'联系电话', + 送达日期:'送达日期', + 月台代码:'月台代码', + 截止日期:'截止日期', + 仓库代码:'仓库代码', + 'ERP单据号(无用)':'ERP单据号(无用)', + 供应商审批人:'供应商审批人', + 供应商审批时间:'供应商审批时间', + 快递单号:'快递单号', + 开票日历管理:'开票日历管理', + 描述:'描述' + + + + }, diff --git a/src/views/home/components/supplierIndex.vue b/src/views/home/components/supplierIndex.vue index 5e8a679c1..af6faa6f0 100644 --- a/src/views/home/components/supplierIndex.vue +++ b/src/views/home/components/supplierIndex.vue @@ -231,7 +231,8 @@ import { set } from 'lodash-es' import { EChartsOption } from 'echarts' import { lineOptions, pieOptions } from '../echarts-data' -import { formatDate } from '@/utils/formatTime' +import { formatDate,dateFormatter } from '@/utils/formatTime' + import * as NotifyMessageApi from '@/api/system/notify/message' import * as IndexApi from '@/api/home' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'