powercompare.jsp 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  1. <%@ page language="java" contentType="text/html;charset=utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <head>
  4. <script src="<%=request.getContextPath() %>/resource/js/highcharts/highcharts.js" type="text/javascript"></script>
  5. <script src="<%=request.getContextPath() %>/resource/js/highcharts/themes/grid.js" type="text/javascript"></script>
  6. <link rel="stylesheet" href="<%=request.getContextPath() %>/resource/css/ztree/zTreeStyle.css" type="text/css">
  7. <script src="<%=request.getContextPath() %>/resource/js/ztree/jquery.ztree.all.min.js" type="text/javascript"></script>
  8. <!-- dialog begin -->
  9. <link rel="stylesheet" href="<%=request.getContextPath() %>/resource/js/dialog/dialog.css" type="text/css"></link>
  10. <link rel="stylesheet" href="<%=request.getContextPath() %>/resource/js/dialog/ibutton.css" type="text/css"></link>
  11. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/dialog/jquery.box.js"></script>
  12. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/dialog/jquery.dialog.js"></script>
  13. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/dialog/jquery.ibutton.js"></script>
  14. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/dialog/jquery.ishadow.js"></script>
  15. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/dialog/jquery.scrollbarwidth.js"></script>
  16. <script src="<%=request.getContextPath() %>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  17. <!-- dialog end -->
  18. <style type="text/css">
  19. .normal {
  20. border-right-style: solid;
  21. border-bottom-style: solid;
  22. border-left-style: solid;
  23. border-top-style:solid;
  24. border-top-color:#ffffff;
  25. border-left-color:#f1f1f1;
  26. border-right-color:#f1f1f1;
  27. border-bottom-color:#f1f1f1;
  28. border-width: 1px;
  29. width:100px;
  30. height:28px;
  31. float:left;
  32. margin-top:-1px;
  33. cursor:pointer;
  34. text-align:center;
  35. line-height:28px;
  36. overflow:hidden;
  37. font-weight:bold;
  38. font-size: 12px;
  39. font-family: tahoma,arial,verdana,sans-serif;
  40. }
  41. .disable {
  42. border-right-style: solid;
  43. border-bottom-style: solid;
  44. border-left-style: solid;
  45. border-top-style:solid;
  46. border-top-color:#f1f1f1;
  47. border-left-color:#f1f1f1;
  48. border-right-color:#f1f1f1;
  49. border-bottom-color:#f1f1f1;
  50. border-width: 1px;
  51. width:100px;
  52. height:25px;
  53. float:left;
  54. margin-top:-1px;
  55. cursor:pointer;
  56. text-align:center;
  57. background-color:#e1e1e1;
  58. line-height:25px;
  59. overflow:hidden;
  60. font-weight:bold;
  61. font-size: 12px;
  62. font-family: tahoma,arial,verdana,sans-serif;
  63. }
  64. .panelcontainer {
  65. width: 100%;
  66. height: 70px;
  67. border-style: solid;
  68. border-color: #f1f1f1;
  69. border-width:1px;
  70. }
  71. .panelquery {
  72. width:100%;
  73. height:25px;
  74. background-color:#f1f1f1;
  75. line-height:25px;
  76. }
  77. .panelquerytext {
  78. margin-left:3px;
  79. font-weight:bold;
  80. font-size: 12px;
  81. font-family: tahoma,arial,verdana,sans-serif;
  82. }
  83. .querycondcontainer {
  84. line-height:39px;
  85. padding:3px;
  86. float:left;
  87. font-size: 12px;
  88. }
  89. a{ /* 统一设置所以样式 */
  90. font-family:Arial;
  91. font-size:12px;
  92. text-align:center;
  93. margin:3px;
  94. }
  95. a:link,a:visited{ /* 超链接正常状态、被访问过的样式 */
  96. color:#000000;
  97. padding:4px 10px 4px 10px;
  98. background-color:#f1f1f1;
  99. text-decoration:none;
  100. border-top:1px solid #EEEEEE; /* 边框实现阴影效果 */
  101. border-left:1px solid #EEEEEE;
  102. border-bottom:1px solid #717171;
  103. border-right:1px solid #717171;
  104. }
  105. a:hover{ /* 鼠标指针经过时的超链接 */
  106. color:#821818; /* 改变文字颜色 */
  107. padding:5px 8px 3px 12px; /* 改变文字位置 */
  108. background-color:#e2c4c9; /* 改变背景色 */
  109. border-top:1px solid #717171; /* 边框变换,实现“按下去”的效果 */
  110. border-left:1px solid #717171;
  111. border-bottom:1px solid #EEEEEE;
  112. border-right:1px solid #EEEEEE;
  113. }
  114. </style>
  115. <script type="text/javascript">
  116. var queryType="fc";
  117. var setting = {
  118. check: {
  119. enable: true,
  120. chkStyle:"radio"
  121. },
  122. view: {
  123. dblClickExpand: false
  124. },
  125. data: {
  126. simpleData: {
  127. enable: true
  128. }
  129. },
  130. callback: {
  131. beforeClick: beforeClickWindfarm,
  132. onCheck: selectWindfarm
  133. },
  134. async: {
  135. enable: true,
  136. url:"windfarmAjax.action",
  137. dataType:"json"
  138. }
  139. };
  140. function beforeClickWindfarm(treeId, treeNode) {
  141. var zTree = $.fn.zTree.getZTreeObj(treeId);
  142. zTree.checkNode(treeNode, !treeNode.checked, null, true);
  143. return false;
  144. }
  145. function showWindfarm() {
  146. var cityObj = $("#windfarm");
  147. var cityOffset = $("#windfarm").offset();
  148. $("#menuWindfarm").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");
  149. $("body").bind("mousedown", onBodyDown);
  150. }
  151. function showWindturbine(){
  152. if(wpids==""){
  153. alert("请选择风场!");
  154. return;
  155. }
  156. var setting2 = {
  157. check: {
  158. enable: true,
  159. chkStyle:"radio"
  160. },
  161. view: {
  162. dblClickExpand: false
  163. },
  164. data: {
  165. simpleData: {
  166. enable: true
  167. }
  168. },
  169. callback: {
  170. beforeClick: beforeClickWindfarm,
  171. onCheck: selectFj
  172. },
  173. async: {
  174. enable: true,
  175. url:"fjAjax.action?wpIds="+wpids,
  176. dataType:"json"
  177. }
  178. };
  179. $.fn.zTree.init($("#treeFj"), setting2);
  180. var cityObj = $("#windturbine");
  181. var cityOffset = $("#windturbine").offset();
  182. $("#menuFj").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");
  183. $("body").bind("mousedown", onBodyDown);
  184. //$("#menuWindfarm").fadeOut("fas
  185. }
  186. function showLine(){
  187. if(wpids==""){
  188. alert("请选择风场!");
  189. return;
  190. }
  191. var setting1 = {
  192. check: {
  193. enable: true,
  194. chkStyle:"radio"
  195. //chkStyle:"checkbox"
  196. },
  197. view: {
  198. dblClickExpand: false
  199. },
  200. data: {
  201. simpleData: {
  202. enable: true
  203. }
  204. },
  205. callback: {
  206. beforeClick: beforeClickWindfarm,
  207. onCheck: selectXl
  208. },
  209. async: {
  210. enable: true,
  211. url:"lineAjax.action?wpIds="+wpids,
  212. dataType:"json"
  213. }
  214. };
  215. $.fn.zTree.init($("#treeXl"), setting1);
  216. var cityObj = $("#line");
  217. var cityOffset = $("#line").offset();
  218. $("#menuXl").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");
  219. $("body").bind("mousedown", onBodyDown);
  220. lines='';
  221. $("#line").val("");
  222. //$("#menuWindfarm").fadeOut("fas
  223. }
  224. function showProject(){
  225. if(wpids==""){
  226. alert("请选择风场!");
  227. return;
  228. }
  229. var setting3 = {
  230. check: {
  231. enable: true,
  232. //chkStyle:"radio"
  233. chkStyle:"checkbox"
  234. },
  235. view: {
  236. dblClickExpand: false
  237. },
  238. data: {
  239. simpleData: {
  240. enable: true
  241. }
  242. },
  243. callback: {
  244. beforeClick: beforeClickWindfarm,
  245. onCheck: selectPj
  246. },
  247. async: {
  248. enable: true,
  249. url:"projectAjax.action?wpIds="+wpids,
  250. dataType:"json"
  251. }
  252. };
  253. $.fn.zTree.init($("#treePj"), setting3);
  254. var cityObj = $("#project");
  255. var cityOffset = $("#project").offset();
  256. $("#menuPj").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");
  257. $("body").bind("mousedown", onBodyDown);
  258. pjIds='';
  259. $("#project").val("");
  260. }
  261. function hideMenuWindfarm() {
  262. $("#menuWindfarm").fadeOut("fast");
  263. }
  264. var wpids="";
  265. function selectWindfarm(e, treeId, treeNode) {
  266. var zTree = $.fn.zTree.getZTreeObj("treeWindfarm"),
  267. nodes = zTree.getCheckedNodes(true);
  268. v = "";
  269. d="";
  270. for (var i=0, l=nodes.length; i<l; i++) {
  271. v += nodes[i].name + ",";
  272. d+=nodes[i].id+",";
  273. }
  274. if (v.length > 0 ) v = v.substring(0, v.length-1);
  275. if (d.length > 0 ) d = d.substring(0, d.length-1);
  276. wpids=d;
  277. var cityObj = $("#windfarm");
  278. cityObj.attr("value", v);
  279. lineIds='';
  280. pjIds='';
  281. $("#project").val("");
  282. $("#line").val("");
  283. //$("#menuWindfarm").fadeOut("fast");
  284. }
  285. var lines="";
  286. function selectXl(e, treeId, treeNode){
  287. var zTree = $.fn.zTree.getZTreeObj("treeXl"),
  288. nodes = zTree.getCheckedNodes(true);
  289. v = "";
  290. d="";
  291. for (var i=0, l=nodes.length; i<l; i++) {
  292. v += nodes[i].name + ",";
  293. d+=nodes[i].id+",";
  294. }
  295. if (v.length > 0 ) v = v.substring(0, v.length-1);
  296. if (d.length > 0 ) d = d.substring(0, d.length-1);
  297. lines=d;
  298. var cityObj = $("#line");
  299. cityObj.attr("value", v);
  300. //$("#menuXl").fadeOut("fast");
  301. }
  302. var pjIds;
  303. function selectPj(e, treeId, treeNode){
  304. var zTree = $.fn.zTree.getZTreeObj("treePj"),
  305. nodes = zTree.getCheckedNodes(true);
  306. v = "";
  307. d="";
  308. for (var i=0, l=nodes.length; i<l; i++) {
  309. v += nodes[i].name + ",";
  310. d+=nodes[i].id+",";
  311. }
  312. if (v.length > 0 ) v = v.substring(0, v.length-1);
  313. if (d.length > 0 ) d = d.substring(0, d.length-1);
  314. pjIds=d;
  315. var cityObj = $("#project");
  316. cityObj.attr("value", v);
  317. //$("#menuXl").fadeOut("fast");
  318. }
  319. function hideMenuPj() {
  320. $("#menuPj").fadeOut("fast");
  321. }
  322. function hideMenuXl() {
  323. $("#menuXl").fadeOut("fast");
  324. }
  325. $(document).ready(function(){
  326. $.fn.zTree.init($("#treeWindfarm"), setting);
  327. });
  328. function swap(obj) {
  329. document.getElementById('fc').className = "disable";
  330. document.getElementById('pj').className = "disable";
  331. document.getElementById('xl').className = "disable";
  332. obj.className = "normal";
  333. /*document.getElementById('pjpanel').style.display = "none";
  334. document.getElementById('xlpanel').style.display = "none";*/
  335. document.getElementById('pjpanel').style.display = "";
  336. document.getElementById('xlpanel').style.display = "";
  337. if (obj.id == "pj") {
  338. queryType="pj";
  339. wpids="";
  340. pjIds="";
  341. lines="";
  342. $("#windfarm").val("");
  343. $("#project").val("");
  344. $("#line").val("");
  345. document.getElementById('pjpanel').style.display = "";
  346. queryApData();
  347. }
  348. else if (obj.id == "xl") {
  349. queryType="xl";
  350. wpids="";
  351. pjIds="";
  352. lines="";
  353. $("#windfarm").val("");
  354. $("#project").val("");
  355. $("#line").val("");
  356. document.getElementById('xlpanel').style.display = "";
  357. queryApData();
  358. }
  359. else{
  360. queryType="fc";
  361. wpids="";
  362. pjIds="";
  363. lines="";
  364. $("#windfarm").val("");
  365. $("#project").val("");
  366. $("#line").val("");
  367. queryApData();
  368. }
  369. }
  370. var chartfc;
  371. Highcharts.setOptions({
  372. global : {
  373. useUTC : false
  374. }
  375. });
  376. var optionsfc = {
  377. chart: {
  378. renderTo: 'container1',
  379. width:870,
  380. height:225,
  381. events: {
  382. load: function () {
  383. $(".aaa").parent().parent().css("left","50px");
  384. }
  385. }
  386. },
  387. title: {
  388. text: '风场绩效榜'
  389. },
  390. xAxis: [{
  391. categories: ['01号风机', '02号风机', '03号风机', '04号风机', '05号风机'],
  392. labels: {
  393. useHTML:true,
  394. formatter: function () {
  395. return "<div style=\"width:78px;text-align:center\">" +
  396. this.value + "</div>";
  397. }
  398. }
  399. },{
  400. categories: ['', '', '', '', ''],
  401. opposite: true
  402. }],
  403. yAxis:{ // Primary yAxis
  404. min: 0,
  405. title: {
  406. text: ''
  407. },
  408. stackLabels: {
  409. enabled: true,
  410. align:'right',
  411. useHTML: true,
  412. formatter: function(){
  413. //var html ="<div>";
  414. return "<div>"+parseFloat(fnlyl[d++])+"%</div>";
  415. //"<div style=\"width:200px;height:20px;text-align:right\"></div>"
  416. },
  417. style: {
  418. fontWeight: 'bold',
  419. color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray',
  420. width:'200px'
  421. }
  422. }
  423. },
  424. legend: {
  425. align: 'center',
  426. verticalAlign: 'top',
  427. margin:20,
  428. y:20,
  429. reversed: true
  430. },
  431. plotOptions: {
  432. series: {
  433. stacking: 'normal',
  434. dataLabels: {
  435. shape: 'callout',
  436. useHTML:true,
  437. backgroundColor: 'rgba(255, 255, 255, 0.75)',
  438. style: {
  439. color: '#000',
  440. textShadow: 'none'
  441. }
  442. }
  443. }
  444. /*,
  445. bar: {
  446. dataLabels: {
  447. enabled: true
  448. }
  449. }*/
  450. },
  451. series: [
  452. {
  453. type: 'bar',
  454. name: '性能损失',
  455. yAxis: 0,
  456. data: []
  457. ,
  458. stack: '2'
  459. },{
  460. type: 'bar',
  461. name: '受累损失',
  462. yAxis: 0,
  463. data: [],
  464. stack: '2'
  465. },
  466. {
  467. type: 'bar',
  468. name: '限电损失',
  469. yAxis: 0,
  470. data: []
  471. ,
  472. stack: '2'
  473. },{
  474. type: 'bar',
  475. name: '非计划检修损失',
  476. yAxis: 0,
  477. data: [],
  478. stack: '2'
  479. }, {
  480. type: 'bar',
  481. name: '计划检修损失',
  482. yAxis: 0,
  483. data: [],
  484. stack: '2'
  485. },{
  486. type: 'bar',
  487. name: '实发电量',
  488. yAxis: 0,
  489. data: [],
  490. stack: '2'
  491. }
  492. /*,{
  493. type: 'bar',
  494. name: '理论电量',
  495. yAxis: 0,
  496. data: [],
  497. stack: '3'
  498. }*/
  499. ,{
  500. type: 'line',
  501. inverted: true,
  502. xAxis: 1,
  503. yAxis: 0,
  504. color: '#000000',
  505. name: ' ',
  506. data: []
  507. }]
  508. };
  509. var fnlyl=[];
  510. var d=0;
  511. function getResultInfo(res)
  512. {
  513. if(res["sfdl"]!=null)
  514. {
  515. var yfdl=[];
  516. var sfdl=[];
  517. var gzdl=[];
  518. var whdl=[];
  519. var xddl=[];
  520. var qfdl=[];
  521. var sldl=[];
  522. var labels=[];
  523. var names=[];
  524. var names2=[];
  525. fnlyl=[];
  526. $.each(res["names"],function(m,obj){
  527. /* if(obj.length<8){
  528. for(var jj=0;jj<8-obj.length;jj++){
  529. obj=obj+" ";
  530. }
  531. } */
  532. names.push(obj);
  533. }
  534. );
  535. $.each(res["names2"],function(m,obj){
  536. names2.push(obj);
  537. }
  538. );
  539. $.each(res["yfdl"],function(m,obj){
  540. yfdl.push(parseFloat(obj));
  541. }
  542. );
  543. fnlyl=res["lyl"];
  544. d=0;
  545. $.each(res["lyl"],function(m,obj){
  546. fnlyl.push(parseFloat(obj));
  547. }
  548. );
  549. /*$.each(res["lyl"],function(m,obj){
  550. var object = new Object();
  551. object.y =parseFloat(obj);
  552. object.dataLabels=new Object();
  553. object.dataLabels.enabled=true;
  554. object.dataLabels.format=parseFloat(obj)+"<br>"+parseFloat(obj)
  555. object.dataLabels.align='right';
  556. object.dataLabels.verticalAlign='middle';
  557. object.dataLabels.x=80;
  558. object.dataLabels.style=new Object();
  559. object.dataLabels.style.position="absolute";
  560. object.dataLabels.style.left=80;
  561. labels.push(object);
  562. }
  563. );*/
  564. $.each(res["sfdl"],function(m,obj){
  565. sfdl.push(parseFloat(obj));
  566. }
  567. );
  568. $.each(res["gzdl"],function(m,obj){
  569. gzdl.push(parseFloat(obj));
  570. }
  571. );
  572. $.each(res["whdl"],function(m,obj){
  573. whdl.push(parseFloat(obj));
  574. }
  575. );
  576. $.each(res["xddl"],function(m,obj){
  577. xddl.push(parseFloat(obj));
  578. }
  579. );
  580. $.each(res["qfdl"],function(m,obj){
  581. qfdl.push(parseFloat(obj));
  582. }
  583. );
  584. $.each(res["sldl"],function(m,obj){
  585. sldl.push(parseFloat(obj));
  586. }
  587. );
  588. var num= names.length;
  589. if(num<4)
  590. {
  591. $("#powerframe").css("height",605*num+"px");
  592. $("#container1").css("height",66*num+"px");
  593. $("#container2").css("height",66*num+"px");
  594. optionsfc.chart.height=num*66;
  595. var top=67;
  596. var left=98;
  597. /* $("#zcontian").html("");
  598. for(var i=0;i<res["lyl"].length;i++ ){
  599. var obj=res["lyl"][i];
  600. top=top+31;
  601. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  602. $("#zcontian").append(div);
  603. }*/
  604. }else if(num<7)
  605. {
  606. $("#powerframe").css("height",45*num+"px");
  607. $("#container1").css("height",45*num+"px");
  608. $("#container2").css("height",45*num+"px");
  609. optionsfc.chart.height=num*44.6;
  610. var top=67;
  611. var left=98;
  612. /* $("#zcontian").html("");
  613. for(var i=0;i<res["lyl"].length;i++ ){
  614. var obj=res["lyl"][i];
  615. top=top+27.4;
  616. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  617. $("#zcontian").append(div);
  618. } */
  619. }else if(num<9)
  620. {
  621. $("#powerframe").css("height",45*num+"px");
  622. $("#container1").css("height",45*num+"px");
  623. $("#container2").css("height",45*num+"px");
  624. optionsfc.chart.height=num*38.6;
  625. var top=67;
  626. var left=98;
  627. /* $("#zcontian").html("");
  628. for(var i=0;i<res["lyl"].length;i++ ){
  629. var obj=res["lyl"][i];
  630. top=top+25.4;
  631. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  632. $("#zcontian").append(div);
  633. } */
  634. }else if(num<12)
  635. {
  636. $("#powerframe").css("height",45*num+"px");
  637. $("#container1").css("height",45*num+"px");
  638. $("#container2").css("height",45*num+"px");
  639. optionsfc.chart.height=num*38.6;
  640. var top=67;
  641. var left=98;
  642. /*$("#zcontian").html("");
  643. for(var i=0;i<res["lyl"].length;i++ ){
  644. var obj=res["lyl"][i];
  645. top=top+28.4;
  646. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  647. $("#zcontian").append(div);
  648. } */
  649. }else if(num<18)
  650. {
  651. $("#powerframe").css("height",45*num+"px");
  652. $("#container1").css("height",45*num+"px");
  653. $("#container2").css("height",45*num+"px");
  654. optionsfc.chart.height=num*38.6;
  655. var top=67;
  656. var left=98;
  657. /* $("#zcontian").html("");
  658. for(var i=0;i<res["lyl"].length;i++ ){
  659. var obj=res["lyl"][i];
  660. top=top+32.5;
  661. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  662. $("#zcontian").append(div);
  663. } */
  664. }else if(num<20)
  665. {
  666. $("#powerframe").css("height",45*num+"px");
  667. $("#container1").css("height",45*num+"px");
  668. $("#container2").css("height",45*num+"px");
  669. optionsfc.chart.height=num*35.6;
  670. var top=67;
  671. var left=98;
  672. /* $("#zcontian").html("");
  673. for(var i=0;i<res["lyl"].length;i++ ){
  674. var obj=res["lyl"][i];
  675. top=top+27.5;
  676. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  677. $("#zcontian").append(div);
  678. } */
  679. }else if(num<35)
  680. {
  681. $("#powerframe").css("height",45*num+"px");
  682. $("#container1").css("height",45*num+"px");
  683. $("#container2").css("height",45*num+"px");
  684. optionsfc.chart.height=num*35.6;
  685. var top=67;
  686. var left=98;
  687. /* $("#zcontian").html("");
  688. for(var i=0;i<res["lyl"].length;i++ ){
  689. var obj=res["lyl"][i];
  690. top=top+32.4;
  691. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  692. $("#zcontian").append(div);
  693. } */
  694. }else if(num<45)
  695. {
  696. optionsfc.chart.height=num*35.6;
  697. $("#powerframe").css("height",40*num+"px");
  698. $("#container1").css("height",40*num+"px");
  699. $("#container2").css("height",40*num+"px");
  700. var top=67;
  701. var left=98;
  702. /* $("#zcontian").html("");
  703. for(var i=0;i<res["lyl"].length;i++ ){
  704. var obj=res["lyl"][i];
  705. top=top+40.5;
  706. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  707. $("#zcontian").append(div);
  708. } */
  709. }else if(num<60)
  710. {
  711. $("#powerframe").css("height",40*num+"px");
  712. $("#container1").css("height",40*num+"px");
  713. $("#container2").css("height",40*num+"px");
  714. optionsfc.chart.height=num*35.6;
  715. var top=67;
  716. var left=98;
  717. /* $("#zcontian").html("");
  718. for(var i=0;i<res["lyl"].length;i++ ){
  719. var obj=res["lyl"][i];
  720. top=top+33.7;
  721. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  722. $("#zcontian").append(div);
  723. } */
  724. }else if(num<70)
  725. {
  726. optionsfc.chart.height=num*35.6;
  727. $("#powerframe").css("height",40*num+"px");
  728. $("#container1").css("height",40*num+"px");
  729. $("#container2").css("height",40*num+"px");
  730. var top=67;
  731. var left=98;
  732. /* $("#zcontian").html("");
  733. for(var i=0;i<res["lyl"].length;i++ ){
  734. var obj=res["lyl"][i];
  735. top=top+34.0;
  736. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  737. $("#zcontian").append(div);
  738. } */
  739. }else if(num<100)
  740. {
  741. $("#powerframe").css("height",50*num+"px");
  742. $("#container1").css("height",50*num+"px");
  743. $("#container2").css("height",50*num+"px");
  744. optionsfc.chart.height=num*35.6;
  745. var top=67;
  746. var left=98;
  747. /* $("#zcontian").html("");
  748. for(var i=0;i<res["lyl"].length;i++ ){
  749. var obj=res["lyl"][i];
  750. top=top+34.45;
  751. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  752. $("#zcontian").append(div);
  753. } */
  754. $(".null").css("left","540px");
  755. }else if(num<250)
  756. {
  757. $("#powerframe").css("height",50*num+"px");
  758. $("#container1").css("height",50*num+"px");
  759. $("#container2").css("height",50*num+"px");
  760. optionsfc.chart.height=num*35.51;
  761. var top=67;
  762. var left=98;
  763. /* $("#zcontian").html("");
  764. for(var i=0;i<res["lyl"].length;i++ ){
  765. var obj=res["lyl"][i];
  766. top=top+35.1;
  767. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  768. $("#zcontian").append(div);
  769. } */
  770. $(".null").css("left","540px");
  771. }else
  772. {
  773. optionsfc.chart.height=num*24.2;
  774. var top=54;
  775. var left=98;
  776. $("#zcontian").html("");
  777. /* for(var i=0;i<res["lyl"].length;i++ ){
  778. var obj=res["lyl"][i];
  779. top=top+27.5;
  780. var div="<Div id='lyldiv"+i+"' style='margin: 0px;border: 0px;padding: 0px;font-size: 12px;width:62px;height:22px;text-align: center;vertical-align: middle;background-image:url(/resource/images/system/pictures/jixiao_bg.fw.png);position: absolute;left:"+left+"px;top:"+top+"px;'>"+parseFloat(obj)+"%</Div>"
  781. $("#zcontian").append(div);
  782. } */
  783. $("#powerframe").css("height",45*num+"px");
  784. $("#container1").css("height",45*num+"px");
  785. $("#container2").css("height",45*num+"px");
  786. $(".null").css("left","540px");
  787. }
  788. optionsfc.series[0].data = qfdl;
  789. optionsfc.series[1].data = sldl;
  790. optionsfc.series[2].data = xddl;
  791. optionsfc.series[3].data = gzdl;
  792. optionsfc.series[4].data = whdl;
  793. optionsfc.series[5].data = sfdl;
  794. optionsfc.series[6].data = yfdl;
  795. //optionsfc.series[7].data = labels;
  796. //optionsfc.series[7].data = yfdl;
  797. optionsfc.xAxis[0].categories = names;
  798. optionsfc.xAxis[1].categories = names2;
  799. //optionsfc.yAxis[0].total=fnlyl;
  800. }else
  801. {
  802. optionsfc.series[0].data = [];
  803. optionsfc.series[1].data = [];
  804. optionsfc.series[2].data = [];
  805. optionsfc.series[3].data = [];
  806. optionsfc.series[4].data = [];
  807. optionsfc.series[5].data = [];
  808. optionsfc.series[6].data = [];
  809. //optionsfc.series[7].data = [];
  810. optionsfc.xAxis[0].categories = [];
  811. optionsfc.xAxis[1].categories = [];
  812. }
  813. chartfc = new Highcharts.Chart(optionsfc);
  814. //chartfc.reflow();
  815. setTimeout(todo,1000);
  816. //console.log(chartfc);
  817. }
  818. function todo(){
  819. var s=$(".highcharts-stack-labels");
  820. var dd=$(s).find("span");
  821. for(var i=0;i<dd.length;i++){
  822. var left=$(dd[i]).attr("style");
  823. $(dd[i]).attr("style",left+"left:700px;");
  824. //var left1=$(dd[i]).attr("style");
  825. }
  826. }
  827. window.onload=function(){
  828. setTimeout(todo,1000);
  829. };
  830. function onBodyDown(event) {
  831. if (( event.target.id != "windfarm" && event.target.id != "menuWindfarm" && $(event.target).parents("#menuWindfarm").length<=0)) {
  832. hideMenuWindfarm();
  833. }
  834. //alert(event.target.id);
  835. //alert($(event.target).parents("#menuXl").length);
  836. if (!( event.target.id == "line" || event.target.id == "menuXl" || $(event.target).parents("#menuXl").length>0)) {
  837. hideMenuXl();
  838. }
  839. if (!( event.target.id == "project" || event.target.id == "menuPj" || $(event.target).parents("#menuPj").length>0)) {
  840. hideMenuPj();
  841. }
  842. }
  843. var types="";
  844. function queryApData(item){
  845. var beginDate=$("#beginDate").val();
  846. var endDate=$("#endDate").val();
  847. if(beginDate==""){
  848. alert("请选开始时间!");
  849. return;
  850. }
  851. if(endDate==""){
  852. alert("请选结束时间!");
  853. return;
  854. }
  855. var url="";
  856. if(wpids==""){
  857. url="queryPowerAll.action?queryType=" + queryType+"&wpIds="+wpids+"&beginDate="+beginDate+"&endDate="+endDate;
  858. $("#powerframe").attr("src","powerdetail.action?type=all&queryType=" + queryType+"&wpIds="+wpids+"&beginDate="+beginDate+"&endDate="+endDate);
  859. }else
  860. {
  861. url="queryPower.action?wpIds="+wpids+"&pjIds="+pjIds+"&lineIds="+lines+"&beginDate="+beginDate+"&endDate="+endDate;
  862. $("#powerframe").attr("src","powerdetail.action?wpIds="+wpids+"&pjIds="+pjIds+"&lineIds="+lines+"&beginDate="+beginDate+"&endDate="+endDate);
  863. }
  864. console.log(url);
  865. $.ajax({
  866. url : url,
  867. type : "post",
  868. cache : false,
  869. dataType : "json",
  870. data : {},
  871. ifModified : false,
  872. success : function(result) {
  873. getResultInfo(result);
  874. }
  875. });
  876. }
  877. function initial(){
  878. $("#beginDate").val("<s:property value='beginDate'/>");
  879. $("#endDate").val("<s:property value='endDate'/>");
  880. //$("#windfarm").val("麻黄山风电场");
  881. queryApData();
  882. //queryApData();
  883. }
  884. function toExcel() {
  885. var beginDate=$("#beginDate").val();
  886. var endDate=$("#endDate").val();
  887. if("" == $("#beginDate").val()){
  888. alert("请选择查询开始日期!");
  889. }else if("" == $("#endDate").val()){
  890. alert("请选择查询结束日期!");
  891. }
  892. else{
  893. if(wpids==""){
  894. url="<%=request.getContextPath() %>/power/powerCompareExcel.action?queryType=" + queryType+"&wpIds="+wpids+"&beginDate="+beginDate+"&endDate="+endDate;
  895. }else
  896. {
  897. url="<%=request.getContextPath() %>/power/powerCompareExcel.action?wpIds="+wpids+"&pjIds="+pjIds+"&lineIds="+lines+"&beginDate="+beginDate+"&endDate="+endDate;
  898. }
  899. $('#toexcel').attr('href',url);
  900. }
  901. }
  902. $(document).ready(function() {
  903. initial();
  904. //$("#windfarm").attr("value", "麻黄山风场");
  905. //wpids = "MHS_FDC";
  906. });
  907. function queryApDataMx(){
  908. $("#f1").attr("action","<%=request.getContextPath() %>/power/powerindexNew.action");
  909. $("#f1").submit();
  910. }
  911. </script>
  912. </head>
  913. <body>
  914. <form action="" method="post" id="f1" style="width:1620px;">
  915. <div class="panelcontainer" style="width:1620px;" >
  916. <div class="panelquery"><span class="panelquerytext">电量绩效榜</span></div>
  917. <div class="querycondcontainer">
  918. 风场:
  919. <input id="windfarm" type="text" readonly value="" style="width:150px;" onclick="showWindfarm();" />
  920. </div>
  921. <div id="pjpanel" class="querycondcontainer" >
  922. 项目:<input id="project" type="text" readonly value="" style="width:150px;" onclick="showProject();" />
  923. </div>
  924. <div id="xlpanel" class="querycondcontainer" >
  925. 线路:<input id="line" type="text" readonly value="" style="width:150px;" onclick="showLine();" />
  926. </div>
  927. <div class="querycondcontainer">
  928. 开始日期:<input type="text" style="width:150px;" class="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  929. id="beginDate" name="beginDate"/>
  930. </div>
  931. <div class="querycondcontainer">
  932. 结束日期:<input type="text" style="width:150px;" class="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  933. id="endDate" name="endDate"/>
  934. </div>
  935. <div style="float:left;line-height:39px;margin-left:20px;width:80px;">
  936. <input type="button" value="查询" onClick="queryApData()"/>
  937. </div>
  938. <div style="float:left;line-height:39px;margin-left:20px;width:80px;">
  939. <input type="button" value="明细信息" id="mx" onClick="queryApDataMx()"/>
  940. </div>
  941. <div style="float:left;line-height:39px;margin-left:20px;width:80px;">
  942. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  943. </div>
  944. </div>
  945. <div id="fc" onclick="swap(this);" class="normal">风场</div>
  946. <div id="pj" onclick="swap(this);" class="disable">项目</div>
  947. <div id="xl" onclick="swap(this);" class="disable">集电线路</div>
  948. <div id="menuWindfarm" class="menuContent" style="overflow-y:scroll;overflow-x:auto;z-index:9999; border: 1px solid #617775;background: #f0f6e4;display:none;position: absolute;">
  949. <!-- <div style="overflow-y:scroll;overflow-x:auto;">-->
  950. <ul id="treeWindfarm" class="ztree" style="margin-top:0; width:180px; height: 300px;"></ul>
  951. <!-- </div>
  952. <div style="padding:5px;margin-left:25px;">
  953. <input style="width:70px" type="button" value="确定" onClick="selectWindfarm()"/>
  954. <input style="width:70px;margin-left:5px;" type="button" value="取消" onClick="hideMenuWindfarm()"/>
  955. </div>-->
  956. </div>
  957. <div id="menuPj" class="menuContent" style="overflow-y:scroll;overflow-x:auto;z-index:9999; border: 1px solid #617775;background: #f0f6e4;display:none;position: absolute;">
  958. <!-- <div style="overflow-y:scroll;overflow-x:auto;">-->
  959. <ul id="treePj" class="ztree" style="margin-top:0; width:180px; height: 300px;"></ul>
  960. <!-- </div>
  961. <div style="padding:5px;margin-left:25px;">
  962. <input style="width:70px" type="button" value="确定" onClick="selectXl()"/>
  963. <input style="width:70px;margin-left:5px;" type="button" value="取消" onClick="hideMenuXl()"/>
  964. </div>-->
  965. </div>
  966. <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;">
  967. <!-- <div style="overflow-y:scroll;overflow-x:auto;">-->
  968. <ul id="treeXl" class="ztree" style="margin-top:0; width:180px; height: 300px;"></ul>
  969. <!-- </div>
  970. <div style="padding:5px;margin-left:25px;">
  971. <input style="width:70px" type="button" value="确定" onClick="selectXl()"/>
  972. <input style="width:70px;margin-left:5px;" type="button" value="取消" onClick="hideMenuXl()"/>
  973. </div>-->
  974. </div>
  975. <p style="clear:both;height:1px"/>
  976. <table style="overflow:scroll">
  977. <tr>
  978. <td><table >
  979. <tr>
  980. <td>
  981. <div style="width:890px;height:850px;overflow:hidden;" id="container1" ></td>
  982. </tr>
  983. </table>
  984. </td>
  985. <td>
  986. <table >
  987. <tr>
  988. <td>
  989. <div style="width:1000px;height:840px" id="container2" >
  990. <iframe id="powerframe" width="1000px" height="900px" frameborder="0" scrolling="no"></iframe>
  991. </div>
  992. </td>
  993. </tr>
  994. </table>
  995. </td>
  996. </tr>
  997. </table>
  998. <div id="zcontiantitle" class="querycondcontainer" style="position: absolute;top: 148px;left: 800px;margin: 0px;border: 0px;padding: 0px;width: 80;height: 30;z-index: 99">风能利用率</div>
  999. <!-- <div id="zcontian" style="width:0px;height:840px;position: absolute;top: 100px;left: 700px;margin: 0px;border: 0px;padding: 0px;z-index: 99"></div> -->
  1000. </form>
  1001. </body>