electricalwarn.jsp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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 beginDate = $("#beginDate").val();
  49. var endDate = $("#endDate").val();
  50. if("" == beginDate){
  51. alert("请选择查询开始日期!");
  52. }else if("" ==endDate){
  53. alert("请选择查询结束日期!");
  54. }else if(beginDate >endDate){
  55. alert("结束日期不允许小于开始日期!");
  56. }else{
  57. var temp="electricalwarnList.action?beginDate="+beginDate
  58. +"&endDate="+endDate
  59. +"&wfId="+wfId;
  60. var url= encodeURI(encodeURI(temp));
  61. $("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  62. }
  63. }
  64. function toExcel() {
  65. var wfId = $("#wfId").val();
  66. var beginDate = $("#beginDate").val();
  67. var endDate = $("#endDate").val();
  68. if("" == beginDate){
  69. alert("请选择查询开始日期!");
  70. }else if("" ==endDate){
  71. alert("请选择查询结束日期!");
  72. }else if(beginDate >endDate){
  73. alert("结束日期不允许小于开始日期!");
  74. }else{
  75. var temp="electricalwarnExcel.action?beginDate="+beginDate
  76. +"&endDate="+endDate
  77. +"&wfId="+wfId;
  78. var url= encodeURI(encodeURI(temp));
  79. $('#toexcel').attr('href',url);
  80. }
  81. }
  82. $(document).ready(function () {
  83. showJqGrid();
  84. });
  85. function showJqGrid() {
  86. var wfId = $("#wfId").val();
  87. var beginDate = $("#beginDate").val();
  88. var endDate = $("#endDate").val();
  89. var temp="electricalwarnList.action?beginDate="+beginDate
  90. +"&endDate="+endDate
  91. +"&wfId="+wfId;
  92. var url= encodeURI(encodeURI(temp));
  93. var id = 'gridTable';
  94. var datatype = 'json';
  95. var colNames = ['场站', '报警时间','报警描述','处理方式'];
  96. var colModel = [
  97. { name: 'windpowerstationname', index: 'windpowerstationname', width: 250, align: 'center'},
  98. /* { name: 'electricalname', index: 'electricalname', width: 250, align: 'center'}, */
  99. { name: 'warningtime', index: 'warningtime', width: 250, align: 'center'},
  100. { name: 'description', index: 'description', width: 250, align: 'center'},
  101. { name: 'handle', index: 'handle', width: 250, align: 'center'}
  102. ];
  103. var caption = '升压站报警管理';
  104. var sortname = 'warningtime';
  105. var gridPagerID ='gridPager';
  106. var sortorder='desc';
  107. var height='650';
  108. var width='1610';
  109. var rownumbers=true;
  110. var multiselect=false;
  111. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  112. multiselect,rownumbers);
  113. }
  114. </script>
  115. <style type="text/css">
  116. fieldset legend {
  117. color:#302A2A;
  118. font: bold 16px/2 Verdana, Geneva, sans-serif;
  119. font-weight: bold;
  120. text-align: left;
  121. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  122. }
  123. </style>
  124. </head>
  125. <body>
  126. <form action="fittingtopindex.action" method="post" id="f1">
  127. <fieldset style="height: 60px;width: 1580px" id="fst">
  128. <legend class="item_Name">查询条件</legend>
  129. <table class="dataform">
  130. <tr>
  131. <th width="5%" class="item_Name">
  132. 场站:
  133. </th>
  134. <td width="15%" >
  135. <s:select list="wps" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" onchange="queryData();" ></s:select>
  136. </td>
  137. <th width="5%" class="item_Name">
  138. 开始日期
  139. </th>
  140. <td width="10%" style="text-align: left">
  141. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  142. id="beginDate" name="beginDate" title="开始日期" onchange="queryData();"/>
  143. </td>
  144. <th width="5%" class="item_Name">
  145. 结束日期
  146. </th>
  147. <td width="10%" style="text-align: left">
  148. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  149. id="endDate" name="endDate" title="结束日期" onchange="queryData();"/>
  150. </td>
  151. <td width="10%" style="text-align: right">
  152. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  153. </td>
  154. <td width="40%"></td>
  155. </tr>
  156. </table>
  157. </fieldset>
  158. <br/>
  159. <table id='gridTable' height="100%">
  160. </table>
  161. <div id='gridPager'></div>
  162. </form>
  163. </body>