change - 传感器报警参数设置修改

main
wenjy 3 years ago
parent e0d098be20
commit b6afb730e7

@ -6,12 +6,12 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
# url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: Haiwei123456
url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: root password: Haiwei123456
# url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: root
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

@ -25,13 +25,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" id="maxParam">
<label class="col-sm-3 control-label">阈值(最大)</label> <label class="col-sm-3 control-label" id="maxParamLabel">阈值(最大)</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="maxValue" class="form-control" type="text"> <input name="maxValue" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" id="minParam">
<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="minValue" class="form-control" type="text"> <input name="minValue" class="form-control" type="text">
@ -54,6 +54,9 @@
focusCleanup: true focusCleanup: true
}); });
//根据报警类型设置报警参数
updateParam();
$(()=>{ $(()=>{
var cp_keynum = "alarmType"; var cp_keynum = "alarmType";
var str = localStorage.getItem(cp_keynum); var str = localStorage.getItem(cp_keynum);
@ -63,6 +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();
}) })
function submitHandler() { function submitHandler() {
@ -90,6 +94,24 @@
$("#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();
}
function updateParam() {
if($("#treeId").val().length == 0){
$("#maxParam").hide();
$("#minParam").hide();
}else{
if($("#treeId").val().indexOf('A2') != -1){
$("#maxParamLabel").text("阈值(最大)");
$("#maxParam").show();
$("#minParam").show();
}else{
$("#maxParamLabel").text("报警数值:");
$("#maxParam").show();
$("#minParam").hide();
}
}
} }
</script> </script>
</body> </body>

@ -134,7 +134,8 @@
}, },
{ {
field: 'maxValue', field: 'maxValue',
title: '阈值(最大)' title: '阈值(最大)/报警数值',
align:'center'
}, },
{ {
field: 'minValue', field: 'minValue',
@ -172,9 +173,19 @@
$.tree.init(options); $.tree.init(options);
function zOnClick(event, treeId, treeNode) { function zOnClick(event, treeId, treeNode) {
var thinnerobjs =$(".th-inner");
$("#alarmtypeId").val(treeNode.id); $("#alarmtypeId").val(treeNode.id);
$.table.search(); $.table.search();
if(treeNode.id.indexOf("A2") != -1 ){
thinnerobjs[3].innerHTML="阈值(最大)";
thinnerobjs[4].show();
}else{
thinnerobjs[3].innerHTML="报警数值";
thinnerobjs[4].hide();
}
var num = new Object; var num = new Object;
num.cp_keynum ="alarmType"; num.cp_keynum ="alarmType";
num.cp_num_value = treeNode.id+"/"+treeNode.name; num.cp_num_value = treeNode.id+"/"+treeNode.name;

@ -32,12 +32,12 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">阈值(最大)</label> <label class="col-sm-3 control-label" id="maxParamLabel">阈值(最大)</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="maxValue" th:field="*{maxValue}" class="form-control" type="text"> <input name="maxValue" th:field="*{maxValue}" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" id="minParam">
<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="minValue" th:field="*{minValue}" class="form-control" type="text"> <input name="minValue" th:field="*{minValue}" class="form-control" type="text">
@ -59,6 +59,8 @@
$("#form-alarmInfo-edit").validate({ $("#form-alarmInfo-edit").validate({
focusCleanup: true focusCleanup: true
}); });
//根据报警类型修改阈值设置
updateParam();
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
@ -85,6 +87,33 @@
$("#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();
}
function updateParam() {
/*if($("#treeId").val().indexOf('A2') != -1){
$("#maxParamLabel").text("阈值(最大)");
$("#minParam").show();
}else{
$("#maxParamLabel").text("报警数值:");
$("#minParam").hide();
}*/
if($("#treeId").val().length == 0){
$("#maxParam").hide();
$("#minParam").hide();
}else{
if($("#treeId").val().indexOf('A2') != -1){
$("#maxParamLabel").text("阈值(最大)");
$("#maxParam").show();
$("#minParam").show();
}else{
$("#maxParamLabel").text("报警数值:");
$("#maxParam").show();
$("#minParam").hide();
}
}
} }
</script> </script>
</body> </body>

Loading…
Cancel
Save