<!DOCTYPE html>
|
<html lang="zh-CN">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="renderer" content="webkit">
|
<title>智能机房管理平台-设备详细</title>
|
<link rel="stylesheet" type="text/css" href="./plugins/layui/css/layui.css"/>
|
<link rel="stylesheet" type="text/css" href="css/page/detail-ty.css"/>
|
</head>
|
|
<body class="pdgxq-body">
|
<div class="i-container">
|
|
<div class="jmkt-main">
|
|
<div class="layui-fluid">
|
<div class="pdgxq-m1 layui-row layui-col-space20">
|
<div class="layui-col-lg5 layui-col-md5">
|
<div class="pdgxq-m1-left pdgxq-m1-box" style="height: 730px">
|
<div class="pdgxq-H">
|
<h3><i></i>设备基本信息</h3>
|
</div>
|
|
<!-- 基本信息 -->
|
<div style="padding: 10px">
|
<div class="pdgxq-m2-right pdgxq-m2-box">
|
<p></p>
|
<p>设备名称:<span id="deviceName">未知设备#1</span></p>
|
<p>设备状态:<span id="deviceVld">激活</span></p>
|
<p>运维厂商:<span id="opVendor"></span></p>
|
|
<div class="pdgxq-phone">
|
<h4>运维电话</h4>
|
<p id="opPhone"></p>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
|
</div><!--pdgxq-m1-left end-->
|
|
<div class="layui-col-lg7 layui-col-md7">
|
|
<div class="pdgxq-m1-right pdgxq-m1-box" style="height: 730px">
|
<div class="pdgxq-H">
|
<h3><i></i>实时监控</h3>
|
<div id="open" class="jmkt-tit-more" onclick="sendAction(this.id);">
|
<button type="button" class="layui-btn layui-btn-normal pop-complete-btn"
|
style="background-color: #46b8da;color: #ffffff;margin-left: 10px;">开机</button>
|
</div>
|
<div id="stop" class="jmkt-tit-more" onclick="sendAction(this.id);">
|
<button type="button" class="layui-btn layui-btn-normal pop-complete-btn"
|
style="background-color: #ff6600;color: #ffffff;margin-left: 10px;">关机</button>
|
</div>
|
</div>
|
|
<div class="pdgxq-group clearfix">
|
<div class="pdgxq-group-item jmkt-chuli">
|
<span id="warnState">无</span>警告状态
|
</div>
|
<div class="pdgxq-group-item jmkt-yichuli">
|
<span id="conState">正常</span>通讯状态
|
</div>
|
</div>
|
|
<div class="pdgxq-table jmkt-table-wrap">
|
<div class="table-thead">
|
<table class="layui-table pdgxq-table1 poptable" lay-skin="nob">
|
<colgroup>
|
<col width="33%">
|
<col width="33%">
|
<col width="33%">
|
</colgroup>
|
<thead>
|
<tr>
|
<th>监控属性</th>
|
<th>监 控 值</th>
|
<th>更新时间</th>
|
</tr>
|
</thead>
|
</table>
|
</div>
|
<div class="table-tbody">
|
<table class="layui-table pdgxq-table1 poptable" lay-skin="nob">
|
<colgroup>
|
<col width="33%">
|
<col width="33%">
|
<col width="33%">
|
</colgroup>
|
<tbody id="listData">
|
<!-- <tr>-->
|
<!-- <td>通讯状态</td>-->
|
<!-- <td>正常</td>-->
|
<!-- <td>2020-04-26 12:30</td>-->
|
<!-- </tr>-->
|
<!-- <tr>-->
|
<!-- <td>警告状态</td>-->
|
<!-- <td>无</td>-->
|
<!-- <td>2020-04-26 12:30</td>-->
|
<!-- </tr>-->
|
</tbody>
|
</table>
|
</div>
|
<div style="height: 15px;border-top: 1px solid #444d58;"></div>
|
</div><!--pdgxq-table end-->
|
|
</div><!--jmkt-jkxx-box end-->
|
|
</div>
|
</div><!--pdgxq-m1-left end-->
|
|
</div><!--pdgxq-m1 end-->
|
|
</div>
|
|
</div><!--jmkt-main end-->
|
|
</div> <!--i-container end-->
|
|
|
<script src="./js/jquery.min.js"></script>
|
<script src="./plugins/layui/layui.js"></script>
|
<script type="text/javascript">
|
//是否展示右侧操作界面
|
function renderAction(category) {
|
var param = {"category":category};
|
$.ajaxSettings.async = false;
|
$.post("./cgi-bin/do/controlShow", JSON.stringify(param), function (data, status) {
|
if ("success" == data.code) {
|
$("#circular").show();
|
} else {
|
$("#circular").hide();
|
}
|
}, "json");
|
}
|
var id = "";
|
var category = "";
|
var from = {};
|
|
//开始渲染
|
function renderInfo(deviceData, device) {
|
//设备信息
|
category = device.type;
|
if(device.type == "2004"){
|
$("#open").show();
|
$("#stop").show();
|
}
|
id = device.id;
|
// renderAction(category);
|
|
//设备基本信息
|
$("#deviceName").html(device.name);
|
$("#deviceVld").html(device.vld==0?'激活':'停用');
|
$("#opVendor").html(window.parent.SYS_SET.opVendor);
|
$("#opPhone").html(window.parent.SYS_SET.opPhone);
|
|
//时间格式处理
|
var time = deviceData.time.substring(0,4) + "-" +
|
deviceData.time.substring(4,6) + "-" +
|
deviceData.time.substring(6,8) + " " +
|
deviceData.time.substring(8,10) + ":" +
|
deviceData.time.substring(10,12);
|
|
//监控属性渲染
|
var list = deviceData.value;
|
var html='';
|
|
if(list !=null && list.length>0){
|
$.each(list,function(index,item){
|
html += '<tr><td>' + item.name + '</td>';
|
if(item.passcode == 1){
|
if (item.value == "0") { //正常
|
html += '<td>正常</td>';
|
}else {
|
html += '<td>异常</td>';
|
$("#conState").html("异常");
|
}
|
}else if(item.passcode == 2){
|
if (item.value == "0") { //正常
|
html += '<td>无</td>';
|
}else {
|
html += '<td>报警</td>';
|
$("#warnState").html("报警");
|
}
|
}else {
|
if((item.passcode >= 3 && item.passcode <= 5) || (item.passcode >= 20 && item.passcode <= 22)){
|
html += '<td>' + item.value + ' V</td>';
|
}
|
else if((item.passcode >= 6 && item.passcode <= 8) || (item.passcode >= 23 && item.passcode <= 25)){
|
html += '<td>' + item.value + ' A</td>';
|
}
|
else if((item.passcode >= 9 && item.passcode <= 12) || (item.passcode >= 26 && item.passcode <= 29)){
|
html += '<td>' + item.value + ' KW</td>';
|
}
|
else if((item.passcode == 16) || (item.passcode == 33)){
|
html += '<td>' + item.value + ' Hz</td>';
|
}
|
else if((item.passcode >= 17 && item.passcode <= 19) || (item.passcode >= 34 && item.passcode <= 36)){
|
html += '<td>' + item.value + ' KWH</td>';
|
}
|
else {
|
html += '<td>' + item.value + '</td>';
|
}
|
// html += '<td>' + item.value + '</td>';
|
}
|
html += '<td>' + time + '</td></tr>';
|
});
|
}else {
|
html += "<tr><td colspan='3'>暂无数据</td></tr>";
|
}
|
$("#listData").html(html);
|
}
|
|
|
|
|
function closepopBtn(){
|
layer.closeAll();
|
}
|
|
function sendAction(tag) {
|
// console.log(tag);
|
var param = {"id": id};
|
if(tag == "open"){
|
if (confirm('是否进行开机操作?')){
|
$.post("./cgi-bin/action/open-xfj", JSON.stringify(param), function (data, status) {
|
|
}, "json");
|
window.parent.notify("命令发送成功!");
|
}
|
}else{
|
if (confirm('是否进行关机操作?')){
|
$.post("./cgi-bin/action/close-xfj", JSON.stringify(param), function (data, status) {
|
|
}, "json");
|
window.parent.notify("命令发送成功!");
|
}
|
}
|
return false;
|
}
|
|
|
</script>
|
|
<script src="./js/page/detail.js"></script>
|
</body>
|
|
|
</html>
|