$(function(){
	
	initGrid();
});


$.extend($.fn.datagrid.methods,
		{
	renderAlarmOverviewData:function(n, g, h){
		 var m = n.parent(".datagrid-view:eq(0)"),
         c;
         var k = m.prev("div").append("<table cellspacing=0 cellpadding=0 style='display:inline-block;height:26px;float:right;'><tbody><tr/></tbody></table>").children("table:eq(1)").find("tbody tr");
         var b = m.parent().height();
         var o = m.parent().width();
         if (!m.next("div.imgcontainer").html()) {
             c = $("<div class='imgcontainer' style='overflow-y:auto; width:99%;height:" + (b - 70) + "px;'></div>");
             m.after(c)
         } else {
             c = m.next("div.imgcontainer")
         }
         if (!g) {
             return
         }
         var f = 0,
         l = [],
         e,
         d,
         j = this;
         for (; (g.data[f]); f++) {
        	 
        	 var HTML='<div class="item">\
				<div class="txt"  ><span>'+(name||"大华设备画面抽帧任务")+'&nbsp;&nbsp; 任务批次：2018-11-08 07:00&nbsp; &nbsp;&nbsp; 检测设备量：308</span></div>\
				<div class="main">\
					<div class="left">\
						<span style="display:block;text-align:center;">96.68</span>	\
						<span style="display:block;text-align:center;">金华市公安局</span>	\
						<span style="display:block;text-align:center;">2015-01-22</span>	\
					</div>\
					<div class="right">\
						<ul>\
								<li><span class="s1">9.86</span><span class="s2">(10*98.58%)</span></li>\
								<li><span class="s1">9.86</span><span class="s2">(10*98.58%)</span></li>\
								<li><span class="s1">9.86</span><span class="s2">(10*98.58%)</span></li>\
								<li><span class="s1">9.86</span><span class="s2">(10*98.58%)</span></li>\
								<li><span class="s1">9.86</span><span class="s2">(10*98.58%)</span></li>\
								<li><span class="s1">9.86</span><span class="s2">(10*98.58%)</span></li>\
						</ul>\
					</div>\
				</div>\
		</div>';
       l.push(HTML);
         }
         c.html('<div class="img-box">' + l.join("") + "</div>")
     }
});
//加载列表
function initGrid(){	
	$('#searchGrid').datagrid({
		bodyCls:'pic-datagrid',
		queryParams:getQueryParams(),
		data:[
		      {name:"大华设备画面抽帧任务 ",date:"2018-11-08 07:00 ",num:308},
		      {name:"大华设备画面抽帧任务 ",date:"2018-11-08 07:00 ",num:308},
		      {name:"大华设备画面抽帧任务 ",date:"2018-11-08 07:00 ",num:308},
		      {name:"大华设备画面抽帧任务 ",date:"2018-11-08 07:00 ",num:308},
		      {name:"大华设备画面抽帧任务 ",date:"2018-11-08 07:00 ",num:308},
		      {name:"大华设备画面抽帧任务 ",date:"2018-11-08 07:00 ",num:308},
		      {name:"大华设备画面抽帧任务 ",date:"2018-11-08 07:00 ",num:308},
		      {name:"大华设备画面抽帧任务 ",date:"2018-11-08 07:00 ",num:308},
		      {name:"大华设备画面抽帧任务 ",date:"2018-11-08 07:00 ",num:308}
		      ],
		onLoadSuccess:function(data){
			if(data){
				data.data=data.rows;
				data.totalSize=data.total;
				$('#searchGrid').datagrid("renderAlarmOverviewData",data);
			}
		},
		rownumbers:true,
	});
}

function getQueryParams(){
	var sParam = {};
	return sParam;
}