diff --git a/frontend/src/components/BaseEChart.tsx b/frontend/src/components/BaseEChart.tsx index edaf902..a3dbc9e 100644 --- a/frontend/src/components/BaseEChart.tsx +++ b/frontend/src/components/BaseEChart.tsx @@ -2,7 +2,7 @@ * 支持 onEvents(常规事件)与 onZrClick(ZRender 底层点击,扩大热区)。 */ 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, diff --git a/frontend/src/services/analyticsApi.ts b/frontend/src/services/analyticsApi.ts index 6009885..104a1ee 100644 --- a/frontend/src/services/analyticsApi.ts +++ b/frontend/src/services/analyticsApi.ts @@ -38,11 +38,16 @@ export interface FlowDevice { external_serial: string | null; material_name: string; spec_model: string; + lead_time: number; // 设备生命周期总时长(小时) + started_at: string; // 设备最早介入时间(T0),MM-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 {