runningalert.jsp 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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 queryData(){
  47. var wfId = $("#wfId").val();
  48. var isconfirmed = $("#isconfirmed").val();
  49. var category1 = $("#category1").val();
  50. var category2 = $("#category2").val();
  51. var beginDate = $("#beginDate").val();
  52. var endDate = $("#endDate").val();
  53. if("" == beginDate){
  54. alert("请选择查询开始日期!");
  55. }else if("" ==endDate){
  56. alert("请选择查询结束日期!");
  57. }else if(beginDate >endDate){
  58. alert("结束日期不允许小于开始日期!");
  59. }else{
  60. var temp="runningAlertList.action?beginDate="+beginDate
  61. +"&endDate="+endDate
  62. +"&wfId="+wfId
  63. +"&isconfirmed="+isconfirmed
  64. +"&category1="+category1
  65. +"&category2="+category2;
  66. var url= encodeURI(encodeURI(temp));
  67. $("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  68. }
  69. }
  70. function changeType(category1){
  71. if(category1!='' && category1!=null ){
  72. var url = "changeBJLXAjax.action?category1="+category1;
  73. $.ajax({
  74. type:"post",
  75. url:url,
  76. dataType:"json",
  77. success: function(data){
  78. if(data.length != 0){
  79. eval(data);
  80. $("#category2").empty();
  81. $("#category2").append("<option value=''>请选择</option>");
  82. for(var i=0; i<data.length; i++){
  83. $("#category2").append("<option value='"+data[i].code+"'>"+data[i].name+"</option>");
  84. }
  85. }else{
  86. $("#category2").empty();
  87. $("#category2").append("<option value=''>请选择</option>");
  88. }
  89. }
  90. });
  91. }
  92. }
  93. $(document).ready(function () {
  94. showJqGrid();
  95. });
  96. function showJqGrid() {
  97. var wfId = $("#wfId").val();
  98. // var isconfirmed = '${isconfirmed}';
  99. var category1 = '${category1}';
  100. var category2 = '${category2}';
  101. var beginDate = $("#beginDate").val();
  102. var endDate = $("#endDate").val();
  103. var temp="runningAlertList.action?beginDate="+beginDate
  104. +"&endDate="+endDate
  105. +"&wfId="+wfId
  106. // +"&isconfirmed="+isconfirmed
  107. +"&category1="+category1
  108. +"&category2="+category2;
  109. var url= encodeURI(encodeURI(temp));
  110. var id = 'gridTable';
  111. var datatype = 'json';
  112. var colNames = ['场站名称', '工程名称','线路名称','风机名称','报警描述','报警时间'
  113. ,'分类1','分类2','报警级别','是否报警','确认时间'];
  114. var colModel = [
  115. { name: 'stationname', index: 'stationname', width: 120, align: 'center'},
  116. { name: 'projectname', index: 'projectname', width: 80, align: 'center'},
  117. { name: 'linename', index: 'linename', width: 80, align: 'center'},
  118. { name: 'windturbinename', index: 'windturbinename', width: 100, align: 'center'},
  119. { name: 'alerttext', index: 'alerttext', width: 240, align: 'center'},
  120. { name: 'lastupdatetime', index: 'lastupdatetime', width: 120, align: 'center'},
  121. { name: 'category1', index: 'category1', width: 80, align: 'center'},
  122. { name: 'category2', index: 'category2', width: 80, align: 'center'},
  123. { name: 'rank', index: 'rank', width: 60, align: 'center'},
  124. { name: 'isopened', index: 'isopened', width: 60, align: 'center'},
  125. // { name: 'isconfirmed', index: 'isconfirmed', width: 60, align: 'center'},
  126. { name: 'confirmtime', index: 'confirmtime', width: 120, align: 'center'}
  127. ];
  128. var caption = '报警列表';
  129. var sortname = 'lastupdatetime';
  130. var gridPagerID ='gridPager';
  131. var sortorder='desc';
  132. var height='650';
  133. var width='1610';
  134. var rownumbers=true;
  135. var multiselect=false;
  136. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  137. multiselect,rownumbers);
  138. }
  139. </script>
  140. <style type="text/css">
  141. fieldset legend {
  142. color:#302A2A;
  143. font: bold 16px/2 Verdana, Geneva, sans-serif;
  144. font-weight: bold;
  145. text-align: left;
  146. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  147. }
  148. </style>
  149. </head>
  150. <body>
  151. <fieldset style="height: 80px;width: 1580px" id="fst">
  152. <legend class="item_Name">查询条件</legend>
  153. <table class="dataform">
  154. <tr>
  155. <th width="100" class="item_Name">
  156. 场站:
  157. </th>
  158. <td width="120" >
  159. <s:select list="wps" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" onchange="queryData();" ></s:select>
  160. </td>
  161. <th width="100" class="item_Name">
  162. 报警类型:
  163. </th>
  164. <td width="120" >
  165. <select name="category1" id="category1" style="width:100" onchange="javascript:changeType(this.value);">
  166. <option value="">请选择</option>
  167. <option value="windturbine">风机报警</option>
  168. <option value="SYZ">升压站报警</option>
  169. <option value="custom">自定义报警</option>
  170. </select>
  171. </td>
  172. <th width="100" class="item_Name">
  173. 报警类别:
  174. </th>
  175. <td width="120" >
  176. <select name="category2" id="category2" style="width:100" onchange="javascript:queryData();">
  177. <option value="">请选择</option>
  178. </select>
  179. </td>
  180. <!-- <th width="100" class="item_Name"> -->
  181. <!-- 是否确认: -->
  182. <!-- </th> -->
  183. <!-- <td width="120" > -->
  184. <!-- <select name="isconfirmed" id="isconfirmed" style="width:100" onchange="javascript:queryData();"> -->
  185. <!-- <option value="">请选择</option> -->
  186. <!-- <option value="1">已确认</option> -->
  187. <!-- <option value="0">未确认</option> -->
  188. <!-- </select> -->
  189. <!-- </td> -->
  190. <td width="80" style="text-align: right">
  191. <a href="#" onclick="javascript:queryData();" id="toexcel">查询</a>
  192. </td>
  193. <td></td>
  194. </tr>
  195. </table>
  196. </fieldset>
  197. <br/>
  198. <table id='gridTable' height="100%">
  199. </table>
  200. <div id='gridPager'></div>
  201. </body>