healthCountByWindturbine.jsp 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 type="text/ecmascript" src="<%=request.getContextPath()%>/resource/js/system/jqdatagrid.js"></script> --%>
  9. <script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  10. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  11. <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  12. <style type="text/css">
  13. a{ /* 统一设置所以样式 */
  14. font-family:Arial;
  15. font-size:12px;
  16. text-align:center;
  17. margin:3px;
  18. }
  19. a:link,a:visited{ /* 超链接正常状态、被访问过的样式 */
  20. color:#000000;
  21. padding:4px 10px 4px 10px;
  22. background-color:#f1f1f1;
  23. text-decoration:none;
  24. border-top:1px solid #EEEEEE; /* 边框实现阴影效果 */
  25. border-left:1px solid #EEEEEE;
  26. border-bottom:1px solid #717171;
  27. border-right:1px solid #717171;
  28. }
  29. a:hover{ /* 鼠标指针经过时的超链接 */
  30. color:#821818; /* 改变文字颜色 */
  31. padding:5px 8px 3px 12px; /* 改变文字位置 */
  32. background-color:#e2c4c9; /* 改变背景色 */
  33. border-top:1px solid #717171; /* 边框变换,实现“按下去”的效果 */
  34. border-left:1px solid #717171;
  35. border-bottom:1px solid #EEEEEE;
  36. border-right:1px solid #EEEEEE;
  37. }
  38. fieldset legend {
  39. color:#302A2A;
  40. font: bold 16px/2 Verdana, Geneva, sans-serif;
  41. font-weight: bold;
  42. text-align: left;
  43. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  44. }
  45. </style>
  46. <script type="text/javascript">
  47. function changeFc(wpid){
  48. var url1 = "<%=request.getContextPath() %>/comboxUtils/findWindturbineByWpid.action?wpid="+wpid;
  49. $.ajax({
  50. type:"post",
  51. url:url1,
  52. dataType:"json",
  53. success: function(data){
  54. if(data.length != 0){
  55. eval(data);
  56. $("#wtid").empty();
  57. $("#wtid").append("<option value='-1'>请选择</option>");
  58. for(var i=0; i<data.length; i++){
  59. $("#wtid").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
  60. }
  61. }else{
  62. $("#wtid").empty();
  63. $("#wtid").append("<option value='-1'>请选择</option>");
  64. //$("#wtid").addOption("请选择","");
  65. }
  66. queryData();
  67. }
  68. });
  69. }
  70. function queryData(){
  71. $("#gridTable").jqGrid('GridUnload');
  72. showJqGrid();
  73. }
  74. $(document).ready(function () {
  75. showJqGrid();
  76. });
  77. function showJqGrid() {
  78. var wpId=$("#wpId").find("option:selected").val();
  79. var wtid=$("#wtid").find("option:selected").val();
  80. var year=$("#year").val();
  81. var month=$("#month").val();
  82. var url = '<%=request.getContextPath() %>/healthCount/findWarningStatisticsForWindturbinList.action?wb.windpowerstationid='+wpId
  83. +"&wb.windturbineid="+wtid+"&wb.year="+year +"&wb.month="+month;
  84. var id = 'gridTable';
  85. var datatype = 'json';
  86. var colNames = ['id','风场', '风机','报警类型','报警名称','年','月','月报警次数','月报警平均间隔时间(h)','月报警平均消缺时间(h)',
  87. '年报警次数','年报警平均间隔时间(h)','年报警平均消缺时间(h)','总报警次数','总报警平均间隔时间(h)',
  88. '总报警平均消缺时间(h)'];
  89. var colModel = [
  90. { name: 'id', index: 'id', width: 20, align: 'center',hidden:true},
  91. { name: 'windpowerstationid', index: 'windpowerstationid', width: 70, align: 'center'},
  92. { name: 'windturbineid', index: 'windturbineid', width: 80, align: 'center'},
  93. { name: 'warningtype', index: 'warningtype', width: 120, align: 'center'},
  94. { name: 'warningid', index: 'warningid', width: 300, align: 'center'},
  95. { name: 'year', index: 'year', width: 35, align: 'center'},
  96. { name: 'month', index: 'month', width: 30, align: 'center'},
  97. { name: 'monthWarningNum', index: 'monthWarningNum', width: 100, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  98. { name: 'monthMTBF', index: 'monthMTBF', width: 100, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  99. { name: 'monthMTTR', index: 'monthMTTR', width: 100, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  100. { name: 'yearwarning', index: 'yearwarning', width: 100, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  101. { name: 'yearMTBF', index: 'yearMTBF', width: 100, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  102. { name: 'yearMTTR', index: 'yearMTTR', width: 100, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  103. { name: 'totalwarningnum', index: 'totalwarningnum', width: 100, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  104. { name: 'totalMTBF', index: 'totalMTBF', width: 100, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  105. { name: 'totalMTTR', index: 'totalMTTR', width: 100, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'}
  106. ];
  107. var caption = '风机报警统计';
  108. var sortname = '';
  109. var gridPagerID ='gridPager';
  110. var sortorder='desc';
  111. var height='600px';
  112. var width='1300px';
  113. var rownumbers=true;
  114. var multiselect=false;
  115. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  116. multiselect,rownumbers);
  117. }
  118. </script>
  119. <style type="text/css">
  120. fieldset legend {
  121. color:#302A2A;
  122. font: bold 16px/2 Verdana, Geneva, sans-serif;
  123. font-weight: bold;
  124. text-align: left;
  125. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  126. }
  127. </style>
  128. </head>
  129. <body>
  130. <form action="" method="post" id="f1">
  131. <fieldset style="height: 60px" id="fst">
  132. <legend class="item_Name">查询条件</legend>
  133. <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
  134. <tr>
  135. <th width="100px" class="item_Name">
  136. 风场:
  137. </th>
  138. <td width="100px" >
  139. <!-- onchange="javascript:queryData();" -->
  140. <s:select list="wps" cssStyle="width:100px" onchange="javascript:changeFc(this.value)" listKey="code" listValue="name" id="wpId" name="wpId" headerKey="-1" headerValue="请选择" ></s:select>
  141. </td>
  142. <th width="100px" class="item_Name">
  143. 风机:
  144. </th>
  145. <td width="100px" >
  146. <!-- onchange="javascript:queryData();" -->
  147. <s:select list="wts" cssStyle="width:100px" onchange="javascript:queryData();" listKey="code" listValue="name" id="wtid" name="wtid" headerKey="-1" headerValue="请选择" ></s:select>
  148. </td>
  149. <th width="100px" class="item_Name">
  150. 年:
  151. </th>
  152. <td width="100px" style="text-align: left">
  153. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy',isShowWeek:true,readOnly:true})"
  154. id="year" name="beginDate" title="开始日期" onchange="javascript:queryData();"/>
  155. </td>
  156. <th width="100px" class="item_Name">
  157. 月:
  158. </th>
  159. <td width="100px" style="text-align: left">
  160. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'MM',isShowWeek:true,readOnly:true})"
  161. id="month" name="endDate" title="结束日期" onchange="javascript:queryData();"/>
  162. </td>
  163. </tr>
  164. </table>
  165. </fieldset>
  166. <br/>
  167. <table id='gridTable' >
  168. </table>
  169. <div id='gridPager'></div>
  170. </form>
  171. </body>