downLoadWt.jsp 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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 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. <script type="text/javascript">
  12. function queryData(){
  13. if("" == $("#beginDate").val()){
  14. alert("请选择查询开始日期!");
  15. }else if("" == $("#endDate").val()){
  16. alert("请选择查询结束日期!");
  17. }
  18. else{
  19. var wpId=$("#wpId").find("option:selected").val();
  20. var beginDate=$("#beginDate").val();
  21. var endDate=$("#endDate").val();
  22. var url = '<%=request.getContextPath() %>/charts/downLoadWtlist.action?wpId='+wpId
  23. +"&beginDate="+beginDate +"&endDate="+endDate;
  24. $("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  25. }
  26. $('#createzip').css('display','');
  27. }
  28. function toExcel() {
  29. if("" == $("#beginDate").val()){
  30. alert("请选择查询开始日期!");
  31. }else if("" == $("#endDate").val()){
  32. alert("请选择查询结束日期!");
  33. }
  34. else{
  35. var wpId=$("#wpId").find("option:selected").val();
  36. var beginDate=$("#beginDate").val();
  37. var endDate=$("#endDate").val();
  38. var url = '<%=request.getContextPath() %>/charts/downLoadWtExcel.action?wpId='+wpId
  39. +"&beginDate="+beginDate +"&endDate="+endDate;
  40. $('#toexcel').attr('href',url);
  41. }}
  42. function createZip() {
  43. if("" == $("#beginDate").val()){
  44. alert("请选择查询开始日期!");
  45. }else if("" == $("#endDate").val()){
  46. alert("请选择查询结束日期!");
  47. }
  48. else{
  49. var wpId=$("#wpId").find("option:selected").val();
  50. var beginDate=$("#beginDate").val();
  51. var endDate=$("#endDate").val();
  52. var url = '<%=request.getContextPath() %>/charts/createZipIndex.action?wpId='+wpId
  53. +"&beginDate="+beginDate +"&endDate="+endDate;
  54. alert("正在生成ZIP文件请稍后!");
  55. $.ajax({
  56. url : url,
  57. type : "post",
  58. cache : false,
  59. data : {},
  60. success : function(obj) {
  61. if (obj.length != 0) {
  62. alert(obj);
  63. }
  64. }
  65. });
  66. /*$('#createzip').attr('href',url);
  67. $('#createzip').css('display','none');
  68. alert('正在生成请耐心等待!');*/
  69. }}
  70. $(document).ready(function () {
  71. showJqGrid();
  72. });
  73. function showJqGrid() {
  74. var wpId=$("#wpId").find("option:selected").val();
  75. var beginDate=$("#beginDate").val();
  76. var endDate=$("#endDate").val();
  77. var id = 'gridTable';
  78. var url = '<%=request.getContextPath() %>/charts/downLoadWtlist.action?wpId='+wpId
  79. +"&beginDate="+beginDate +"&endDate="+endDate;
  80. var datatype = 'json';
  81. var colNames = ['风机', '时间','功率','风速','发电机转速','桨叶角度','累计发电量'];
  82. var colModel = [
  83. { name: 'windturbineid', index: 'windturbineid', width: 200, align: 'center'},
  84. { name: 'recorddate', index: 'recorddate', width: 200, align: 'center'},
  85. { name: 'power', index: 'power', width: 250, align: 'center'},
  86. { name: 'speed', index: 'speed', width: 250, align: 'center'},
  87. { name: 'generatorrpm', index: 'generatorrpm', width: 200, align: 'center'},
  88. { name: 'ppa', index: 'ppa', width: 200, align: 'center'},
  89. { name: 'generatingcapacity', index: 'generatingcapacity', width: 200, align: 'center'}
  90. ];
  91. var caption = '风机十分钟数据';
  92. var sortname = 'windturbineid';
  93. var gridPagerID ='gridPager';
  94. var sortorder='desc';
  95. var height='670';
  96. var width='1610';
  97. var rownumbers=true;
  98. var multiselect=false;
  99. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  100. multiselect,rownumbers);
  101. }
  102. </script>
  103. <style type="text/css">
  104. a{ /* 统一设置所以样式 */
  105. font-family:Arial;
  106. font-size:12px;
  107. text-align:center;
  108. margin:3px;
  109. }
  110. a:link,a:visited{ /* 超链接正常状态、被访问过的样式 */
  111. color:#000000;
  112. padding:4px 10px 4px 10px;
  113. background-color:#f1f1f1;
  114. text-decoration:none;
  115. border-top:1px solid #EEEEEE; /* 边框实现阴影效果 */
  116. border-left:1px solid #EEEEEE;
  117. border-bottom:1px solid #717171;
  118. border-right:1px solid #717171;
  119. }
  120. a:hover{ /* 鼠标指针经过时的超链接 */
  121. color:#821818; /* 改变文字颜色 */
  122. padding:5px 8px 3px 12px; /* 改变文字位置 */
  123. background-color:#e2c4c9; /* 改变背景色 */
  124. border-top:1px solid #717171; /* 边框变换,实现“按下去”的效果 */
  125. border-left:1px solid #717171;
  126. border-bottom:1px solid #EEEEEE;
  127. border-right:1px solid #EEEEEE;
  128. }
  129. fieldset legend {
  130. color:#302A2A;
  131. font: bold 16px/2 Verdana, Geneva, sans-serif;
  132. font-weight: bold;
  133. text-align: left;
  134. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  135. }
  136. </style>
  137. </head>
  138. <body>
  139. <form action="fittingtopindex.action" method="post" id="f1">
  140. <fieldset style="height: 60px" id="fst">
  141. <legend>查询条件</legend>
  142. <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
  143. <tr>
  144. <th width="100px" class="item_Name">
  145. 风场:
  146. </th>
  147. <td width="100px" class="item_Name">
  148. <s:select list="wps" cssStyle="width:100px" listKey="id" listValue="name" id="wpId" name="wpId" headerKey="" headerValue="请选择" onchange="javascript:queryData();"></s:select>
  149. </td>
  150. <th width="100px" class="item_Name">
  151. 开始日期
  152. </th>
  153. <td width="100px" style="text-align: left">
  154. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  155. id="beginDate" name="beginDate" title="开始日期" onchange="javascript:queryData();"/>
  156. </td>
  157. <th width="100px" class="item_Name">
  158. 结束日期
  159. </th>
  160. <td width="100px" style="text-align: left">
  161. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  162. id="endDate" name="endDate" title="结束日期" onchange="javascript:queryData();"/>
  163. </td>
  164. <td width="400px" style="text-align: left">
  165. <a href="#" onclick="javascript:queryData();" >查询</a>
  166. <a href="#" onclick="javascript:createZip();" id="createzip">生成压缩文件</a>
  167. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  168. </td>
  169. </tr>
  170. </table>
  171. </fieldset>
  172. <br/>
  173. <table id='gridTable' >
  174. </table>
  175. <div id='gridPager'></div>
  176. </form>
  177. </body>