feat(analytics): 前端 ECharts CustomChart 注册 + 数据契约类型扩展
- BaseEChart 注册 CustomChart 支持区间渲染 - FlowInterval 类型扩为 6 位(含 isMain) - FlowDevice 增加 lead_time/started_at
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
* 支持 onEvents(常规事件)与 onZrClick(ZRender 底层点击,扩大热区)。 */
|
* 支持 onEvents(常规事件)与 onZrClick(ZRender 底层点击,扩大热区)。 */
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import * as echarts from "echarts/core";
|
import * as echarts from "echarts/core";
|
||||||
import { LineChart, BarChart } from "echarts/charts";
|
import { LineChart, BarChart, CustomChart } from "echarts/charts";
|
||||||
import {
|
import {
|
||||||
GridComponent, TooltipComponent, LegendComponent, DataZoomComponent,
|
GridComponent, TooltipComponent, LegendComponent, DataZoomComponent,
|
||||||
} from "echarts/components";
|
} from "echarts/components";
|
||||||
@ -13,6 +13,7 @@ import type { EChartsCoreOption } from "echarts/core";
|
|||||||
echarts.use([
|
echarts.use([
|
||||||
LineChart,
|
LineChart,
|
||||||
BarChart,
|
BarChart,
|
||||||
|
CustomChart,
|
||||||
GridComponent,
|
GridComponent,
|
||||||
TooltipComponent,
|
TooltipComponent,
|
||||||
LegendComponent,
|
LegendComponent,
|
||||||
|
|||||||
@ -38,11 +38,16 @@ export interface FlowDevice {
|
|||||||
external_serial: string | null;
|
external_serial: string | null;
|
||||||
material_name: string;
|
material_name: string;
|
||||||
spec_model: 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 {
|
export interface FlowSeries {
|
||||||
name: string; // 工序节点名
|
name: string; // 人员姓名
|
||||||
data: (number | null)[]; // 每台设备在该工序的总耗时(未经过为 null)
|
data: FlowInterval[]; // 该人员的任务时间区间列表(同一设备可多次出现)
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FlowResponse {
|
export interface FlowResponse {
|
||||||
|
|||||||
Reference in New Issue
Block a user