wtscatter.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <%--<meta http-equiv="X-UA-Compatible" content="IE=7"></meta>--%>
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  8. <script type="text/javascript"
  9. src="<%=request.getContextPath()%>/resource/js/jquery-1.8.3.js">
  10. </script>
  11. <script
  12. src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js"
  13. type="text/javascript">
  14. </script>
  15. <link rel="stylesheet" type="text/css"
  16. href="<%=request.getContextPath()%>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  17. <script
  18. src="<%=request.getContextPath()%>/resource/js/echarts/echarts-all.js">
  19. </script>
  20. <link rel="stylesheet"
  21. href="<%=request.getContextPath()%>/resource/css/ztree/zTreeStyle.css"
  22. type="text/css">
  23. <script
  24. src="<%=request.getContextPath()%>/resource/js/ztree/jquery.ztree.all.min.js"
  25. type="text/javascript">
  26. </script>
  27. <style type="text/css">
  28. fieldset legend {
  29. color: #302A2A;
  30. font: bold 16px/ 2 Verdana, Geneva, sans-serif;
  31. font-weight: bold;
  32. text-align: left;
  33. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  34. }
  35. .normal {
  36. border-right-style: solid;
  37. border-bottom-style: solid;
  38. border-left-style: solid;
  39. border-top-style: solid;
  40. border-top-color: #ffffff;
  41. border-left-color: #f1f1f1;
  42. border-right-color: #f1f1f1;
  43. border-bottom-color: #f1f1f1;
  44. border-width: 1px;
  45. width: 100px;
  46. height: 28px;
  47. float: left;
  48. margin-top: -1px;
  49. cursor: pointer;
  50. text-align: center;
  51. line-height: 28px;
  52. overflow: hidden;
  53. font-weight: bold;
  54. font-size: 12px;
  55. font-family: tahoma, arial, verdana, sans-serif;
  56. }
  57. .disable {
  58. border-right-style: solid;
  59. border-bottom-style: solid;
  60. border-left-style: solid;
  61. border-top-style: solid;
  62. border-top-color: #f1f1f1;
  63. border-left-color: #f1f1f1;
  64. border-right-color: #f1f1f1;
  65. border-bottom-color: #f1f1f1;
  66. border-width: 1px;
  67. width: 100px;
  68. height: 25px;
  69. float: left;
  70. margin-top: -1px;
  71. cursor: pointer;
  72. text-align: center;
  73. background-color: #e1e1e1;
  74. line-height: 25px;
  75. overflow: hidden;
  76. font-weight: bold;
  77. font-size: 12px;
  78. font-family: tahoma, arial, verdana, sans-serif;
  79. }
  80. .panelcontainer {
  81. width: 100%;
  82. height: 70px;
  83. border-style: solid;
  84. border-color: #f1f1f1;
  85. border-width: 1px;
  86. }
  87. .panelquery {
  88. width: 100%;
  89. height: 25px;
  90. background-color: #f1f1f1;
  91. line-height: 25px;
  92. }
  93. .panelquerytext {
  94. margin-left: 3px;
  95. font-weight: bold;
  96. font-size: 12px;
  97. font-family: tahoma, arial, verdana, sans-serif;
  98. }
  99. .querycondcontainer {
  100. line-height: 39px;
  101. padding: 3px;
  102. float: left;
  103. font-size: 12px;
  104. }
  105. a { /* 统一设置所以样式 */
  106. font-family: Arial;
  107. font-size: 12px;
  108. text-align: center;
  109. margin: 3px;
  110. }
  111. a:link,a:visited { /* 超链接正常状态、被访问过的样式 */
  112. color: #000000;
  113. padding: 4px 10px 4px 10px;
  114. background-color: #f1f1f1;
  115. text-decoration: none;
  116. border-top: 1px solid #EEEEEE; /* 边框实现阴影效果 */
  117. border-left: 1px solid #EEEEEE;
  118. border-bottom: 1px solid #717171;
  119. border-right: 1px solid #717171;
  120. }
  121. a:hover { /* 鼠标指针经过时的超链接 */
  122. color: #821818; /* 改变文字颜色 */
  123. padding: 5px 8px 3px 12px; /* 改变文字位置 */
  124. background-color: #e2c4c9; /* 改变背景色 */
  125. border-top: 1px solid #717171; /* 边框变换,实现“按下去”的效果 */
  126. border-left: 1px solid #717171;
  127. border-bottom: 1px solid #EEEEEE;
  128. border-right: 1px solid #EEEEEE;
  129. }
  130. </style>
  131. <script type="text/javascript">
  132. var queryType = "fc";
  133. var setting = {
  134. check : {
  135. enable : true,
  136. chkStyle : "radio"
  137. },
  138. view : {
  139. dblClickExpand : false
  140. },
  141. data : {
  142. simpleData : {
  143. enable : true
  144. }
  145. },
  146. callback : {
  147. beforeClick : beforeClickWindfarm,
  148. onCheck : selectWindfarm
  149. },
  150. async : {
  151. enable : true,
  152. url : "../power/windfarmAjax.action",
  153. dataType : "json"
  154. }
  155. };
  156. function beforeClickWindfarm(treeId, treeNode) {
  157. var zTree = $.fn.zTree.getZTreeObj(treeId);
  158. zTree.checkNode(treeNode, !treeNode.checked, null, true);
  159. return false;
  160. }
  161. function showWindfarm() {
  162. var cityObj = $("#wpId");
  163. var cityOffset = $("#wpId").offset();
  164. $("#menuWindfarm").css( {
  165. left : cityOffset.left + "px",
  166. top : cityOffset.top + cityObj.outerHeight() + "px"
  167. }).slideDown("fast");
  168. $("body").bind("mousedown", onBodyDown);
  169. }
  170. function showWt() {
  171. if (wpids == "") {
  172. alert("请选择风场!");
  173. return;
  174. }
  175. var setting1 = {
  176. check : {
  177. enable : true,
  178. chkStyle : "radio"
  179. },
  180. view : {
  181. dblClickExpand : false
  182. },
  183. data : {
  184. simpleData : {
  185. enable : true
  186. }
  187. },
  188. callback : {
  189. beforeClick : beforeClickWindfarm,
  190. onCheck : selectWt
  191. },
  192. async : {
  193. enable : true,
  194. url : "../power/wtAjax.action?wpIds=" + wpids,
  195. dataType : "json"
  196. }
  197. };
  198. $.fn.zTree.init($("#treeWt"), setting1);
  199. var cityObj = $("#wtId");
  200. var cityOffset = $("#wtId").offset();
  201. $("#menuWt").css( {
  202. left : cityOffset.left + "px",
  203. top : cityOffset.top + cityObj.outerHeight() + "px"
  204. }).slideDown("fast");
  205. $("body").bind("mousedown", onBodyDown);
  206. wtIds = '';
  207. $("#wtId").val("");
  208. //$("#menuWindfarm").fadeOut("fas
  209. }
  210. function hideMenuWindfarm() {
  211. $("#menuWindfarm").fadeOut("fast");
  212. }
  213. var wpids = "";
  214. function selectWindfarm(e, treeId, treeNode) {
  215. var zTree = $.fn.zTree.getZTreeObj("treeWindfarm"), nodes = zTree
  216. .getCheckedNodes(true);
  217. v = "";
  218. d = "";
  219. for ( var i = 0, l = nodes.length; i < l; i++) {
  220. v += nodes[i].name + ",";
  221. d += nodes[i].id + ",";
  222. }
  223. if (v.length > 0)
  224. v = v.substring(0, v.length - 1);
  225. if (d.length > 0)
  226. d = d.substring(0, d.length - 1);
  227. wpids = d;
  228. var cityObj = $("#wpId");
  229. cityObj.attr("value", v);
  230. pjIds = '';
  231. $("#wtId").val("");
  232. $("#wtId").val("");
  233. //$("#menuWindfarm").fadeOut("fast");
  234. }
  235. var wtIds = "";
  236. function selectWt(e, treeId, treeNode) {
  237. var zTree = $.fn.zTree.getZTreeObj("treeWt"), nodes = zTree
  238. .getCheckedNodes(true);
  239. v = "";
  240. d = "";
  241. for ( var i = 0, l = nodes.length; i < l; i++) {
  242. v += nodes[i].name + ",";
  243. d += nodes[i].id + ",";
  244. }
  245. if (v.length > 0)
  246. v = v.substring(0, v.length - 1);
  247. if (d.length > 0)
  248. d = d.substring(0, d.length - 1);
  249. wtIds = d;
  250. var cityObj = $("#wtId");
  251. cityObj.attr("value", v);
  252. //$("#menuXl").fadeOut("fast");
  253. }
  254. function hideMenuWt() {
  255. $("#menuWt").fadeOut("fast");
  256. }
  257. function onBodyDown(event) {
  258. if ((event.target.id != "wpId" && event.target.id != "menuWindfarm" && $(
  259. event.target).parents("#menuWindfarm").length <= 0)) {
  260. hideMenuWindfarm();
  261. }
  262. if (!(event.target.id == "wtId" || event.target.id == "menuWt" || $(
  263. event.target).parents("#menuWt").length > 0)) {
  264. hideMenuWt();
  265. }
  266. }
  267. $(document).ready(function() {
  268. $.fn.zTree.init($("#treeWindfarm"), setting);
  269. });
  270. </script>
  271. </head>
  272. <body>
  273. <form action="pjscatterIndex.action" method="post" id="f1">
  274. <fieldset style="height: 60px" id="fst">
  275. <legend class="item_Name">
  276. 查询条件
  277. </legend>
  278. <div class="panelcontainer" style="width: 1620px;">
  279. <div class="querycondcontainer">
  280. 风场:
  281. <input id="wpId" type="text" readonly value=""
  282. style="width: 150px;" onclick="showWindfarm();" />
  283. </div>
  284. <div id="pjpanel" class="querycondcontainer">
  285. 风机:
  286. <input id="wtId" type="text" readonly value=""
  287. style="width: 150px;" onclick="showWt();" />
  288. </div>
  289. <div class="querycondcontainer">
  290. 年份:
  291. <s:textfield cssClass="Wdate"
  292. onFocus="WdatePicker({dateFmt:'yyyy',isShowWeek:true,readOnly:true})"
  293. id="year" name="year" title="年份" />
  294. </div>
  295. <div class="querycondcontainer">
  296. 月份:
  297. <s:textfield cssClass="Wdate"
  298. onFocus="WdatePicker({dateFmt:'MM',isShowWeek:true,readOnly:true})"
  299. id="month" name="month" title="月份" />
  300. </div>
  301. <div
  302. style="float: left; line-height: 39px; margin-left: 20px; width: 80px;">
  303. <input type="button" value="查询" onClick="queryData()" />
  304. </div>
  305. </div>
  306. </fieldset>
  307. <br />
  308. <div id="main"
  309. style="height: 700px; border: 1px solid #ccc; padding: 10px;"></div>
  310. <div id="menuWindfarm" class="menuContent"
  311. style="overflow-y: scroll; overflow-x: auto; z-index: 9999; border: 1px solid #617775; background: #f0f6e4; display: none; position: absolute;">
  312. <ul id="treeWindfarm" class="ztree"
  313. style="margin-top: 0; width: 180px; height: 300px;"></ul>
  314. </div>
  315. <div id="menuWt" class="menuContent"
  316. style="overflow-y: scroll; overflow-x: auto; z-index: 9999; border: 1px solid #617775; background: #f0f6e4; display: none; position: absolute;">
  317. <ul id="treeWt" class="ztree"
  318. style="margin-top: 0; width: 180px; height: 300px;"></ul>
  319. </div>
  320. <script type="text/javascript">
  321. // Step:3 echarts & zrender as a Global Interface by the echarts-plain.js.
  322. // Step:3 echarts和zrender被echarts-plain.js写入为全局接口
  323. var myChart = echarts.init(document.getElementById('main'));
  324. var option = {
  325. title : {
  326. text : '风机功率风速排布情况'
  327. },
  328. tooltip : {
  329. trigger : 'axis',
  330. showDelay : 0,
  331. formatter : function(params) {
  332. if (params.value.length > 0) {
  333. return params.seriesName + ' :<br/>' + params.value[0] + 'kw ';
  334. } else {
  335. return params.seriesName + ' :<br/>' + params.value + 'kw ';
  336. }
  337. },
  338. axisPointer : {
  339. show : true,
  340. type : 'cross',
  341. lineStyle : {
  342. type : 'dashed',
  343. width : 1
  344. }
  345. }
  346. },
  347. legend : {
  348. data : [ '功率' ]
  349. },
  350. toolbox : {
  351. show : true,
  352. feature : {
  353. mark : {
  354. show : true
  355. },
  356. dataZoom : {
  357. show : true
  358. },
  359. dataView : {
  360. show : true,
  361. readOnly : false
  362. },
  363. restore : {
  364. show : true
  365. },
  366. saveAsImage : {
  367. show : true
  368. }
  369. }
  370. },
  371. xAxis : [ {
  372. type : 'value',
  373. scale : true,
  374. splitNumber:25,
  375. axisLabel : {
  376. formatter : '{value} m/s'
  377. }
  378. } ],
  379. yAxis : [ {
  380. type : 'value',
  381. scale : true,
  382. axisLabel : {
  383. formatter : '{value} kw'
  384. }
  385. } ],
  386. series : [ {
  387. name : '功率',
  388. type : 'scatter',
  389. large : true,
  390. data : [],
  391. markPoint : {
  392. data : [ {
  393. type : 'max',
  394. name : '最大值'
  395. }, {
  396. type : 'min',
  397. name : '最小值'
  398. } ]
  399. },
  400. markLine : {
  401. data : [ {
  402. type : 'average',
  403. name : '平均值'
  404. } ]
  405. }
  406. } ]
  407. };
  408. // 使用刚指定的配置项和数据显示图表。
  409. //queryData();
  410. function findscatter() {
  411. var wpId = wpids;
  412. var wtId = wtIds;
  413. var year = $("#year").val();
  414. var month = $("#month").val();
  415. var url = "/scatter/scatterWtAjax.action?wpId=" + wpId + "&year=" + year
  416. + "&month=" + month + "&wtId=" + wtId;
  417. $.ajax( {
  418. url : url,
  419. type : "post",
  420. cache : false,
  421. dataType : "json",
  422. async : false,
  423. data : {},
  424. ifModified : false,
  425. success : function(result) {
  426. // 使用刚指定的配置项和数据显示图表。
  427. option.series[0].data = result;
  428. myChart.setOption(option);
  429. //options1.series[0].data = result;
  430. //chart1 = new Highcharts.Chart(options1);
  431. }
  432. });
  433. }
  434. function queryData() {
  435. if ("" == $("#wpId").val()) {
  436. alert("请选择风场!");
  437. } else if ("" == $("#wtId").val()) {
  438. alert("请选择风机!");
  439. } else if ("" == $("#year").val()) {
  440. alert("请选择年份!");
  441. } else if ("" == $("#month").val()) {
  442. alert("请选择月份!");
  443. } else {
  444. findscatter();
  445. }
  446. }
  447. </script>
  448. </form>
  449. </body>