From 8546cfc6156ac0cc8d869dc7e1d3506b0a46112d Mon Sep 17 00:00:00 2001 From: zhongzm Date: Sat, 8 Feb 2025 15:56:08 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=95=8C=E9=9D=A2=E4=B8=AD=E8=8B=B1=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/langs/en-us.ts | 22 ++++++++++++- src/locales/langs/zh-cn.ts | 22 ++++++++++++- src/views/user-center/user/index.vue | 32 ++++++++++--------- .../user-center/user/modules/user-search.vue | 21 ++++++++---- 4 files changed, 73 insertions(+), 24 deletions(-) diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index e844f61..d0ad989 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -738,7 +738,27 @@ const local: any = { plemac:'Please enter MAC address', search:'Search', reset:'Reset', - } + }, + user:{ + title:'User Information', + username:'User Name', + fullname:'Full Name', + sex:'Gender', + man:'Man', + woman:'Woman', + birthdate:'Birth Date', + age:'Age ', + email:'Email', + phone:'Phone', + kyc:'KYC', + ver:'Verified', + unver:'Unverified', + pleusername:'Please enter username', + pleemail:'Please enter email address', + search:'Search', + reset:'Reset', + + }, }, form: { required: 'Cannot be empty', diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index e8ac1ae..a523334 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -738,7 +738,27 @@ const local:any = { plemac:'请输入MAC地址', search:'搜索', reset:'重置', - } + }, + user:{ + title:'用户信息', + username:'用户名', + fullname:'姓名', + sex:'性别', + man:'男', + woman:'女', + birthdate:'出生日期', + age:'年龄', + email:'邮箱', + phone:'手机号', + kyc:'KYC验证', + ver:'已验证', + unver:'未验证', + pleusername:'请输入用户名', + pleemail:'请输入邮箱', + search:'搜索', + reset:'重置', + + }, }, form: { required: '不能为空', diff --git a/src/views/user-center/user/index.vue b/src/views/user-center/user/index.vue index ba1f6c3..ca0c44c 100644 --- a/src/views/user-center/user/index.vue +++ b/src/views/user-center/user/index.vue @@ -7,7 +7,8 @@ import { computed, shallowRef } from 'vue'; import { useElementSize } from '@vueuse/core'; import { doGetUserList } from '@/service/api/user'; import type { UserInfo, SearchModel } from '@/views/user-center/user/type'; - +import { useI18n } from 'vue-i18n'; +const { t } = useI18n(); // 修改API函数实现 const doGetUserInfo = async (params: SearchModel) => { try { @@ -93,25 +94,25 @@ const { { key: 'username', dataIndex: 'username', - title: '用户名', + title: t('page.user.username'), align: 'center' }, { key: 'fullname', dataIndex: 'fullname', - title: '姓名', + title: t('page.user.fullname'), align: 'center' }, { key: 'sex', dataIndex: 'sex', - title: '性别', + title: t('page.user.sex'), align: 'center', width: 80, customRender: ({ record }: { record: UserInfo }) => { const sexMap = { - 'M': '男', - 'F': '女' + 'M': t('page.user.man'), + 'F': t('page.user.woman') }; return sexMap[record.sex] || '-'; } @@ -119,37 +120,37 @@ const { { key: 'birthdate', dataIndex: 'birthdate', - title: '出生日期', + title: t('page.user.birthdate'), align: 'center' }, { key: 'age', dataIndex: 'age', - title: '年龄', + title: t('page.user.age'), align: 'center', width: 80 }, { key: 'email', dataIndex: 'email', - title: '邮箱', + title: t('page.user.email'), align: 'center' }, { key: 'phonenumber', dataIndex: 'phonenumber', - title: '手机号', + title: t('page.user.phone'), align: 'center' }, { key: 'isKYC', dataIndex: 'isKYC', - title: 'KYC验证', + title: t('page.user.kyc'), align: 'center', customRender: ({ record }: { record: UserInfo }) => { const KYC_STATUS = { - verified: '已验证', - unverified: '未验证' + verified: t('page.user.ver'), + unverified: t('page.user.unver') } as const; return ( @@ -221,7 +222,7 @@ const calculateAge = (birthDate: string): number => { @search="handleSearch" /> { diff --git a/src/views/user-center/user/modules/user-search.vue b/src/views/user-center/user/modules/user-search.vue index d2a3c3a..d7f9279 100644 --- a/src/views/user-center/user/modules/user-search.vue +++ b/src/views/user-center/user/modules/user-search.vue @@ -2,7 +2,8 @@ import { ref, computed } from 'vue'; import type { FormInstance } from 'ant-design-vue'; import type { SearchModel } from '@/views/user-center/user/type'; - +import { useI18n } from 'vue-i18n'; +const { t } = useI18n(); const props = defineProps<{ model: SearchModel; }>(); @@ -83,24 +84,30 @@ const handleSearch = () => { layout="inline" class="flex flex-wrap gap-16px items-center" > - + - + - 重置 - 搜索 + + {{ t('page.user.search') }} + + {{ t('page.user.reset') }}