Pārlūkot izejas kodu

perf(views): 优化“创建设备”模块

1. 选择网关参数接口传参增加 deviceId
2. 修正参数验证接口传参格式
wangcong 2 mēneši atpakaļ
vecāks
revīzija
c7d6fbc853

+ 3 - 1
src/api/index.ts

@@ -375,7 +375,9 @@ export const deviceGatewayUpdate = async (equipmentUpdateForm: EquipmentUpdateFo
 export const postParameterVerification = async (deviceId: number) => {
   const data = await request<ParameterVerification[]>(apiBiz('/protocolParamVerify/list'), {
     method: 'POST',
-    body: JSON.stringify(deviceId),
+    body: JSON.stringify({
+      deviceId,
+    }),
   });
   return data;
 };

+ 1 - 0
src/types/index.ts

@@ -1309,6 +1309,7 @@ export interface DeviceGateways {
 }
 
 export interface DeviceParamGroupRels {
+  deviceId: number;
   protocolParamId: number;
   paramGroupName: string;
   paramType: number;

+ 1 - 0
src/views/create-device/GatewayParameters.vue

@@ -651,6 +651,7 @@ const finish = async () => {
       linkId,
     });
     deviceParamGroupRels.push({
+      deviceId,
       protocolParamId: id,
       paramGroupName: groupName,
       paramType: 1,