Explorar el Código

chore(api): 更新报警关联相关接口

wangshun hace 1 mes
padre
commit
e7a9e5fc3c
Se han modificado 1 ficheros con 48 adiciones y 0 borrados
  1. 48 0
      src/api/index.ts

+ 48 - 0
src/api/index.ts

@@ -6,9 +6,13 @@ import type {
   AddInterface,
   AgreementUpdate,
   AlarmEvent,
+  AlarmEventHistoryItemData,
+  AlarmHistory,
   AlarmHistoryItem,
+  AlarmPageParams,
   AllDevicesList,
   BatchUpdate,
+  ChangeState,
   CustomParameters,
   DeviceBindQuery,
   DeviceGroup,
@@ -28,6 +32,7 @@ import type {
   EquipmentInformationForm,
   EquipmentTypeItem,
   EquipmentUpdateForm,
+  EventTriggerData,
   GatewayBody,
   GatewayInformation,
   GatewayInterface,
@@ -154,6 +159,49 @@ export const addAlarmEvent = async (params: AlarmEvent) => {
   });
 };
 
+export const alarmEventChangeState = async (params: ChangeState) => {
+  await request(apiBiz('/alarmEvent/changeState'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+};
+
+export const deleteAlarmEvent = async (id: number) => {
+  await request(apiBiz(`/alarmEvent/delete/${id}`), {
+    method: 'POST',
+  });
+};
+
+export const getAlarmEventGetPageList = async (params: AlarmPageParams) => {
+  const data = await request<EventTriggerData>(apiBiz('/alarmEvent/getPageList'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+  return data;
+};
+
+export const getAlarmEventInfo = async (id: number) => {
+  const data = await request<AlarmEvent>(apiBiz(`/alarmEvent/info/${id}`));
+  return data;
+};
+
+export const updateAlarmEvent = async (params: AlarmEvent) => {
+  await request(apiBiz('/alarmEvent/update'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+};
+
+// 报警历史表
+
+export const getAlarmHistoryList = async (params: AlarmHistory) => {
+  const data = await request<AlarmEventHistoryItemData>(apiBiz('/alarmHistory/getPageList'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+  return data;
+};
+
 // 环境监控-监测点预警配置
 
 export const addBatchMonitorPointAlarm = async (params: WarningItem[]) => {