change - 传感器信息展示参数阈值效果优化

main
wenjy 3 years ago
parent 04b1c074dd
commit 875bc6f5be

@ -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<BaseAlarmInfoDto> list = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo);
return JSONArray.toJSONString(list);
}
/**
*
*/

@ -173,6 +173,11 @@ public class BaseSensorInfoController extends BaseController {
baseAlarmInfo.setMaxValue(baseSensorInfo.getMaxValue()[i]);
baseAlarmInfo.setMinValue(baseSensorInfo.getMinValue()[i]);
baseAlarmInfo.setEnableFlag(baseSensorInfo.getEnableFlag());
/*List<BaseAlarmInfoDto> baseAlarmInfoDtos = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo);
if(baseAlarmInfoDtos.size() > 0){
return AjaxResult.error("已包括该阈值,请勿重复添加");
}*/
baseAlarmInfoService.insertBaseAlarmInfo(baseAlarmInfo);
}
return AjaxResult.success();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

@ -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();
}
}
}
}*/
</script>
</body>
</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";

@ -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();
}
}
}
}*/
</script>
</body>
</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);
}

@ -14,7 +14,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">传感器编号:</label>
<div class="col-sm-8">
<input name="sensorId" th:field="*{sensorId}" class="form-control" type="text" readonly="true">
<input name="sensorId" id="sensorId" th:field="*{sensorId}" class="form-control" type="text" readonly="true">
</div>
</div>
<div class="form-group">
@ -108,7 +108,23 @@
</script>
<script>
var arrList = new Array();
$.ajax({
url: "/base/alarmInfo/getAlarmParamList?sensorId=" + document.getElementById('sensorId').value,
type: 'post',
cache: false,
processData: false,
contentType: false,
dataType: "json",
success: function(result) {
result.forEach(function (value,index) {
arrList.push(value.alarmtypeId);
})
}
});
var productid;
//动态添加成品数量
var testBsSuggest = $("#suggest-demo-1").bsSuggest({
@ -142,7 +158,6 @@
"</div>"
);
arrList.push(productid);
console.log(arrList)
} else {
$.modal.msgWarning('参数已添加!');
}

Loading…
Cancel
Save