customwarnindex.jsp 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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><script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  8. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  9. <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  10. <style type="text/css">
  11. a{ /* 统一设置所以样式 */
  12. font-family:Arial;
  13. font-size:12px;
  14. text-align:center;
  15. margin:3px;
  16. }
  17. a:link,a:visited{ /* 超链接正常状态、被访问过的样式 */
  18. color:#000000;
  19. padding:4px 10px 4px 10px;
  20. background-color:#f1f1f1;
  21. text-decoration:none;
  22. border-top:1px solid #EEEEEE; /* 边框实现阴影效果 */
  23. border-left:1px solid #EEEEEE;
  24. border-bottom:1px solid #717171;
  25. border-right:1px solid #717171;
  26. }
  27. a:hover{ /* 鼠标指针经过时的超链接 */
  28. color:#821818; /* 改变文字颜色 */
  29. padding:5px 8px 3px 12px; /* 改变文字位置 */
  30. background-color:#e2c4c9; /* 改变背景色 */
  31. border-top:1px solid #717171; /* 边框变换,实现“按下去”的效果 */
  32. border-left:1px solid #717171;
  33. border-bottom:1px solid #EEEEEE;
  34. border-right:1px solid #EEEEEE;
  35. }
  36. fieldset legend {
  37. color:#302A2A;
  38. font: bold 16px/2 Verdana, Geneva, sans-serif;
  39. font-weight: bold;
  40. text-align: left;
  41. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  42. }
  43. </style>
  44. <script type="text/javascript">
  45. function changeFc(fcId){
  46. var url1 = "../warn/changeFc.action?fcId="+fcId;
  47. $.ajax({
  48. type:"post",
  49. url:url1,
  50. dataType:"json",
  51. success: function(data){
  52. if(data.length != 0){
  53. eval(data);
  54. $("#objectid").empty();
  55. $("#objectid").append("<option value=''>请选择</option>");
  56. for(var i=0; i<data.length; i++){
  57. $("#objectid").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
  58. }
  59. $("#objectid").get(0).selectedIndex = 1;
  60. }else{
  61. $("#objectid").empty();
  62. $("#objectid").append("<option value=''>请选择</option>");
  63. }
  64. queryData();
  65. }
  66. });
  67. }
  68. function queryData(){
  69. var wfId = $("#wfId").val();
  70. var objectid = $("#objectid").val();
  71. var beginDate = $("#beginDate").val();
  72. var endDate = $("#endDate").val();
  73. if("" == beginDate){
  74. alert("请选择查询开始日期!");
  75. }else if("" ==endDate){
  76. alert("请选择查询结束日期!");
  77. }else if(beginDate >endDate){
  78. alert("结束日期不允许小于开始日期!");
  79. }else{
  80. var temp="query.action?beginDate="+beginDate
  81. +"&endDate="+endDate
  82. +"&objectid="+objectid
  83. +"&wfId="+wfId;
  84. var url= encodeURI(encodeURI(temp));
  85. $("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  86. }
  87. }
  88. function toExcel() {
  89. var wfId = $("#wfId").val();
  90. var objectid = $("#objectid").val();
  91. var beginDate = $("#beginDate").val();
  92. var endDate = $("#endDate").val();
  93. if("" == beginDate){
  94. alert("请选择查询开始日期!");
  95. }else if("" ==endDate){
  96. alert("请选择查询结束日期!");
  97. }else if(beginDate >endDate){
  98. alert("结束日期不允许小于开始日期!");
  99. }else{
  100. var temp="customwarnExcel.action?beginDate="+beginDate
  101. +"&endDate="+endDate
  102. +"&objectid="+objectid
  103. +"&wfId="+wfId;
  104. var url= encodeURI(encodeURI(temp));
  105. $('#toexcel').attr('href',url);
  106. }
  107. }
  108. $(document).ready(function () {
  109. changeFc("NSS_FDC");
  110. setTimeout("showJqGrid()",2000);
  111. });
  112. function showJqGrid() {
  113. var wfId = $("#wfId").val();
  114. var objectid = $("#objectid").val();
  115. var beginDate = $("#beginDate").val();
  116. var endDate = $("#endDate").val();
  117. var temp="query.action?beginDate="+beginDate
  118. +"&endDate="+endDate
  119. +"&objectid="+objectid
  120. +"&wfId="+wfId;
  121. var url= encodeURI(encodeURI(temp));
  122. var id = 'gridTable';
  123. var datatype = 'json';
  124. var colNames = ['设备名称', '报警时间','型号','报警描述','结果'];
  125. var colModel = [
  126. { name: 'objectname', index: 'objectname', width: 200, align: 'center'},
  127. { name: 'recordtime', index: 'recordtime', width: 250, align: 'center'},
  128. { name: 'modelid', index: 'modelid', width: 250, align: 'center'},
  129. { name: 'description', index: 'description', width: 250, align: 'center'},
  130. { name: 'result', index: 'result', width: 250, align: 'center'}
  131. ];
  132. var caption = '自定义报警';
  133. var sortname = 'warningtime';
  134. var gridPagerID ='gridPager';
  135. var sortorder='desc';
  136. var height='650';
  137. var width='1610';
  138. var rownumbers=true;
  139. var multiselect=false;
  140. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  141. multiselect,rownumbers);
  142. }
  143. </script>
  144. <style type="text/css">
  145. fieldset legend {
  146. color:#302A2A;
  147. font: bold 16px/2 Verdana, Geneva, sans-serif;
  148. font-weight: bold;
  149. text-align: left;
  150. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  151. }
  152. </style>
  153. </head>
  154. <body>
  155. <form action="fittingtopindex.action" method="post" id="f1">
  156. <fieldset style="height: 50px;width: 1580px" id="fst">
  157. <legend class="item_Name">查询条件</legend>
  158. <table class="dataform">
  159. <tr>
  160. <th width="5%" class="item_Name">
  161. 场站:
  162. </th>
  163. <td width="15%" >
  164. <s:select list="wps" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" onchange="javascript:changeFc(this.value);" ></s:select>
  165. </td>
  166. <th width="5%" class="item_Name">
  167. 机组:
  168. </th>
  169. <td width="15%">
  170. <select name="objectid" id="objectid" onchange="queryData();">
  171. <option value="">请选择</option>
  172. </select>
  173. </td>
  174. <th width="5%" class="item_Name">
  175. 开始日期
  176. </th>
  177. <td width="10%" style="text-align: left">
  178. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  179. id="beginDate" name="beginDate" title="开始日期" onchange="queryData();"/>
  180. </td>
  181. <th width="5%" class="item_Name">
  182. 结束日期
  183. </th>
  184. <td width="10%" style="text-align: left">
  185. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  186. id="endDate" name="endDate" title="结束日期" onchange="queryData();"/>
  187. </td>
  188. <td width="10%" style="text-align: right">
  189. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  190. </td>
  191. <td width="40%"></td>
  192. </tr>
  193. </table>
  194. </fieldset>
  195. <br/>
  196. <table id='gridTable' height="100%">
  197. </table>
  198. <div id='gridPager'></div>
  199. </form>
  200. </body>