物联网平台 +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.
 
 
 
 

141 lines
3.7 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>
<title><%=ProConfig.PROJECT_NAME %></title>
<%@ include file="/WEB-INF/wechat/iot/common/resource_lib.jsp"%>
<style type="text/css">
.title-container{
height: 50px;
line-height: 48px;
text-align: center;
background: #fff;
}
.title-container .width20{
font-weight: 540;
}
.title-container .width33.active{
border-bottom: 2px solid #46addb;
color:#46addb;
}
.weui-panel.weui-panel_access{
border-radius: 5px;
}
.weui-cells{
color: #333;
}
.weui-cells label{
font-size: 15px;
}
.weui-cells span{
font-size: 14px;
}
</style>
</head>
<body>
<div class="container">
<div class="t-c title-info" onclick="backup()">
<span>传感信息</span>
<div class="back" style=" position: fixed;top: 0px;" >
返回</div>
</div>
<div style="height: 50px;"></div>
<div class="clear title-container">
<div class="float-left width33 pointer active" url="/wiot/sensor?id=">
<span>基本信息</span>
</div>
<div class="float-left width33 pointer" url="/wiot/history?id=">
<span>数据曲线</span>
</div>
<div class="float-left width33 pointer" url="/wiot/trigger?id=">
<span>触发器信息</span>
</div>
</div>
<div class="jui-detail_get" config-option=" url:'/sensor.json?id=$#sensorId$',success:'successBack' ">
<input type="hidden" id="sensorId">
<div class="weui-cells weui-cells_form" >
<div class="weui-cell">
<div class="weui-cell__hd">
<label for="" class="weui-label">当前值</label>
</div>
<div class="weui-cell__bd">
<span style="color: cornflowerblue;" id="sensorvalue"></span>
</div>
</div>
<div class="weui-cell">
<div class="weui-cell__hd">
<label for="" class="weui-label">所属设备</label>
</div>
<div class="weui-cell__bd">
<span type-name="node_name" type-value="h"></span>
</div>
</div>
<div class="weui-cell">
<div class="weui-cell__hd">
<label for="" class="weui-label">传感器名称</label>
</div>
<div class="weui-cell__bd">
<span type-name="name" type-value="h"></span>
</div>
</div>
<div class="weui-cell">
<div class="weui-cell__hd">
<label for="" class="weui-label">类型</label>
</div>
<div class="weui-cell__bd">
<span style="color:darkolivegreen;" type-name="iot_sensor_type" type-value="ch"></span>
</div>
</div>
</div>
<div class="weui-cells weui-cells_form" style="margin-top: 0.67647059em;">
<div class="weui-cell">
<div class="weui-cell__hd">
<label for="" class="weui-label">更新时间</label>
</div>
<div class="weui-cell__bd">
<span id="register_time"></span>
</div>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript">
function backup(){
forward('/wiot/device?id='+ GetQueryString("did"));
}
$(function(){
$("#sensorId").val( GetQueryString("id") );
$(".title-container .width33").click(function(){
forward( $(this).attr("url") + GetQueryString("id") +"&did="+ GetQueryString("did") );
})
})
function successBack(data){
if(isOK(data)){
$("#sensorvalue").html(data.data.sdata+" "+ data.data.data.measure_unit_type);
if( data.data.iot_sensor_status == 16 ){
$("#sensorStatus").css("color","green");
}else{
$("#sensorStatus").css("color","red");
}
$("#register_time").html( time2Str(data.data.mtime) );
}
}
</script>
</html>