物联网平台 +Web 组态
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

133 lines
4.9 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="com.lp.cfg.ProConfig"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/WEB-INF/oss/iot/common/variable.jsp"%>
<%@ include file="/WEB-INF/oss/iot/common/variable_js.jsp"%>
<%@ include file="/WEB-INF/oss/iot/common/resource_lib.jsp"%>
<link type="text/css" href="<%=basePath%>/css/oss/iot/alarm_manager.css?<%=v%>" rel="stylesheet"/>
</head>
<body>
<div>
<div style="background: #ecf0f5;">
<div class="mapContainer" >
<div class="app-container">
<div class="container-layout sceneList-info">
<div class="box join-device-box">
<div class="search-container" type-option="search_table" config-option=" submit:'#searchbtns',table:'#init-table'">
<span>项目名称:</span>
<select type-name="scene_id" class="input input-select input-self">
<option value="">选择项目</option>
<c:forEach items="${info.data.getData()}" varStatus="status" var="obj">
<option value="${obj.id}">${obj.name }</option>
</c:forEach>
</select>
<span class="ml-10">传感器名称:</span>
<input type-name="sensor_name" placeholder="传感器名称" class="input input-self" />
<input type="hidden" type-name="iot_alarm_process_status" value="46" >
<span class="ml-10">报警级别:</span>
<select type-name="iot_trigger_alarm_level" type-option="selecter"
config-option=" method:'GET','url':'/dictionary/38','key':'code','value':'name',
'type':'list' ,init_value:'选择报警级别' " class="input input-select input-self" ></select>
<c:if test="${user.type == 10 || user.type == 8 }">
<button id="solvebtns" onclick="allSetRead()" class="button ml-20 bg-iot float-right"><span class="icon-bullhorn"></span> 全部标记为已读</button>
</c:if>
<button id="searchbtns" class="button ml-20 bg-iot float-right"><span class="icon-search"></span> 查询</button>
</div>
<!-- {name:'报警数值 / 阀值','value':'{sdata} / {alarm_sdata}','width':'13%'}, -->
<div id="init-table" class="jui-table" config-option="url:'/page/alarm',
param:{iot_alarm_process_status:46},
columns:[
{name:'序号','type':'seq','value':'seq','width':'6%'},
{name:'报警名称','value':'name','width':'13%'},
{name:'报警详情','value':'description','width':'22%',limit:26},
{name:'报警联系人','value':'{contact_names}','width':'13%'},
{name:'报警级别','type':'category','value':'iot_trigger_alarm_level','width':'8%',style:{39:'color,#e33',40:'color,#CD5C5C',41:'#FF7F50' } },
{name:'处理标志','type':'category','value':'iot_alarm_process_status','width':'8%',style:{47:'color,#A9A9A9',48:'color,#FF7F50',46:'color,#e33' }},
{name:'时间','type':'time','value':'atime','width':'12%'},
{ name:'操作', type:'self', value_callback :'value_function','width':'10%'}]" >
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript">
function value_function(data,seq){
<c:if test="${user.type == 10 || user.type == 8 }">
return "<span tag='处理消息' onclick='t_modify(this,"+data.id+")' class='icon-eye self-icon'></span>"+
"<span tag='标记' onclick='t_tag(this,"+data.id+")' class='self-icon icon-tag'></span>"+
"<span tag='删除' onclick='t_delete(this,"+data.id+")' class='self-icon icon-bitbucket'></span>";
</c:if>
}
function t_modify(obj,i){
var data ={
id: i,
iot_alarm_process_status:47
};
commonAjax("PUT",localUrl+"/alarm", data,function(){
tip("报警消息已处理");
setTimeout(function(){
$("#init-table").tableAdaptor();
},1000)
});
}
function t_tag(obj,i){
lcomfirm('是否确定标记该报警信息?',function(){
var data ={
id:i,
iot_alarm_process_status:48
};
commonAjax("PUT",localUrl+"/alarm", data,function(){
tip("标记成功");
setTimeout(function(){
$("#init-table").tableAdaptor();
},1000)
});
})
}
function t_delete(obj,i){
lcomfirm('是否确定删除该报警信息?',function(){
commonAjax("DELETE",localUrl+"/alarm?id="+i, '',function(data){
if(isOK(data)){
tip("删除成功");
setTimeout(function(){
$("#init-table").tableAdaptor();
},1000);
}
});
})
}
function allSetRead(){
lcomfirm('是否确定设置所有报警信息为已处理?',function(){
commonAjax("GET",localUrl+"/alarm/read", '',function(){
tip("处理成功");
$("#init-table").tableAdaptor();
});
})
}
$(function(){
$(document).delegate(".limiter","click",function(){
layer.tips($(this).attr("tag") , this, {
tips: [1, '#4682B4']
});
})
})
</script>
</html>