warnhistory.jsp 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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].code+"</option>");
  59. }
  60. }else{
  61. $("#wtId").empty();
  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 levelId = $("#levelId").val();
  72. var classifyId = $("#classifyId").val();
  73. var warnDesc = $("#warnDesc").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="warnhistoryList.action?beginDate="+beginDate
  84. +"&endDate="+endDate
  85. +"&wfId="+wfId
  86. +"&wtId="+wtId
  87. +"&levelId="+levelId
  88. +"&classifyId="+classifyId
  89. +"&warnDesc="+warnDesc;
  90. var url= encodeURI(encodeURI(temp));
  91. $("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  92. }
  93. }
  94. function toExcel() {
  95. var wfId = $("#wfId").val();
  96. var wtId = $("#wtId").val();
  97. var levelId = $("#levelId").val();
  98. var classifyId = $("#classifyId").val();
  99. var warnDesc = $("#warnDesc").val();
  100. var beginDate = $("#beginDate").val();
  101. var endDate = $("#endDate").val();
  102. if("" == beginDate){
  103. alert("请选择查询开始日期!");
  104. }else if("" ==endDate){
  105. alert("请选择查询结束日期!");
  106. }else if(beginDate >endDate){
  107. alert("结束日期不允许小于开始日期!");
  108. }else{
  109. var temp="warnhistoryExcel.action?beginDate="+beginDate
  110. +"&endDate="+endDate
  111. +"&wfId="+wfId
  112. +"&wtId="+wtId
  113. +"&levelId="+levelId
  114. +"&classifyId="+classifyId
  115. +"&warnDesc="+warnDesc;
  116. var url= encodeURI(encodeURI(temp));
  117. $('#toexcel').attr('href',url);
  118. }
  119. }
  120. $(document).ready(function () {
  121. showJqGrid();
  122. });
  123. function showJqGrid() {
  124. var wfId = $("#wfId").val();
  125. var wtId = $("#wtId").val();
  126. var levelId = $("#levelId").val();
  127. var classifyId = $("#classifyId").val();
  128. var warnDesc = $("#warnDesc").val();
  129. var beginDate = $("#beginDate").val();
  130. var endDate = $("#endDate").val();
  131. var temp="warnhistoryList.action?beginDate="+beginDate
  132. +"&endDate="+endDate
  133. +"&wfId="+wfId
  134. +"&wtId="+wtId
  135. +"&levelId="+levelId
  136. +"&classifyId="+classifyId
  137. +"&warnDesc="+warnDesc;
  138. var url= encodeURI(encodeURI(temp));
  139. var id = 'gridTable';
  140. var datatype = 'json';
  141. var colNames = ['场站', '编号', '机组','报警时间','报警描述','报警类别','报警等级'];
  142. var colModel = [
  143. { name: 'wfName', index: 'wfName', width: 200, align: 'center'},
  144. { name: 'wtName', index: 'wtName', width: 100, align: 'center',hidden : true},
  145. { name: 'code', index: 'code', width: 100, align: 'center'},
  146. { name: 'warningtime', index: 'warningtime', width: 250, align: 'center'},
  147. { name: 'warnDesc', index: 'warnDesc', width: 250, align: 'center'},
  148. { name: 'className', index: 'className', width: 250, align: 'center'},
  149. { name: 'levelNum', index: 'levelNum', width: 250, align: 'center'}
  150. ];
  151. var caption = 'SCADA报警查询';
  152. var sortname = 'warningtime';
  153. var gridPagerID ='gridPager';
  154. var sortorder='desc';
  155. var height='610';
  156. var width='1610';
  157. var rownumbers=true;
  158. var multiselect=false;
  159. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  160. multiselect,rownumbers);
  161. }
  162. </script>
  163. <style type="text/css">
  164. fieldset legend {
  165. color:#302A2A;
  166. font: bold 16px/2 Verdana, Geneva, sans-serif;
  167. font-weight: bold;
  168. text-align: left;
  169. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  170. }
  171. </style>
  172. </head>
  173. <body>
  174. <form action="fittingtopindex.action" method="post" id="f1">
  175. <fieldset style="height: 100px;width: 1580px" id="fst">
  176. <legend class="item_Name">查询条件</legend>
  177. <table class="dataform">
  178. <tr>
  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="5%" class="item_Name">
  194. 描述:
  195. </th>
  196. <td width="10%">
  197. <s:textfield id="warnDesc" name="warnDesc" title="描述" onchange="queryData();"/>
  198. </td>
  199. <th width="5%" class="item_Name" style="visibility:hidden" >
  200. 等级:
  201. </th>
  202. <td width="10%" style="visibility:hidden" >
  203. <select name="levelId" id="levelId" onchange="queryData();">
  204. <option value="">请选择</option>
  205. <option value="1">一级</option>
  206. <option value="2">二级</option>
  207. <option value="3">三级</option>
  208. <option value="4">四级</option>
  209. <option value="5">五级</option>
  210. </select>
  211. </td>
  212. </tr>
  213. <tr>
  214. <th width="5%" class="item_Name">
  215. 分类:
  216. </th>
  217. <td width="15%" >
  218. <s:select list="wss" listKey="id" listValue="name" id="classifyId" name="classifyId" headerKey="" headerValue="请选择" onchange="queryData();" ></s:select>
  219. </td>
  220. <th width="5%" class="item_Name">
  221. 开始日期
  222. </th>
  223. <td width="10%" style="text-align: left">
  224. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  225. id="beginDate" name="beginDate" title="开始日期" onchange="queryData();"/>
  226. </td>
  227. <th width="5%" class="item_Name">
  228. 结束日期
  229. </th>
  230. <td width="10%" style="text-align: left">
  231. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  232. id="endDate" name="endDate" title="结束日期" onchange="queryData();"/>
  233. </td>
  234. <td width="10%" style="text-align: right">
  235. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  236. </td>
  237. <td width="40%"></td>
  238. </tr>
  239. </table>
  240. </fieldset>
  241. <br/>
  242. <table id='gridTable' height="100%">
  243. </table>
  244. <div id='gridPager'></div>
  245. </form>
  246. </body>