<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="../../inc.jsp"></jsp:include>
<script type="text/javascript" charset="utf-8">
	var datagrid;
	$(function() {
		datagrid = $('#datagrid').datagrid({
			url : 'cohistory!datagrid.do',
			pagination : true,
			pagePosition : 'bottom',
			pageSize : 20,
			pageList : [ 20, 40, 60, 80, 100, 120, 140, 160, 200 ],
			fit : true,
			fitColumns : true,
			nowrap : true,
			border : false,
			idField : 'id',
			sortName : 'id',
			sortOrder : 'asc',
			checkOnSelect : true,
			selectOnCheck : true,
			frozenColumns : [ [ {
				title : '编号',
				field : 'id',
				width : 10,
				sortable : true,
				checkbox : true
			} ] ],
			columns : [ [{
				title : '中段',
				field : 'zduan',
				width : 50,

			}, {
				title : '站点编号',
				field : 'sensorname',
				width : 120,

			}, {
				title : '检测值',
				field : 'value2',
				width : 120,

			}, {
				title : '检测时间',
				field : 'jctime',
				width : 120,

			}, {
				title : '解除报警时间',
				field : 'jcbjtime',
				width : 120
			} ] ],

			toolbar : [  {
				text : '导出',
				iconCls : 'icon-edit',
				handler : function() {
					exportd();
				}
			}, '-'],
			onRowContextMenu : function(e, rowIndex, rowData) {
				e.preventDefault();
				$(this).datagrid('unselectAll');
				$(this).datagrid('selectRow', rowIndex);
				$('#menu').menu('show', {
					left : e.pageX,
					top : e.pageY
				});
			}
		});

	});

	function _search() {
		datagrid.datagrid('load', dj.serializeObject($('#searchForm')));
	}
	function cleanSearch() {
		datagrid.datagrid('load', {});
		$('#searchForm input').val('');
	}
	function exportd() {
		Export('一氧化碳历史记录', $('#datagrid'))

	}
</script>
</head>
<body class="easyui-layout" data-options="fit:true">
	<div data-options="region:'north',border:false,title:'过滤条件'"
		style="height: 55px;overflow: hidden;" align="left">
		<form id="searchForm">
			<table class="tableForm datagrid-toolbar"
				style="width: 100%;height: 100%;">
				<tr>
					<th>中段：</th>
					<td><input name="zduan" style="width:100px;" />
					<th>站点编号：</th>
					<td><input name="sensorname" style="width:100px;" />
					<th>检测时间起：</th>
					<td><input class="easyui-datetimebox" name="jctimeStart"
						style="width:150px;" />
					<th>止：</th>
					<td><input class="easyui-datetimebox" name="jctimeEnd"
						style="width:150px;" /> <a href="javascript:void(0);"
						class="easyui-linkbutton" onclick="_search();">过滤</a><a
						href="javascript:void(0);" class="easyui-linkbutton"
						onclick="cleanSearch();">取消</a></td>
				</tr>
			</table>
		</form>
	</div>
	<div data-options="region:'center',border:false"
		style="overflow: hidden;">
		<table id="datagrid"></table>
	</div>

	 <div id="menu" class="easyui-menu" style="width:120px;display: none;">
		<!-- <div onclick="append();" data-options="iconCls:'icon-add'">增加</div>
		<div onclick="remove();" data-options="iconCls:'icon-remove'">删除</div>
		<div onclick="edit();" data-options="iconCls:'icon-edit'">编辑</div>
		-->
		<div onclick="exportd();" data-options="iconCls:'icon-edit'">导出</div>
	</div>


</body>
</html>
