From 6175bddd03f2969407560578a7e3c80c90b1eaa2 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 15 Nov 2023 14:23:26 +0800 Subject: [PATCH] feat: i18n support for user/index.vue --- src/pages/user/constants.ts | 42 ------------------------------------ src/pages/user/index.vue | 43 ++++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/src/pages/user/constants.ts b/src/pages/user/constants.ts index 38dab681..18faadaa 100644 --- a/src/pages/user/constants.ts +++ b/src/pages/user/constants.ts @@ -1,51 +1,9 @@ -import { t } from '@/locales'; - export interface UserInfoListType { title: string; content: string; span?: number; } -export const USER_INFO_LIST: Array = [ - { - title: t('pages.user.personalInfo.desc.mobile'), - content: '+86 13923734567', - }, - { - title: t('pages.user.personalInfo.desc.phone'), - content: '734567', - }, - { - title: t('pages.user.personalInfo.desc.email'), - content: 'Account@qq.com', - }, - { - title: t('pages.user.personalInfo.desc.seat'), - content: 'T32F 012', - }, - { - title: t('pages.user.personalInfo.desc.entity'), - content: '腾讯集团', - }, - { - title: t('pages.user.personalInfo.desc.leader'), - content: 'Michael Wang', - }, - { - title: t('pages.user.personalInfo.desc.position'), - content: '高级 UI 设计师', - }, - { - title: t('pages.user.personalInfo.desc.joinDay'), - content: '2021-07-01', - }, - { - title: t('pages.user.personalInfo.desc.group'), - content: '腾讯/腾讯公司/某事业群/某产品部/某运营中心/商户服务组', - span: 6, - }, -]; - export const TEAM_MEMBERS = [ { avatar: 'https://avatars.githubusercontent.com/Wen1kang', diff --git a/src/pages/user/index.vue b/src/pages/user/index.vue index 048ccef3..78bcc890 100644 --- a/src/pages/user/index.vue +++ b/src/pages/user/index.vue @@ -105,11 +105,12 @@ import ProductAIcon from '@/assets/assets-product-1.svg'; import ProductBIcon from '@/assets/assets-product-2.svg'; import ProductCIcon from '@/assets/assets-product-3.svg'; import ProductDIcon from '@/assets/assets-product-4.svg'; +import { t } from '@/locales'; import { useSettingStore } from '@/store'; import { changeChartsTheme } from '@/utils/color'; import { LAST_7_DAYS } from '@/utils/date'; -import { PRODUCT_LIST, TEAM_MEMBERS, USER_INFO_LIST } from './constants'; +import { PRODUCT_LIST, TEAM_MEMBERS, UserInfoListType } from './constants'; import { getFolderLineDataSet } from './index'; echarts.use([GridComponent, TooltipComponent, LineChart, CanvasRenderer, LegendComponent]); @@ -119,6 +120,46 @@ let lineChart: echarts.ECharts; const store = useSettingStore(); const chartColors = computed(() => store.chartColors); +const USER_INFO_LIST: Array = [ + { + title: t('pages.user.personalInfo.desc.mobile'), + content: '+86 13923734567', + }, + { + title: t('pages.user.personalInfo.desc.phone'), + content: '734567', + }, + { + title: t('pages.user.personalInfo.desc.email'), + content: 'Account@qq.com', + }, + { + title: t('pages.user.personalInfo.desc.seat'), + content: 'T32F 012', + }, + { + title: t('pages.user.personalInfo.desc.entity'), + content: '腾讯集团', + }, + { + title: t('pages.user.personalInfo.desc.leader'), + content: 'Michael Wang', + }, + { + title: t('pages.user.personalInfo.desc.position'), + content: '高级 UI 设计师', + }, + { + title: t('pages.user.personalInfo.desc.joinDay'), + content: '2021-07-01', + }, + { + title: t('pages.user.personalInfo.desc.group'), + content: '腾讯/腾讯公司/某事业群/某产品部/某运营中心/商户服务组', + span: 6, + }, +]; + const onLineChange = (value: DateRangeValue) => { lineChart.setOption( getFolderLineDataSet({