Explorar o código

perf(views): 修复“选择网关参数”自定义监控参数分组为选择提交异常问题

wangshun hai 2 semanas
pai
achega
fa554d1cc8
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      src/views/create-device/GatewayParameters.vue

+ 6 - 2
src/views/create-device/GatewayParameters.vue

@@ -505,7 +505,7 @@ const addCustomizationData = () => {
     customFormula: '',
     unit: '',
     decimalDigits: undefined,
-    paramGroupId: undefined,
+    paramGroupId: groupingList.value.length ? groupingList.value[0].id : undefined,
     groupSerialNum: 1,
     groupParamSerialNum: undefined,
     isProcessData: false,
@@ -516,7 +516,7 @@ const addCustomizationData = () => {
     decimalDigitsShow: false,
     groupSerialNumShow: false,
     paramGroupIdShow: false,
-    paramGroupName: '',
+    paramGroupName: groupingList.value.length ? groupingList.value[0].groupName : '',
   });
 };
 
@@ -760,6 +760,10 @@ const finish = async () => {
     throw new Error(t('createDevice.parameterEncodingRepeat'));
   }
 
+  if (customizationData.value.some((item) => item.paramGroupName == '')) {
+    throw new Error(t('createDevice.groupNameEmpty'));
+  }
+
   deviceParamGroups.value = [];
   customParameters.value = [];
   deviceGateways.value = [];