main.jsp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. <%@ page language="java" contentType="text/html;charset=utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <html>
  4. <head>
  5. <title>国电电力山西新能源开发有限公司生产运行监控平台</title>
  6. <link rel="shortcut icon" href="favicon.ico" type=”image/x-icon” />
  7. <style>
  8. body {
  9. font-size: 12px;
  10. margin-left: 0px;
  11. margin-top: 0px;
  12. margin-right: 0px;
  13. margin-bottom: 0px;
  14. }
  15. @font-face {
  16. font-family: 'fontNameRegular';
  17. src:
  18. url('<%=request.getContextPath()%>/resource/fonts/DS-DIGIT-webfont.eot');
  19. src: local('<%=request.getContextPath()%>/resource/fonts/DS-DIGIT-webfont Regular'
  20. ),
  21. local('<%=request.getContextPath()%>/resource/fonts/DS-DIGIT-webfont'),
  22. url('<%=request.getContextPath()%>/resource/fonts/DS-DIGIT-webfont.woff')
  23. format('woff'),
  24. url('<%=request.getContextPath()%>/resource/fonts/DS-DIGIT-webfont.ttf')
  25. format('truetype'),
  26. url('<%=request.getContextPath()%>/resource/fonts/DS-DIGIT-webfont.svg#fontName')
  27. format('svg');
  28. font-size: 20px;
  29. font-weight: bolder;
  30. }
  31. </style>
  32. <script
  33. src="<%=request.getContextPath()%>/resource/js/jquery-1.10.2.min.js"
  34. type="text/javascript"></script>
  35. <link rel="stylesheet" type="text/css"
  36. href="<%=request.getContextPath()%>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  37. <script
  38. src="<%=request.getContextPath()%>/resource/plugin/jqueryui/js/jquery-ui-1.9.2.custom.js"
  39. type="text/javascript"></script>
  40. <script
  41. src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.widget.js"></script>
  42. <script
  43. src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.tabs.js"></script>
  44. <style>
  45. .ui-tabs {
  46. position: relative;
  47. padding: .31px;
  48. zoom: 1;
  49. }
  50. /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
  51. .ui-tabs .ui-tabs-nav {
  52. margin: 0;
  53. padding: .31px .31px 0;
  54. }
  55. .ui-tabs .ui-tabs-nav li {
  56. list-style: none;
  57. float: left;
  58. position: relative;
  59. top: 0;
  60. margin: 2px .2px 0 0;
  61. border-bottom: 0;
  62. padding: 0;
  63. white-space: nowrap;
  64. }
  65. .ui-tabs .ui-tabs-nav li a {
  66. float: left;
  67. padding: .2em 30px;
  68. text-decoration: none;
  69. }
  70. .ui-tabs .ui-tabs-nav li.ui-tabs-active {
  71. margin-bottom: -1px;
  72. padding-bottom: 1px;
  73. }
  74. .ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a
  75. {
  76. cursor: text;
  77. }
  78. .ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a
  79. {
  80. cursor: pointer;
  81. }
  82. /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
  83. .ui-tabs .ui-tabs-panel {
  84. display: block;
  85. border-width: 0;
  86. padding: 0em 0em;
  87. background: none;
  88. }
  89. .ui-tooltip {
  90. padding: 8px;
  91. position: absolute;
  92. z-index: 9999;
  93. max-width: 300px;
  94. -webkit-box-shadow: 0 0 5px #aaa;
  95. box-shadow: 0 0 5px #aaa;
  96. }
  97. </style>
  98. <script type="text/javascript">
  99. </script>
  100. <script type="text/javascript">
  101. var $tabs = null;
  102. window.onkeydown= function(e){
  103. e.keyCode = 0;
  104. e.returnvalue = false;
  105. }
  106. $(function() {
  107. $tabs =$( "#tabs" ).tabs({
  108. select: function(event, ui) {
  109. // ui.tab锚元素选中的标签页
  110. // ui.panel 锚元素选中的标签页的内容
  111. // ui.index 锚元素选中的标签页的索引(从0开始)
  112. if(ui.index==0)
  113. {
  114. }
  115. else if(ui.index==1)
  116. {
  117. <%-- $("#tab2").attr("src","<%=request.getContextPath()%>/matrix/monitormainIndex.action");
  118. $("#tab1").attr("src","about:blank");
  119. $("#tab4").attr("src","about:blank");
  120. $("#tab3").attr("src","about:blank");
  121. $("#tab5").attr("src","about:blank");
  122. $("#tab6").attr("src","about:blank");
  123. $("#tab7").attr("src","about:blank");
  124. $("#tab8").attr("src","about:blank");
  125. $("#tab9").attr("src","about:blank");
  126. $("#tab10").attr("src","about:blank"); --%>
  127. }
  128. else if(ui.index==2)
  129. {
  130. $("#tab3").attr("src","<%=request.getContextPath()%>/matrix/monitorqf.action");
  131. $("#tab1").attr("src","about:blank");
  132. $("#tab2").attr("src","about:blank");
  133. $("#tab4").attr("src","about:blank");
  134. $("#tab5").attr("src","about:blank");
  135. $("#tab6").attr("src","about:blank");
  136. $("#tab7").attr("src","about:blank");
  137. $("#tab8").attr("src","about:blank");
  138. $("#tab9").attr("src","about:blank");
  139. $("#tab10").attr("src","about:blank");
  140. }
  141. else if(ui.index==3)
  142. {
  143. $("#tab4").attr("src","<%=request.getContextPath()%>/apdata/apdatalayout.action");
  144. $("#tab1").attr("src","about:blank");
  145. $("#tab2").attr("src","about:blank");
  146. $("#tab3").attr("src","about:blank");
  147. $("#tab5").attr("src","about:blank");
  148. $("#tab6").attr("src","about:blank");
  149. $("#tab7").attr("src","about:blank");
  150. $("#tab8").attr("src","about:blank");
  151. $("#tab9").attr("src","about:blank");
  152. $("#tab10").attr("src","about:blank");
  153. }
  154. else if(ui.index==4)
  155. {
  156. $("#tab5").attr("src","<%=request.getContextPath()%>/analysis/analysislayout.action");
  157. $("#tab1").attr("src","about:blank");
  158. $("#tab2").attr("src","about:blank");
  159. $("#tab3").attr("src","about:blank");
  160. $("#tab4").attr("src","about:blank");
  161. $("#tab6").attr("src","about:blank");
  162. $("#tab7").attr("src","about:blank");
  163. $("#tab8").attr("src","about:blank");
  164. $("#tab9").attr("src","about:blank");
  165. $("#tab10").attr("src","about:blank");
  166. }
  167. else if(ui.index==5)
  168. {
  169. $("#tab6").attr("src","<%=request.getContextPath()%>/layout.action");
  170. $("#tab1").attr("src","about:blank");
  171. $("#tab2").attr("src","about:blank");
  172. $("#tab3").attr("src","about:blank");
  173. $("#tab4").attr("src","about:blank");
  174. $("#tab5").attr("src","about:blank");
  175. $("#tab7").attr("src","about:blank");
  176. $("#tab8").attr("src","about:blank");
  177. $("#tab9").attr("src","about:blank");
  178. $("#tab10").attr("src","about:blank");
  179. }
  180. else if(ui.index==6)
  181. {
  182. $("#tab7").attr("src","<%=request.getContextPath()%>/gradeassess/gmlayouts.action");
  183. $("#tab1").attr("src","about:blank");
  184. $("#tab2").attr("src","about:blank");
  185. $("#tab3").attr("src","about:blank");
  186. $("#tab4").attr("src","about:blank");
  187. $("#tab5").attr("src","about:blank");
  188. $("#tab6").attr("src","about:blank");
  189. $("#tab8").attr("src","about:blank");
  190. $("#tab9").attr("src","about:blank");
  191. $("#tab10").attr("src","about:blank");
  192. }
  193. else if(ui.index==7)
  194. {
  195. $("#tab8").attr("src","<%=request.getContextPath()%>/electricalwarn/layoutwarnIndex.action");
  196. $("#tab1").attr("src","about:blank");
  197. $("#tab2").attr("src","about:blank");
  198. $("#tab3").attr("src","about:blank");
  199. $("#tab4").attr("src","about:blank");
  200. $("#tab5").attr("src","about:blank");
  201. $("#tab6").attr("src","about:blank");
  202. $("#tab7").attr("src","about:blank");
  203. $("#tab9").attr("src","about:blank");
  204. $("#tab10").attr("src","about:blank");
  205. }
  206. else if(ui.index==8)
  207. {
  208. $("#tab9").attr("src","<%=request.getContextPath()%>/reportview/reportlayouts.action");
  209. $("#tab1").attr("src","about:blank");
  210. $("#tab2").attr("src","about:blank");
  211. $("#tab3").attr("src","about:blank");
  212. $("#tab4").attr("src","about:blank");
  213. $("#tab5").attr("src","about:blank");
  214. $("#tab6").attr("src","about:blank");
  215. $("#tab7").attr("src","about:blank");
  216. $("#tab8").attr("src","about:blank");
  217. $("#tab10").attr("src","about:blank");
  218. }
  219. }
  220. });
  221. });
  222. function clicktab2()
  223. {
  224. $("#tab2").attr("src","<%=request.getContextPath()%>/matrix/monitormainIndex.action");
  225. $("#tab1").attr("src","about:blank");
  226. $("#tab3").attr("src","about:blank");
  227. $("#tab4").attr("src","about:blank");
  228. $("#tab5").attr("src","about:blank");
  229. $("#tab6").attr("src","about:blank");
  230. $("#tab7").attr("src","about:blank");
  231. $("#tab8").attr("src","about:blank");
  232. $("#tab9").attr("src","about:blank");
  233. $("#tab10").attr("src","about:blank");
  234. }
  235. function clicktab1()
  236. {
  237. <%-- $("#tab1").attr("src","<%=request.getContextPath()%>/Html5/1234/ldjsc.htm"); --%>
  238. $("#tab1").attr("src","<%=request.getContextPath()%>/desktop.action");
  239. $("#tab3").attr("src","about:blank");
  240. $("#tab2").attr("src","about:blank");
  241. $("#tab4").attr("src","about:blank");
  242. $("#tab5").attr("src","about:blank");
  243. $("#tab6").attr("src","about:blank");
  244. $("#tab7").attr("src","about:blank");
  245. $("#tab8").attr("src","about:blank");
  246. $("#tab9").attr("src","about:blank");
  247. $("#tab10").attr("src","about:blank");
  248. }
  249. function clicktab10()
  250. {
  251. $("#tab10").attr("src","<%=request.getContextPath()%>/matrix/matrixList.action");
  252. $("#tab3").attr("src","about:blank");
  253. $("#tab1").attr("src","about:blank");
  254. $("#tab4").attr("src","about:blank");
  255. $("#tab5").attr("src","about:blank");
  256. $("#tab6").attr("src","about:blank");
  257. $("#tab7").attr("src","about:blank");
  258. $("#tab8").attr("src","about:blank");
  259. $("#tab9").attr("src","about:blank");
  260. $("#tab2").attr("src","about:blank");
  261. }
  262. function clicktab3()
  263. {
  264. $("#tab11").attr("src","<%=request.getContextPath()%>/agc/agcindexNew.action");
  265. $("#tab1").attr("src","about:blank");
  266. $("#tab2").attr("src","about:blank");
  267. $("#tab3").attr("src","about:blank");
  268. $("#tab4").attr("src","about:blank");
  269. $("#tab5").attr("src","about:blank");
  270. $("#tab6").attr("src","about:blank");
  271. $("#tab7").attr("src","about:blank");
  272. $("#tab8").attr("src","about:blank");
  273. $("#tab9").attr("src","about:blank");
  274. $("#tab10").attr("src","about:blank");
  275. $("#tab12").attr("src","about:blank");
  276. $("#tab13").attr("src","about:blank");
  277. }
  278. function clicktab4()
  279. {
  280. $("#tab11").attr("src","<%=request.getContextPath()%>/agc/agcindexNew.action");
  281. $("#tab1").attr("src","about:blank");
  282. $("#tab2").attr("src","about:blank");
  283. $("#tab3").attr("src","about:blank");
  284. $("#tab4").attr("src","about:blank");
  285. $("#tab5").attr("src","about:blank");
  286. $("#tab6").attr("src","about:blank");
  287. $("#tab7").attr("src","about:blank");
  288. $("#tab8").attr("src","about:blank");
  289. $("#tab9").attr("src","about:blank");
  290. $("#tab10").attr("src","about:blank");
  291. $("#tab12").attr("src","about:blank");
  292. $("#tab13").attr("src","about:blank");
  293. }
  294. function clicktab12()
  295. {
  296. $("#tab12").attr("src","<%=request.getContextPath()%>/matrix/indexStatus.action");
  297. $("#tab1").attr("src","about:blank");
  298. $("#tab2").attr("src","about:blank");
  299. $("#tab3").attr("src","about:blank");
  300. $("#tab4").attr("src","about:blank");
  301. $("#tab5").attr("src","about:blank");
  302. $("#tab6").attr("src","about:blank");
  303. $("#tab7").attr("src","about:blank");
  304. $("#tab8").attr("src","about:blank");
  305. $("#tab9").attr("src","about:blank");
  306. $("#tab10").attr("src","about:blank");
  307. $("#tab11").attr("src","about:blank");
  308. $("#tab13").attr("src","about:blank");
  309. }
  310. function clicktab13(){
  311. $("#tab13").attr("src","http://11.0.118.58:8070/bi/showreport.do?resid=EBI$12$9UUFC0MUONU6M4JUCUNZY7WWY6U7CO60$1$OCI9UNJAUUY3B61C1FYEK01A42CUZFSY.rpttpl&id=admin&pw=admin&showmenu=false&showparams=true&calcnow=true");
  312. $("#tab1").attr("src","about:blank");
  313. $("#tab2").attr("src","about:blank");
  314. $("#tab3").attr("src","about:blank");
  315. $("#tab4").attr("src","about:blank");
  316. $("#tab5").attr("src","about:blank");
  317. $("#tab6").attr("src","about:blank");
  318. $("#tab7").attr("src","about:blank");
  319. $("#tab8").attr("src","about:blank");
  320. $("#tab9").attr("src","about:blank");
  321. $("#tab10").attr("src","about:blank");
  322. $("#tab11").attr("src","about:blank");
  323. $("#tab12").attr("src","about:blank");
  324. }
  325. <%-- function clicktab11()
  326. {
  327. $("#tab12").attr("src","<%=request.getContextPath()%>/matrix/monitornew.action");
  328. $("#tab10").attr("src","about:blank");
  329. $("#tab3").attr("src","about:blank");
  330. $("#tab1").attr("src","about:blank");
  331. $("#tab4").attr("src","about:blank");
  332. $("#tab5").attr("src","about:blank");
  333. $("#tab6").attr("src","about:blank");
  334. $("#tab7").attr("src","about:blank");
  335. $("#tab8").attr("src","about:blank");
  336. $("#tab9").attr("src","about:blank");
  337. $("#tab2").attr("src","about:blank");
  338. } --%>
  339. </script>
  340. </head>
  341. <body>
  342. <table width="1899px" border="0" cellspacing="0" cellpadding="0">
  343. <tr>
  344. <td height="50px" align="right" valign="top"
  345. background="<%=request.getContextPath()%>/resource/images/hbsj/benner.png">
  346. </td>
  347. </tr>
  348. </table>
  349. <div id="tabs"
  350. style="width: 1899px;height: 879px;border: 0px;margin: 0px">
  351. <ul>
  352. <li><a href="#tabs-1" onclick="clicktab1()"
  353. style="cursor: pointer;">领导驾驶舱</a>
  354. </li>
  355. <li><a href="#tabs-2" onclick="clicktab2()">状态监视
  356. </a>
  357. </li>
  358. <li><a href="#tabs-3" >设备矩阵
  359. </a>
  360. </li>
  361. <li><a href="#tabs-4">性能分析</a>
  362. </li>
  363. <li><a href="#tabs-5">对标管理</a>
  364. </li>
  365. <li><a href="#tabs-6">指标排行</a>
  366. </li>
  367. <li><a href="#tabs-7">等级评估</a>
  368. </li>
  369. <li><a href="#tabs-8" id="tab_8">报警中心</a>
  370. </li>
  371. <li><a href="#tabs-9">报表管理</a>
  372. </li>
  373. <li><a href="#tabs-10" onclick="clicktab10()"
  374. style="cursor: pointer;">状态管理</a>
  375. </li>
  376. <!--<li><a href="#tabs-12" onclick="clicktab12()"
  377. style="cursor: pointer;">通讯监视</a>
  378. </li>
  379. -->
  380. <li><a href="#tabs-13" onclick="clicktab13()"
  381. style="cursor: pointer;">公司日报</a>
  382. </li>
  383. <!-- <li><a href="#tabs-12" onclick="clicktab11()" style="cursor: pointer;">明细矩阵</a></li> -->
  384. </ul>
  385. <div id="tabs-1" style="border: 0px;margin: 0px">
  386. <iframe id="tab1" src="<%=request.getContextPath()%>/desktop.action"
  387. style="border: 0px;margin: 0px" marginwidth="0px" marginheight="0px"
  388. frameborder="0" width="1899px" height="880px" scrolling="no"></iframe>
  389. </div>
  390. <div id="tabs-2">
  391. <iframe id="tab2" src="about:blank" style="border: 0px;margin: 0px"
  392. marginwidth="0px" marginheight="0px" frameborder="0" width="1899px"
  393. height="880px" scrolling="auto"></iframe>
  394. </div>
  395. <div id="tabs-3">
  396. <iframe id="tab3" src="about:blank" style="border: 0px;margin: 0px"
  397. marginwidth="0px" marginheight="0px" frameborder="0" width="1899px"
  398. height="880px" scrolling="auto"></iframe>
  399. </div>
  400. <div id="tabs-4">
  401. <iframe id="tab4" src="about:blank" style="border: 0px;margin: 0px"
  402. marginwidth="0px" marginheight="0px" frameborder="0" width="1899px"
  403. height="880px" scrolling="auto"></iframe>
  404. </div>
  405. <div id="tabs-5">
  406. <iframe id="tab5" src="about:blank" style="border: 0px;margin: 0px"
  407. marginwidth="0px" marginheight="0px" frameborder="0" width="1890px"
  408. height="880px" scrolling="auto"></iframe>
  409. </div>
  410. <div id="tabs-6">
  411. <iframe id="tab6" src="about:blank" style="border: 0px;margin: 0px"
  412. marginwidth="0px" marginheight="0px" frameborder="0" width="1890px"
  413. height="879px" scrolling="auto"></iframe>
  414. </div>
  415. <div id="tabs-7">
  416. <iframe id="tab7" src="about:blank" style="border: 0px;margin: 0px"
  417. marginwidth="0px" marginheight="0px" frameborder="0" width="1890px"
  418. height="879px" scrolling="auto"></iframe>
  419. </div>
  420. <div id="tabs-8">
  421. <iframe id="tab8" src="about:blank" style="border: 0px;margin: 0px"
  422. marginwidth="0px" marginheight="0px" frameborder="0" width="1890px"
  423. height="879px" scrolling="auto"></iframe>
  424. </div>
  425. <div id="tabs-9">
  426. <iframe id="tab9" src="about:blank" style="border: 0px;margin: 0px"
  427. marginwidth="0px" marginheight="0px" frameborder="0" width="1890px"
  428. height="879px" scrolling="auto"></iframe>
  429. </div>
  430. <div id="tabs-10">
  431. <iframe id="tab10" src="about:blank" style="border: 0px;margin: 0px"
  432. marginwidth="0px" marginheight="0px" frameborder="0" width="1890px"
  433. height="879px" scrolling="auto"></iframe>
  434. </div>
  435. <!--<div id="tabs-12">
  436. <iframe id="tab12" src="about:blank" style="border: 0px;margin: 0px"
  437. marginwidth="0px" marginheight="0px" frameborder="0" width="1890px"
  438. height="879px" scrolling="no"></iframe>
  439. </div>
  440. -->
  441. <div id="tabs-13">
  442. <iframe id="tab13" src="about:blank" style="border: 0px;margin: 0px"
  443. marginwidth="0px" marginheight="0px" frameborder="0" width="1890px"
  444. height="879px" scrolling="no"></iframe>
  445. </div>
  446. </div>
  447. <style type="text/css">
  448. ul {
  449. list-style: none;
  450. }
  451. .slides {
  452. position: fixed;
  453. right: 0;
  454. top: 94%;
  455. }
  456. </style>
  457. <!--侧边栏-->
  458. <div class="slides">
  459. <div id='switch_pic' title="开启或关闭实时报警弹出!"
  460. style="cursor:hand;width: 30px;height: 30px;" onclick="doSwitch();">
  461. </div>
  462. </div>
  463. <div id="jquery_jplayer_1"></div>
  464. <script
  465. src="<%=request.getContextPath()%>/resource/js/jquery.toast.min.js"></script>
  466. <link rel="stylesheet" type="text/css"
  467. href="<%=request.getContextPath()%>/resource/css/jquery.toast.min.css" />
  468. <script
  469. src="<%=request.getContextPath()%>/resource/js/jplayer/jquery.jplayer.min.js"></script>
  470. <script type="text/javascript">
  471. function doSwitch(){
  472. var isRun = getCookie('lug.gdhf.gyee');
  473. if(isRun==null || isRun == 'run'){
  474. setCookie('lug.gdhf.gyee','stop');
  475. $("#switch_pic")[0].style.background = "url('/resource/images/system/close.png')";
  476. }else{
  477. setCookie('lug.gdhf.gyee','run');
  478. $("#switch_pic")[0].style.background = "url('/resource/images/system/open.png')";
  479. }
  480. }
  481. function setCookie(name,value){//两个参数,一个是cookie的名子,一个是值
  482. var Days = 30; //此 cookie 将被保存 30 天
  483. var exp = new Date(); //new Date("December 31, 9998");
  484. exp.setTime(exp.getTime() + Days*24*60*60*1000);
  485. document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
  486. var message;
  487. var bg_color;
  488. if(value=='stop'){
  489. message='页面实时报警关闭成功';
  490. bg_color='#857788';
  491. }else{
  492. message='页面实时报警开启成功';
  493. bg_color='#5EA279';
  494. }
  495. $.toast({
  496. heading: '报警信息',
  497. text: message,
  498. position: 'bottom-right',
  499. bgColor: bg_color, // Background color of the toast
  500. textColor: '#ffffff', // Text color of the toast
  501. textAlign: 'left', // Text alignment i.e. left, right or center
  502. loader: true, // Whether to show loader or not. True by default
  503. loaderBg: '#b5ff44', // Background color of the toast loader
  504. showHideTransition: 'slide',
  505. hideAfter:false,
  506. stack: false
  507. });
  508. }
  509. function getCookie(name){//取cookies函数
  510. var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
  511. if(arr != null) return unescape(arr[2]); return null;
  512. }
  513. var version;
  514. function message(){
  515. var isRun = getCookie('lug.gdhf.gyee');
  516. if(isRun==null){
  517. isRun = 'run';
  518. setCookie('lug.gdhf.gyee','run');
  519. }
  520. if(isRun=='stop'){//实时改变图标
  521. $("#switch_pic")[0].style.background = "url('/resource/images/system/close.png')";
  522. return;
  523. }else{
  524. $("#switch_pic")[0].style.background = "url('/resource/images/system/open.png')";
  525. }
  526. $.ajax({
  527. url: "<%=request.getContextPath()%>/message/warning.action",
  528. cache: false,
  529. dataType: "json",
  530. type: "post",
  531. data: {
  532. 'version': version
  533. },
  534. timeout: 3000,
  535. success: function (msg) {
  536. if(msg!=null&&msg!=''){
  537. if((version != null && version < msg.version) && msg.message != null){
  538. version = msg.version;
  539. doSound();//用的时候打开,防止提交后别人重复报警
  540. var message = '<a href="#" onclick="mockClick();">';
  541. message = message + msg.message;
  542. message = message + '</a>';
  543. $.toast({
  544. heading: '报警信息',
  545. text: message,
  546. position: 'bottom-right',
  547. bgColor: '#d5634a', // Background color of the toast
  548. textColor: '#ffffff', // Text color of the toast
  549. textAlign: 'left', // Text alignment i.e. left, right or center
  550. loader: true, // Whether to show loader or not. True by default
  551. loaderBg: '#b5ff44', // Background color of the toast loader
  552. hideAfter:false,
  553. showHideTransition: 'slide',
  554. stack: false
  555. });
  556. }else if(version == null && msg.version!=null){//第一次加载页面,不报警
  557. version = msg.version;
  558. }
  559. }
  560. }
  561. })
  562. }
  563. function doSound(){
  564. if(!!window.ActiveXObject || "ActiveXObject" in window){
  565. $("#jquery_jplayer_1").jPlayer({
  566. ready: function () {
  567. $(this).jPlayer("setMedia", {
  568. mp3: "<%=request.getContextPath()%>/resource/js/jplayer/warn.mp3"
  569. });
  570. $(this).jPlayer("play");
  571. },
  572. swfPath: "<%=request.getContextPath()%>/resource/js/jplayer",
  573. supplied: "mp3"
  574. }).jPlayer("play");
  575. }else{
  576. $("#jquery_jplayer_1").jPlayer({
  577. ready: function () {
  578. $(this).jPlayer("setMedia", {
  579. oga: "<%=request.getContextPath()%>/resource/js/jplayer/warn.ogg"
  580. });
  581. $(this).jPlayer("play");
  582. },
  583. swfPath: "<%=request.getContextPath()%>/resource/js/jplayer",supplied : "oga"}).jPlayer("play");
  584. }
  585. }
  586. function mockClick() {
  587. $("#tab_8").trigger("click");
  588. }
  589. window.onload = function() {
  590. var isRun = getCookie('lug.gdhf.gyee');
  591. if (isRun != null && isRun == 'stop') {//实时改变图标
  592. $("#switch_pic")[0].style.background = "url('/resource/images/system/close.png')";
  593. } else {
  594. $("#switch_pic")[0].style.background = "url('/resource/images/system/open.png')";
  595. }
  596. window.setInterval(message, 20000);
  597. };
  598. </script>
  599. </body>
  600. </html>