From ae5de803a2555b127cb3d650dbe2f29ac5a26d52 Mon Sep 17 00:00:00 2001 From: hwj Date: Wed, 1 Apr 2026 17:56:19 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=B7=BB=E5=8A=A0=E6=8A=A5?= =?UTF-8?q?=E8=AD=A6=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/deviceWarningRecord/index.ts | 67 +++ src/views/iot/alert/statistics/index.vue | 576 +++++++++++++++++++++++ 2 files changed, 643 insertions(+) create mode 100644 src/api/iot/deviceWarningRecord/index.ts create mode 100644 src/views/iot/alert/statistics/index.vue diff --git a/src/api/iot/deviceWarningRecord/index.ts b/src/api/iot/deviceWarningRecord/index.ts new file mode 100644 index 0000000..799398f --- /dev/null +++ b/src/api/iot/deviceWarningRecord/index.ts @@ -0,0 +1,67 @@ +import request from '@/config/axios' + +// 报警统计 Count 响应 +export interface DeviceWarningCountRespVO { + totalCount: number + normalCount: number + tipCount: number + seriousCount: number +} + +// 报警趋势 响应 +export interface DeviceWarningTrendRespVO { + timePoints: string[] + counts: number[] +} + +// 报警记录 响应 +export interface DeviceWarningRecordRespVO { + id: number + deviceId: number + modelId: number + rule: string + alarmLevel: string + addressValue: string + ruleId: number + deviceName: string + modelName: string + ruleName: string + createTime: string + customerName: string +} + +// 查询参数 +export interface DeviceWarningQueryParams { + startTime?: string + endTime?: string + alarmLevel?: string + pageNo?: number + pageSize?: number +} + +// 报警统计与记录 API +export const DeviceWarningRecordApi = { + // 获取报警统计数量 + getWarningCount: async (params: { startTime?: string; endTime?: string }) => { + return await request.get({ + url: `/iot/device-warinning-record/count`, + params + }) + }, + + // 获取报警趋势 + getWarningTrend: async (params: { startTime?: string; endTime?: string }) => { + return await request.get({ + url: `/iot/device-warinning-record/trend`, + params + }) + }, + + // 获取报警记录分页 + getWarningRecordList: async (params: DeviceWarningQueryParams) => { + return await request.get>({ + url: `/iot/device-warinning-record/page`, + params + }) + } +} diff --git a/src/views/iot/alert/statistics/index.vue b/src/views/iot/alert/statistics/index.vue new file mode 100644 index 0000000..a576111 --- /dev/null +++ b/src/views/iot/alert/statistics/index.vue @@ -0,0 +1,576 @@ + + + + +