totalpowercapacitytop.jsp 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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 changeFc(type){
  47. var url1 = "windfarmAjax.action?type="+type;
  48. $.ajax({
  49. type:"post",
  50. url:url1,
  51. dataType:"json",
  52. success: function(data){
  53. if(data.length != 0){
  54. eval(data);
  55. $("#wpId").empty();
  56. $("#wpId").append("<option value=''>请选择</option>");
  57. for(var i=0; i<data.length; i++){
  58. $("#wpId").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
  59. }
  60. }else{
  61. $("#wpId").append("<option value=''>请选择</option>");
  62. $("#wpId").addOption("请选择","");
  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 type=$("#type").val();
  76. //var wpId=$("#wpId").find("option:selected").val();
  77. //var beginDate=$("#beginDate").val();
  78. //var endDate=$("#endDate").val();
  79. //var url = '<%=request.getContextPath() %>/charts/totalPowerCapacityTopList.action?wpId='+wpId
  80. // +"&beginDate="+beginDate +"&endDate="+endDate+"&type="+type;
  81. //$("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  82. $("#gridTable").jqGrid('GridUnload');
  83. showJqGrid();
  84. }
  85. }
  86. $(document).ready(function () {
  87. showJqGrid();
  88. });
  89. function showJqGrid() {
  90. var wpId=$("#wpId").find("option:selected").val();
  91. var beginDate=$("#beginDate").val();
  92. var endDate=$("#endDate").val();
  93. var url = '<%=request.getContextPath() %>/charts/totalPowerCapacityTopList.action?wpId='+wpId
  94. +"&beginDate="+beginDate +"&endDate="+endDate;
  95. var id = 'gridTable';
  96. var datatype = 'json';
  97. var colNames = ['风场', '风机','起始日期','截至日期','平均风速','SCADA发电量(万kwh)'];
  98. var colModel = [
  99. { name: 'windfarm', index: 'windfarm', width: 200, align: 'center'},
  100. { name: 'windturbine', index: 'windturbine', width: 200, align: 'center'},
  101. { name: 'beginDate', index: 'beginDate', width: 250, align: 'center',formatter:'date', formatoptions:{newformat:'Y-m-d'},align:'center'},
  102. { name: 'endDate', index: 'endDate', width: 250, align: 'center',formatter:'date', formatoptions:{newformat:'Y-m-d'},align:'center'},
  103. { name: 'speed', index: 'speed', width: 200, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  104. { name: 'generatingCapacity', index: 'generatingCapacity', width: 200, align: 'center', formatter:'number', formatoptions:{decimalPlaces: 4},sorttype: 'int'}
  105. ];
  106. var caption = '总发电量排行榜';
  107. var sortname = 'generatingCapacity';
  108. var gridPagerID ='gridPager';
  109. var sortorder='desc';
  110. var height='auto';
  111. var width='auto';
  112. var rownumbers=true;
  113. var multiselect=false;
  114. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  115. multiselect,rownumbers);}
  116. function toExcel() {
  117. if("" == $("#beginDate").val()){
  118. alert("请选择查询开始日期!");
  119. }else if("" == $("#endDate").val()){
  120. alert("请选择查询结束日期!");
  121. }
  122. else{
  123. var type=$("#type").val();
  124. var wpId=$("#wpId").find("option:selected").val();
  125. var beginDate=$("#beginDate").val();
  126. var endDate=$("#endDate").val();
  127. var url = '<%=request.getContextPath() %>/charts/totalPowerCapacityTopExcel.action?wpId='+wpId
  128. +"&beginDate="+beginDate +"&endDate="+endDate+"&type="+type;
  129. $('#toexcel').attr('href',url);
  130. }
  131. }
  132. </script>
  133. <style type="text/css">
  134. fieldset legend {
  135. color:#302A2A;
  136. font: bold 16px/2 Verdana, Geneva, sans-serif;
  137. font-weight: bold;
  138. text-align: left;
  139. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  140. }
  141. </style>
  142. </head>
  143. <body>
  144. <form action="generatingcapacityTop.action" method="post" id="f1">
  145. <fieldset style="height: 60px" id="fst">
  146. <legend class="item_Name">查询条件</legend>
  147. <table width="1300px" cellpadding="0" cellspacing="0" class="dataform">
  148. <tr>
  149. <th width="100px" class="item_Name">
  150. 类型:
  151. </th>
  152. <td width="100px" >
  153. <s:select list="#{'':'全部','fc':'风场'}" cssStyle="width:100px" id="type" name="type" onchange="javascript:changeFc(this.value);"></s:select>
  154. </td>
  155. <th width="100px" class="item_Name">
  156. 风场:
  157. </th>
  158. <td width="200px" >
  159. <s:select list="wps" cssStyle="width:200px" listKey="id" listValue="name" id="wpId" name="wpId" headerKey="" headerValue="请选择" onchange="javascript:queryData();"></s:select>
  160. </td>
  161. <th width="100px" class="item_Name">
  162. 开始日期
  163. </th>
  164. <td width="100px" style="text-align: left">
  165. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  166. id="beginDate" name="beginDate" title="开始日期" onchange="javascript:queryData();"/>
  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="endDate" name="endDate" title="结束日期" onchange="javascript:queryData();"/>
  174. </td>
  175. <td width="200px" style="text-align: right">
  176. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  177. </td>
  178. </tr>
  179. </table>
  180. </fieldset>
  181. <br/>
  182. <table id='gridTable' >
  183. </table>
  184. <div id='gridPager'></div>
  185. </form>
  186. </body>