626e55a20661ed020d1a0d49b92c4b93d2725695.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>线路跳闸统计-不同电压</title>
  5. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  8. <script type="text/javascript" src="/nwyj/scripts/cockpit/cockpitIndex/context.js"></script>
  9. <script type="text/javascript" src="/nwyj/page/cockpit/echarts-2.2.7/build/dist/echarts.min.js"></script>
  10. <script type="text/javascript" src="/nwyj/page/cockpit/echarts-2.2.7/build/dist/echarts-all.min.js"></script>
  11. <script type="text/javascript" src="/nwyj/page/cockpit/echarts-2.2.7/build/dist/chart/bar.js"></script>
  12. <script type="text/javascript" src=" /nwyj/page/cockpit/cockpit_echart.js"></script>
  13. <script type="text/javascript" src="/nwyj/scripts/cockpit/cockpitIndex/util.js"></script>
  14. <link rel="stylesheet" type="text/css" href=" /nwyj/css/cockpit/commom/ehcartPage.css" />
  15. <script type="text/javascript" src="/nwyj/scripts/cockpit/search/search_util.js"></script>
  16. <!-- dwr 实现消息推送功能 star-->
  17. <script type='text/javascript' src='/nwyj/dwr/engine.js'></script>
  18. <script type='text/javascript' src='/nwyj/dwr/util.js'></script>
  19. <!-- dwr 实现消息推送功能 end-->
  20. <!-- 驾驶舱与首页显示的样式 star -->
  21. <script type="text/javascript" src="/nwyj/scripts/cockpit/cockpitIndex/cockpitANDmainIndex.js"></script>
  22. <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/right/ReSetIdxHeight.js"></script>
  23. <!-- 驾驶舱与首页显示的样式 end -->
  24. </head>
  25. <body onload="dwr.engine.setActiveReverseAjax(true);dwr.engine.setNotifyServerOnPageUnload(true);">
  26. <div id="i_page_main" class="c_page_main">
  27. <div id="i_page_head" class="c_page_head">
  28. <div id="i_page_head_title">
  29. </div>
  30. </div>
  31. <!-- 专题图 -->
  32. <div id="i_page_chart" class="c_page_chart"></div>
  33. </div>
  34. <script type="text/javascript">
  35. var pageParam={};
  36. var chart=null;
  37. var utils=new Util();
  38. var searchUtil = new SearchUtil();
  39. $(function(){
  40. pageParam.style=utils.resolveUrl()["style"]||"style1";
  41. pageParam.title=utils.resolveUrl()["title"]||"广东电网";
  42. pageParam.number=utils.resolveUrl()["number"]||warnningnumber;
  43. pageParam.compId=utils.resolveUrl()["dept_id"]||11;
  44. init();
  45. //首页里面加载Iframe展开方法
  46. setIframe(iframModuleID);
  47. });
  48. function init(){
  49. if(utils.resolveUrl().dataSourceState==0){
  50. loadChart(pageParam);
  51. }else{
  52. changeSysDataLoadChart(pageParam);
  53. }
  54. }
  55. function loadChart(jsonParam){
  56. pageParam.isalert=null;
  57. if(pageParam.number.split("|")[0]=="预警"){
  58. pageParam.isalert="0";
  59. }else{
  60. pageParam.isalert="1";
  61. }
  62. pageParam.number=pageParam.number.split("|")[1];
  63. $.post("/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getChildDataOrSelfByWarnningNumber",{charType:"xianlutiaozha",name:"getRecodeSumData",number:jsonParam.number,isalert:pageParam.isalert,compId:jsonParam.compId,viewName:"ROUTE_OFLINE_RESTORE_VIEW"},function(result){
  64. if(result.rows.length==0){
  65. zeroChart();
  66. return;
  67. }
  68. veriColor();
  69. var suml="TRIP_OUT_";
  70. var unl="NO_RECOVER_";
  71. var tempLevel=["ONE","TWO","THREE","FOUR","FIVE"];
  72. var tempXAxis=["500kV","220kV","110kV","35kV","10kV"];
  73. var sArr=[ {
  74. type:"bar",
  75. // stack:"sum",
  76. barMaxWidth:30,
  77. name:"跳闸数",data:[],
  78. itemStyle: {
  79. normal: {
  80. borderWidth: 1,
  81. borderColor:"tomato",
  82. color: pageStyle[jsonParam.style]["chartColor"][0],
  83. label:
  84. {
  85. show:true,
  86. position:"top",
  87. textStyle:
  88. {
  89. color: "rgb(255, 255, 255)",
  90. fontSize: 10,
  91. fontStyle: "normal",
  92. fontWeight: "bold"
  93. }
  94. }
  95. }
  96. },
  97. },
  98. {
  99. type:"bar",
  100. //stack:"sum",
  101. name:"未恢复",
  102. data:[],
  103. barMaxWidth:30,
  104. itemStyle: {
  105. normal: {
  106. borderWidth: 1,
  107. borderColor:"tomato",
  108. color: pageStyle[jsonParam.style]["chartColor"][1],
  109. label : { show : true,
  110. position: "top",
  111. textStyle: {
  112. color: "rgb(255, 255, 255)",
  113. fontSize: 10,
  114. fontStyle: "normal",
  115. fontWeight: "bold"
  116. }
  117. }
  118. }}
  119. }
  120. ];
  121. var xAxis=[];
  122. var data=result.rows[0];
  123. var max = 0;
  124. for(var index=0,len=tempLevel.length;index<len;index++){
  125. var sum=utils.changeQ(data[suml+tempLevel[index]]);
  126. var un=utils.changeQ(data[unl+tempLevel[index]]);
  127. max = max < sum ? sum : max;
  128. max = max < un ? un : max;
  129. /* if(sum!=0 && un!=0){ */
  130. xAxis.push(tempXAxis[index]);
  131. sArr[0].data.push({value:sum,stack:"sum",data:{text:pageParam.title,
  132. level:tempXAxis[index],
  133. compId:jsonParam.compId,
  134. text:jsonParam.title,
  135. number:jsonParam.number,
  136. tempLevel:tempLevel[index],style:jsonParam.style,
  137. recordId:data["REPORT_ID"],
  138. levelLabel:suml+tempLevel[index]}});
  139. sArr[1].data.push({value:un,stack:"sum",data:{text:pageParam.title,
  140. level:tempXAxis[index],
  141. compId:jsonParam.compId,
  142. text:jsonParam.title,
  143. number:jsonParam.number,
  144. tempLevel:tempLevel[index],
  145. style:jsonParam.style,
  146. recordId:data["REPORT_ID"],
  147. levelLabel:unl+tempLevel[index]}});
  148. /* } */
  149. }
  150. max=(parseInt(max/10)+1)*10;
  151. pageParam.opParams={
  152. //title:"截止:"+data["APPEAR_TIME"],//标题
  153. title:"起始:"+data["SEND_TIME"]+":00"+" 截止:"+data["APPEAR_TIME"],//标题
  154. subtext:"10kV及以上电压线路跳闸总数:"+data["sum"]+"(条)\n10kV及以上电压线路未恢复总数:"+data["unsum"]+"(条)",
  155. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  156. unit:"条",//单位
  157. leArr:["跳闸数","未恢复"],//图例
  158. xAxis:xAxis,//x轴
  159. sArr:sArr,//主数据
  160. legendColor:legendC,
  161. xAxisColor:xAxisC,
  162. yAxisColor:yAxisC,
  163. min:0,
  164. max:max
  165. };
  166. setTitle();
  167. chart=getEchart($("#i_page_chart"),getOption,pageParam.opParams,null);
  168. //bindEvent();
  169. //自适应
  170. $(window).resize(function(){
  171. chart.resize();
  172. });
  173. },"json");
  174. }
  175. /**
  176. * 人工数据源绑定点击事件
  177. */
  178. function bindEvent(){
  179. //点击事件
  180. chart.on("click",function(params){
  181. if(parseInt(params.data.data.level)>=110){
  182. lt110(params);
  183. }else{
  184. gt110(params);
  185. }
  186. });
  187. }
  188. /**
  189. *设置标题
  190. */
  191. function setTitle(){
  192. $("#i_page_head_title").find("h2").remove();
  193. if(pageParam.title=="广东电网有限责任公司"){
  194. pageParam.title="广东电网公司";
  195. }
  196. $("#i_page_head_title").append("<h2>"+pageParam.title+"线路跳闸统计</h2>");
  197. }
  198. /**
  199. * 小于110kV事件
  200. */
  201. function gt110(jsonParam){
  202. var pathStr=url["http_path"]+"page/cockpit/echart_maticView/line_trip/line_trip_sum_chart_lt110_grid.html?"+encodeURI ($.param(jsonParam.data.data));
  203. /* util.openIframe(pathStr); */
  204. utils.openIframe(pathStr)
  205. }
  206. /**
  207. * 大于等于110kV点击事件
  208. */
  209. function lt110(jsonParam){
  210. var pathStr=url["http_path"]+"page/cockpit/echart_maticView/line_trip/line_trip_sum_chart_gt110_grid.html?"+encodeURI ($.param(jsonParam.data.data));
  211. utils.openIframe(pathStr)
  212. }
  213. /*dwr推送人工数据方法 */
  214. function dwrData(number){
  215. if(0!=top.dataSourceState) return;
  216. if(number== pageParam.number){
  217. loadChart(pageParam);
  218. }
  219. }
  220. /*dwr推送系统数据方法 */
  221. function dwrSysData(number){
  222. if(1!=top.dataSourceState) return;
  223. //如果需要关联通知单,放开注释即可
  224. // if(number== pageParam.number){
  225. changeSysData(pageParam);
  226. // }
  227. }
  228. /********************************************系统数据源*******************************************************/
  229. function changeSysData(number){
  230. pageParam.number=number;
  231. changeSysDataLoadChart(pageParam)
  232. }
  233. function changeSysDataLoadChart(jsonParam){
  234. setTitle();
  235. if("C984DC9C294A486096C25FAA78C99AED"!= jsonParam.compId)
  236. if("C984DC9C294A486096C25FAA78C99AED"!= jsonParam.parentId){
  237. zeroChartIntoParam("本单位未提供系统数据源");
  238. return;
  239. }
  240. $.post("/nwyj/ws/SystemDataSourceChartServiceImpl/SystemDataSourceChartServiceImpl/getLineTripByDept",
  241. {number:jsonParam.number,compId:jsonParam.compId},function(result){
  242. if("FAILURE"==result.state){
  243. zeroChartIntoParam(result.rows);
  244. return;
  245. }
  246. if(result.rows.length==0){
  247. zeroChart();
  248. return;
  249. }
  250. veriColor();
  251. var tempLevel=["E","F","T","ONE","THREE","TEN"];
  252. var tempXAxis=["800kV","500kV","220kV","110kV","35kV","10kV"];
  253. var sArr=[ {
  254. type:"bar",
  255. // stack:"sum",
  256. barMaxWidth:30,
  257. name:"跳闸数",data:[],
  258. itemStyle: {
  259. normal: {
  260. borderWidth: 1,
  261. borderColor:"tomato",
  262. color: pageStyle[jsonParam.style]["chartColor"][0],
  263. label:
  264. {
  265. show:true,
  266. position:"top",
  267. textStyle:
  268. {
  269. color: "rgb(255, 255, 255)",
  270. fontSize: 10,
  271. fontStyle: "normal",
  272. fontWeight: "bold"
  273. }
  274. }
  275. }
  276. },
  277. },
  278. {
  279. type:"bar",
  280. //stack:"sum",
  281. name:"未恢复",
  282. data:[],
  283. barMaxWidth:30,
  284. itemStyle: {
  285. normal: {
  286. borderWidth: 1,
  287. borderColor:"tomato",
  288. color: pageStyle[jsonParam.style]["chartColor"][1],
  289. label : { show : true,
  290. position: "top",
  291. textStyle: {
  292. color: "rgb(255, 255, 255)",
  293. fontSize: 10,
  294. fontStyle: "normal",
  295. fontWeight: "bold"
  296. }
  297. }
  298. }}
  299. }
  300. ];
  301. var xAxis=[];
  302. var data=result.rows[0];
  303. //alert(JSON.stringify(data));
  304. var max=0;
  305. for(var index=0,len=tempLevel.length;index<len;index++){
  306. var sum=utils.changeQ(data[tempLevel[index]+"T"]);
  307. var un=utils.changeQ(data[tempLevel[index]+"W"]);
  308. max = max < sum ? sum : max;
  309. max = max < un ? un : max;
  310. /* if(sum!=0 && un!=0){ */
  311. xAxis.push(tempXAxis[index]);
  312. sArr[0].data.push({value:sum,stack:"sum",
  313. data:{
  314. text:pageParam.title,
  315. compId:jsonParam.compId,
  316. text:jsonParam.title,
  317. voltage:tempXAxis[index],
  318. style:jsonParam.style,
  319. reportId:data["FD_OBJECTID"],
  320. }
  321. });
  322. sArr[1].data.push({value:un,stack:"sum",
  323. data:{
  324. text:pageParam.title,
  325. compId:jsonParam.compId,
  326. text:jsonParam.title,
  327. voltage:tempXAxis[index],
  328. style:jsonParam.style,
  329. reportId:data["FD_OBJECTID"],
  330. }
  331. });
  332. /* } */
  333. }
  334. /* var date = new Date();
  335. var appear_time = new SearchUtil().getNowFormatDateTime(date); */
  336. max=(parseInt(max/10)+1)*10;
  337. pageParam.opParams={
  338. title:"截止:"+data["APPEAR_TIME"],//"截止:"+data["APPEAR_TIME"],//标题
  339. subtext:"220kV及以上电压线路跳闸总数:"+parseInt(data["mainT"])+"(条)\n220kV及以上电压线路未恢复总数:"+parseInt(data["mainW"])+"(条)",
  340. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  341. unit:"条",//单位
  342. leArr:["跳闸数","未恢复"],//图例
  343. xAxis:xAxis,//x轴
  344. sArr:sArr,//主数据
  345. legendColor:legendC,
  346. xAxisColor:xAxisC,
  347. yAxisColor:yAxisC,
  348. min:0,
  349. max:max
  350. };
  351. chart=getEchart($("#i_page_chart"),getOption,pageParam.opParams,null);
  352. bindSysEvent();
  353. },"json");
  354. }
  355. /**
  356. * 系统数据源绑定点击事件
  357. */
  358. function bindSysEvent(){
  359. //点击事件
  360. chart.on("click",function(params){
  361. if(params.data.data.voltage=="500kV"||params.data.data.voltage=="220kV"){
  362. var pathStr=url["http_path"]+"page/cockpit/echart_maticView/line_trip/sys_line_trip_sum_chart_gt110_grid.html?"+encodeURI ($.param(params.data.data));
  363. utils.openIframe(pathStr)
  364. }
  365. });
  366. //自适应
  367. $(window).resize(function(){
  368. chart.resize();
  369. });
  370. }
  371. function subDate(str){
  372. if(str==null || str==undefined) return "-";
  373. return str.substring(0,str.indexOf("."));
  374. }
  375. </script>
  376. </body>
  377. </html>