feat(analytics): 前端 ECharts CustomChart 注册 + 数据契约类型扩展

- BaseEChart 注册 CustomChart 支持区间渲染
- FlowInterval 类型扩为 6 位(含 isMain)
- FlowDevice 增加 lead_time/started_at
This commit is contained in:
2026-08-14 11:44:48 +08:00
parent 74d404cc11
commit 2b17dde42e
2 changed files with 9 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* 支持 onEvents常规事件与 onZrClickZRender 底层点击,扩大热区)。 */
import { useEffect, useRef } from "react";
import * as echarts from "echarts/core";
import { LineChart, BarChart } from "echarts/charts";
import { LineChart, BarChart, CustomChart } from "echarts/charts";
import {
GridComponent, TooltipComponent, LegendComponent, DataZoomComponent,
} from "echarts/components";
@ -13,6 +13,7 @@ import type { EChartsCoreOption } from "echarts/core";
echarts.use([
LineChart,
BarChart,
CustomChart,
GridComponent,
TooltipComponent,
LegendComponent,

View File

@ -38,11 +38,16 @@ export interface FlowDevice {
external_serial: string | null;
material_name: string;
spec_model: string;
lead_time: number; // 设备生命周期总时长(小时)
started_at: string; // 设备最早介入时间T0MM-DD HH:mm
}
// 时间区间deviceIndex, startOffset, endOffset, taskName, duration, isMain
export type FlowInterval = [number, number, number, string, number, number];
export interface FlowSeries {
name: string; // 工序节点
data: (number | null)[]; // 每台设备在该工序的总耗时(未经过为 null
name: string; // 人员姓
data: FlowInterval[]; // 该人员的任务时间区间列表(同一设备可多次出现
}
export interface FlowResponse {