<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
 	<link rel="stylesheet" href="../../css/count.css">
	<style>
	.form-line .text-content{
		width:120px;
	}
	.pagination > table{
		border-top:none !important;
	}
	.pagination-info{
		line-height:30px !important;
	}
	td{height: 30px;font-size:12px;}
	</style>
</head>
<body class="easyui-layout">
	
	<div style="height: 436px;text-align: center;font-size: 14px; overflow: auto;    padding: 0 6px;">
		 <table  cellspacing="0"  width="100%"  cellpadding="0"  border="1"  align="center"  style="border:1px solid #827d7d;text-align:center;margin: 10px auto;">
     		 <thead>
      			<tr>
					<td colspan="6" style="font-size:14px;font-weight:bold;border:none" id="titName"></td>
				</tr>
      			<tr style="border-top: 1px solid #827d7d;">
					<td colspan="6" style="text-align:right;border:none;padding:0 15px;" id="zbsj"></td>
				</tr>
 				<tr>
 					<td>序号</td>
					<td>行政区划</td>
					<td>监控点名称</td>
					<td>设备编号</td>
					<td>通道编号</td>
					<td>IP地址</td>
 				</tr>    					
      		 </thead>
        	 <tbody id="nonet">
         	 </tbody>
         </table>
	</div>
        <div id="pp" style="background: #F9FAF9;margin:0 6px;"></div>
</body>
</html>

<script type="text/javascript">
	var winId	= $.getUrlParam("winId");
	var records = top.$("#"+winId).panel("options").data;
	var flag=true;
	var pageNum=0;
	$(function(){
		$('#titName').html(records.xzmc+" "+records.title)
		$('#zbsj').html(records.zbsj);	
		
		getData();
	})	

	// 统计 区域下 告警设备
	function getData(page,rows){
		var params = {};		
		if(page == undefined || page==null){       // 页码
			page = 1;
		} 
		if(rows == undefined || rows==null){       //每页10条
			rows = 10;
		} 
		pageNum = page;
		params=records;
		params.page = page;			
		params.rows = rows;

		params.networkproperty = 1;

//		console.log(params)
		$.ajax({
			type:'post',
			dataType : 'json',
			url:'ywvideocurrentstateAction!areaNotOnlineByPageDetail.do',
			data : params,
			success : function(res){
//				console.log("结果：",res);
				var html = "";
				var num = 10*(pageNum-1);
				if(res!=null) {
					res.rows.forEach(function (item, index) {
						var sbip = item.sbip;
						sbip = sbip == null ? "" : sbip;
						var tdmc = item.tdmc == null ? "" : item.tdmc;
						html += "<tr>" +
								"<td>" + (index + 1 + num) + "</td>" +
								"<td>" + records.xzmc + "</td>" +
								"<td>" + tdmc + "</td>" +
								"<td>" + item.sbbh + "</td>" +
								"<td>" + item.tdbh + "</td>" +
								"<td>" + sbip + "</td>" +
								"</tr>"
					})
				}
				$('#nonet').html(html);
				if(flag){
						$('#pp').pagination({
						    total:res.total,
						    showRefresh:true,
						    pageSize:10,
						    pageList:[10,20,30,50,80,100],
							onSelectPage:function(pageNumber, pageSize){
								$(this).pagination('loading');
								$(this).pagination('loaded');
								getData(pageNumber,pageSize)
							}
						});
						flag=false;
				}
			}
		})
	}
</script>
