style: 个人中心多语言

This commit is contained in:
TsMask
2023-11-11 14:51:52 +08:00
parent 3ae8a7c237
commit b7340ff101
7 changed files with 304 additions and 98 deletions

View File

@@ -6,6 +6,8 @@ import { reactive, ref, onMounted } from 'vue';
import { parseDateToStr } from '@/utils/date-utils';
import useUserStore from '@/store/modules/user';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
const { t } = useI18n();
/**加载状态 */
let loading = ref<boolean>(true);
@@ -100,31 +102,33 @@ onMounted(() => {
:bordered="true"
:column="1"
>
<a-descriptions-item label="手机号码">
<a-descriptions-item
:label="t('views.account.profile.phonenumber')"
>
{{ state.user.phonenumber || '-' }}
</a-descriptions-item>
<a-descriptions-item label="用户邮箱">
<a-descriptions-item :label="t('views.account.profile.email')">
{{ state.user.email || '-' }}
</a-descriptions-item>
<a-descriptions-item label="所属部门">
<a-descriptions-item :label="t('views.account.profile.deptName')">
{{ state.user.dept?.deptName || '-' }}
</a-descriptions-item>
<a-descriptions-item label="拥有岗位">
<a-descriptions-item :label="t('views.account.profile.postGroup')">
<span v-if="state.postGroup.length === 0">-</span>
<a-tag v-else v-for="v in state.postGroup" :key="v">
{{ v }}
</a-tag>
</a-descriptions-item>
<a-descriptions-item label="拥有角色">
<a-descriptions-item :label="t('views.account.profile.roleGroup')">
<span v-if="state.roleGroup.length === 0">-</span>
<a-tag v-else v-for="v in state.roleGroup" :key="v">
{{ v }}
</a-tag>
</a-descriptions-item>
<a-descriptions-item label="登录地址">
<a-descriptions-item :label="t('views.account.profile.loginIp')">
{{ state.user.loginIp || '-' }}
</a-descriptions-item>
<a-descriptions-item label="登录时间">
<a-descriptions-item :label="t('views.account.profile.loginDate')">
<span v-if="+state.user.loginDate > 0">
{{ parseDateToStr(+state.user.loginDate) }}
</span>
@@ -140,7 +144,7 @@ onMounted(() => {
:destroy-inactive-tab-pane="true"
v-model:activeKey="activeKey"
>
<a-tab-pane key="list" tab="列表">
<a-tab-pane key="list" :tab="t('views.account.profile.list')">
<a-list
item-layout="horizontal"
:data-source="listData"
@@ -163,10 +167,14 @@ onMounted(() => {
</template>
</a-list>
</a-tab-pane>
<a-tab-pane key="empty" tab="空状态">
<a-tab-pane key="empty" :tab="t('views.account.profile.empty')">
<a-empty>
<template #description> 暂无数据尝试刷新看看 </template>
<a-button type="primary">刷新</a-button>
<template #description>
{{ t('views.account.profile.description') }}
</template>
<a-button type="primary">
{{ t('commom.reloadText') }}
</a-button>
</a-empty>
</a-tab-pane>
</a-tabs>