tuqin
2026-11-03 2acdb4e99bed8d95d4bff4101649fb1d893db3a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { requestClient } from '#/api/request';
 
export namespace MesSafetyStatisticsApi {
  /** 查询参数 */
  export interface StatisticsParam {
    startDate?: string;
    endDate?: string;
    workshopId?: number;
  }
 
  /** 汇总指标 */
  export interface Summary {
    hazardTotal: number;
    hazardClosed: number;
    hazardClosedRate: number;
    hazardOverdue: number;
    ticketTotal: number;
    ticketArchived: number;
    ticketRejected: number;
    trainingTotal: number;
    trainingAttendee: number;
    trainingAvgScore?: number;
    certificateTotal: number;
    certificateExpired: number;
  }
 
  /** 分组统计项 */
  export interface GroupStat {
    name: string;
    code?: number;
    total: number;
    finished?: number;
    finishRate?: number;
    attendeeTotal?: number;
    avgScore?: number;
  }
 
  /** 统计报表 */
  export interface StatisticsReport {
    summary: Summary;
    hazardByWorkshop: GroupStat[];
    hazardByLevel: GroupStat[];
    hazardBySource: GroupStat[];
    ticketByType: GroupStat[];
    ticketByStatus: GroupStat[];
    trainingByType: GroupStat[];
    certificateByType: GroupStat[];
  }
}
 
/** 获得安全生产统计报表 */
export function getStatisticsReport(params: MesSafetyStatisticsApi.StatisticsParam) {
  return requestClient.get<MesSafetyStatisticsApi.StatisticsReport>(
    '/mes/safety/statistics/report',
    { params },
  );
}
 
/** 导出隐患明细 */
export function exportHazardDetail(params: MesSafetyStatisticsApi.StatisticsParam) {
  return requestClient.download('/mes/safety/statistics/export-hazard', { params });
}