pjscatter.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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 showProject() {
  171. if (wpids == "") {
  172. alert("请选择风场!");
  173. return;
  174. }
  175. var setting3 = {
  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 : selectPj
  191. },
  192. async : {
  193. enable : true,
  194. url : "../power/projectAjax.action?wpIds=" + wpids,
  195. dataType : "json"
  196. }
  197. };
  198. $.fn.zTree.init($("#treePj"), setting3);
  199. var cityObj = $("#pjId");
  200. var cityOffset = $("#pjId").offset();
  201. $("#menuPj").css( {
  202. left : cityOffset.left + "px",
  203. top : cityOffset.top + cityObj.outerHeight() + "px"
  204. }).slideDown("fast");
  205. $("body").bind("mousedown", onBodyDown);
  206. pjIds = '';
  207. $("#pjId").val("");
  208. }
  209. function hideMenuWindfarm() {
  210. $("#menuWindfarm").fadeOut("fast");
  211. }
  212. var wpids = "";
  213. function selectWindfarm(e, treeId, treeNode) {
  214. var zTree = $.fn.zTree.getZTreeObj("treeWindfarm"), nodes = zTree
  215. .getCheckedNodes(true);
  216. v = "";
  217. d = "";
  218. for ( var i = 0, l = nodes.length; i < l; i++) {
  219. v += nodes[i].name + ",";
  220. d += nodes[i].id + ",";
  221. }
  222. if (v.length > 0)
  223. v = v.substring(0, v.length - 1);
  224. if (d.length > 0)
  225. d = d.substring(0, d.length - 1);
  226. wpids = d;
  227. var cityObj = $("#wpId");
  228. cityObj.attr("value", v);
  229. pjIds = '';
  230. $("#pjId").val("");
  231. $("#line").val("");
  232. //$("#menuWindfarm").fadeOut("fast");
  233. }
  234. var pjIds;
  235. function selectPj(e, treeId, treeNode) {
  236. var zTree = $.fn.zTree.getZTreeObj("treePj"), nodes = zTree
  237. .getCheckedNodes(true);
  238. v = "";
  239. d = "";
  240. for ( var i = 0, l = nodes.length; i < l; i++) {
  241. v += nodes[i].name + ",";
  242. d += nodes[i].id + ",";
  243. }
  244. if (v.length > 0)
  245. v = v.substring(0, v.length - 1);
  246. if (d.length > 0)
  247. d = d.substring(0, d.length - 1);
  248. pjIds = d;
  249. var cityObj = $("#pjId");
  250. cityObj.attr("value", v);
  251. //$("#menuXl").fadeOut("fast");
  252. }
  253. function hideMenuPj() {
  254. $("#menuPj").fadeOut("fast");
  255. }
  256. function onBodyDown(event) {
  257. if ((event.target.id != "wpId" && event.target.id != "menuWindfarm" && $(
  258. event.target).parents("#menuWindfarm").length <= 0)) {
  259. hideMenuWindfarm();
  260. }
  261. if (!(event.target.id == "pjId" || event.target.id == "menuPj" || $(
  262. event.target).parents("#menuPj").length > 0)) {
  263. hideMenuPj();
  264. }
  265. }
  266. $(document).ready(function() {
  267. $.fn.zTree.init($("#treeWindfarm"), setting);
  268. });
  269. </script>
  270. </head>
  271. <body>
  272. <form action="pjscatterIndex.action" method="post" id="f1">
  273. <fieldset style="height: 60px" id="fst">
  274. <legend class="item_Name">
  275. 查询条件
  276. </legend>
  277. <div class="panelcontainer" style="width: 1620px;">
  278. <div class="querycondcontainer">
  279. 风场:
  280. <input id="wpId" type="text" readonly value=""
  281. style="width: 150px;" onclick="showWindfarm();" />
  282. </div>
  283. <div id="pjpanel" class="querycondcontainer">
  284. 项目:
  285. <input id="pjId" type="text" readonly value=""
  286. style="width: 150px;" onclick="showProject();" />
  287. </div>
  288. <div class="querycondcontainer">
  289. 年份:
  290. <s:textfield cssClass="Wdate"
  291. onFocus="WdatePicker({dateFmt:'yyyy',isShowWeek:true,readOnly:true})"
  292. id="year" name="year" title="年份" />
  293. </div>
  294. <div class="querycondcontainer">
  295. 月份:
  296. <s:textfield cssClass="Wdate"
  297. onFocus="WdatePicker({dateFmt:'MM',isShowWeek:true,readOnly:true})"
  298. id="month" name="month" title="月份" />
  299. </div>
  300. <div
  301. style="float: left; line-height: 39px; margin-left: 20px; width: 80px;">
  302. <input type="button" value="查询" onClick="queryData()" />
  303. </div>
  304. </div>
  305. </fieldset>
  306. <br />
  307. <div id="main"
  308. style="height: 700px; border: 1px solid #ccc; padding: 10px;"></div>
  309. <div id="menuWindfarm" class="menuContent"
  310. style="overflow-y: scroll; overflow-x: auto; z-index: 9999; border: 1px solid #617775; background: #f0f6e4; display: none; position: absolute;">
  311. <ul id="treeWindfarm" class="ztree"
  312. style="margin-top: 0; width: 180px; height: 300px;"></ul>
  313. </div>
  314. <div id="menuPj" class="menuContent"
  315. style="overflow-y: scroll; overflow-x: auto; z-index: 9999; border: 1px solid #617775; background: #f0f6e4; display: none; position: absolute;">
  316. <ul id="treePj" class="ztree"
  317. style="margin-top: 0; width: 180px; height: 300px;"></ul>
  318. </div>
  319. <script type="text/javascript">
  320. // Step:3 echarts & zrender as a Global Interface by the echarts-plain.js.
  321. // Step:3 echarts和zrender被echarts-plain.js写入为全局接口
  322. var myChart = echarts.init(document.getElementById('main'));
  323. var option = {
  324. title : {
  325. text : '项目功率风速排布情况'
  326. },
  327. tooltip : {
  328. trigger : 'axis',
  329. showDelay : 0,
  330. formatter : function(params) {
  331. if (params.value.length > 0) {
  332. return params.seriesName + ' :<br/>' + params.value[0] + '万kw ';
  333. } else {
  334. return params.seriesName + ' :<br/>' + params.value + '万kw ';
  335. }
  336. },
  337. axisPointer : {
  338. show : true,
  339. type : 'cross',
  340. lineStyle : {
  341. type : 'dashed',
  342. width : 1
  343. }
  344. }
  345. },
  346. legend : {
  347. data : [ '功率' ]
  348. },
  349. toolbox : {
  350. show : true,
  351. feature : {
  352. mark : {
  353. show : true
  354. },
  355. dataZoom : {
  356. show : true
  357. },
  358. dataView : {
  359. show : true,
  360. readOnly : false
  361. },
  362. restore : {
  363. show : true
  364. },
  365. saveAsImage : {
  366. show : true
  367. }
  368. }
  369. },
  370. xAxis : [ {
  371. type : 'value',
  372. scale : true,
  373. splitNumber:25,
  374. axisLabel : {
  375. formatter : '{value} m/s'
  376. }
  377. } ],
  378. yAxis : [ {
  379. type : 'value',
  380. scale : true,
  381. axisLabel : {
  382. formatter : '{value} 万kw'
  383. }
  384. } ],
  385. series : [ {
  386. name : '功率',
  387. type : 'scatter',
  388. large : true,
  389. data : [],
  390. markPoint : {
  391. data : [ {
  392. type : 'max',
  393. name : '最大值'
  394. }, {
  395. type : 'min',
  396. name : '最小值'
  397. } ]
  398. },
  399. markLine : {
  400. data : [ {
  401. type : 'average',
  402. name : '平均值'
  403. } ]
  404. }
  405. } ]
  406. };
  407. // 使用刚指定的配置项和数据显示图表。
  408. //queryData();
  409. function findscatter() {
  410. var wpId = wpids;
  411. var pjId = pjIds;
  412. var year = $("#year").val();
  413. var month = $("#month").val();
  414. var url = "/scatter/scatterAjax.action?wpId=" + wpId + "&year=" + year
  415. + "&month=" + month + "&pjId=" + pjId;
  416. $.ajax( {
  417. url : url,
  418. type : "post",
  419. cache : false,
  420. dataType : "json",
  421. async : false,
  422. data : {},
  423. ifModified : false,
  424. success : function(result) {
  425. // 使用刚指定的配置项和数据显示图表。
  426. option.series[0].data = result;
  427. myChart.setOption(option);
  428. //options1.series[0].data = result;
  429. //chart1 = new Highcharts.Chart(options1);
  430. }
  431. });
  432. }
  433. function queryData() {
  434. if ("" == $("#wpId").val()) {
  435. alert("请选择风场!");
  436. } else if ("" == $("#pjId").val()) {
  437. alert("请选择项目!");
  438. } else if ("" == $("#year").val()) {
  439. alert("请选择年份!");
  440. } else if ("" == $("#month").val()) {
  441. alert("请选择月份!");
  442. } else {
  443. findscatter();
  444. }
  445. }
  446. </script>
  447. </form>
  448. </body>