From b4795181eeb9479db3e7f43bf5ad4ffbad307709 Mon Sep 17 00:00:00 2001 From: duxingchen Date: Thu, 3 Sep 2026 16:35:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BA=BA=E5=91=98=E8=A7=86=E5=9B=BEX?= =?UTF-8?q?=E8=BD=B4=E6=94=B9=E4=B8=BA=E5=9B=9B=E8=A1=8C=E5=B1=95=E7=A4=BA?= =?UTF-8?q?(=E5=90=8D=E7=A7=B0/=E8=A7=84=E6=A0=BC/=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8F=B7/=E8=BA=AB=E4=BB=BD=E8=AF=81)=E5=B9=B6=E5=8A=A0?= =?UTF-8?q?=E5=A4=A7=E5=BA=95=E9=83=A8=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/admin/AnalyticsDashboard.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/admin/AnalyticsDashboard.tsx b/frontend/src/pages/admin/AnalyticsDashboard.tsx index e187f3e..40831a7 100644 --- a/frontend/src/pages/admin/AnalyticsDashboard.tsx +++ b/frontend/src/pages/admin/AnalyticsDashboard.tsx @@ -315,17 +315,21 @@ export default function AnalyticsDashboard() { }, }, legend: { top: 0, type: "scroll" }, - grid: { left: 48, right: 24, top: 80, bottom: 48 }, // top 加大,避免图例遮挡柱子 + grid: { left: 48, right: 24, top: 80, bottom: 96 }, // bottom 加大以容纳 X 轴四行标签(名称/规格/序列号/身份证) xAxis: { type: "category", data: chunkDevices.map((d) => d.product_sn), axisLabel: { - fontSize: 11, interval: 0, color: "#666", lineHeight: 14, - // 🔧 标签改为「产品名称(截断) + 尾号4位」,避免 16 位身份证重叠 + fontSize: 11, interval: 0, color: "#666", lineHeight: 15, width: 120, overflow: 'break' as const, + // 🔧 X 轴四行展示(与轨迹流转一致):产品名称 / 规格型号 / 业务序列号(若有) / 身份证 formatter: (sn: string) => { const dev = chunkDevices.find((d) => d.product_sn === sn); - const name = dev?.material_name ? dev.material_name.slice(0, 6) : sn.slice(0, 6); - return `${name} ${sn.slice(-4)}`; + if (!dev) return sn; + const lines = [dev.material_name || "—"]; + if (dev.spec_model) lines.push(dev.spec_model); + if (dev.external_serial) lines.push(dev.external_serial); + lines.push(dev.product_sn); + return lines.join("\n"); }, }, },