matrixList.jsp 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <%@ page language="java" contentType="text/html;charset=utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta http-equiv="X-UA-Compatible" content="IE=8" />
  8. <title>国电电力山西新能源公司生产运行监控平台</title>
  9. <link href="<%=request.getContextPath() %>/pages/monitor/css/page_fjjz_new.css" rel="stylesheet" type="text/css" />
  10. <script type='text/javascript' src='<%=request.getContextPath() %>/resource/js/jquery-1.8.3.js'></script>
  11. <link href="<%=request.getContextPath() %>/resource/js/contextmenu/skins/default/contextmenu.css" rel="stylesheet"/>
  12. <script src="<%=request.getContextPath() %>/resource/js/contextmenu/contextmenu.js" type="text/javascript"></script>
  13. </head>
  14. <script type="text/javascript">
  15. var islongin=0;
  16. var username="tom";
  17. var password="jerry";
  18. var errorCode=-1;
  19. $(document).ready(function() {
  20. getDetail();
  21. window.setInterval(getDetail, 30000);
  22. window.setInterval(initIslongin, 300000);
  23. });
  24. function initIslongin(){
  25. islongin=0;
  26. }
  27. function login(){
  28. var user=$("#username").val();
  29. var pwd=$("#password").val();
  30. if(username==user&&password==pwd){
  31. islongin=1;
  32. }else{
  33. islongin=0;
  34. errorCode=0;
  35. }
  36. }
  37. function checkLogin(wpId,pjId,lineId,wtId,stateId){
  38. if(islongin==0){
  39. if(errorCode=0){
  40. alert("用户名或密码不正确,请重新输入");
  41. }
  42. showDialog(wpId,pjId,lineId,wtId,stateId);
  43. return false;
  44. }else{
  45. return true;
  46. }
  47. }
  48. function showDialog(wpId,pjId,lineId,wtId,stateId){
  49. }
  50. function changeState(wpId,pjId,lineId,wtId,stateId){
  51. //alert("下发人工干预状态!!");
  52. //alert(wpId+"=="+pjId+"=="+lineId+"=="+wtId+"=="+stateId)
  53. $.ajax({
  54. url : "/matrix/changeState.action",
  55. type : "post",
  56. cache : false,
  57. dataType : "json",
  58. data : {"wpId":wpId,"pjId":pjId,"lineId":lineId,"wtId":wtId,"stateId":stateId},
  59. async : false,
  60. ifModified : false,
  61. success : function(res) {
  62. getDetail();
  63. }
  64. });
  65. }
  66. function getDetail(type)
  67. {
  68. if( type!="" && type!=null && type!=undefined)
  69. {
  70. $("#type").val(type);
  71. }else
  72. {
  73. type=$("#type").val();
  74. }
  75. $.ajax({
  76. url : "/matrix/ztXdslAjax.action",
  77. type : "post",
  78. cache : false,
  79. dataType : "json",
  80. data : {},
  81. async : false,
  82. ifModified : false,
  83. success : function(res) {
  84. for (var key in res){
  85. getStateType(res[key],key,type);
  86. }
  87. }
  88. });
  89. }
  90. function gowt(id)
  91. {
  92. var wpId=$("#wpId").val();
  93. $("#wtId").val(id);
  94. parent.$tabs.tabs('select', 1);
  95. $("#tab3", window.parent.document).attr("src","about:blank");
  96. $("#tab2", window.parent.document).attr("src","/wpmonitor/wtindex.action?wpId="+wpId+"&wtId="+id);
  97. }
  98. function getStateType(result,id,type) {
  99. switch(result){
  100. case 1:
  101. if(type==1 || type==6)
  102. {
  103. $("#"+id).attr("class","matrix_pink");
  104. }else
  105. {
  106. $("#"+id).attr("class","matrix_none");
  107. }
  108. break;
  109. case 0:
  110. if(type==0 || type==6)
  111. {
  112. $("#"+id).attr("class","matrix_blue");
  113. }else
  114. {
  115. $("#"+id).attr("class","matrix_none");
  116. }
  117. break;
  118. case 2:
  119. if(type==2 || type==6)
  120. {
  121. $("#"+id).attr("class","matrix_orange");
  122. }else
  123. {
  124. $("#"+id).attr("class","matrix_none");
  125. }
  126. break;
  127. case 3:
  128. if(type==3 || type==6)
  129. {
  130. $("#"+id).attr("class","matrix_red");
  131. }else
  132. {
  133. $("#"+id).attr("class","matrix_none");
  134. }
  135. break;
  136. case 4:
  137. if(type==4 || type==6)
  138. {
  139. $("#"+id).attr("class","matrix_deepblack");
  140. }else
  141. {
  142. $("#"+id).attr("class","matrix_none");
  143. }
  144. break;
  145. case 5:
  146. if(type==5 || type==6)
  147. {
  148. $("#"+id).attr("class","matrix_deepblue");
  149. }else
  150. {
  151. $("#"+id).attr("class","matrix_none");
  152. }
  153. break;
  154. }
  155. }
  156. function setTab(m,n){
  157. var menu=document.getElementById("tab"+m).getElementsByTagName("li");
  158. for(i=0;i<menu.length;i++)
  159. {
  160. menu[i].className=(i==n?"now":"");
  161. }
  162. }
  163. </script>
  164. <!--[if gte IE 6]>
  165. <script type="text/javascript">
  166. function correctPNG()
  167. {
  168. for(var i=0; i<document.images.length; i++)
  169. {
  170. var img = document.images[i]
  171. var imgName = img.src.toUpperCase()
  172. if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
  173. {
  174. var imgID = (img.id) ? "id='" + img.id + "' " : ""
  175. var imgClass = (img.className) ? "class='" + img.className + "' " : ""
  176. var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
  177. var imgStyle = "display:inline-block;" + img.style.cssText
  178. if (img.align == "left") imgStyle = "float:left;" + imgStyle
  179. if (img.align == "right") imgStyle = "float:right;" + imgStyle
  180. if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
  181. var strNewHTML = "<span " + imgID + imgClass + imgTitle
  182. + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
  183. + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
  184. + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
  185. img.outerHTML = strNewHTML
  186. i = i-1
  187. }
  188. }
  189. }
  190. window.attachEvent("onload", correctPNG);
  191. </script>
  192. <![endif]-->
  193. <body>
  194. <div id="WincontextMenu" class="WincontextMenu" style="top:100px; left:230px; display:none;">
  195. <li><a id="0" href="#"><img src="<%=request.getContextPath() %>/resource/js/contextmenu/skins/default/contextmenu/icons/Copy.png"/><span>正常状态</span></a></li>
  196. <li><a id="1" href="#"><img src="<%=request.getContextPath() %>/resource/js/contextmenu/skins/default/contextmenu/icons/New.png"/><span>限电状态</span></a></li>
  197. <li><a id="2" href="#"><img src="<%=request.getContextPath() %>/resource/js/contextmenu/skins/default/contextmenu/icons/Save.png"/><span>站内计划停运</span></a></li>
  198. <li><a id="3" href="#" ><img src="<%=request.getContextPath() %>/resource/js/contextmenu/skins/default/contextmenu/icons/table.png"/><span>站内故障停运</span></a></li>
  199. <li><a id="4" href="#"><img src="<%=request.getContextPath() %>/resource/js/contextmenu/skins/default/contextmenu/icons/Pinion.png"/><span>站外受累电网</span></a></li>
  200. <li><a id="5" href="#"><img src="<%=request.getContextPath() %>/resource/js/contextmenu/skins/default/contextmenu/icons/Person.png"/><span>站外受累天气</span></a></li>
  201. </div>
  202. <form id="f1" action="" method="post">
  203. <s:hidden id="type" value="6"></s:hidden>
  204. <s:hidden id="wpId" name="wpId"></s:hidden>
  205. <s:hidden id="wtId" name="wtId"></s:hidden>
  206. <div class="">
  207. <div class="">
  208. <s:iterator id="wp" value="wpls" status="wfst" >
  209. <table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse;border-color:graytext;">
  210. <tr>
  211. <td width="150px">
  212. <div id="<s:property value='#wp.id'/>"><s:property value='#wp.name'/></div>
  213. <script type="text/javascript">
  214. $(document).ready(function() {
  215. $("#<s:property value='#wp.id'/>").WinContextMenu({cancel:'.cancel',action:function(e){changeState("<s:property value='#wp.id'/>","","","",e.id)}});
  216. });
  217. </script>
  218. </td>
  219. <td>
  220. <s:iterator id="pj" value="pjsmap" >
  221. <s:if test="#wp.id==#pj.key">
  222. <table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;border-color: graytext;">
  223. <s:iterator id="pjls" value="#pj.value" >
  224. <tr>
  225. <td width="150px"><div id="<s:property value='#pjls.id'/>"><s:property value='#pjls.name'/></div></td>
  226. <script type="text/javascript">
  227. $(document).ready(function() {
  228. $("#<s:property value='#pjls.id'/>").WinContextMenu({cancel:'.cancel',action:function(e){changeState("","<s:property value='#pjls.id'/>","","",e.id)}});
  229. });
  230. </script>
  231. <td>
  232. <table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;border-color: white;" >
  233. <s:iterator id="lnpj" value="lnpjmap" >
  234. <s:if test="#pjls.id==#lnpj.key">
  235. <s:property value='#lnpj.name'/>
  236. <s:iterator id="lnpj2" value="#lnpj.value" >
  237. <tr>
  238. <td width="150px"><div id="<s:property value='#lnpj2.id'/>"><s:property value='#lnpj2.name'/></div>
  239. <script type="text/javascript">
  240. $(document).ready(function() {
  241. $("#<s:property value='#lnpj2.id'/>").WinContextMenu({cancel:'.cancel',action:function(e){changeState("","","<s:property value='#lnpj2.id'/>","",e.id)}});
  242. });
  243. </script>
  244. </td>
  245. <td width="1200px">
  246. <s:iterator id="wtls" value="wtlinemap" >
  247. <s:if test="#lnpj2.id==#wtls.key">
  248. <div class="">
  249. <s:iterator id="wtls2" value="#wtls.value" >
  250. <div class="matrix_white" id="<s:property value='#wtls2.id'/>"><s:property value='#wtls2.code'/></div>
  251. <script type="text/javascript">
  252. $(document).ready(function() {
  253. $("#<s:property value='#wtls2.id'/>").WinContextMenu({cancel:'.cancel',action:function(e){changeState("","","","<s:property value='#wtls2.id'/>",e.id)}});
  254. });
  255. </script>
  256. </s:iterator>
  257. </div>
  258. </s:if>
  259. </s:iterator>
  260. </td>
  261. </tr>
  262. </s:iterator>
  263. </s:if>
  264. </s:iterator>
  265. </table>
  266. </td>
  267. </tr>
  268. </s:iterator>
  269. </table>
  270. </s:if>
  271. </s:iterator>
  272. </td>
  273. </tr>
  274. </table>
  275. </s:iterator>
  276. </div>
  277. </div>
  278. </form>
  279. </body>
  280. </html>