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.Date;
import java.util.List; import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.dto.BaseAlarmInfoDto; import com.ruoyi.system.domain.dto.BaseAlarmInfoDto;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -74,6 +75,19 @@ public class BaseAlarmInfoController extends BaseController
return getDataTable(list); 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.setMaxValue(baseSensorInfo.getMaxValue()[i]);
baseAlarmInfo.setMinValue(baseSensorInfo.getMinValue()[i]); baseAlarmInfo.setMinValue(baseSensorInfo.getMinValue()[i]);
baseAlarmInfo.setEnableFlag(baseSensorInfo.getEnableFlag()); baseAlarmInfo.setEnableFlag(baseSensorInfo.getEnableFlag());
/*List<BaseAlarmInfoDto> baseAlarmInfoDtos = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo);
if(baseAlarmInfoDtos.size() > 0){
return AjaxResult.error("已包括该阈值,请勿重复添加");
}*/
baseAlarmInfoService.insertBaseAlarmInfo(baseAlarmInfo); baseAlarmInfoService.insertBaseAlarmInfo(baseAlarmInfo);
} }
return AjaxResult.success(); 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"; 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 )); $("#treeName").val(num.cp_num_value.substring(num.cp_num_value.indexOf('/')+1,num.cp_num_value.length ));
} }
updateParam(); //updateParam();
}) })
function submitHandler() { function submitHandler() {
@ -94,10 +94,10 @@
$("#treeId").val(body.find('#treeId').val()); $("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val()); $("#treeName").val(body.find('#treeName').val());
$.modal.close(index); $.modal.close(index);
updateParam(); //updateParam();
} }
function updateParam() { /*function updateParam() {
if($("#treeId").val().length == 0){ if($("#treeId").val().length == 0){
$("#maxParam").hide(); $("#maxParam").hide();
$("#minParam").hide(); $("#minParam").hide();
@ -112,7 +112,7 @@
$("#minParam").hide(); $("#minParam").hide();
} }
} }
} }*/
</script> </script>
</body> </body>
</html> </html>

@ -134,7 +134,7 @@
}, },
{ {
field: 'maxValue', field: 'maxValue',
title: '阈值(最大)/报警数值', title: '阈值(最大)',
align:'center' align:'center'
}, },
{ {
@ -178,13 +178,13 @@
$("#alarmtypeId").val(treeNode.id); $("#alarmtypeId").val(treeNode.id);
$.table.search(); $.table.search();
if(treeNode.id.indexOf("A2") != -1 ){ /*if(treeNode.id.indexOf("A2") != -1 ){
thinnerobjs[3].innerHTML="阈值(最大)"; thinnerobjs[3].innerHTML="阈值(最大)";
thinnerobjs[4].show(); thinnerobjs[4].show();
}else{ }else{
thinnerobjs[3].innerHTML="报警数值"; thinnerobjs[3].innerHTML="报警数值";
thinnerobjs[4].hide(); thinnerobjs[4].hide();
} }*/
var num = new Object; var num = new Object;
num.cp_keynum ="alarmType"; num.cp_keynum ="alarmType";

@ -60,7 +60,7 @@
focusCleanup: true focusCleanup: true
}); });
//根据报警类型修改阈值设置 //根据报警类型修改阈值设置
updateParam(); //updateParam();
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
@ -88,17 +88,10 @@
$("#treeName").val(body.find('#treeName').val()); $("#treeName").val(body.find('#treeName').val());
$.modal.close(index); $.modal.close(index);
updateParam(); //updateParam();
} }
function updateParam() { /*function updateParam() {
/*if($("#treeId").val().indexOf('A2') != -1){
$("#maxParamLabel").text("阈值(最大)");
$("#minParam").show();
}else{
$("#maxParamLabel").text("报警数值:");
$("#minParam").hide();
}*/
if($("#treeId").val().length == 0){ if($("#treeId").val().length == 0){
$("#maxParam").hide(); $("#maxParam").hide();
@ -114,7 +107,7 @@
$("#minParam").hide(); $("#minParam").hide();
} }
} }
} }*/
</script> </script>
</body> </body>
</html> </html>

@ -159,6 +159,9 @@
removeParamUrl:"/base/alarmInfo/remove", removeParamUrl:"/base/alarmInfo/remove",
onClickRow: onClickRow, onClickRow: onClickRow,
modalName: "传感器信息", modalName: "传感器信息",
fixedColumns: true,
fixedNumber: 6,
fixedRightNumber: 1,
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
@ -169,7 +172,7 @@
}, },
{ {
field: 'edgeId', field: 'edgeId',
title: 'edgeId' title: 'edgeId',
}, },
{ {
field: 'sensorId', field: 'sensorId',
@ -261,7 +264,7 @@
function zOnClick(event, treeId, treeNode) { function zOnClick(event, treeId, treeNode) {
$("#monitorunitId").val(treeNode.id); $("#monitorunitId").val(treeNode.id);
$.table.search(); $.table.search();
initTable(treeNode.id);
var num = new Object; var num = new Object;
num.cp_keynum = "key_num"; num.cp_keynum = "key_num";
num.cp_num_value = treeNode.id + "/" + treeNode.name; num.cp_num_value = treeNode.id + "/" + treeNode.name;
@ -291,7 +294,7 @@
$.modal.openTab("监控单元", url); $.modal.openTab("监控单元", url);
} }
function onClickRow(row, $element) { const onClickRow = function (row, $element) {
initTable(row.sensorId); initTable(row.sensorId);
} }

@ -14,7 +14,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">传感器编号:</label> <label class="col-sm-3 control-label">传感器编号:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
@ -108,7 +108,23 @@
</script> </script>
<script> <script>
var arrList = new Array(); 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 productid;
//动态添加成品数量 //动态添加成品数量
var testBsSuggest = $("#suggest-demo-1").bsSuggest({ var testBsSuggest = $("#suggest-demo-1").bsSuggest({
@ -142,7 +158,6 @@
"</div>" "</div>"
); );
arrList.push(productid); arrList.push(productid);
console.log(arrList)
} else { } else {
$.modal.msgWarning('参数已添加!'); $.modal.msgWarning('参数已添加!');
} }

Loading…
Cancel
Save