diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmInfoController.java index 45d7fdd..9dd65f2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmInfoController.java @@ -3,6 +3,7 @@ package com.ruoyi.web.controller.base; import java.util.Date; import java.util.List; +import com.alibaba.fastjson.JSONArray; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.system.domain.dto.BaseAlarmInfoDto; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -74,6 +75,19 @@ public class BaseAlarmInfoController extends BaseController return getDataTable(list); } + /** + * 查询传感器报警信息参数 + */ + @PostMapping("/getAlarmParamList") + @ResponseBody + public String getAlarmParamList(String sensorId) + { + BaseAlarmInfo baseAlarmInfo = new BaseAlarmInfo(); + baseAlarmInfo.setSensorId(sensorId); + List list = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo); + return JSONArray.toJSONString(list); + } + /** * 导出传感器报警信息列表 */ 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 6f5c6f5..5dda38a 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 @@ -173,6 +173,11 @@ public class BaseSensorInfoController extends BaseController { baseAlarmInfo.setMaxValue(baseSensorInfo.getMaxValue()[i]); baseAlarmInfo.setMinValue(baseSensorInfo.getMinValue()[i]); baseAlarmInfo.setEnableFlag(baseSensorInfo.getEnableFlag()); + + /*List baseAlarmInfoDtos = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo); + if(baseAlarmInfoDtos.size() > 0){ + return AjaxResult.error("已包括该阈值,请勿重复添加"); + }*/ baseAlarmInfoService.insertBaseAlarmInfo(baseAlarmInfo); } return AjaxResult.success(); diff --git a/ruoyi-admin/src/main/resources/static/favicon.ico b/ruoyi-admin/src/main/resources/static/favicon.ico index 6f07782..1c9d52b 100644 Binary files a/ruoyi-admin/src/main/resources/static/favicon.ico and b/ruoyi-admin/src/main/resources/static/favicon.ico differ diff --git a/ruoyi-admin/src/main/resources/static/favicon2.ico b/ruoyi-admin/src/main/resources/static/favicon2.ico new file mode 100644 index 0000000..6f07782 Binary files /dev/null and b/ruoyi-admin/src/main/resources/static/favicon2.ico differ diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmInfo/add.html b/ruoyi-admin/src/main/resources/templates/base/alarmInfo/add.html index ec36a94..c51fee2 100644 --- a/ruoyi-admin/src/main/resources/templates/base/alarmInfo/add.html +++ b/ruoyi-admin/src/main/resources/templates/base/alarmInfo/add.html @@ -55,7 +55,7 @@ }); //根据报警类型设置报警参数 - updateParam(); + //updateParam(); $(()=>{ var cp_keynum = "alarmType"; @@ -66,7 +66,7 @@ $("#treeName").val(num.cp_num_value.substring(num.cp_num_value.indexOf('/')+1,num.cp_num_value.length )); } - updateParam(); + //updateParam(); }) function submitHandler() { @@ -94,10 +94,10 @@ $("#treeId").val(body.find('#treeId').val()); $("#treeName").val(body.find('#treeName').val()); $.modal.close(index); - updateParam(); + //updateParam(); } - function updateParam() { + /*function updateParam() { if($("#treeId").val().length == 0){ $("#maxParam").hide(); $("#minParam").hide(); @@ -112,7 +112,7 @@ $("#minParam").hide(); } } - } + }*/ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmInfo/alarmInfo.html b/ruoyi-admin/src/main/resources/templates/base/alarmInfo/alarmInfo.html index 54ed586..1760e86 100644 --- a/ruoyi-admin/src/main/resources/templates/base/alarmInfo/alarmInfo.html +++ b/ruoyi-admin/src/main/resources/templates/base/alarmInfo/alarmInfo.html @@ -134,7 +134,7 @@ }, { field: 'maxValue', - title: '阈值(最大)/报警数值', + title: '阈值(最大)', align:'center' }, { @@ -178,13 +178,13 @@ $("#alarmtypeId").val(treeNode.id); $.table.search(); - if(treeNode.id.indexOf("A2") != -1 ){ + /*if(treeNode.id.indexOf("A2") != -1 ){ thinnerobjs[3].innerHTML="阈值(最大)"; thinnerobjs[4].show(); }else{ thinnerobjs[3].innerHTML="报警数值"; thinnerobjs[4].hide(); - } + }*/ var num = new Object; num.cp_keynum ="alarmType"; diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmInfo/edit.html b/ruoyi-admin/src/main/resources/templates/base/alarmInfo/edit.html index 3cc0f4d..2da03cd 100644 --- a/ruoyi-admin/src/main/resources/templates/base/alarmInfo/edit.html +++ b/ruoyi-admin/src/main/resources/templates/base/alarmInfo/edit.html @@ -60,7 +60,7 @@ focusCleanup: true }); //根据报警类型修改阈值设置 - updateParam(); + //updateParam(); function submitHandler() { if ($.validate.form()) { @@ -88,17 +88,10 @@ $("#treeName").val(body.find('#treeName').val()); $.modal.close(index); - updateParam(); + //updateParam(); } - function updateParam() { - /*if($("#treeId").val().indexOf('A2') != -1){ - $("#maxParamLabel").text("阈值(最大):"); - $("#minParam").show(); - }else{ - $("#maxParamLabel").text("报警数值:"); - $("#minParam").hide(); - }*/ + /*function updateParam() { if($("#treeId").val().length == 0){ $("#maxParam").hide(); @@ -114,7 +107,7 @@ $("#minParam").hide(); } } - } + }*/ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/sensorInfo/sensorInfo.html b/ruoyi-admin/src/main/resources/templates/base/sensorInfo/sensorInfo.html index 6f90b7a..235b9f3 100644 --- a/ruoyi-admin/src/main/resources/templates/base/sensorInfo/sensorInfo.html +++ b/ruoyi-admin/src/main/resources/templates/base/sensorInfo/sensorInfo.html @@ -159,6 +159,9 @@ removeParamUrl:"/base/alarmInfo/remove", onClickRow: onClickRow, modalName: "传感器信息", + fixedColumns: true, + fixedNumber: 6, + fixedRightNumber: 1, columns: [{ checkbox: true }, @@ -169,7 +172,7 @@ }, { field: 'edgeId', - title: 'edgeId' + title: 'edgeId', }, { field: 'sensorId', @@ -261,7 +264,7 @@ function zOnClick(event, treeId, treeNode) { $("#monitorunitId").val(treeNode.id); $.table.search(); - + initTable(treeNode.id); var num = new Object; num.cp_keynum = "key_num"; num.cp_num_value = treeNode.id + "/" + treeNode.name; @@ -291,7 +294,7 @@ $.modal.openTab("监控单元", url); } - function onClickRow(row, $element) { + const onClickRow = function (row, $element) { initTable(row.sensorId); } 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 710b361..37dffba 100644 --- a/ruoyi-admin/src/main/resources/templates/base/sensorInfo/setAlarmParam.html +++ b/ruoyi-admin/src/main/resources/templates/base/sensorInfo/setAlarmParam.html @@ -14,7 +14,7 @@
- +
@@ -108,7 +108,23 @@