diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSensorInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSensorInfoController.java index 5dda38a..4939a0f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSensorInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSensorInfoController.java @@ -174,10 +174,15 @@ public class BaseSensorInfoController extends BaseController { baseAlarmInfo.setMinValue(baseSensorInfo.getMinValue()[i]); baseAlarmInfo.setEnableFlag(baseSensorInfo.getEnableFlag()); - /*List baseAlarmInfoDtos = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo); + List baseAlarmInfoDtos = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo); if(baseAlarmInfoDtos.size() > 0){ - return AjaxResult.error("已包括该阈值,请勿重复添加"); - }*/ + baseAlarmInfoDtos.forEach(x->{ + x.setMaxValue(baseAlarmInfo.getMaxValue()); + x.setMinValue(baseAlarmInfo.getMinValue()); + baseAlarmInfoService.updateBaseAlarmInfo(x); + }); + continue; + } baseAlarmInfoService.insertBaseAlarmInfo(baseAlarmInfo); } return AjaxResult.success(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/SysParamConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/SysParamConfigController.java index c21bbee..18c850d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/SysParamConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/SysParamConfigController.java @@ -57,6 +57,7 @@ public class SysParamConfigController extends BaseController { public String getParameter(String sensorTypeId) { SysParamConfig sysParamConfig = new SysParamConfig(); sysParamConfig.setParamType(sensorTypeId); + sysParamConfig.setVisibleFlag(0); List sysParamConfigs = sysParamConfigService.selectSysParamConfigList(sysParamConfig); return JSONArray.toJSONString(sysParamConfigs); diff --git a/ruoyi-admin/src/main/resources/templates/base/sensorInfo/setAlarmParam.html b/ruoyi-admin/src/main/resources/templates/base/sensorInfo/setAlarmParam.html index 37dffba..dbb8591 100644 --- a/ruoyi-admin/src/main/resources/templates/base/sensorInfo/setAlarmParam.html +++ b/ruoyi-admin/src/main/resources/templates/base/sensorInfo/setAlarmParam.html @@ -50,7 +50,6 @@ -
@@ -67,9 +66,6 @@ }); function submitHandler() { - /*if ($.validate.form()) { - $.operate.save(prefix + "/set", $('#form-sensorInfo-edit').serialize()); - }*/ if ($.validate.form()) { if (arrList.length<1){ @@ -120,10 +116,34 @@ dataType: "json", success: function(result) { result.forEach(function (value,index) { - arrList.push(value.alarmtypeId); + /*arrList.push(value.alarmtypeId); + console.log(value);*/ + createParams(value); }) } }); + + const createParams = function (paramNames) { + $("#product").append( + "
\n" + + "
\n" + + " \n" + + "
\n" + + " " + + "
\n" + + " \n" + + "
\n" + + " " + + "
\n" + + " \n" + + "
\n" + + "
\n" + + "

\n" + + "
" + + "
" + ); + arrList.push(paramNames.alarmtypeId); + } var productid; //动态添加成品数量 @@ -135,6 +155,7 @@ effectiveFieldsAlias: {paramCode: "参数编码", paramName: "参数名称"}, searchFields: ["paramName"], }).on('onDataRequestSuccess', function (e, result) { + console.log(arrList); console.log('onDataRequestSuccess: ', result); }).on('onSetSelectValue', function (e, keyword) { productid = keyword.id;