feat(效能分析): 人员视图也支持自然天/工作日耗时切换
- capability 接口加 mode 参数,natural 用自然小时、workdays 用工作小时 - 人员视图柱状图随顶部按钮切换,排除休息日的耗时 - 切换按钮自动重新请求 capability 与 flow
This commit is contained in:
@ -120,8 +120,9 @@ export default function AnalyticsDashboard() {
|
||||
q.since = range[0].startOf("day").toISOString();
|
||||
q.until = range[1].endOf("day").toISOString();
|
||||
}
|
||||
q.mode = totalDaysMode; // 自然天 / 工作日,控制人员视图耗时口径
|
||||
return q;
|
||||
}, [assigneeIds, specModels, range]);
|
||||
}, [assigneeIds, specModels, range, totalDaysMode]);
|
||||
|
||||
const buildFlowQuery = useCallback((): FlowQuery => {
|
||||
const q: FlowQuery = {};
|
||||
|
||||
@ -98,6 +98,7 @@ export interface CapabilityQuery {
|
||||
spec_models?: string[];
|
||||
since?: string;
|
||||
until?: string;
|
||||
mode?: "natural" | "workdays";
|
||||
}
|
||||
|
||||
export interface FlowQuery {
|
||||
@ -116,6 +117,7 @@ export async function fetchCapabilityProfile(query: CapabilityQuery): Promise<Ca
|
||||
if (query.spec_models?.length) params.spec_models = query.spec_models.join(",");
|
||||
if (query.since) params.since = query.since;
|
||||
if (query.until) params.until = query.until;
|
||||
if (query.mode) params.mode = query.mode;
|
||||
const { data } = await api.get<CapabilityResponse>("/analytics/capability", { params });
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user