| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import request from '@/utils/request';
- import { AxiosPromise } from 'axios';
- /**
- * 工作台 Dashboard 统计 API
- */
- // 顶部 4 张统计卡片数据
- export interface DashboardStatsVo {
- dangerTotal: number;
- dangerHandled: number;
- dangerPending: number;
- dangerYesterdayTotal: number;
- dangerDayRatio: number;
- equipmentTotal: number;
- equipmentMaintaining: number;
- dangerTypeStats: Array<{ name: string; value: number }>;
- monthlyTrend: Array<{ month: string; reported: number; handled: number }>;
- }
- export interface RecentDangerVo {
- dangerCode: string;
- dangerTitle: string;
- location: string;
- dangerType: string;
- dangerLevel: string;
- reportTime: string;
- handleStatus: string;
- }
- export interface RecentTrainingVo {
- trainingName: string;
- trainingTime: string;
- }
- export interface RecentNoticeVo {
- title: string;
- summary: string;
- publishTime: string;
- }
- /** 工作台统计数据 */
- export const getDashboardStats = (): AxiosPromise<DashboardStatsVo> => {
- return request({
- url: '/risk/dashboard/stats',
- method: 'get'
- });
- };
- /** 最新安全隐患 */
- export const getRecentDangers = (): AxiosPromise<RecentDangerVo[]> => {
- return request({
- url: '/risk/dashboard/recent/dangers',
- method: 'get'
- });
- };
- /** 近期安全培训 */
- export const getRecentTrainings = (): AxiosPromise<RecentTrainingVo[]> => {
- return request({
- url: '/risk/dashboard/recent/trainings',
- method: 'get'
- });
- };
- /** 最近公告 */
- export const getRecentNotices = (): AxiosPromise<RecentNoticeVo[]> => {
- return request({
- url: '/risk/dashboard/recent/notices',
- method: 'get'
- });
- };
|