Parcourir la source

chore(api): 更新实时监测相关接口

wangcong il y a 1 jour
Parent
commit
cdb938d11e
2 fichiers modifiés avec 34 ajouts et 1 suppressions
  1. 16 1
      src/api/index.ts
  2. 18 0
      src/types/index.ts

+ 16 - 1
src/api/index.ts

@@ -44,6 +44,7 @@ import type {
   DevicesList,
   DevicesListItemData,
   DeviceTypeCount,
+  DevStartStopStatus,
   DevWorkHisDataQuery,
   DevWorkHistoryData,
   DevWorkRealTimeData,
@@ -1264,12 +1265,13 @@ export const updateGroupModuleInfo = async (params: Partial<GroupModuleInfo>) =>
   });
 };
 
-export const getGroupModuleDevData = async (deviceId: number, deviceType: number) => {
+export const getGroupModuleDevData = async (deviceId: number, deviceType: number, valveType?: number) => {
   const data = await request<GroupModuleDevData>(apiBiz('/moduleInfo/info/device/detail'), {
     method: 'POST',
     body: JSON.stringify({
       deviceId,
       deviceType,
+      valveType,
     }),
   });
 
@@ -1287,6 +1289,19 @@ export const updateGroupModuleDevData = async (deviceId: number, deviceParamCode
   });
 };
 
+export const getDevStartStopStatus = async (deviceId: number, deviceType: number, valveType?: number) => {
+  const data = await request<DevStartStopStatus>(apiBiz('/moduleInfo/info/device/determine'), {
+    method: 'POST',
+    body: JSON.stringify({
+      deviceId,
+      deviceType,
+      valveType,
+    }),
+  });
+
+  return data;
+};
+
 export const getGroupModuleDevStatus = async (groupId: number) => {
   const data = await request<GroupModuleBatchItem[]>(apiBiz('/moduleInfo/info/batch/status'), {
     method: 'POST',

+ 18 - 0
src/types/index.ts

@@ -2230,6 +2230,24 @@ export interface GroupModuleDevData {
     dataCode: string;
     value?: number | string;
   }[];
+  dataListRO: GroupModuleDevParam[];
+  dataListRW: GroupModuleDevParam[];
+}
+
+export interface GroupModuleDevParam {
+  dataName: string;
+  dataCode: string;
+  value: string;
+  unit: string | null;
+  bitAddress0Status: string | null;
+  bitAddress0Detail: string | null;
+  bitAddress1Status: string | null;
+  bitAddress1Detail: string | null;
+}
+
+export interface DevStartStopStatus {
+  status: boolean;
+  message: string[];
 }
 
 export interface GroupModuleBatchItem {