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"); }, }, },