From ba52721db2f00779e2da2d010ec115c4340951f8 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 27 Jun 2025 22:39:32 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90IoT=20=E7=89=A9=E8=81=94?= =?UTF-8?q?=E7=BD=91=E3=80=91=E5=88=9D=E5=A7=8B=E5=8C=96=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/alert/config/index.ts | 41 ++++ src/utils/dict.ts | 3 +- .../iot/alert/config/AlertConfigForm.vue | 132 ++++++++++++ src/views/iot/alert/config/index.vue | 194 ++++++++++++++++++ src/views/iot/rule/data/rule/index.vue | 1 - 5 files changed, 369 insertions(+), 2 deletions(-) create mode 100644 src/api/iot/alert/config/index.ts create mode 100644 src/views/iot/alert/config/AlertConfigForm.vue create mode 100644 src/views/iot/alert/config/index.vue diff --git a/src/api/iot/alert/config/index.ts b/src/api/iot/alert/config/index.ts new file mode 100644 index 00000000..9d382a8b --- /dev/null +++ b/src/api/iot/alert/config/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +/** IoT 告警配置信息 */ +export interface AlertConfig { + id: number // 配置编号 + name?: string // 配置名称 + description: string // 配置描述 + level?: number // 告警级别 + status?: number // 配置状态 + sceneRuleIds: string // 关联的场景联动规则编号数组 + receiveUserIds: string // 接收的用户编号数组 + receiveTypes: string // 接收的类型数组 +} + +// IoT 告警配置 API +export const AlertConfigApi = { + // 查询告警配置分页 + getAlertConfigPage: async (params: any) => { + return await request.get({ url: `/iot/alert-config/page`, params }) + }, + + // 查询告警配置详情 + getAlertConfig: async (id: number) => { + return await request.get({ url: `/iot/alert-config/get?id=` + id }) + }, + + // 新增告警配置 + createAlertConfig: async (data: AlertConfig) => { + return await request.post({ url: `/iot/alert-config/create`, data }) + }, + + // 修改告警配置 + updateAlertConfig: async (data: AlertConfig) => { + return await request.put({ url: `/iot/alert-config/update`, data }) + }, + + // 删除告警配置 + deleteAlertConfig: async (id: number) => { + return await request.delete({ url: `/iot/alert-config/delete?id=` + id }) + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index a5f8de1b..202c5335 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -239,5 +239,6 @@ export enum DICT_TYPE { IOT_RW_TYPE = 'iot_rw_type', // IOT 读写类型 IOT_DATA_SINK_TYPE_ENUM = 'iot_data_sink_type_enum', // IoT 数据流转目的类型 IOT_RULE_SCENE_TRIGGER_TYPE_ENUM = 'iot_rule_scene_trigger_type_enum', // IoT 场景流转的触发类型枚举 - IOT_RULE_SCENE_ACTION_TYPE_ENUM = 'iot_rule_scene_action_type_enum' // IoT 规则场景的触发类型枚举 + IOT_RULE_SCENE_ACTION_TYPE_ENUM = 'iot_rule_scene_action_type_enum', // IoT 规则场景的触发类型枚举 + IOT_ALERT_LEVEL = 'iot_alert_level' // IoT 告警级别 } diff --git a/src/views/iot/alert/config/AlertConfigForm.vue b/src/views/iot/alert/config/AlertConfigForm.vue new file mode 100644 index 00000000..b53856e2 --- /dev/null +++ b/src/views/iot/alert/config/AlertConfigForm.vue @@ -0,0 +1,132 @@ + + diff --git a/src/views/iot/alert/config/index.vue b/src/views/iot/alert/config/index.vue new file mode 100644 index 00000000..88a11efc --- /dev/null +++ b/src/views/iot/alert/config/index.vue @@ -0,0 +1,194 @@ + + + diff --git a/src/views/iot/rule/data/rule/index.vue b/src/views/iot/rule/data/rule/index.vue index 04c08812..cce4830b 100644 --- a/src/views/iot/rule/data/rule/index.vue +++ b/src/views/iot/rule/data/rule/index.vue @@ -67,7 +67,6 @@ :stripe="true" :show-overflow-tooltip="true" > -