power.jsp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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" src="<%=request.getContextPath()%>/resource/js/jquery-1.8.3.js"></script>
  9. <script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  10. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  11. <style type="text/css">
  12. <!--
  13. fieldset legend {
  14. color: #302A2A;
  15. font: bold 16px/ 2 Verdana, Geneva, sans-serif;
  16. font-weight: bold;
  17. text-align: left;
  18. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  19. }
  20. .text { font-family: "宋体";
  21. font-size: 12px;
  22. color: #000000;
  23. }
  24. .valuetext { font-family: Arial, Helvetica, sans-serif;
  25. font-size: 14px;
  26. color: #000000;
  27. font-weight: bold;
  28. }
  29. -->
  30. </style>
  31. <script type="text/javascript">
  32. function countData() {
  33. var llfdl = $("#yffdl").html();
  34. var sfdl = $("#sfdl").html();
  35. var xdss = $("#xddl").html();
  36. var dwsl = $("#dwsl").html();
  37. var tqsl = $("#tqsl").html();
  38. var zjrl = $("#zjrl").html();
  39. var llfdlxs = llfdl/zjrl*10;
  40. var sfdlxs = sfdl/zjrl*10;
  41. var xdssxs = xdss/zjrl*10;
  42. var dwslxs = dwsl/zjrl*10;
  43. var tqslxs = tqsl/zjrl*10;
  44. var result = (llfdlxs-sfdlxs-xdssxs-dwslxs-tqslxs)/(llfdlxs-xdssxs-dwslxs-tqslxs)*100;
  45. $("#result").html(result.toFixed(2)+"%");
  46. }
  47. function queryData() {
  48. var wpid = $("#wpid").val();
  49. var year = $("#year").val();
  50. var month = $("#month").val();
  51. if("" == year){
  52. alert("请选择年份!");
  53. }else if ("" == month){
  54. alert("请选择月份!");
  55. }else{
  56. var url2 = "wpinfoajax.action?wpid=" + wpid + "&year=" + year + "&month=" + month;
  57. $.ajax( {
  58. type : "post",
  59. url : url2,
  60. dataType : "json",
  61. success : function(data){
  62. if (data.length != 0){
  63. eval(data);
  64. $("#zjrl").html(data["zjrl"]*10);
  65. $("#sfdl").html(data["sfdl"]);
  66. $("#yffdl").html(data["yffdl"]);
  67. $("#xddl").html(data["xddl"]);
  68. $("#dwsl").html(data["dwsl"]);
  69. $("#tqsl").html(data["tqsl"]);
  70. $("#result").html(data["result"]+"%");
  71. }
  72. }
  73. });
  74. }
  75. }
  76. $(document).ready(function(){
  77. $("#year").val("<s:property value='year'/>");
  78. $("#month").val("<s:property value='month'/>");
  79. queryData();
  80. });
  81. </script>
  82. </head>
  83. <body>
  84. <form action="powerindex.action" method="post" id="f1">
  85. <fieldset style="height: 100px; width: 1400" id="fst">
  86. <legend class="item_Name">
  87. 查询条件
  88. </legend>
  89. <table class="dataform">
  90. <tr>
  91. <th width="5%" class="item_Name">
  92. 场站:
  93. </th>
  94. <td width="15%">
  95. <s:select list="wpls" listKey="id" listValue="name" id="wpid"
  96. name="wpid"></s:select>
  97. </td>
  98. <th width="5%" class="item_Name">
  99. 年份:
  100. </th>
  101. <td width="10%" style="text-align: left">
  102. <s:textfield cssClass="Wdate"
  103. onFocus="WdatePicker({dateFmt:'yyyy',isShowWeek:true,readOnly:true})"
  104. id="year" name="year" title="年" />
  105. </td>
  106. <th width="5%" class="item_Name">
  107. 月份:
  108. </th>
  109. <td width="10%" style="text-align: left">
  110. <s:textfield cssClass="Wdate"
  111. onFocus="WdatePicker({dateFmt:'MM',isShowWeek:true,readOnly:true})"
  112. id="month" name="month" title="月" />
  113. </td>
  114. <td width="10%" style="text-align: right">
  115. <input type="button" onclick="queryData();" value="查询">
  116. </td>
  117. <td width="10%" style="text-align: right">
  118. <input type="button" onclick="countData();" value="计算">
  119. </td>
  120. <td width="40%"></td>
  121. </tr>
  122. </table>
  123. </fieldset>
  124. <table width="1400" border="0" cellpadding="2" cellspacing="1" bgcolor="efefef">
  125. <tr>
  126. <td height="30" align="center" bgcolor="#FFFFFF" class="text">结论如下</td>
  127. </tr>
  128. </table>
  129. <table width="1400" border="0" cellspacing="1" bgcolor="#efefef">
  130. <tr>
  131. <td width="185" height="40" align="right" valign="middle" bgcolor="#F7FCFF" class="text">装机容量:</td>
  132. <td width="185" align="center" valign="middle" bgcolor="#F7FCFF" class="valuetext"><span id="zjrl" contenteditable="true"></span></td>
  133. <td width="185" align="left" valign="middle" bgcolor="#F7FCFF" class="text">MW</td>
  134. <td width="185" align="right" valign="middle" bgcolor="#F7FCFF" class="text">实际发电量:</td>
  135. <td width="185" align="center" valign="middle" bgcolor="#F7FCFF" class="valuetext"><span id="sfdl" contenteditable="true"></span></td>
  136. <td width="185" align="left" valign="middle" bgcolor="#F7FCFF" class="text">万kWh</td>
  137. <td width="185" align="right" valign="middle" bgcolor="#F7FCFF" class="text">理论发电量:</td>
  138. <td width="185" align="center" valign="middle" bgcolor="#F7FCFF" class="valuetext"><span id="yffdl" contenteditable="true"></span></td>
  139. <td width="185" align="left" valign="middle" bgcolor="#F7FCFF" class="text">万kWh</td>
  140. </tr>
  141. <tr>
  142. <td height="40" align="right" valign="middle" bgcolor="#FFF9EE" class="text">限电损失电量:</td>
  143. <td align="center" valign="middle" bgcolor="#FFF9EE" class="valuetext"><span id="xddl" contenteditable="true"></span></td>
  144. <td align="left" valign="middle" bgcolor="#FFF9EE" class="text">万kWh</td>
  145. <td align="right" valign="middle" bgcolor="#FFF9EE" class="text">电网受累损失:</td>
  146. <td align="center" valign="middle" bgcolor="#FFF9EE" class="valuetext"><span id="dwsl" contenteditable="true"></span></td>
  147. <td align="left" valign="middle" bgcolor="#FFF9EE" class="text">万kWh</td>
  148. <td align="right" valign="middle" bgcolor="#FFF9EE" class="text">天气受累损失:</td>
  149. <td align="center" valign="middle" bgcolor="#FFF9EE" class="valuetext"><span id="tqsl" contenteditable="true"></span></td>
  150. <td align="left" valign="middle" bgcolor="#FFF9EE" class="text">万kWh</td>
  151. </tr>
  152. </table>
  153. <table width="1400" border="0" cellpadding="2" cellspacing="1" bgcolor="efefef">
  154. <tr>
  155. <td height="30" align="center" bgcolor="#FFFFFF" class="text">公式如下</td>
  156. </tr>
  157. </table>
  158. <table width="1400" border="0" cellspacing="0" cellpadding="2">
  159. <tr>
  160. <td height="150" align="center" valign="middle" bgcolor="#F7F7EE"><img src="<%=request.getContextPath()%>/resource/images/system/pictures/bt.gif" width="364" height="87" /><span valign="middle" id="result" style="position: absolute; left:880px;top:330px"></span></td>
  161. </tr>
  162. </table>
  163. </form>
  164. </body>