fix: 移除并修复遗漏的i18n相关代码

This commit is contained in:
悠静萝莉 2024-09-03 18:00:06 +08:00
parent 4c53ffa3ca
commit 2427a8ff68
No known key found for this signature in database
GPG Key ID: 4EDF1CA1CEA8EBCC
7 changed files with 52 additions and 55 deletions

View File

@ -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;
}, []);

View File

@ -2,7 +2,7 @@
<t-row :gutter="[16, 16]">
<t-col v-for="(item, index) in PANE_LIST" :key="item.title" :xs="6" :xl="3">
<t-card
:title="t(item.title)"
:title="item.title"
:bordered="false"
:class="{ 'dashboard-item': true, 'dashboard-item--main-color': index == 0 }"
>
@ -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;

View File

@ -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<DashboardPanel> = [
{
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<TendItem> = [
{
growUp: 1,

View File

@ -1,9 +1,8 @@
<template>
<div class="detail-advanced">
<t-card title="基本信息" :bordered="false">
<div class="info-block">
<div v-for="(item, index) in BASE_INFO_DATA" :key="index" class="info-item">
<h1>{{ item.name }}</h1>
<t-card :bordered="false">
<t-descriptions title="基本信息" table-layout="auto">
<t-descriptions-item v-for="(item, index) in BASE_INFO_DATA" :key="index" :label="item.name">
<span
:class="{
['inProgress']: item.type && item.type.value === 'inProgress',
@ -13,8 +12,8 @@
<i v-if="item.type && item.type.key === 'contractStatus'" />
{{ item.value }}
</span>
</div>
</div>
</t-descriptions-item>
</t-descriptions>
</t-card>
<!-- 发票进度 -->

View File

@ -1,9 +1,8 @@
<template>
<div class="detail-base">
<t-card title="基本信息" :bordered="false">
<div class="info-block">
<div v-for="(item, index) in BASE_INFO_DATA" :key="index" class="info-item">
<h1>{{ item.name }}</h1>
<t-card :bordered="false">
<t-descriptions title="基本信息" table-layout="auto">
<t-descriptions-item v-for="(item, index) in BASE_INFO_DATA" :key="index" :label="item.name">
<span
:class="{
['inProgress']: item.type && item.type.value === 'inProgress',
@ -13,8 +12,8 @@
<i v-if="item.type && item.type.key === 'contractStatus'" />
{{ item.value }}
</span>
</div>
</div>
</t-descriptions-item>
</t-descriptions>
</t-card>
<t-card title="变更记录" class="container-base-margin-top" :bordered="false">

View File

@ -19,7 +19,7 @@
<tdesign-setting />
</div>
<footer class="copyright">Copyright @ 2021-2023 Tencent. All Rights Reserved</footer>
<footer class="copyright">Copyright @ 2021-2024 Tencent. All Rights Reserved</footer>
</div>
</template>
<script lang="ts">

View File

@ -2,7 +2,7 @@ import type { TabValue } from 'tdesign-vue-next';
import { LocationQueryRaw, RouteRecordName } from 'vue-router';
export interface RouteMeta {
title?: string | Record<string, string>;
title?: string;
icon?: string;
expanded?: boolean;
orderNo?: number;
@ -16,7 +16,7 @@ export interface RouteMeta {
export interface MenuRoute {
path: string;
title?: string | Record<string, string>;
title?: string;
name?: string;
icon?:
| string