goodhistory.jsp 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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/js/system/jqdatagrid.js"></script>
  7. <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. $("#windturbineid").empty();
  55. //$("#windturbineid").append("<option value=''>请选择</option>");
  56. for(var i=0; i<data.length; i++){
  57. $("#windturbineid").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
  58. }
  59. $("#windturbineid").val('<s:property value="wtId"/>');
  60. }else{
  61. $("#windturbineid").empty();
  62. //$("#windturbineid").append("<option value=''>请选择</option>");
  63. }
  64. queryData();
  65. }
  66. });
  67. }
  68. function queryData(){
  69. if("" == $("#beginDate").val()){
  70. alert("请选择查询开始日期!");
  71. }else if("" == $("#endDate").val()){
  72. alert("请选择查询结束日期!");
  73. }
  74. else{
  75. var windturbineid=$("#windturbineid").find("option:selected").val();
  76. var beginDate=$("#beginDate").val();
  77. var endDate=$("#endDate").val();
  78. //var url = '<%=request.getContextPath() %>/wtgoodness/goodhistorylist.action?windturbineid='+windturbineid
  79. // +"&beginDate="+beginDate+"&endDate="+endDate;
  80. //$("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  81. $("#gridTable").jqGrid('GridUnload');
  82. showJqGrid();
  83. }
  84. }
  85. $(document).ready(function () {
  86. changeFc("<s:property value='windfarm'/>");
  87. setTimeout("showJqGrid()",1000);
  88. });
  89. function showJqGrid() {
  90. var windturbineid=$("#windturbineid").find("option:selected").val();
  91. var beginDate=$("#beginDate").val();
  92. var endDate=$("#endDate").val();
  93. var id = 'gridTable';
  94. var url = '<%=request.getContextPath() %>/wtgoodness/goodhistorylist.action?windturbineid='+windturbineid
  95. +"&beginDate="+beginDate+"&endDate="+endDate;
  96. var datatype = 'json';
  97. var colNames = ['日期','风机','日发电量','日理论发电量','日平均功率','日运行小时',
  98. '日待机小时','日故障小时','日维护小时','日中断小时','日有效风时','日损失电量',
  99. '日报警次数','日停机次数','日不饱和次数','日设备可利用率', '日平均温度','日平均湿度',
  100. '日平均压强','日拟合优度','日实际/保证'];
  101. var colModel = [
  102. { name: 'recorddate', index: 'recorddate', width: 100, align: 'center',formatter:'date',formatoptions: {newformat:'Y-m-d'}},
  103. { name: 'windturbineid', index: 'windturbineid', width: 100, align: 'center'},
  104. { name: 'c1', index: 'c1', width: 100, align: 'center'},
  105. { name: 'c4', index: 'c4', width: 100, align: 'center'},
  106. { name: 'c7', index: 'c7', width: 100, align: 'center'},
  107. { name: 'c13', index: 'c13', width: 100, align: 'center'},
  108. { name: 'c16', index: 'c16', width: 100, align: 'center'},
  109. { name: 'c19', index: 'c19', width: 100, align: 'center'},
  110. { name: 'c22', index: 'c22', width: 100, align: 'center'},
  111. { name: 'c25', index: 'c25', width: 100, align: 'center'},
  112. { name: 'c28', index: 'c28', width: 100, align: 'center'},
  113. { name: 'c31', index: 'c31', width: 100, align: 'center'},
  114. { name: 'c34', index: 'c34', width: 100, align: 'center'},
  115. { name: 'c37', index: 'c37', width: 100, align: 'center'},
  116. { name: 'c40', index: 'c40', width: 100, align: 'center'},
  117. { name: 'c43', index: 'c43', width: 100, align: 'center'},
  118. { name: 'c46', index: 'c46', width: 100, align: 'center'},
  119. { name: 'c49', index: 'c49', width: 100, align: 'center'},
  120. { name: 'c52', index: 'c52', width: 100, align: 'center'},
  121. { name: 'c55', index: 'c55', width: 100, align: 'center'},
  122. { name: 'c58', index: 'c58', width: 100, align: 'center'}
  123. ];
  124. var caption = '单机历史性能分析';
  125. var sortname = 'windturbineid';
  126. var gridPagerID ='gridPager';
  127. var sortorder='desc';
  128. var height='auto';
  129. var width='auto';
  130. var rownumbers=true;
  131. var multiselect=false;
  132. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  133. multiselect,rownumbers);}
  134. function goPage() {
  135. $("#f1").attr("action", "goodnessindex.action").submit();
  136. }
  137. </script>
  138. <style type="text/css">
  139. fieldset legend {
  140. color:#302A2A;
  141. font: bold 16px/2 Verdana, Geneva, sans-serif;
  142. font-weight: bold;
  143. text-align: left;
  144. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  145. }
  146. </style>
  147. </head>
  148. <body>
  149. <form action="utilizationIndex.action" method="post" id="f1">
  150. <fieldset style="height: 60px" id="fst">
  151. <legend class="item_Name">查询条件</legend>
  152. <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
  153. <tr>
  154. <th width="100px" class="item_Name">
  155. 风场:
  156. </th>
  157. <td width="120px" class="item_Name">
  158. <s:select list="wps" cssStyle="width:100px" listKey="id" listValue="name" id="windfarm" name="windfarm" headerKey="" headerValue="请选择" onchange="javascript:changeFc(this.value);"></s:select>
  159. </td>
  160. <th width="100px" class="item_Name">
  161. 风机:
  162. </th>
  163. <td width="120px">
  164. <select name="wtId" id="windturbineid" onchange="queryData();">
  165. <option value="">请选择</option>
  166. </select>
  167. </td>
  168. <th width="100px" class="item_Name">
  169. 开始日期
  170. </th>
  171. <td width="100px" style="text-align: left">
  172. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  173. id="beginDate" name="beginDate" title="开始日期" onchange="javascript:queryData();"/>
  174. </td>
  175. <th width="100px" class="item_Name">
  176. 结束日期
  177. </th>
  178. <td width="100px" style="text-align: left">
  179. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  180. id="endDate" name="endDate" title="结束日期" onchange="javascript:queryData();"/>
  181. </td>
  182. <td style="text-align: right">
  183. <input type="button" class="button" onclick="javascript:goPage();"
  184. value="返回" />
  185. </td>
  186. </tr>
  187. </table>
  188. </fieldset>
  189. <br/>
  190. <table id='gridTable' >
  191. </table>
  192. <div id='gridPager'></div>
  193. </form>
  194. </body>