From 81da329cbd651f7e845006f28b5f5fcc52528f90 Mon Sep 17 00:00:00 2001 From: lzh Date: Sun, 1 Mar 2026 15:46:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(ops):=20=E4=BF=AE=E5=A4=8D=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E5=9B=BE=E8=A1=A8=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=20=E2=80=94=20funnelData=20=E5=AD=97=E6=AE=B5=E5=90=8D?= =?UTF-8?q?=E4=B8=8E=E5=90=8E=E7=AB=AF=20statusDistribution=20=E4=B8=8D?= =?UTF-8?q?=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后端 API 返回的字段名为 statusDistribution,但前端类型定义和数据映射使用的是 funnelData, 导致工单状态分布、工牌队列统计、功能类型排行图表数据为 undefined 无法渲染。 Co-Authored-By: Claude Opus 4.6 --- apps/web-antd/src/api/ops/order-center/index.ts | 2 +- .../ops/cleaning/work-order/dashboard/index.vue | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/web-antd/src/api/ops/order-center/index.ts b/apps/web-antd/src/api/ops/order-center/index.ts index 5cef5cb9c..63f0d1913 100644 --- a/apps/web-antd/src/api/ops/order-center/index.ts +++ b/apps/web-antd/src/api/ops/order-center/index.ts @@ -198,7 +198,7 @@ export interface DashboardStatsResp { dates: string[]; responseTimeData: number[]; }; - funnelData: Array<{ name: string; value: number }>; + statusDistribution: Array<{ name: string; value: number }>; heatmapData: { data: number[][]; days: string[]; hours: string[] }; functionTypeRanking: Array<{ completed: number; diff --git a/apps/web-antd/src/views/ops/cleaning/work-order/dashboard/index.vue b/apps/web-antd/src/views/ops/cleaning/work-order/dashboard/index.vue index 660ef896b..e2ffda75f 100644 --- a/apps/web-antd/src/views/ops/cleaning/work-order/dashboard/index.vue +++ b/apps/web-antd/src/views/ops/cleaning/work-order/dashboard/index.vue @@ -64,7 +64,7 @@ interface DashboardStats { }; // 工单状态分布 - funnelData: Array<{ name: string; value: number }>; + statusDistribution: Array<{ name: string; value: number }>; // 时段热力图数据(近7天 x 24小时) heatmapData: { @@ -136,7 +136,7 @@ const statsData = ref({ responseTimeData: [], completionTimeData: [], }, - funnelData: [], + statusDistribution: [], heatmapData: { days: [], hours: [], @@ -156,7 +156,7 @@ const EMPTY_STATS: DashboardStats = { trendData: { dates: [], createdData: [], completedData: [] }, hourlyDistribution: { hours: [], data: [] }, timeTrendData: { dates: [], responseTimeData: [], completionTimeData: [] }, - funnelData: [], + statusDistribution: [], heatmapData: { days: [], hours: [], data: [] }, functionTypeRanking: [], }; @@ -396,7 +396,7 @@ function getTimeTrendChartOptions(): ECOption { * 工单状态分布环形饼图配置 */ function getFunnelChartOptions(): ECOption { - const { funnelData } = statsData.value; + const { statusDistribution } = statsData.value; const STATUS_COLORS: Record = { 待处理: '#f5a623', 排队中: '#8b5cf6', @@ -406,7 +406,7 @@ function getFunnelChartOptions(): ECOption { 已取消: '#f43f5e', 已暂停: '#94a3b8', }; - const total = funnelData.reduce((sum, item) => sum + item.value, 0); + const total = statusDistribution.reduce((sum, item) => sum + item.value, 0); return { tooltip: { trigger: 'item', @@ -478,7 +478,7 @@ function getFunnelChartOptions(): ECOption { borderWidth: 2, borderRadius: 4, }, - data: funnelData.map((item) => ({ + data: statusDistribution.map((item) => ({ ...item, itemStyle: { color: STATUS_COLORS[item.name] || '#d1d5db', @@ -745,7 +745,7 @@ async function loadStats() { trendData: resp.trendData, hourlyDistribution: resp.hourlyDistribution, timeTrendData: resp.timeTrendData, - funnelData: resp.funnelData, + statusDistribution: resp.statusDistribution, heatmapData: resp.heatmapData, functionTypeRanking: resp.functionTypeRanking, monthlyTrendData: resp.monthlyTrendData,