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 @@