fix:用户信息界面中英适配
This commit is contained in:
@@ -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 (
|
||||
<Tag color={record.isKYC ? 'success' : 'warning'}>
|
||||
@@ -221,7 +222,7 @@ const calculateAge = (birthDate: string): number => {
|
||||
@search="handleSearch"
|
||||
/>
|
||||
<ACard
|
||||
title="个人信息"
|
||||
:title="t('page.user.title')"
|
||||
:bordered="false"
|
||||
:body-style="{ flex: 1, overflow: 'hidden' }"
|
||||
class="flex-col-stretch sm:flex-1-hidden card-wrapper"
|
||||
@@ -230,8 +231,9 @@ const calculateAge = (birthDate: string): number => {
|
||||
<TableHeaderOperation
|
||||
v-model:columns="columnChecks"
|
||||
:loading="loading"
|
||||
:show-delete="false"
|
||||
:not-show-add="true"
|
||||
:show-add="false"
|
||||
:show-delete="false"
|
||||
@refresh="getData"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user