Przeglądaj źródła

chore(api): 更新设备工况相关接口

wangcong 2 miesięcy temu
rodzic
commit
992ff90e81
2 zmienionych plików z 39 dodań i 3 usunięć
  1. 19 2
      src/api/index.ts
  2. 20 1
      src/types/index.ts

+ 19 - 2
src/api/index.ts

@@ -12,6 +12,7 @@ import type {
   DeviceGroup,
   DeviceGroupItem,
   DeviceGroupListQuery,
+  DeviceParamGroup,
   DeviceParams,
   DevicesList,
   DevicesListItemData,
@@ -272,11 +273,27 @@ export const getDeviceListSimple = async (deviceId: number) => {
   return data;
 };
 
+export const getDeviceParams = async (deviceId: number, isProcessData: boolean) => {
+  const data = await request<DeviceParamGroup[]>(apiBiz('/device/protocolParamVerify '), {
+    method: 'POST',
+    body: JSON.stringify({
+      deviceId,
+      isProcessData,
+    }),
+  });
+
+  return data;
+};
+
 // 设备工况
 
-export const getDevWorkTypeCount = async (deviceGroupId: number) => {
-  const data = await request<DeviceTypeCount[]>(apiBiz('/deviceCondition/getTypeCount', { deviceGroupId }), {
+export const getDevWorkTypeCount = async (deviceGroupId: number, deviceTypes: number[]) => {
+  const data = await request<DeviceTypeCount[]>(apiBiz('/deviceCondition/getTypeCount'), {
     method: 'POST',
+    body: JSON.stringify({
+      deviceGroupId,
+      deviceTypes,
+    }),
   });
 
   return data;

+ 20 - 1
src/types/index.ts

@@ -5,7 +5,7 @@ import type { Component, ComponentPublicInstance } from 'vue';
 import type { StepProps, UploadProps } from 'ant-design-vue';
 import type { Rule, RuleObject } from 'ant-design-vue/es/form';
 import type { FormLabelAlign } from 'ant-design-vue/es/form/interface';
-import type { ProtocolConfigMethod } from '@/constants';
+import type { DeviceRunningStatus, ProtocolConfigMethod } from '@/constants';
 
 export interface ApiResponse<T> {
   data: T;
@@ -776,6 +776,7 @@ export interface DevicesList {
   gatewaySnCode?: string;
   deviceName?: string;
   runningStatus?: number;
+  runningStatusList?: DeviceRunningStatus[] | null;
   errorStatus?: number;
 }
 
@@ -873,6 +874,7 @@ export interface DevicesListItem {
   phone: string;
   serviceLife: number;
   status: number;
+  runningStatus: number;
   remarks: string;
   deviceNum: string;
   deleted: boolean;
@@ -903,6 +905,23 @@ export interface DeviceGroup {
   orgId: number;
 }
 
+export interface DeviceParamGroup {
+  id: number;
+  deviceParamGroupName: string;
+  valueVos: DeviceParamItem[];
+}
+
+export interface DeviceParamItem {
+  value: string;
+  valueId: number | null;
+  serialNum: number | null;
+  paramName: string;
+  unit: string | null;
+  time: string;
+  deviceParamName: string;
+  deviceParamCode: string;
+}
+
 export interface DeviceTypeCount {
   deviceType: number;
   deviceTypeName: string;