feat: 人员视图X轴改为四行展示(名称/规格/序列号/身份证)并加大底部空间
This commit is contained in:
@ -315,17 +315,21 @@ export default function AnalyticsDashboard() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
legend: { top: 0, type: "scroll" },
|
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: {
|
xAxis: {
|
||||||
type: "category",
|
type: "category",
|
||||||
data: chunkDevices.map((d) => d.product_sn),
|
data: chunkDevices.map((d) => d.product_sn),
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: 11, interval: 0, color: "#666", lineHeight: 14,
|
fontSize: 11, interval: 0, color: "#666", lineHeight: 15, width: 120, overflow: 'break' as const,
|
||||||
// 🔧 标签改为「产品名称(截断) + 尾号4位」,避免 16 位身份证重叠
|
// 🔧 X 轴四行展示(与轨迹流转一致):产品名称 / 规格型号 / 业务序列号(若有) / 身份证
|
||||||
formatter: (sn: string) => {
|
formatter: (sn: string) => {
|
||||||
const dev = chunkDevices.find((d) => d.product_sn === sn);
|
const dev = chunkDevices.find((d) => d.product_sn === sn);
|
||||||
const name = dev?.material_name ? dev.material_name.slice(0, 6) : sn.slice(0, 6);
|
if (!dev) return sn;
|
||||||
return `${name} ${sn.slice(-4)}`;
|
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");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user