powercompare.jsp 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143
  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 tmp;
  377. var optionsfc = {
  378. chart: {
  379. renderTo: 'container1',
  380. width:870,
  381. height:225,
  382. events: {
  383. load: function () {
  384. $(".aaa").parent().parent().css("left","50px");
  385. }
  386. }
  387. },
  388. title: {
  389. text: '风场绩效榜'
  390. },
  391. xAxis: [{
  392. categories: ['01号风机', '02号风机', '03号风机', '04号风机', '05号风机'],
  393. labels: {
  394. useHTML:true,
  395. formatter: function () {
  396. return "<div style=\"width:78px;text-align:center\">" +
  397. this.value + "</div>";
  398. }
  399. }
  400. },{
  401. categories: ['', '', '', '', ''],
  402. opposite: true
  403. }],
  404. yAxis:{ // Primary yAxis
  405. min: 0,
  406. title: {
  407. text: ''
  408. },
  409. stackLabels: {
  410. enabled: true,
  411. align:'right',
  412. useHTML: true,
  413. formatter: function(){
  414. var t=tmp[d++];
  415. if(typeof(t)=='undefined'){
  416. t1="";
  417. }else{
  418. var t1=t+"%";
  419. }
  420. // if(d==10){
  421. // d=0;
  422. //}
  423. /* alert(t1); */
  424. return t1;
  425. //"<div style=\"width:200px;height:20px;text-align:right\"></div>"
  426. },
  427. style: {
  428. fontWeight: 'bold',
  429. color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray',
  430. width:'200px'
  431. }
  432. }
  433. },
  434. legend: {
  435. align: 'center',
  436. verticalAlign: 'top',
  437. margin:20,
  438. y:20,
  439. reversed: true
  440. },
  441. plotOptions: {
  442. series: {
  443. stacking: 'normal',
  444. dataLabels: {
  445. shape: 'callout',
  446. useHTML:true,
  447. backgroundColor: 'rgba(255, 255, 255, 0.75)',
  448. style: {
  449. color: '#000',
  450. textShadow: 'none'
  451. }
  452. }
  453. }
  454. /*,
  455. bar: {
  456. dataLabels: {
  457. enabled: true
  458. }
  459. }*/
  460. },
  461. series: [
  462. {
  463. type: 'bar',
  464. name: '性能损失',
  465. yAxis: 0,
  466. data: []
  467. ,
  468. stack: '2'
  469. },{
  470. type: 'bar',
  471. name: '受累损失',
  472. yAxis: 0,
  473. data: [],
  474. stack: '2'
  475. },
  476. {
  477. type: 'bar',
  478. name: '限电损失',
  479. yAxis: 0,
  480. data: []
  481. ,
  482. stack: '2'
  483. },{
  484. type: 'bar',
  485. name: '非计划检修损失',
  486. yAxis: 0,
  487. data: [],
  488. stack: '2'
  489. }, {
  490. type: 'bar',
  491. name: '计划检修损失',
  492. yAxis: 0,
  493. data: [],
  494. stack: '2'
  495. },{
  496. type: 'bar',
  497. name: '实发电量',
  498. yAxis: 0,
  499. data: [],
  500. stack: '2'
  501. }
  502. /*,{
  503. type: 'bar',
  504. name: '理论电量',
  505. yAxis: 0,
  506. data: [],
  507. stack: '3'
  508. }*/
  509. ,{
  510. type: 'line',
  511. inverted: true,
  512. xAxis: 0,
  513. yAxis: 0,
  514. color: '#000000',
  515. name: ' ',
  516. data: []
  517. }]
  518. };
  519. var fnlyl=[];
  520. var d=0;
  521. function getResultInfo(res)
  522. {
  523. if(res["sfdl"]!=null)
  524. {
  525. var yfdl=[];
  526. var sfdl=[];
  527. var gzdl=[];
  528. var whdl=[];
  529. var xddl=[];
  530. var qfdl=[];
  531. var sldl=[];
  532. var labels=[];
  533. var names=[];
  534. var names2=[];
  535. fnlyl=[];
  536. $.each(res["names"],function(m,obj){
  537. /* if(obj.length<8){
  538. for(var jj=0;jj<8-obj.length;jj++){
  539. obj=obj+" ";
  540. }
  541. } */
  542. names.push(obj);
  543. }
  544. );
  545. $.each(res["names2"],function(m,obj){
  546. names2.push(obj);
  547. }
  548. );
  549. $.each(res["yfdl"],function(m,obj){
  550. yfdl.push(parseFloat(obj));
  551. }
  552. );
  553. tmp=res["lyl"];
  554. d=0;
  555. $.each(res["lyl"],function(m,obj){
  556. fnlyl.push(parseFloat(obj));
  557. }
  558. );
  559. /*$.each(res["lyl"],function(m,obj){
  560. var object = new Object();
  561. object.y =parseFloat(obj);
  562. object.dataLabels=new Object();
  563. object.dataLabels.enabled=true;
  564. object.dataLabels.format=parseFloat(obj)+"<br>"+parseFloat(obj)
  565. object.dataLabels.align='right';
  566. object.dataLabels.verticalAlign='middle';
  567. object.dataLabels.x=80;
  568. object.dataLabels.style=new Object();
  569. object.dataLabels.style.position="absolute";
  570. object.dataLabels.style.left=80;
  571. labels.push(object);
  572. }
  573. );*/
  574. $.each(res["sfdl"],function(m,obj){
  575. sfdl.push(parseFloat(obj));
  576. }
  577. );
  578. $.each(res["gzdl"],function(m,obj){
  579. gzdl.push(parseFloat(obj));
  580. }
  581. );
  582. $.each(res["whdl"],function(m,obj){
  583. whdl.push(parseFloat(obj));
  584. }
  585. );
  586. $.each(res["xddl"],function(m,obj){
  587. xddl.push(parseFloat(obj));
  588. }
  589. );
  590. $.each(res["qfdl"],function(m,obj){
  591. qfdl.push(parseFloat(obj));
  592. }
  593. );
  594. $.each(res["sldl"],function(m,obj){
  595. sldl.push(parseFloat(obj));
  596. }
  597. );
  598. var num= names.length;
  599. if(num<4)
  600. {
  601. $("#powerframe").css("height",605*num+"px");
  602. $("#container1").css("height",66*num+"px");
  603. $("#container2").css("height",66*num+"px");
  604. optionsfc.chart.height=num*66;
  605. var top=67;
  606. var left=98;
  607. /* $("#zcontian").html("");
  608. for(var i=0;i<res["lyl"].length;i++ ){
  609. var obj=res["lyl"][i];
  610. top=top+31;
  611. 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>"
  612. $("#zcontian").append(div);
  613. }*/
  614. }else if(num<7)
  615. {
  616. $("#powerframe").css("height",45*num+"px");
  617. $("#container1").css("height",45*num+"px");
  618. $("#container2").css("height",45*num+"px");
  619. optionsfc.chart.height=num*44.6;
  620. var top=67;
  621. var left=98;
  622. /* $("#zcontian").html("");
  623. for(var i=0;i<res["lyl"].length;i++ ){
  624. var obj=res["lyl"][i];
  625. top=top+27.4;
  626. 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>"
  627. $("#zcontian").append(div);
  628. } */
  629. }else if(num<9)
  630. {
  631. $("#powerframe").css("height",45*num+"px");
  632. $("#container1").css("height",45*num+"px");
  633. $("#container2").css("height",45*num+"px");
  634. optionsfc.chart.height=num*38.6;
  635. var top=67;
  636. var left=98;
  637. /* $("#zcontian").html("");
  638. for(var i=0;i<res["lyl"].length;i++ ){
  639. var obj=res["lyl"][i];
  640. top=top+25.4;
  641. 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>"
  642. $("#zcontian").append(div);
  643. } */
  644. }else if(num<12)
  645. {
  646. $("#powerframe").css("height",45*num+"px");
  647. $("#container1").css("height",45*num+"px");
  648. $("#container2").css("height",45*num+"px");
  649. optionsfc.chart.height=num*38.6;
  650. var top=67;
  651. var left=98;
  652. /*$("#zcontian").html("");
  653. for(var i=0;i<res["lyl"].length;i++ ){
  654. var obj=res["lyl"][i];
  655. top=top+28.4;
  656. 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>"
  657. $("#zcontian").append(div);
  658. } */
  659. }else if(num<18)
  660. {
  661. $("#powerframe").css("height",45*num+"px");
  662. $("#container1").css("height",45*num+"px");
  663. $("#container2").css("height",45*num+"px");
  664. optionsfc.chart.height=num*38.6;
  665. var top=67;
  666. var left=98;
  667. /* $("#zcontian").html("");
  668. for(var i=0;i<res["lyl"].length;i++ ){
  669. var obj=res["lyl"][i];
  670. top=top+32.5;
  671. 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>"
  672. $("#zcontian").append(div);
  673. } */
  674. }else if(num<20)
  675. {
  676. $("#powerframe").css("height",45*num+"px");
  677. $("#container1").css("height",45*num+"px");
  678. $("#container2").css("height",45*num+"px");
  679. optionsfc.chart.height=num*35.6;
  680. var top=67;
  681. var left=98;
  682. /* $("#zcontian").html("");
  683. for(var i=0;i<res["lyl"].length;i++ ){
  684. var obj=res["lyl"][i];
  685. top=top+27.5;
  686. 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>"
  687. $("#zcontian").append(div);
  688. } */
  689. }else if(num<35)
  690. {
  691. $("#powerframe").css("height",45*num+"px");
  692. $("#container1").css("height",45*num+"px");
  693. $("#container2").css("height",45*num+"px");
  694. optionsfc.chart.height=num*35.6;
  695. var top=67;
  696. var left=98;
  697. /* $("#zcontian").html("");
  698. for(var i=0;i<res["lyl"].length;i++ ){
  699. var obj=res["lyl"][i];
  700. top=top+32.4;
  701. 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>"
  702. $("#zcontian").append(div);
  703. } */
  704. }else if(num<45)
  705. {
  706. optionsfc.chart.height=num*35.6;
  707. $("#powerframe").css("height",40*num+"px");
  708. $("#container1").css("height",40*num+"px");
  709. $("#container2").css("height",40*num+"px");
  710. var top=67;
  711. var left=98;
  712. /* $("#zcontian").html("");
  713. for(var i=0;i<res["lyl"].length;i++ ){
  714. var obj=res["lyl"][i];
  715. top=top+40.5;
  716. 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>"
  717. $("#zcontian").append(div);
  718. } */
  719. }else if(num<60)
  720. {
  721. $("#powerframe").css("height",40*num+"px");
  722. $("#container1").css("height",40*num+"px");
  723. $("#container2").css("height",40*num+"px");
  724. optionsfc.chart.height=num*35.6;
  725. var top=67;
  726. var left=98;
  727. /* $("#zcontian").html("");
  728. for(var i=0;i<res["lyl"].length;i++ ){
  729. var obj=res["lyl"][i];
  730. top=top+33.7;
  731. 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>"
  732. $("#zcontian").append(div);
  733. } */
  734. }else if(num<70)
  735. {
  736. optionsfc.chart.height=num*35.6;
  737. $("#powerframe").css("height",40*num+"px");
  738. $("#container1").css("height",40*num+"px");
  739. $("#container2").css("height",40*num+"px");
  740. var top=67;
  741. var left=98;
  742. /* $("#zcontian").html("");
  743. for(var i=0;i<res["lyl"].length;i++ ){
  744. var obj=res["lyl"][i];
  745. top=top+34.0;
  746. 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>"
  747. $("#zcontian").append(div);
  748. } */
  749. }else if(num<100)
  750. {
  751. $("#powerframe").css("height",50*num+"px");
  752. $("#container1").css("height",50*num+"px");
  753. $("#container2").css("height",50*num+"px");
  754. optionsfc.chart.height=num*35.6;
  755. var top=67;
  756. var left=98;
  757. /* $("#zcontian").html("");
  758. for(var i=0;i<res["lyl"].length;i++ ){
  759. var obj=res["lyl"][i];
  760. top=top+34.45;
  761. 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>"
  762. $("#zcontian").append(div);
  763. } */
  764. $(".null").css("left","540px");
  765. }else if(num<250)
  766. {
  767. $("#powerframe").css("height",50*num+"px");
  768. $("#container1").css("height",50*num+"px");
  769. $("#container2").css("height",50*num+"px");
  770. optionsfc.chart.height=num*35.51;
  771. var top=67;
  772. var left=98;
  773. /* $("#zcontian").html("");
  774. for(var i=0;i<res["lyl"].length;i++ ){
  775. var obj=res["lyl"][i];
  776. top=top+35.1;
  777. 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>"
  778. $("#zcontian").append(div);
  779. } */
  780. $(".null").css("left","540px");
  781. }else
  782. {
  783. optionsfc.chart.height=num*24.2;
  784. var top=54;
  785. var left=98;
  786. $("#zcontian").html("");
  787. /* for(var i=0;i<res["lyl"].length;i++ ){
  788. var obj=res["lyl"][i];
  789. top=top+27.5;
  790. 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>"
  791. $("#zcontian").append(div);
  792. } */
  793. $("#powerframe").css("height",45*num+"px");
  794. $("#container1").css("height",45*num+"px");
  795. $("#container2").css("height",45*num+"px");
  796. $(".null").css("left","540px");
  797. }
  798. optionsfc.series[0].data = qfdl;
  799. optionsfc.series[1].data = sldl;
  800. optionsfc.series[2].data = xddl;
  801. optionsfc.series[3].data = gzdl;
  802. optionsfc.series[4].data = whdl;
  803. optionsfc.series[5].data = sfdl;
  804. optionsfc.series[6].data = yfdl;
  805. //optionsfc.series[7].data = labels;
  806. //optionsfc.series[7].data = yfdl;
  807. optionsfc.xAxis[0].categories = names;
  808. optionsfc.xAxis[1].categories = names2;
  809. //optionsfc.yAxis[0].total=fnlyl;
  810. }else
  811. {
  812. optionsfc.series[0].data = [];
  813. optionsfc.series[1].data = [];
  814. optionsfc.series[2].data = [];
  815. optionsfc.series[3].data = [];
  816. optionsfc.series[4].data = [];
  817. optionsfc.series[5].data = [];
  818. optionsfc.series[6].data = [];
  819. //optionsfc.series[7].data = [];
  820. optionsfc.xAxis[0].categories = [];
  821. optionsfc.xAxis[1].categories = [];
  822. }
  823. chartfc = new Highcharts.Chart(optionsfc);
  824. //chartfc.reflow();
  825. setTimeout(todo,1000);
  826. // console.log(chartfc);
  827. }
  828. function todo(){
  829. var s=$(".highcharts-stack-labels");
  830. var dd=$(s).find("span");
  831. for(var i=0;i<dd.length;i++){
  832. var left=$(dd[i]).attr("style");
  833. $(dd[i]).attr("style",left+"left:700px;");
  834. //var left1=$(dd[i]).attr("style");
  835. }
  836. }
  837. window.onload=function(){
  838. setTimeout(todo,1000);
  839. };
  840. function onBodyDown(event) {
  841. if (( event.target.id != "windfarm" && event.target.id != "menuWindfarm" && $(event.target).parents("#menuWindfarm").length<=0)) {
  842. hideMenuWindfarm();
  843. }
  844. //alert(event.target.id);
  845. //alert($(event.target).parents("#menuXl").length);
  846. if (!( event.target.id == "line" || event.target.id == "menuXl" || $(event.target).parents("#menuXl").length>0)) {
  847. hideMenuXl();
  848. }
  849. if (!( event.target.id == "project" || event.target.id == "menuPj" || $(event.target).parents("#menuPj").length>0)) {
  850. hideMenuPj();
  851. }
  852. }
  853. var types="";
  854. function queryApData(item){
  855. var beginDate=$("#beginDate").val();
  856. var endDate=$("#endDate").val();
  857. if(beginDate==""){
  858. alert("请选开始时间!");
  859. return;
  860. }
  861. if(endDate==""){
  862. alert("请选结束时间!");
  863. return;
  864. }
  865. var url="";
  866. if(wpids==""){
  867. url="queryPowerAll.action?queryType=" + queryType+"&wpIds="+wpids+"&beginDate="+beginDate+"&endDate="+endDate;
  868. $("#powerframe").attr("src","powerdetail.action?type=all&queryType=" + queryType+"&wpIds="+wpids+"&beginDate="+beginDate+"&endDate="+endDate);
  869. }else
  870. {
  871. url="queryPower.action?wpIds="+wpids+"&pjIds="+pjIds+"&lineIds="+lines+"&beginDate="+beginDate+"&endDate="+endDate;
  872. $("#powerframe").attr("src","powerdetail.action?wpIds="+wpids+"&pjIds="+pjIds+"&lineIds="+lines+"&beginDate="+beginDate+"&endDate="+endDate);
  873. }
  874. console.log(url);
  875. $.ajax({
  876. url : url,
  877. type : "post",
  878. cache : false,
  879. dataType : "json",
  880. data : {},
  881. ifModified : false,
  882. success : function(result) {
  883. getResultInfo(result);
  884. }
  885. });
  886. }
  887. function initial(){
  888. $("#beginDate").val("<s:property value='beginDate'/>");
  889. $("#endDate").val("<s:property value='endDate'/>");
  890. //$("#windfarm").val("麻黄山风电场");
  891. queryApData();
  892. //queryApData();
  893. }
  894. function toExcel() {
  895. var beginDate=$("#beginDate").val();
  896. var endDate=$("#endDate").val();
  897. if("" == $("#beginDate").val()){
  898. alert("请选择查询开始日期!");
  899. }else if("" == $("#endDate").val()){
  900. alert("请选择查询结束日期!");
  901. }
  902. else{
  903. if(wpids==""){
  904. url="<%=request.getContextPath() %>/power/powerCompareExcel.action?queryType=" + queryType+"&wpIds="+wpids+"&beginDate="+beginDate+"&endDate="+endDate;
  905. }else
  906. {
  907. url="<%=request.getContextPath() %>/power/powerCompareExcel.action?wpIds="+wpids+"&pjIds="+pjIds+"&lineIds="+lines+"&beginDate="+beginDate+"&endDate="+endDate;
  908. }
  909. $('#toexcel').attr('href',url);
  910. }
  911. }
  912. $(document).ready(function() {
  913. initial();
  914. //$("#windfarm").attr("value", "麻黄山风场");
  915. //wpids = "MHS_FDC";
  916. });
  917. function queryApDataMx(){
  918. $("#f1").attr("action","<%=request.getContextPath() %>/power/powerindexNew.action");
  919. $("#f1").submit();
  920. }
  921. </script>
  922. </head>
  923. <body>
  924. <form action="" method="post" id="f1" style="width:1620px;">
  925. <div class="panelcontainer" style="width:1620px;" >
  926. <div class="panelquery"><span class="panelquerytext">电量绩效榜</span></div>
  927. <div class="querycondcontainer">
  928. 风场:
  929. <input id="windfarm" type="text" readonly value="" style="width:150px;" onclick="showWindfarm();" />
  930. </div>
  931. <div id="pjpanel" class="querycondcontainer" >
  932. 项目:<input id="project" type="text" readonly value="" style="width:150px;" onclick="showProject();" />
  933. </div>
  934. <div id="xlpanel" class="querycondcontainer" >
  935. 线路:<input id="line" type="text" readonly value="" style="width:150px;" onclick="showLine();" />
  936. </div>
  937. <div class="querycondcontainer">
  938. 开始日期:<input type="text" style="width:150px;" class="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  939. id="beginDate" name="beginDate"/>
  940. </div>
  941. <div class="querycondcontainer">
  942. 结束日期:<input type="text" style="width:150px;" class="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  943. id="endDate" name="endDate"/>
  944. </div>
  945. <div style="float:left;line-height:39px;margin-left:20px;width:80px;">
  946. <input type="button" value="查询" onClick="queryApData()"/>
  947. </div>
  948. <div style="float:left;line-height:39px;margin-left:20px;width:80px;">
  949. <input type="button" value="明细信息" id="mx" onClick="queryApDataMx()"/>
  950. </div>
  951. <div style="float:left;line-height:39px;margin-left:20px;width:80px;">
  952. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  953. </div>
  954. </div>
  955. <div id="fc" onclick="swap(this);" class="normal">风场</div>
  956. <div id="pj" onclick="swap(this);" class="disable">项目</div>
  957. <div id="xl" onclick="swap(this);" class="disable">集电线路</div>
  958. <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;">
  959. <!-- <div style="overflow-y:scroll;overflow-x:auto;">-->
  960. <ul id="treeWindfarm" class="ztree" style="margin-top:0; width:180px; height: 300px;"></ul>
  961. <!-- </div>
  962. <div style="padding:5px;margin-left:25px;">
  963. <input style="width:70px" type="button" value="确定" onClick="selectWindfarm()"/>
  964. <input style="width:70px;margin-left:5px;" type="button" value="取消" onClick="hideMenuWindfarm()"/>
  965. </div>-->
  966. </div>
  967. <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;">
  968. <!-- <div style="overflow-y:scroll;overflow-x:auto;">-->
  969. <ul id="treePj" class="ztree" style="margin-top:0; width:180px; height: 300px;"></ul>
  970. <!-- </div>
  971. <div style="padding:5px;margin-left:25px;">
  972. <input style="width:70px" type="button" value="确定" onClick="selectXl()"/>
  973. <input style="width:70px;margin-left:5px;" type="button" value="取消" onClick="hideMenuXl()"/>
  974. </div>-->
  975. </div>
  976. <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;">
  977. <!-- <div style="overflow-y:scroll;overflow-x:auto;">-->
  978. <ul id="treeXl" class="ztree" style="margin-top:0; width:180px; height: 300px;"></ul>
  979. <!-- </div>
  980. <div style="padding:5px;margin-left:25px;">
  981. <input style="width:70px" type="button" value="确定" onClick="selectXl()"/>
  982. <input style="width:70px;margin-left:5px;" type="button" value="取消" onClick="hideMenuXl()"/>
  983. </div>-->
  984. </div>
  985. <p style="clear:both;height:1px"/>
  986. <table style="overflow:scroll;width:780px">
  987. <tr>
  988. <td><table >
  989. <tr>
  990. <td>
  991. <div style="width:780;height:850px;overflow:hidden;" id="container1" ></td>
  992. </tr>
  993. </table>
  994. </td>
  995. <td>
  996. <table >
  997. <tr>
  998. <td>
  999. <div style="width:750px;height:840px" id="container2" >
  1000. <iframe id="powerframe" width="900px" height="900px" frameborder="0" scrolling="no"></iframe>
  1001. </div>
  1002. </td>
  1003. </tr>
  1004. </table>
  1005. </td>
  1006. </tr>
  1007. </table>
  1008. <!-- <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> -->
  1009. <!-- <div id="zcontian" style="width:0px;height:840px;position: absolute;top: 100px;left: 700px;margin: 0px;border: 0px;padding: 0px;z-index: 99"></div> -->
  1010. </form>
  1011. </body>