mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-23 08:36:29 +08:00
fix: 移除并修复遗漏的i18n相关代码
This commit is contained in:
parent
4c53ffa3ca
commit
2427a8ff68
|
@ -10,11 +10,8 @@
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { useLocale } from '@/locales/useLocale';
|
|
||||||
import { RouteMeta } from '@/types/interface';
|
import { RouteMeta } from '@/types/interface';
|
||||||
|
|
||||||
const { locale } = useLocale();
|
|
||||||
|
|
||||||
const crumbs = computed(() => {
|
const crumbs = computed(() => {
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
@ -27,18 +24,11 @@ const crumbs = computed(() => {
|
||||||
if (meta?.hiddenBreadcrumb || Object.values(route.params).includes(path)) {
|
if (meta?.hiddenBreadcrumb || Object.values(route.params).includes(path)) {
|
||||||
return breadcrumbArray;
|
return breadcrumbArray;
|
||||||
}
|
}
|
||||||
let title = path;
|
|
||||||
if (meta?.title) {
|
|
||||||
if (typeof meta.title === 'string') {
|
|
||||||
title = meta.title;
|
|
||||||
} else {
|
|
||||||
title = meta.title[locale.value];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
breadcrumbArray.push({
|
breadcrumbArray.push({
|
||||||
path,
|
path,
|
||||||
to: breadcrumbArray[idx - 1] ? `/${breadcrumbArray[idx - 1].path}/${path}` : `/${path}`,
|
to: breadcrumbArray[idx - 1] ? `/${breadcrumbArray[idx - 1].path}/${path}` : `/${path}`,
|
||||||
title,
|
title: route.matched[idx]?.meta?.title ?? path,
|
||||||
});
|
});
|
||||||
return breadcrumbArray;
|
return breadcrumbArray;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<t-row :gutter="[16, 16]">
|
<t-row :gutter="[16, 16]">
|
||||||
<t-col v-for="(item, index) in PANE_LIST" :key="item.title" :xs="6" :xl="3">
|
<t-col v-for="(item, index) in PANE_LIST" :key="item.title" :xs="6" :xl="3">
|
||||||
<t-card
|
<t-card
|
||||||
:title="t(item.title)"
|
:title="item.title"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
:class="{ 'dashboard-item': true, 'dashboard-item--main-color': index == 0 }"
|
: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 { useSettingStore } from '@/store';
|
||||||
import { changeChartsTheme } from '@/utils/color';
|
import { changeChartsTheme } from '@/utils/color';
|
||||||
|
|
||||||
|
import { PANE_LIST } from '../constants';
|
||||||
import { constructInitDashboardDataset } from '../index';
|
import { constructInitDashboardDataset } from '../index';
|
||||||
|
|
||||||
echarts.use([LineChart, BarChart, CanvasRenderer]);
|
echarts.use([LineChart, BarChart, CanvasRenderer]);
|
||||||
|
@ -74,33 +75,6 @@ echarts.use([LineChart, BarChart, CanvasRenderer]);
|
||||||
const store = useSettingStore();
|
const store = useSettingStore();
|
||||||
const resizeTime = ref(1);
|
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
|
// moneyCharts
|
||||||
let moneyContainer: HTMLElement;
|
let moneyContainer: HTMLElement;
|
||||||
let moneyChart: echarts.ECharts;
|
let moneyChart: echarts.ECharts;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
interface DashboardPanel {
|
||||||
|
title: string;
|
||||||
|
number: string | number;
|
||||||
|
leftType: string;
|
||||||
|
upTrend?: string;
|
||||||
|
downTrend?: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface TendItem {
|
interface TendItem {
|
||||||
growUp?: number;
|
growUp?: number;
|
||||||
productName: string;
|
productName: string;
|
||||||
|
@ -5,6 +13,33 @@ interface TendItem {
|
||||||
date: string;
|
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> = [
|
export const SALE_TEND_LIST: Array<TendItem> = [
|
||||||
{
|
{
|
||||||
growUp: 1,
|
growUp: 1,
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="detail-advanced">
|
<div class="detail-advanced">
|
||||||
<t-card title="基本信息" :bordered="false">
|
<t-card :bordered="false">
|
||||||
<div class="info-block">
|
<t-descriptions title="基本信息" table-layout="auto">
|
||||||
<div v-for="(item, index) in BASE_INFO_DATA" :key="index" class="info-item">
|
<t-descriptions-item v-for="(item, index) in BASE_INFO_DATA" :key="index" :label="item.name">
|
||||||
<h1>{{ item.name }}</h1>
|
|
||||||
<span
|
<span
|
||||||
:class="{
|
:class="{
|
||||||
['inProgress']: item.type && item.type.value === 'inProgress',
|
['inProgress']: item.type && item.type.value === 'inProgress',
|
||||||
|
@ -13,8 +12,8 @@
|
||||||
<i v-if="item.type && item.type.key === 'contractStatus'" />
|
<i v-if="item.type && item.type.key === 'contractStatus'" />
|
||||||
{{ item.value }}
|
{{ item.value }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</t-descriptions-item>
|
||||||
</div>
|
</t-descriptions>
|
||||||
</t-card>
|
</t-card>
|
||||||
|
|
||||||
<!-- 发票进度 -->
|
<!-- 发票进度 -->
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="detail-base">
|
<div class="detail-base">
|
||||||
<t-card title="基本信息" :bordered="false">
|
<t-card :bordered="false">
|
||||||
<div class="info-block">
|
<t-descriptions title="基本信息" table-layout="auto">
|
||||||
<div v-for="(item, index) in BASE_INFO_DATA" :key="index" class="info-item">
|
<t-descriptions-item v-for="(item, index) in BASE_INFO_DATA" :key="index" :label="item.name">
|
||||||
<h1>{{ item.name }}</h1>
|
|
||||||
<span
|
<span
|
||||||
:class="{
|
:class="{
|
||||||
['inProgress']: item.type && item.type.value === 'inProgress',
|
['inProgress']: item.type && item.type.value === 'inProgress',
|
||||||
|
@ -13,8 +12,8 @@
|
||||||
<i v-if="item.type && item.type.key === 'contractStatus'" />
|
<i v-if="item.type && item.type.key === 'contractStatus'" />
|
||||||
{{ item.value }}
|
{{ item.value }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</t-descriptions-item>
|
||||||
</div>
|
</t-descriptions>
|
||||||
</t-card>
|
</t-card>
|
||||||
|
|
||||||
<t-card title="变更记录" class="container-base-margin-top" :bordered="false">
|
<t-card title="变更记录" class="container-base-margin-top" :bordered="false">
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<tdesign-setting />
|
<tdesign-setting />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="copyright">Copyright @ 2021-2023 Tencent. All Rights Reserved</footer>
|
<footer class="copyright">Copyright @ 2021-2024 Tencent. All Rights Reserved</footer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|
4
src/types/interface.d.ts
vendored
4
src/types/interface.d.ts
vendored
|
@ -2,7 +2,7 @@ import type { TabValue } from 'tdesign-vue-next';
|
||||||
import { LocationQueryRaw, RouteRecordName } from 'vue-router';
|
import { LocationQueryRaw, RouteRecordName } from 'vue-router';
|
||||||
|
|
||||||
export interface RouteMeta {
|
export interface RouteMeta {
|
||||||
title?: string | Record<string, string>;
|
title?: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
expanded?: boolean;
|
expanded?: boolean;
|
||||||
orderNo?: number;
|
orderNo?: number;
|
||||||
|
@ -16,7 +16,7 @@ export interface RouteMeta {
|
||||||
|
|
||||||
export interface MenuRoute {
|
export interface MenuRoute {
|
||||||
path: string;
|
path: string;
|
||||||
title?: string | Record<string, string>;
|
title?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
icon?:
|
icon?:
|
||||||
| string
|
| string
|
||||||
|
|
Loading…
Reference in New Issue
Block a user