From 2427a8ff6873750534b6fe5b868ba3ebc2dabafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=82=A0=E9=9D=99=E8=90=9D=E8=8E=89?= Date: Tue, 3 Sep 2024 18:00:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=81=97=E6=BC=8F=E7=9A=84i18n=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/components/Breadcrumb.vue | 14 ++------ .../dashboard/base/components/TopPanel.vue | 30 ++-------------- src/pages/dashboard/base/constants.ts | 35 +++++++++++++++++++ src/pages/detail/advanced/index.vue | 11 +++--- src/pages/detail/base/index.vue | 11 +++--- src/pages/login/index.vue | 2 +- src/types/interface.d.ts | 4 +-- 7 files changed, 52 insertions(+), 55 deletions(-) diff --git a/src/layouts/components/Breadcrumb.vue b/src/layouts/components/Breadcrumb.vue index 2c48f79..19f1c64 100644 --- a/src/layouts/components/Breadcrumb.vue +++ b/src/layouts/components/Breadcrumb.vue @@ -10,11 +10,8 @@ import { computed } from 'vue'; import { useRoute } from 'vue-router'; -import { useLocale } from '@/locales/useLocale'; import { RouteMeta } from '@/types/interface'; -const { locale } = useLocale(); - const crumbs = computed(() => { const route = useRoute(); @@ -27,18 +24,11 @@ const crumbs = computed(() => { if (meta?.hiddenBreadcrumb || Object.values(route.params).includes(path)) { return breadcrumbArray; } - let title = path; - if (meta?.title) { - if (typeof meta.title === 'string') { - title = meta.title; - } else { - title = meta.title[locale.value]; - } - } + breadcrumbArray.push({ path, to: breadcrumbArray[idx - 1] ? `/${breadcrumbArray[idx - 1].path}/${path}` : `/${path}`, - title, + title: route.matched[idx]?.meta?.title ?? path, }); return breadcrumbArray; }, []); diff --git a/src/pages/dashboard/base/components/TopPanel.vue b/src/pages/dashboard/base/components/TopPanel.vue index eb4852b..0f9dc8e 100644 --- a/src/pages/dashboard/base/components/TopPanel.vue +++ b/src/pages/dashboard/base/components/TopPanel.vue @@ -2,7 +2,7 @@ @@ -67,6 +67,7 @@ import Trend from '@/components/trend/index.vue'; import { useSettingStore } from '@/store'; import { changeChartsTheme } from '@/utils/color'; +import { PANE_LIST } from '../constants'; import { constructInitDashboardDataset } from '../index'; echarts.use([LineChart, BarChart, CanvasRenderer]); @@ -74,33 +75,6 @@ echarts.use([LineChart, BarChart, CanvasRenderer]); const store = useSettingStore(); const resizeTime = ref(1); -const PANE_LIST = [ - { - title: 'pages.dashboardBase.topPanel.card1', - number: '¥ 28,425.00', - upTrend: '20.5%', - leftType: 'echarts-line', - }, - { - title: 'pages.dashboardBase.topPanel.card2', - number: '¥ 768.00', - downTrend: '20.5%', - leftType: 'echarts-bar', - }, - { - title: 'pages.dashboardBase.topPanel.card3', - number: '1126', - upTrend: '20.5%', - leftType: 'icon-usergroup', - }, - { - title: 'pages.dashboardBase.topPanel.card4', - number: 527, - downTrend: '20.5%', - leftType: 'icon-file-paste', - }, -]; - // moneyCharts let moneyContainer: HTMLElement; let moneyChart: echarts.ECharts; diff --git a/src/pages/dashboard/base/constants.ts b/src/pages/dashboard/base/constants.ts index 48b401a..ebc6488 100644 --- a/src/pages/dashboard/base/constants.ts +++ b/src/pages/dashboard/base/constants.ts @@ -1,3 +1,11 @@ +interface DashboardPanel { + title: string; + number: string | number; + leftType: string; + upTrend?: string; + downTrend?: string; +} + interface TendItem { growUp?: number; productName: string; @@ -5,6 +13,33 @@ interface TendItem { date: string; } +export const PANE_LIST: Array = [ + { + title: '总收入', + number: '¥ 28,425.00', + upTrend: '20.5%', + leftType: 'echarts-line', + }, + { + title: '总退款', + number: '¥ 768.00', + downTrend: '20.5%', + leftType: 'echarts-bar', + }, + { + title: '活跃用户(个)', + number: '1126', + upTrend: '20.5%', + leftType: 'icon-usergroup', + }, + { + title: '产生订单(个)', + number: 527, + downTrend: '20.5%', + leftType: 'icon-file-paste', + }, +]; + export const SALE_TEND_LIST: Array = [ { growUp: 1, diff --git a/src/pages/detail/advanced/index.vue b/src/pages/detail/advanced/index.vue index 00644d5..18f3c36 100644 --- a/src/pages/detail/advanced/index.vue +++ b/src/pages/detail/advanced/index.vue @@ -1,9 +1,8 @@