From ca77cb7830d4dc2a184111f5b34fbf34ee72a173 Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 22 Mar 2022 11:31:04 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BC=A0=E6=84=9F=E5=99=A8?= =?UTF-8?q?=E9=98=88=E5=80=BC=E7=BB=B4=E6=8A=A4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/BaseSensorInfoController.java | 11 +++++-- .../base/SysParamConfigController.java | 1 + .../base/sensorInfo/setAlarmParam.html | 31 ++++++++++++++++--- 3 files changed, 35 insertions(+), 8 deletions(-) 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;