goodness.jsp 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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() %>/pages/apdata/goodness.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 displaybuttons(cellvalue, options, rawObject) {
  46. var recorddate=$("#recorddate").val();
  47. var detail = "<input type='button' value='详情' onclick=detail('"
  48. + rawObject.windturbineid + "','" + recorddate + "')>";
  49. var history = "<input type='button' value='历史' onclick=history('"
  50. + rawObject.windturbineid + "','" + recorddate + "')>";
  51. return "&nbsp;&nbsp;&nbsp;\t" + detail + "&nbsp;&nbsp;&nbsp;\t"
  52. + history;
  53. };
  54. function detail(windturbineid, recorddate) {
  55. $("#f1").attr("action", "../wtgoodness/goodnesstab.action?windturbineid="+windturbineid+"&recorddate="+recorddate).submit();
  56. }
  57. function history(windturbineid, recorddate) {
  58. $("#wtId").val(windturbineid);
  59. $("#recorddate").val(recorddate);
  60. $("#f1").attr("action", "goodhistoryindex.action").submit();
  61. }
  62. function queryData(){
  63. $("#gridTable").jqGrid('GridUnload');
  64. showJqGrid();
  65. // if("" == $("#recorddate").val()){
  66. // alert("请选择查询日期!");
  67. // }
  68. // else{
  69. // var windfarm=$("#windfarm").find("option:selected").val();
  70. // var recorddate=$("#recorddate").val();
  71. // var url = '<%=request.getContextPath() %>/wtgoodness/goodnesslist.action?windfarm='+windfarm
  72. // +"&recorddate="+recorddate
  73. // $("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  74. // }
  75. }
  76. function toExcel() {
  77. if("" == $("#recorddate").val()){
  78. alert("请选择查询日期!");
  79. }
  80. else{
  81. var windfarm=$("#windfarm").find("option:selected").val();
  82. var recorddate=$("#recorddate").val();
  83. var url = '<%=request.getContextPath() %>/wtgoodness/wtGoodNessExcel.action?windfarm='+windfarm
  84. +"&recorddate="+recorddate;
  85. $('#toexcel').attr('href',url);
  86. }
  87. }
  88. $(document).ready(function () {
  89. showJqGrid();
  90. });
  91. function showJqGrid() {
  92. var windfarm=$("#windfarm").find("option:selected").val();
  93. var recorddate=$("#recorddate").val();
  94. var id = 'gridTable';
  95. var url = '<%=request.getContextPath() %>/wtgoodness/goodnesslist.action?windfarm='+windfarm
  96. +"&recorddate="+recorddate;
  97. var datatype = 'json';
  98. var colNames = ['风场', '风机','型号',
  99. '日排行榜', '日拟合优度(%)','日风速(m/s)',
  100. '月排行榜', '月拟合优度(%)','月风速(m/s)',
  101. '年排行榜', '年拟合优度(%)','年风速(m/s)',
  102. '操作'
  103. ];
  104. var colModel = [
  105. { name: 'name', index: 'name', width: 100, align: 'center'},
  106. { name: 'windturbineid', index: 'windturbineid', width: 100, align: 'center'},
  107. { name: 'modelid', index: 'modelid', width: 100, align: 'center'},
  108. { name: 'daytop', index: 'daytop', width: 100, align: 'center', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  109. { name: 'daygoodness', index: 'daygoodness', width: 100, align: 'center', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  110. { name: 'dayspeed', index: 'dayspeed', width: 100, align: 'center', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  111. { name: 'monthtop', index: 'monthtop', width: 100, align: 'center', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  112. { name: 'monthgoodness', index: 'monthgoodness', width: 100, align: 'center', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  113. { name: 'monthspeed', index: 'monthspeed', width: 100, align: 'center', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  114. { name: 'yeartop', index: 'yeartop', width: 100, align: 'center', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  115. { name: 'yeargoodness', index: 'yeargoodness', width: 100, align: 'center', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  116. { name: 'yearspeed', index: 'yearspeed', width: 100, align: 'center', formatoptions:{decimalPlaces: 0},sorttype: 'int'},
  117. { name: 'yearspeed', index: 'yearspeed', width: 200, align: 'center',formatter:displaybuttons}
  118. ];
  119. var caption = '单机信息总览列表';
  120. var sortname = 'daytop';
  121. var gridPagerID ='gridPager';
  122. var sortorder='desc';
  123. var height='auto';
  124. var width='auto';
  125. var rownumbers=true;
  126. var multiselect=false;
  127. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  128. multiselect,rownumbers);}
  129. </script>
  130. <style type="text/css">
  131. fieldset legend {
  132. color:#302A2A;
  133. font: bold 16px/2 Verdana, Geneva, sans-serif;
  134. font-weight: bold;
  135. text-align: left;
  136. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  137. }
  138. </style>
  139. </head>
  140. <body>
  141. <form action="" method="post" id="f1">
  142. <fieldset style="height: 60px" id="fst">
  143. <legend class="item_Name">查询条件</legend>
  144. <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
  145. <tr>
  146. <th width="100px" class="item_Name">
  147. 风场:
  148. </th>
  149. <td width="100px" class="item_Name">
  150. <s:select list="wps" cssStyle="width:100px" listKey="id" listValue="name" id="windfarm" name="windfarm" headerKey="" headerValue="请选择" onchange="javascript:queryData();"></s:select>
  151. </td>
  152. <th width="100px" class="item_Name">
  153. 日期
  154. </th>
  155. <td width="100px" style="text-align: left">
  156. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  157. id="recorddate" name="recorddate" title="日期" onchange="javascript:queryData();"/>
  158. </td>
  159. <td width="200px" style="text-align: right">
  160. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  161. </td>
  162. </tr>
  163. </table>
  164. </fieldset>
  165. <br/>
  166. <table id='gridTable' >
  167. </table>
  168. <div id='gridPager'></div>
  169. <input type="hidden" id="wtId" name="wtId">
  170. <input type="hidden" id="recorddate" name="recorddate">
  171. </form>
  172. </body>