goodhistory.jsp 9.7 KB

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