alerthistroy.jsp 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp" %>
  3. <head>
  4. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/jquery-1.8.3.js"></script>
  5. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js"></script>
  6. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/i18n/grid.locale-cn.js"></script>
  7. <script type="text/ecmascript" src="<%=request.getContextPath()%>/resource/js/system/jqdatagridpage.js"></script>
  8. <script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  9. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  10. <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  11. <style type="text/css">
  12. a{ /* 统一设置所以样式 */
  13. font-family:Arial;
  14. font-size:12px;
  15. text-align:center;
  16. margin:3px;
  17. }
  18. a:link,a:visited{ /* 超链接正常状态、被访问过的样式 */
  19. color:#000000;
  20. padding:4px 10px 4px 10px;
  21. background-color:#f1f1f1;
  22. text-decoration:none;
  23. border-top:1px solid #EEEEEE; /* 边框实现阴影效果 */
  24. border-left:1px solid #EEEEEE;
  25. border-bottom:1px solid #717171;
  26. border-right:1px solid #717171;
  27. }
  28. a:hover{ /* 鼠标指针经过时的超链接 */
  29. color:#821818; /* 改变文字颜色 */
  30. padding:5px 8px 3px 12px; /* 改变文字位置 */
  31. background-color:#e2c4c9; /* 改变背景色 */
  32. border-top:1px solid #717171; /* 边框变换,实现“按下去”的效果 */
  33. border-left:1px solid #717171;
  34. border-bottom:1px solid #EEEEEE;
  35. border-right:1px solid #EEEEEE;
  36. }
  37. fieldset legend {
  38. color:#302A2A;
  39. font: bold 16px/2 Verdana, Geneva, sans-serif;
  40. font-weight: bold;
  41. text-align: left;
  42. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  43. }
  44. </style>
  45. <script type="text/javascript">
  46. function changeFc(fcId){
  47. var url1 = "../warn/changeFc.action?fcId="+fcId;
  48. $.ajax({
  49. type:"post",
  50. url:url1,
  51. dataType:"json",
  52. success: function(data){
  53. if(data.length != 0){
  54. eval(data);
  55. $("#wtId").empty();
  56. $("#wtId").append("<option value=''>请选择</option>");
  57. for(var i=0; i<data.length; i++){
  58. $("#wtId").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
  59. }
  60. }else{
  61. $("#wtId").append("<option value=''>请选择</option>");
  62. $("#wtId").append("<option value=''>请选择</option>");
  63. }
  64. queryData();
  65. }
  66. });
  67. }
  68. function queryData(){
  69. var wfId = $("#wfId").val();
  70. var wtId = $("#wtId").val();
  71. var isconfirmed = $("#isconfirmed").val();
  72. var category1 = $("#category1").val();
  73. var category2 = $("#category2").val();
  74. var beginDate = $("#beginDate").val();
  75. var endDate = $("#endDate").val();
  76. if("" == beginDate){
  77. alert("请选择查询开始日期!");
  78. }else if("" ==endDate){
  79. alert("请选择查询结束日期!");
  80. }else if(beginDate >endDate){
  81. alert("结束日期不允许小于开始日期!");
  82. }else{
  83. var temp="alerthistroyList.action?beginDate="+beginDate
  84. +"&endDate="+endDate
  85. +"&wfId="+wfId
  86. +"&wtId="+wtId
  87. +"&isconfirmed="+isconfirmed
  88. +"&category1="+category1
  89. +"&category2="+category2;
  90. var url= encodeURI(encodeURI(temp));
  91. $("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  92. }
  93. }
  94. function changeType(category1){
  95. if(category1!='' && category1!=null ){
  96. var url = "changeBJLXAjax.action?category1="+category1;
  97. $.ajax({
  98. type:"post",
  99. url:url,
  100. dataType:"json",
  101. success: function(data){
  102. if(data.length != 0){
  103. eval(data);
  104. $("#category2").empty();
  105. $("#category2").append("<option value=''>请选择</option>");
  106. for(var i=0; i<data.length; i++){
  107. $("#category2").append("<option value='"+data[i].code+"'>"+data[i].name+"</option>");
  108. }
  109. }else{
  110. $("#category2").empty();
  111. $("#category2").append("<option value=''>请选择</option>");
  112. }
  113. }
  114. });
  115. }
  116. }
  117. $(document).ready(function () {
  118. showJqGrid();
  119. });
  120. function showJqGrid() {
  121. var wfId = $("#wfId").val();
  122. var wtId = $("#wtId").val();
  123. var beginDate = $("#beginDate").val();
  124. var endDate = $("#endDate").val();
  125. var temp="alerthistroyList.action?beginDate="+beginDate
  126. +"&endDate="+endDate
  127. +"&wfId="+wfId
  128. +"&wtId="+wtId;
  129. var url= encodeURI(encodeURI(temp));
  130. var id = 'gridTable';
  131. var datatype = 'json';
  132. var colNames = ['场站名称', '工程名称','线路名称','风机名称','报警描述','报警时间'
  133. ,'分类1','分类2','报警级别','是否报警'];
  134. var colModel = [
  135. { name: 'stationname', index: 'stationname', width: 120, align: 'center'},
  136. { name: 'projectname', index: 'projectname', width: 80, align: 'center'},
  137. { name: 'linename', index: 'linename', width: 80, align: 'center'},
  138. { name: 'windturbinename', index: 'windturbinename', width: 100, align: 'center'},
  139. { name: 'alerttext', index: 'alerttext', width: 240, align: 'center'},
  140. { name: 'alerttime', index: 'alerttime', width: 120, align: 'center'},
  141. { name: 'category1', index: 'category1', width: 80, align: 'center'},
  142. { name: 'category2', index: 'category2', width: 80, align: 'center'},
  143. { name: 'rank', index: 'rank', width: 60, align: 'center'},
  144. { name: 'isopened', index: 'isopened', width: 60, align: 'center'}
  145. ];
  146. var caption = '报警历史查询';
  147. var sortname = 'alerttime';
  148. var gridPagerID ='gridPager';
  149. var sortorder='desc';
  150. var height='650';
  151. var width='1610';
  152. var rownumbers=true;
  153. var multiselect=false;
  154. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  155. multiselect,rownumbers);
  156. }
  157. </script>
  158. <style type="text/css">
  159. fieldset legend {
  160. color:#302A2A;
  161. font: bold 16px/2 Verdana, Geneva, sans-serif;
  162. font-weight: bold;
  163. text-align: left;
  164. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  165. }
  166. </style>
  167. </head>
  168. <body>
  169. <fieldset style="height: 80px;width: 1580px" id="fst">
  170. <legend class="item_Name">查询条件</legend>
  171. <table class="dataform">
  172. <tr>
  173. <%-- <th width="100" class="item_Name">
  174. 场站:
  175. </th>
  176. <td width="120" >
  177. <s:select list="wps" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" onchange="queryData();" ></s:select>
  178. </td> --%>
  179. <th width="5%" class="item_Name">
  180. 场站:
  181. </th>
  182. <td width="15%" >
  183. <s:select list="wps" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" onchange="javascript:changeFc(this.value);" ></s:select>
  184. </td>
  185. <th width="5%" class="item_Name">
  186. 机组:
  187. </th>
  188. <td width="15%">
  189. <select name="wtId" id="wtId" onchange="queryData();">
  190. <option value="">请选择</option>
  191. </select>
  192. </td>
  193. <th width="100" class="item_Name">
  194. 报警类型:
  195. </th>
  196. <td width="120" >
  197. <select name="category1" id="category1" style="width:100" onchange="javascript:changeType(this.value);">
  198. <option value="">请选择</option>
  199. <option value="windturbine">风机报警</option>
  200. <option value="SYZ">升压站报警</option>
  201. <option value="custom">自定义报警</option>
  202. </select>
  203. </td>
  204. <th width="100" class="item_Name">
  205. 报警类别:
  206. </th>
  207. <td width="120" >
  208. <select name="category2" id="category2" style="width:100" onchange="javascript:queryData();">
  209. <option value="">请选择</option>
  210. </select>
  211. </td>
  212. <!-- <th width="100" class="item_Name">
  213. 是否确认:
  214. </th>
  215. <td width="120" >
  216. <select name="isconfirmed" id="isconfirmed" style="width:100" onchange="javascript:queryData();">
  217. <option value="">请选择</option>
  218. <option value="1">已确认</option>
  219. <option value="0">未确认</option>
  220. </select>
  221. </td> -->
  222. <td></td>
  223. </tr>
  224. <tr>
  225. <th width="100" class="item_Name">
  226. 开始日期:
  227. </th>
  228. <td width="120" style="text-align: left">
  229. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  230. id="beginDate" name="beginDate" title="开始日期" onchange="queryData();"/>
  231. </td>
  232. <th width="100" class="item_Name">
  233. 结束日期:
  234. </th>
  235. <td width="120" style="text-align: left">
  236. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  237. id="endDate" name="endDate" title="结束日期" onchange="queryData();"/>
  238. </td>
  239. <td width="80" style="text-align: right">
  240. <a href="#" onclick="javascript:queryData();" id="toexcel">查询</a>
  241. </td>
  242. <td colspan="4"></td>
  243. </tr>
  244. </table>
  245. </fieldset>
  246. <br/>
  247. <table id='gridTable' height="100%">
  248. </table>
  249. <div id='gridPager'></div>
  250. </body>