gljz.jsp 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <%@ page language="java" contentType="text/html;charset=utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <html>
  4. <head>
  5. <script type="text/javascript"
  6. src="<%=request.getContextPath()%>/resource/js/jquery.progressbar/js/jquery.progressbar.js">
  7. </script>
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9. <title>功率矩阵</title>
  10. <style type="text/css">
  11. <!--
  12. body {
  13. margin-left: 0px;
  14. margin-top: 0px;
  15. margin-right: 0px;
  16. margin-bottom: 0px;
  17. }
  18. .item_Name {
  19. font-family: Arial, Helvetica, sans-serif;
  20. font-size: 14px;
  21. font-weight: bolder;
  22. color: #333;
  23. }
  24. .item_Name_Green { FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: green; FONT-SIZE: 12px; FONT-WEIGHT: bolder
  25. }
  26. .item_Name_H{ FONT-FAMILY: Arial, Helvetica, sans-serif; #cccccc: green; FONT-SIZE: 12px; FONT-WEIGHT: bolder
  27. }
  28. -->
  29. </style>
  30. <script type="text/javascript">
  31. $(document).ready(function() {
  32. $("#wpId").val('<s:property value="wpId"/>')
  33. $("#wpName").val('<s:property value="wpName"/>')
  34. getDetail();
  35. //window.setInterval(getDetail, 30000);
  36. });
  37. function reback()
  38. {
  39. $("#f1").attr("action", "<%=request.getContextPath() %>/matrix/index.action").submit();
  40. }
  41. function getDetail()
  42. {
  43. var wpId=$("#wpId").val();
  44. var wpName=$("#wpName").val();
  45. $.ajax({
  46. url : "gljzAjax.action?wpId="+wpId,
  47. type : "post",
  48. cache : false,
  49. dataType : "json",
  50. data : {},
  51. async : false,
  52. ifModified : false,
  53. success : function(res) {
  54. var html ="<table width='1880' border='0' align='center' cellpadding='0' cellspacing='0'>";
  55. html =html+"<tr>";
  56. html =html+"<td height='50' background='<%=request.getContextPath()%>/resource/images/system/pictures/gljz_Top.fw.png' class='item_Name'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+wpName+"<button value='返回' type='button' onclick='reback();' style='position:absolute;top:12px;left: 1700px;width: 60px'>返回</button> </td>";
  57. html =html+"</tr>";
  58. html =html+"</table>";
  59. html =html+"<table width='1880' border='0' align='center' cellspacing='0' cellpadding='0'>";
  60. html =html+createTd(res);
  61. html =html+"</table>";
  62. $("#content").html(html);
  63. $.each(res,function(i, value) {
  64. var code=value['windTurbineCode'];
  65. var percent=value['percent'];
  66. if(percent>=80)
  67. {
  68. $("#"+code).progressBar({ barImage: '<%=request.getContextPath()%>/resource/js/jquery.progressbar/images/progressbg_green.gif', showText: false} );;
  69. }else if(percent>=60 && percent<80)
  70. {
  71. $("#"+code).progressBar({ barImage: '<%=request.getContextPath()%>/resource/js/jquery.progressbar/images/progressbg_yellow.gif', showText: false} );;
  72. }else
  73. {
  74. $("#"+code).progressBar({ barImage: '<%=request.getContextPath()%>/resource/js/jquery.progressbar/images/progressbg_red.gif', showText: false} );;
  75. }
  76. });
  77. }
  78. });
  79. }
  80. function createTd(result) {
  81. var html = "<tr >";
  82. var num=0;
  83. $.each(result,function(i, value) {
  84. var code=value['windTurbineCode'];
  85. var temp=code.substring(code.length-3,code.length);
  86. var tempnum=temp;
  87. if(!isNaN(temp))
  88. {
  89. temp=temp+"号";
  90. }else
  91. {
  92. temp=code.substring(code.length-2,code.length)+"号";
  93. tempnum=code.substring(code.length-2,code.length);
  94. }
  95. html += "<td width='208' height='75' align='center' valign='middle' background='<%=request.getContextPath()%>/resource/images/system/pictures/gljz_Icon.fw.png'>";
  96. html += "<table width='208' border='0' cellspacing='0' cellpadding='0'>";
  97. html += " <tr>";
  98. html += "<td height='25' colspan='2' valign='bottom' class='item_Name'>&nbsp;&nbsp;"+temp+"</td>";
  99. html += "</tr>";
  100. html += "<tr>";
  101. html += "<td height='25' colspan='2' align='center' valign='bottom' class='item_Name1'>&nbsp;";
  102. html += "<span class='item_Name_Green'>应&nbsp;发&nbsp;&nbsp;</span>";
  103. html +="<span class='progressBar' width='20px' id='"+code+"'>"+value['percent']+"</span>"
  104. html += "<span class='item_Name_H'>&nbsp;&nbsp;实&nbsp;发</span>&nbsp;</td>";
  105. html += "</tr>";
  106. html += "<tr>";
  107. html += "<td width='106' height='25' class='item_Name_Green'>&nbsp;&nbsp;"+value['calwindpower']+"kWh</td>";
  108. html += "<td width='102' align='right' class='item_Name_H'>"+value['windpower']+"kWh&nbsp;&nbsp;</td>";
  109. html += "</tr>";
  110. html += "</table>";
  111. if(num==8)
  112. {
  113. html +="</td>";
  114. html += "</tr><tr>";
  115. num=0;
  116. }else
  117. {
  118. html +="</td>";
  119. num++;
  120. }
  121. });
  122. html += "</tr>";
  123. return html;
  124. }
  125. </script>
  126. </head>
  127. <body>
  128. <form action="<%=request.getContextPath() %>/matrix/glindex.action" method="post" id="f1">
  129. <s:hidden id="wpId"></s:hidden>
  130. <s:hidden id="wpName"></s:hidden>
  131. <div id="content" style="width: 1881px;border: 0;margin: 0;"></div>
  132. </form>
  133. </body>
  134. </html>