curvemonth.jsp 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <head>
  4. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js"></script>
  5. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/i18n/grid.locale-cn.js"></script>
  6. <script type="text/ecmascript" src="<%=request.getContextPath()%>/resource/js/system/jqdatagridpagenum.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. <script src="<%=request.getContextPath()%>/resource/js/highcharts/highcharts.src.js" type="text/javascript"></script>
  11. <script src="<%=request.getContextPath()%>/resource/js/highcharts/highcharts-more.js"> </script>
  12. <script src="<%=request.getContextPath()%>/resource/js/highcharts/modules/solid-gauge.src.js"></script>
  13. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resource/plugin/highslide/highslide.css" />
  14. <script type="text/javascript" src="<%=request.getContextPath()%>/resource/plugin/highslide/highslide-with-html.js"></script>
  15. <style type="text/css">
  16. a.url { /* 统一设置所以样式 */
  17. font-family:Arial;
  18. font-size:12px;
  19. text-align:center;
  20. margin:3px;
  21. }
  22. a:link.url ,a:visited.url{ /* 超链接正常状态、被访问过的样式 */
  23. color:#000000;
  24. padding:4px 10px 4px 10px;
  25. background-color:#f1f1f1;
  26. text-decoration:none;
  27. border-top:1px solid #EEEEEE; /* 边框实现阴影效果 */
  28. border-left:1px solid #EEEEEE;
  29. border-bottom:1px solid #717171;
  30. border-right:1px solid #717171;
  31. }
  32. a:hover.url{ /* 鼠标指针经过时的超链接 */
  33. color:#821818; /* 改变文字颜色 */
  34. padding:5px 8px 3px 12px; /* 改变文字位置 */
  35. background-color:#e2c4c9; /* 改变背景色 */
  36. border-top:1px solid #717171; /* 边框变换,实现“按下去”的效果 */
  37. border-left:1px solid #717171;
  38. border-bottom:1px solid #EEEEEE;
  39. border-right:1px solid #EEEEEE;
  40. }
  41. fieldset legend {
  42. color:#302A2A;
  43. font: bold 16px/2 Verdana, Geneva, sans-serif;
  44. font-weight: bold;
  45. text-align: left;
  46. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  47. }
  48. </style>
  49. <script type="text/javascript">
  50. hs.graphicsDir = '<%=request.getContextPath()%>/resource/plugin/highslide/graphics/';
  51. hs.outlineType = 'rounded-white';
  52. hs.wrapperClassName = 'draggable-header';
  53. var options;
  54. var chart;
  55. var windfarm = '<s:property value="windfarm"/>'
  56. function thisPage() {
  57. $("#f1").attr("action", "curvedeviationmonthindex.action").submit();
  58. }
  59. function queryClear() {
  60. $("#windfarm").val("");
  61. $("#beginDate").val("");
  62. }
  63. function queryData() {
  64. var windfarm = $("#windfarm").val();
  65. var year = $("#year").val();
  66. var month = $("#month").val();
  67. if ("" == windfarm) {
  68. alert("请选择风场!");
  69. } else if ("" == year) {
  70. alert("请选择年份!");
  71. } else if ("" == month) {
  72. alert("请选择月份!");
  73. } else {
  74. /*var temp = "curvedeviationmonthlist.action?windfarm=" + windfarm + "&year="
  75. + year + "&month=" + month;
  76. var url = encodeURI(encodeURI(temp));
  77. $("#gridTable").setGridParam({url:url}).trigger("reloadGrid"); */
  78. $("#gridTable").jqGrid('GridUnload');
  79. showJqGrid();
  80. }
  81. }
  82. function toExcel() {
  83. var windfarm = $("#windfarm").val();
  84. var year = $("#year").val();
  85. var month = $("#month").val();
  86. if ("" == windfarm) {
  87. alert("请选择风场!");
  88. } else if ("" == year) {
  89. alert("请选择年份!");
  90. } else if ("" == month) {
  91. alert("请选择月份!");
  92. } else {
  93. var temp = "curveMonthExcel.action?windfarm=" + windfarm + "&year="
  94. + year + "&month=" + month;
  95. var url = encodeURI(encodeURI(temp));
  96. $('#toexcel').attr('href',url);
  97. }
  98. }
  99. $(document).ready(function () {
  100. showJqGrid();
  101. options = {
  102. chart : {
  103. renderTo : 'container',
  104. type : 'spline'
  105. },
  106. title : {
  107. text : '曲线偏差率排行'
  108. },
  109. xAxis : {
  110. categories : [],
  111. labels : {
  112. rotation : -45,
  113. align : 'right',
  114. style : {
  115. fontSize : '13px',
  116. fontFamily : 'Verdana, sans-serif'
  117. }
  118. }
  119. },
  120. yAxis : {
  121. title : {
  122. text : '功率(MW)'
  123. }
  124. },
  125. tooltip : {
  126. headerFormat : '<b>{series.name}</b><br/>',
  127. pointFormat : ' {point.y}MW'
  128. },
  129. plotOptions : {
  130. spline : {
  131. marker : {
  132. enable : false
  133. }
  134. }
  135. },
  136. series: [{
  137. name: '',
  138. data: []
  139. }, {
  140. name: '',
  141. data: []
  142. }]
  143. }
  144. });
  145. function showJqGrid() {
  146. var windfarm = $("#windfarm").val();
  147. var year = $("#year").val();
  148. var month = $("#month").val();
  149. var temp = "curvedeviationmonthlist.action?windfarm=" + windfarm + "&year="
  150. + year + "&month=" + month;
  151. var url = encodeURI(encodeURI(temp));
  152. var id = 'gridTable';
  153. var datatype = 'json';
  154. var colNames = ['风机','编号', '实际与保证偏差率(%)','实际与最优偏差率(%)','最优与保证偏差率(%)','环比','同比','比标杆风机'];
  155. var colModel = [
  156. { name: 'windturbineid', index: 'windturbineid', width: 200, align: 'center',hidden : true},
  157. { name: 'code', index: 'code', width: 80, align: 'center'},
  158. { name: 'deviationrate2', index: 'deviationrate2', width: 200, align: 'center'},
  159. { name: 'deviationrate1', index: 'deviationrate1', width: 200, align: 'center'},
  160. { name: 'deviationrate3', index: 'deviationrate3', width: 200, align: 'center'},
  161. { name: 'monthdeviationrate', index: 'monthdeviationrate', width: 200, align: 'center'},
  162. { name: 'yeardeviationrate', index: 'yeardeviationrate', width: 200, align: 'center'},
  163. { name: 'standarddeviationrate', index: 'standarddeviationrate', width: 200, align: 'center'}
  164. ];
  165. var caption = '月曲线偏差率排行榜';
  166. var sortname = 'deviationrate2';
  167. var gridPagerID ='gridPager';
  168. var sortorder='desc';
  169. var height='auto';
  170. var width='auto';
  171. var rownumbers=true;
  172. var multiselect=false;
  173. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  174. multiselect,rownumbers);
  175. }
  176. function detail(windturbineid, type) {
  177. chartAjax(windturbineid,type);
  178. }
  179. function showDiv1() {
  180. var hc = $("#container");
  181. // return hs.htmlExpand(obj, {
  182. return hs.htmlExpand(hc[0], {
  183. contentId : 'showDiv2',
  184. width : 1370,
  185. height : 500,
  186. align : 'center',
  187. headingText : '月曲线偏差率排行'
  188. });
  189. }
  190. function chartAjax(windturbineid,type) {
  191. var year=$("#year").val();
  192. var month=$("#month").val();
  193. var url = "";
  194. if (type == 'tb') {
  195. url = "curvemonthchatAjaxtb.action?windturbineid=" + windturbineid
  196. +"&year="+year+"&month="+month+"&type="+type;
  197. } else if (type == 'hb') {
  198. url = "curvemonthchatAjaxhb.action?windturbineid=" + windturbineid
  199. +"&year="+year+"&month="+month+"&type="+type;
  200. } else if (type == 'bg') {
  201. url = "curvemonthchatAjaxbg.action?windturbineid=" + windturbineid
  202. +"&year="+year+"&month="+month+"&type="+type;
  203. } else {
  204. url = "curvemonthchatAjax.action?windturbineid=" + windturbineid
  205. +"&year="+year+"&month="+month+"&type="+type;
  206. }
  207. $.ajax( {
  208. url : url,
  209. type : "post",
  210. cache : false,
  211. dataType : "json",
  212. data : {},
  213. ifModified : false,
  214. success : function(result) {
  215. var sj = [];
  216. var zy = [];
  217. var fu = [];
  218. var name1=result["name1"];
  219. var name2=result["name2"];
  220. $.each(result["datas"], function(m, obj) {
  221. if (obj.value1 != null) {
  222. fu.push(parseFloat(obj.value1));
  223. }
  224. if (obj.value2 != null) {
  225. sj.push(parseFloat(obj.value2));
  226. }
  227. if (obj.value3 != null) {
  228. zy.push(parseFloat(obj.value3));
  229. }
  230. });
  231. options.series[0].data = sj;
  232. options.series[0].name = name1;
  233. options.series[1].data = zy;
  234. options.series[1].name = name2;
  235. options.xAxis.categories = fu;
  236. chart = new Highcharts.Chart(options);
  237. //alert(options.xAxis.categories);
  238. }
  239. });
  240. showDiv1();
  241. }
  242. </script>
  243. </head>
  244. <body>
  245. <form action="curveindex.action" method="post" id="f1">
  246. <br/>
  247. <fieldset style="height: 50px" id="fst">
  248. <legend class="item_Name">查询条件</legend>
  249. <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
  250. <tr>
  251. <th width="5%" class="item_Name">
  252. 风场:
  253. </th>
  254. <td width="20%">
  255. <s:select list="wps" cssStyle="width:150px" listKey="id"
  256. listValue="name" id="windfarm" name="windfarm" onchange="queryData()"></s:select>
  257. </td>
  258. <th width="5%" class="item_Name">
  259. 年份:
  260. </th>
  261. <td width="20%" style="text-align: left">
  262. <s:textfield cssClass="Wdate" cssStyle="width:150px"
  263. onFocus="WdatePicker({dateFmt:'yyyy',isShowWeek:true,readOnly:true})"
  264. id="year" name="year" title="年份" onchange="queryData()"/>
  265. </td>
  266. <th width="5%" class="item_Name">
  267. 月份:
  268. </th>
  269. <td width="20%" style="text-align: left">
  270. <s:textfield cssClass="Wdate" cssStyle="width:150px"
  271. onFocus="WdatePicker({dateFmt:'MM',isShowWeek:true,readOnly:true})"
  272. id="month" name="month" title="月份" onchange="queryData()"/>
  273. </td>
  274. <td width="200px" style="text-align: right">
  275. <a href="#" onclick="javascript:toExcel();" id="toexcel" class="url">导出</a>
  276. </td>
  277. </tr>
  278. </table>
  279. </fieldset>
  280. <br/>
  281. <table id='gridTable' >
  282. </table>
  283. <div id='gridPager'></div>
  284. <div class="highslide-html-content" id="showDiv2" style="height: 800">
  285. <div class="highslide-header">
  286. <ul>
  287. <li class="highslide-move">
  288. <a href="#" onclick="return false">Move</a>
  289. </li>
  290. <li class="highslide-close">
  291. <a href="#" onclick="return hs.close(this)"></a>
  292. </li>
  293. </ul>
  294. </div>
  295. <div id="container"
  296. style="background-color: '#ffffff'; vertical-align: middle; width: 100%; height: 100%"></div>
  297. </div>
  298. </form>
  299. </body>