lnscatter.jsp 11 KB

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