feat: 效能分析X轴四行标签/flow分块/自然工作日即时切换/时间快捷选项

This commit is contained in:
2026-09-02 10:39:01 +08:00
parent 3c6c8c0c53
commit 06337fc8eb
2 changed files with 182 additions and 73 deletions

View File

@ -45,8 +45,9 @@ export interface FlowDevice {
total_workdays: number; // 设备生产总天数(工作日)
}
// 时间区间:deviceIndex, startOffset, endOffset, taskName, duration, isMain
export type FlowInterval = [number, number, number, string, number, number];
// 时间区间:deviceIndex, taskName, isMain,
// startNat, endNat, startWork, endWork, durationTotal(自然), durationWork(工作日)
export type FlowInterval = [number, string, number, number, number, number, number, number, number];
export interface FlowSeries {
name: string; // 人员姓名
@ -105,6 +106,8 @@ export interface FlowQuery {
product_sns?: string[];
spec_models?: string[];
mode?: "natural" | "workdays";
since?: string;
until?: string;
}
// ============================================================
@ -127,6 +130,8 @@ export async function fetchFlowData(query: FlowQuery): Promise<FlowResponse> {
if (query.product_sns?.length) params.product_sns = query.product_sns.join(",");
if (query.spec_models?.length) params.spec_models = query.spec_models.join(",");
if (query.mode) params.mode = query.mode;
if (query.since) params.since = query.since;
if (query.until) params.until = query.until;
const { data } = await api.get<FlowResponse>("/analytics/flow", { params });
return data;
}