feat(效能分析): 轨迹流转图时间轴支持工作日/自然天切换
- flow 接口加 mode 参数,workdays 模式把时间偏移换算为排除周末/节假日的工作小时 - 轨迹流转图的横轴随顶部按钮(自然天/工作日)切换,休息日被压缩 - 按钮切换自动重新请求 flow
This commit is contained in:
@ -127,8 +127,9 @@ export default function AnalyticsDashboard() {
|
||||
const q: FlowQuery = {};
|
||||
if (productSns.length) q.product_sns = productSns;
|
||||
if (specModels.length) q.spec_models = specModels;
|
||||
q.mode = totalDaysMode; // 自然天 / 工作日,控制轨迹流转图时间口径
|
||||
return q;
|
||||
}, [productSns, specModels]);
|
||||
}, [productSns, specModels, totalDaysMode]);
|
||||
|
||||
// ─── 能力图谱(需选择人员才发起) ──
|
||||
const loadCapability = useCallback(async () => {
|
||||
|
||||
@ -103,6 +103,7 @@ export interface CapabilityQuery {
|
||||
export interface FlowQuery {
|
||||
product_sns?: string[];
|
||||
spec_models?: string[];
|
||||
mode?: "natural" | "workdays";
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
@ -123,6 +124,7 @@ export async function fetchFlowData(query: FlowQuery): Promise<FlowResponse> {
|
||||
const params: Record<string, string> = {};
|
||||
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;
|
||||
const { data } = await api.get<FlowResponse>("/analytics/flow", { params });
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user