outputspeed.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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/jqdatagrid.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 displaybuttons(cellvalue, options, rawObject) {
  47. var windfarm=$("#windfarm").find("option:selected").val();
  48. var recorddate=$("#recorddate").val();
  49. var detail = "<input type='button' value='历史' onclick=detail('"
  50. + rawObject.windturbineid + "','" +recorddate+ "','" +windfarm+ "')>";
  51. return "&nbsp;&nbsp;&nbsp;\t" + detail + "&nbsp;&nbsp;&nbsp;\t";
  52. };
  53. function detail(windturbineid,recorddate,windfarm) {
  54. $("#f1").attr("action", "../total/outputspeedhistoryindex.action?windturbineid="+windturbineid).submit();
  55. }
  56. function changeFc(type){
  57. var url1 = "windfarmAjax.action?type="+type;
  58. $.ajax({
  59. type:"post",
  60. url:url1,
  61. dataType:"json",
  62. success: function(data){
  63. if(data.length != 0){
  64. eval(data);
  65. $("#windfarm").empty();
  66. $("#windfarm").append("<option value=''>请选择</option>");
  67. for(var i=0; i<data.length; i++){
  68. $("#windfarm").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
  69. }
  70. }else{
  71. $("#windfarm").append("<option value=''>请选择</option>");
  72. $("#windfarm").addOption("请选择","");
  73. }
  74. queryData();
  75. }
  76. });
  77. }
  78. function queryData(){
  79. if("" == $("#recorddate").val()){
  80. alert("请选择查询开始日期!");
  81. }
  82. else{
  83. //var type=$("#type").val();
  84. //var windfarm=$("#windfarm").find("option:selected").val();
  85. //var recorddate=$("#recorddate").val();
  86. //var endDate=$("#endDate").val();
  87. //var url = '<%=request.getContextPath() %>/charts/lossList.action?windfarm='+windfarm
  88. // +"&recorddate="+recorddate +"&endDate="+endDate+"&type="+type;
  89. //$("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  90. $("#gridTable").jqGrid('GridUnload');
  91. showJqGrid();
  92. }
  93. }
  94. function toExcel() {
  95. if("" == $("#recorddate").val()){
  96. alert("请选择查询开始日期!");
  97. }
  98. else{
  99. var windfarm=$("#windfarm").find("option:selected").val();
  100. var recorddate=$("#recorddate").val();
  101. var url = '<%=request.getContextPath() %>/total/oroutputspeedExcel.action?windfarm='+windfarm
  102. +"&recorddate="+recorddate ;
  103. $('#toexcel').attr('href',url);
  104. }
  105. }
  106. $(document).ready(function () {
  107. showJqGrid();
  108. });
  109. function showJqGrid() {
  110. var windfarm=$("#windfarm").find("option:selected").val();
  111. var recorddate=$("#recorddate").val();
  112. var id = 'gridTable';
  113. var url = '<%=request.getContextPath() %>/total/outputspeedlist.action?windfarm='+windfarm
  114. +"&recorddate="+recorddate
  115. var datatype = 'json';
  116. var colNames = ['风机','编号','总小风切入','总小风切入合格率','总大风切入','总大风切入合格率','总小风切出',
  117. '总小风切出合格率','总大风切出', '总大风切出合格率','日小风切入','日小风切入合格率','日小风切出',
  118. '日小风切出合格率', '日大风切入','日大风切入合格率','日大风切出','日大风切出合格率',
  119. '月小风切入', '月小风切入合格率','月大风切入','月大风切入合格率','月小风切出',
  120. '月小风切出合格率', '月大风切出','月大风切出合格率','年小风切入','年小风切入合格率',
  121. '年大风切入', '年大风切入合格率','年小风切出','年小风切出合格率','年大风切出',
  122. '年大风切出合格率','操作'
  123. ];
  124. var colModel = [
  125. { name: 'windturbineid', index: 'windturbineid', width: 80, align: 'center',hidden : true},
  126. { name: 'code', index: 'code', width: 80, align: 'center'},
  127. { name: 'inputsmall', index: 'inputsmall', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  128. { name: 'inputsmallratio', index: 'inputsmallratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int',hidden:true},
  129. { name: 'inputbig', index: 'inputbig', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  130. { name: 'inputbigratio', index: 'inputbigratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int',hidden:true},
  131. { name: 'outputsmall', index: 'outputsmall', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  132. { name: 'outputsmallratio', index: 'outputsmallratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int',hidden:true},
  133. { name: 'outputbig', index: 'outputbig', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  134. { name: 'outputbigmaxratio', index: 'outputbigmaxratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int',hidden:true},
  135. { name: 'dayinputsmall', index: 'dayinputsmall', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  136. { name: 'dayinputsmallratio', index: 'dayinputsmallratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  137. { name: 'dayoutputsmall', index: 'dayoutputsmall', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  138. { name: 'dayoutputsmallratio', index: 'dayoutputsmallratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  139. { name: 'dayinputbig', index: 'dayinputbig', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  140. { name: 'dayinputbigratio', index: 'dayinputbigratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  141. { name: 'dayoutputbig', index: 'dayoutputbig', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  142. { name: 'dayoutputbigratio', index: 'dayoutputbigratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  143. { name: 'monthinputsmall', index: 'monthinputsmall', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  144. { name: 'monthinputsmallratio', index: 'monthinputsmallratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  145. { name: 'monthinputbig', index: 'monthinputbig', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  146. { name: 'monthinputbigratio', index: 'monthinputbigratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  147. { name: 'monthoutputsmall', index: 'monthoutputsmall', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  148. { name: 'monthoutputsmallratio', index: 'monthoutputsmallratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  149. { name: 'monthoutputbig', index: 'monthoutputbig', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  150. { name: 'monthoutputbigratio', index: 'monthoutputbigratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  151. { name: 'yearinputsmall', index: 'yearinputsmall', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  152. { name: 'yearinputsmallratio', index: 'yearinputsmallratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  153. { name: 'yearinputbig', index: 'yearinputbig', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  154. { name: 'yearinputbigratio', index: 'yearinputbigratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  155. { name: 'yearoutputsmall', index: 'yearoutputsmall', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  156. { name: 'yearoutputsmallratio', index: 'yearoutputsmallratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  157. { name: 'yearoutputbig', index: 'yearoutputbig', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  158. { name: 'yearoutputbigratio', index: 'yearoutputbigratio', width: 80, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  159. { name: 'windturbineid', index: 'windturbineid', width: 80, align: 'center',formatter:displaybuttons}
  160. ];
  161. var caption = '切入切出风速整合';
  162. var sortname = 'windturbineid';
  163. var gridPagerID ='gridPager';
  164. var sortorder='desc';
  165. var height='auto';
  166. var width='auto';
  167. var rownumbers=true;
  168. var multiselect=false;
  169. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  170. multiselect,rownumbers);}
  171. </script>
  172. <style type="text/css">
  173. fieldset legend {
  174. color:#302A2A;
  175. font: bold 16px/2 Verdana, Geneva, sans-serif;
  176. font-weight: bold;
  177. text-align: left;
  178. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  179. }
  180. </style>
  181. </head>
  182. <body>
  183. <form action="../total/outputspeedindex.action" method="post" id="f1">
  184. <fieldset style="height: 60px" id="fst">
  185. <legend class="item_Name">查询条件</legend>
  186. <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
  187. <tr>
  188. <th width="100px" class="item_Name">
  189. 风场:
  190. </th>
  191. <td width="100px" class="item_Name">
  192. <s:select list="wps" cssStyle="width:100px" listKey="id" listValue="name" id="windfarm" name="windfarm" headerKey="" headerValue="请选择" onchange="javascript:queryData();"></s:select>
  193. </td>
  194. <th width="100px" class="item_Name">
  195. 日期
  196. </th>
  197. <td width="100px" style="text-align: left">
  198. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  199. id="recorddate" name="recorddate" title="开始日期" onchange="javascript:queryData();"/>
  200. </td>
  201. <td width="200px" style="text-align: right">
  202. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  203. </td>
  204. </tr>
  205. </table>
  206. </fieldset>
  207. <br/>
  208. <table id='gridTable' >
  209. </table>
  210. <div id='gridPager'></div>
  211. </form>
  212. </body>