From 3d87b7f70645c6dbf4c1c01f39c57abc4ebdfe27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=9F=91=E8=9E=82?= Date: Tue, 12 May 2026 23:22:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CategoryComparisonTable.vue | 13 +- .../components/PlatformSummaryCard.vue | 8 +- .../components/ShopComparisonTable.vue | 13 +- .../workbench/WorkbenchOverviewTables.vue | 167 ++++++++ .../src/views/dashboard/workbench/data.ts | 85 +--- .../src/views/dashboard/workbench/index.vue | 390 +++++++----------- .../dashboard/workbench/overview-mock.ts | 323 +++++++++++++++ 7 files changed, 670 insertions(+), 329 deletions(-) create mode 100644 ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/WorkbenchOverviewTables.vue create mode 100644 ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/overview-mock.ts diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/CategoryComparisonTable.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/CategoryComparisonTable.vue index f0e67789..3c6da117 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/CategoryComparisonTable.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/CategoryComparisonTable.vue @@ -19,6 +19,10 @@ interface Props { taxRate: number; categoryExportMode?: boolean; selectedExportCategoryIds?: number[]; + headingTitle?: string; + headingSubtitle?: string; + /** 首列维度名称,如「品类」「商品」 */ + firstColumnLabel?: string; } interface Emits { @@ -30,6 +34,9 @@ interface Emits { const props = withDefaults(defineProps(), { categoryExportMode: false, selectedExportCategoryIds: () => [], + headingTitle: '各品类多维度经营明细汇总', + headingSubtitle: '包含:规模、成本及最终损益所有维度', + firstColumnLabel: '品类', }); const emit = defineEmits(); @@ -62,10 +69,10 @@ const cellRoi = (v: number | null | undefined) => >

- 各品类多维度经营明细汇总 + {{ props.headingTitle }}

- 包含:规模、成本及最终损益所有维度 + {{ props.headingSubtitle }}

@@ -131,7 +138,7 @@ const cellRoi = (v: number | null | undefined) => rowspan="2" class="sticky-col border-b p-6 text-base font-black text-slate-900 dark:text-[hsl(0deg_0%_95%)] border-r-2 border-slate-100 dark:border-[hsl(240deg_3.7%_22%)] bg-white dark:bg-[hsl(222.34deg_10.43%_12.27%)] shadow-sm dark:shadow-none" > - 品类 + {{ props.firstColumnLabel }} (), { platformExportMode: false, selectedExportPlatformIds: () => [], + headingTitle: '各平台多维度经营明细汇总', + headingSubtitle: '目标达成 · 规模 · 成本费用 · 盈利分析,四大维度完整汇总', }); const emit = defineEmits(); @@ -112,10 +116,10 @@ const sortedData = computed(() => { >

- 各平台多维度经营明细汇总 + {{ props.headingTitle }}

- 目标达成 · 规模 · 成本费用 · 盈利分析,四大维度完整汇总 + {{ props.headingSubtitle }}

diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/ShopComparisonTable.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/ShopComparisonTable.vue index ac31256f..7d539fd5 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/ShopComparisonTable.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/ShopComparisonTable.vue @@ -22,6 +22,10 @@ interface Props { taxRate: number; shopExportMode: boolean; selectedExportShopIds: number[]; + /** 覆盖默认表头主标题(如工作台演示) */ + headingTitle?: string; + /** 覆盖默认表头副标题 */ + headingSubtitle?: string; } interface Emits { @@ -31,7 +35,10 @@ interface Emits { (e: 'navigate', shopId: number): void; } -const props = defineProps(); +const props = withDefaults(defineProps(), { + headingTitle: '各店铺多维度经营明细汇总', + headingSubtitle: '包含:目标达成、规模、成本及最终损益所有维度', +}); const emit = defineEmits(); const allShopsSelected = computed(() => { @@ -65,10 +72,10 @@ const cellRoi = (v: number | null | undefined) => >

- 各店铺多维度经营明细汇总 + {{ props.headingTitle }}

- 包含:目标达成、规模、成本及最终损益所有维度 + {{ props.headingSubtitle }}

diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/WorkbenchOverviewTables.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/WorkbenchOverviewTables.vue new file mode 100644 index 00000000..cfd19218 --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/WorkbenchOverviewTables.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/data.ts b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/data.ts index 30830b77..68e8a32f 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/data.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/data.ts @@ -107,88 +107,17 @@ export const COST_STRUCTURE = [ { name: '其他费用', value: 18.0, pct: 6.6 }, ] as const; -/** 与 COST_STRUCTURE 顺序一一对应,用于成本结构饼图 */ +/** 与 COST_STRUCTURE 顺序一一对应;配色对齐全店概览表(盈利翠绿 / 规模蓝 / 成本橙红系 / 退款灰) */ export const COST_STRUCTURE_PIE_COLORS = [ - '#22c55e', - '#3b82f6', - '#ef4444', - '#f59e0b', - '#a855f7', + '#059669', + '#2563eb', + '#e11d48', + '#ea580c', + '#d97706', '#94a3b8', - '#14b8a6', + '#0d9488', ] as const; -/** 商品销量 TOP5(演示):件数、GMV、环比 */ -export type ProductSalesTopItem = { - rank: number; - name: string; - sales: number; - gmvWan: number; - momPct: number; - barColor: string; -}; - -export const PRODUCT_SALES_TOP5: ProductSalesTopItem[] = [ - { - rank: 1, - name: '316不锈钢保温杯-女款 500ml', - sales: 42_860, - gmvWan: 42.6, - momPct: 18.2, - barColor: '#f59e0b', - }, - { - rank: 2, - name: '大容量运动水壶 1.2L 吸管款', - sales: 31_240, - gmvWan: 28.9, - momPct: 9.6, - barColor: '#6366f1', - }, - { - rank: 3, - name: '玻璃内胆保温壶 2.5L 家用', - sales: 24_180, - gmvWan: 36.2, - momPct: -2.1, - barColor: '#10b981', - }, - { - rank: 4, - name: '儿童保温杯卡通款 350ml', - sales: 19_650, - gmvWan: 15.4, - momPct: 6.8, - barColor: '#a855f7', - }, - { - rank: 5, - name: '情侣对杯礼盒 限定包装', - sales: 15_920, - gmvWan: 22.7, - momPct: 14.0, - barColor: '#ec4899', - }, -]; - -/** 平台销量 TOP5(演示):万件 + 占比 */ -export type PlatformSalesTopItem = { - rank: number; - label: string; - short: string; - salesWan: number; - sharePct: number; - color: string; -}; - -export const PLATFORM_SALES_TOP5: PlatformSalesTopItem[] = [ - { rank: 1, label: '拼多多', short: 'PDD', salesWan: 58.2, sharePct: 38.6, color: '#e02e24' }, - { rank: 2, label: '抖音电商', short: '抖店', salesWan: 36.4, sharePct: 24.1, color: '#fe2c55' }, - { rank: 3, label: '淘宝', short: 'TB', salesWan: 28.7, sharePct: 19.0, color: '#ff5000' }, - { rank: 4, label: '京东', short: 'JD', salesWan: 21.3, sharePct: 14.1, color: '#e3393c' }, - { rank: 5, label: '快手小店', short: 'KS', salesWan: 6.2, sharePct: 4.1, color: '#ff6600' }, -]; - export const STORES = [ { name: '优品生活旗舰店', diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue index 7e562039..40519ff2 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue @@ -27,9 +27,7 @@ import { GLOBAL_SUMMARY, GMV_TREND, PLATFORM_OPTIONS, - PLATFORM_SALES_TOP5, PRODUCT_RANK, - PRODUCT_SALES_TOP5, PRODUCT_TIME_SEGMENTS, PROMO_TABLE, PROMO_TIMELINE, @@ -39,6 +37,7 @@ import { TRAFFIC_SOURCES, storeCompareRows, } from './data'; +import WorkbenchOverviewTables from './WorkbenchOverviewTables.vue'; defineOptions({ name: 'PddWorkbench' }); @@ -86,27 +85,6 @@ const costTotal = computed(() => COST_STRUCTURE.reduce((a, x) => a + x.value, 0), ); -const productSalesTopMax = computed(() => - Math.max(...PRODUCT_SALES_TOP5.map((x) => x.sales), 1), -); - -const platformSalesTopMax = computed(() => - Math.max(...PLATFORM_SALES_TOP5.map((x) => x.salesWan), 0.01), -); - -const rankMedalClass = (rank: number) => { - if (rank === 1) { - return 'bg-gradient-to-br from-amber-400 to-orange-600 text-white shadow-md shadow-amber-500/30'; - } - if (rank === 2) { - return 'bg-gradient-to-br from-slate-300 to-slate-500 text-slate-900 dark:from-slate-500 dark:to-slate-700 dark:text-white'; - } - if (rank === 3) { - return 'bg-gradient-to-br from-amber-700 to-orange-900 text-amber-100'; - } - return 'bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-300'; -}; - const keywordColumnsSimple = [ { title: '关键词', dataIndex: 'keyword', key: 'keyword', ellipsis: true }, { title: '曝光量', dataIndex: 'impression', key: 'impression' }, @@ -183,10 +161,10 @@ const drawFinanceTrend = () => { }, legend: { top: 0, - textStyle: { color: axisLabel }, + textStyle: { color: axisLabel, fontWeight: 700 }, data: ['GMV(万)', '净利润(万)', '退款(万)'], }, - grid: { left: '3%', right: '3%', bottom: '3%', top: 48, containLabel: true }, + grid: { left: '3%', right: '3%', bottom: '3%', top: 52, containLabel: true }, xAxis: { type: 'category', data: GMV_TREND.map((d) => d.date), @@ -212,8 +190,8 @@ const drawFinanceTrend = () => { x2: 0, y2: 1, colorStops: [ - { offset: 0, color: '#6366f1' }, - { offset: 1, color: 'rgba(99, 102, 241, 0.25)' }, + { offset: 0, color: isDark ? '#60a5fa' : '#1d4ed8' }, + { offset: 1, color: isDark ? 'rgba(37, 99, 235, 0.35)' : 'rgba(37, 99, 235, 0.22)' }, ], }, }, @@ -224,15 +202,15 @@ const drawFinanceTrend = () => { smooth: true, symbolSize: 6, data: GMV_TREND.map((d) => d.profit), - lineStyle: { width: 2.5, color: '#10b981' }, - itemStyle: { color: '#10b981' }, + lineStyle: { width: 2.5, color: isDark ? '#34d399' : '#059669' }, + itemStyle: { color: isDark ? '#34d399' : '#059669' }, }, { name: '退款(万)', type: 'bar', data: GMV_TREND.map((d) => d.refund), barMaxWidth: 8, - itemStyle: { color: 'rgba(148, 163, 184, 0.55)' }, + itemStyle: { color: isDark ? 'rgba(251, 113, 133, 0.75)' : 'rgba(244, 63, 94, 0.55)' }, }, ], }); @@ -345,6 +323,10 @@ const kpiCardClass = const panelCardClass = 'rounded-2xl border border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] bg-white/90 dark:bg-[hsl(222.34deg_10.43%_12.27%)] p-6 shadow-[0_4px_12px_rgba(0,0,0,0.03)] dark:shadow-none backdrop-blur-[10px]'; + +/** 与全店概览汇总表同款外框(无内边距,由头/体分区) */ +const chartOverviewShell = + 'overflow-hidden rounded-2xl border border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] bg-white/90 dark:bg-[hsl(222.34deg_10.43%_12.27%)] shadow-[0_4px_12px_rgba(0,0,0,0.03)] dark:shadow-none backdrop-blur-[10px]';