796a20480e9d8f6efb275981a69f002b7610b025.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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/page/cockpit/webgis/util.js"></script> -->
  14. <script type="text/javascript" src="/nwyj/scripts/cockpit/cockpitIndex/util.js"></script>
  15. <link rel="stylesheet" type="text/css" href=" /nwyj/css/cockpit/commom/ehcartPage.css" />
  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. <!-- 驾驶舱与首页显示的样式 end -->
  23. <script type="text/javascript" src="/nwyj/scripts/cockpit/search/search_util.js"></script>
  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 id="i_page_head_subtitle"></div>
  31. </div>
  32. <div id="i_page_chart" class="c_page_chart">
  33. </div>
  34. </div>
  35. <script type="text/javascript">
  36. var pageParam={};
  37. var chart=null;
  38. var utils=new Util();
  39. var searchUtil = new SearchUtil();
  40. $(function(){
  41. pageParam.style=utils.resolveUrl()["style"]||"style1";
  42. pageParam.title=utils.resolveUrl()["title"]||"广东电网公司";
  43. pageParam.number=utils.resolveUrl()["number"]||warnningnumber;
  44. pageParam.compId=utils.resolveUrl()["dept_id"]||11;
  45. init();
  46. });
  47. /**
  48. *初始化方法
  49. */
  50. function init(){
  51. if(utils.resolveUrl().dataSourceState==0){
  52. loadChart(pageParam);
  53. }else{
  54. changeSysDataLoadChart(pageParam);
  55. }
  56. }
  57. function loadChart(jsonParam){
  58. pageParam.isalert=null;
  59. if(pageParam.number.split("|")[0]=="预警"){
  60. pageParam.isalert="0";
  61. }else{
  62. pageParam.isalert="1";
  63. }
  64. pageParam.number=pageParam.number.split("|")[1];
  65. $.post("/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getChildDataOrSelfByWarnningNumber",{charType:"xianlutiaozha",name:"getChildsRecodeSumData",number:jsonParam.number,compId:jsonParam.compId,isalert:pageParam.isalert,viewName:"ROUTE_OFLINE_RESTORE_VIEW"},function(result){
  66. if(result.rows.length==0){
  67. zeroChart();
  68. return;
  69. }
  70. veriColor();
  71. removeNoData();
  72. var sArr=[
  73. {type:"bar",
  74. name:"跳闸数",
  75. data:[],
  76. barMaxWidth:40,
  77. itemStyle: {
  78. normal: {
  79. borderWidth: 1,
  80. borderColor:"tomato",
  81. color: pageStyle[jsonParam.style]["chartColor"][0],
  82. label:
  83. {
  84. show:true,
  85. position:"top",
  86. textStyle:
  87. {
  88. color: "rgb(255, 255, 255)",
  89. fontSize: 14,
  90. fontStyle: "normal",
  91. fontWeight: "bold"
  92. }
  93. }
  94. }
  95. },
  96. },
  97. {
  98. type:"bar",
  99. //stack:"sum",
  100. name:"未恢复",
  101. data:[],
  102. barMaxWidth:40,
  103. itemStyle: {
  104. normal: {borderWidth: 1,
  105. borderColor:"tomato",
  106. color: pageStyle[jsonParam.style]["chartColor"][1],
  107. label : { show : true,
  108. position:"top",
  109. textStyle: {
  110. color: "rgb(255, 255, 255)",
  111. fontSize: 14,
  112. fontStyle: "normal",
  113. fontWeight: "bold"
  114. }
  115. }
  116. }}
  117. }
  118. ];
  119. var xAxis=[];
  120. var data=result.rows[0];
  121. var total=0;
  122. var untotal=0;
  123. var max = 0;
  124. for(var index=0,len=result.rows.length;index<len;index++){
  125. var item=result.rows[index];
  126. var sum=utils.changeQ(item["sum"]);
  127. var un=utils.changeQ(item["unsum"]);
  128. total+=sum;
  129. max = max < sum ? sum : max;
  130. untotal+=un;
  131. //if(sum!=0 || un!=0 ){
  132. sArr[0].data.push({value:sum,
  133. data:{
  134. state:"NO_RECOVER_",
  135. compId:item["COMP_ID"],
  136. deptId:jsonParam.compId,
  137. number:jsonParam.number,
  138. style:jsonParam.style,
  139. text:item["DEPT_NAME"],
  140. legendColor:legendC,
  141. xAxisColor:xAxisC,
  142. yAxisColor:yAxisC
  143. }
  144. });
  145. sArr[1].data.push({value:un,
  146. data:{
  147. state:"TRIP_OUT_",
  148. compId:item["COMP_ID"],
  149. number:jsonParam.number,
  150. deptId:jsonParam.compId,
  151. style:jsonParam.style,
  152. text:item["DEPT_NAME"],
  153. legendColor:legendC,
  154. xAxisColor:xAxisC,
  155. yAxisColor:yAxisC
  156. }
  157. });
  158. xAxis.push(subStrDept(item["DEPT_NAME"]));
  159. //}
  160. }
  161. /* if(xAxis.length==0){
  162. zeroChartIntoParam("目前子部门的数据全部为0");
  163. return;
  164. } */
  165. max=(parseInt(max/10)+1)*10;
  166. //设置x轴显示1行或两行
  167. var showHang=0;
  168. if(pageParam.compId=="C984DC9C294A486096C25FAA78C99AED"){
  169. showHang=1;
  170. }else{
  171. showHang=2;
  172. }
  173. pageParam.opParams={
  174. title:"起始:"+data["SEND_TIME"]+":00"+" 截止:"+data["APPEAR_TIME"],//标题
  175. //title:"截止:"+data["APPEAR_TIME"],//标题
  176. subtext:"10kV及以上电压跳闸总数:"+total+"(条)\n10kV及以上电压跳闸未恢复总数:"+untotal+"(条)",
  177. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  178. unit:"条",//单位
  179. leArr:["跳闸数","未恢复"],//图例
  180. xAxis:xAxis,//x轴
  181. sArr:sArr,//主数据
  182. legendColor:legendC,
  183. xAxisColor:xAxisC,
  184. yAxisColor:yAxisC,
  185. isVertical:true,
  186. fold:showHang,
  187. min:0,
  188. max:max
  189. };
  190. chart=getEchart($("#i_page_chart"),getOption,pageParam.opParams,null);
  191. bindEvent();
  192. //自适应
  193. $(window).resize(function(){
  194. chart.resize();
  195. });
  196. },"json");
  197. //设置标题的名称
  198. $("#i_page_head_title").empty();
  199. setTitle();
  200. }
  201. /**
  202. *设置标题
  203. */
  204. function setTitle(){
  205. $("#i_page_head_title").find("h2").remove();
  206. if(pageParam.title=="广东电网有限责任公司"){
  207. pageParam.title="广东电网公司";
  208. }
  209. $("#i_page_head_title").append("<h2>"+pageParam.title+"线路跳闸统计</h2>");
  210. }
  211. /**
  212. * 绑定人工点击事件
  213. */
  214. function bindEvent(){
  215. //点击事件
  216. chart.on("click",function(params){
  217. var pathStr=url["http_path"]+"page/cockpit/echart_maticView/line_trip/line_trip_child_pie.html?"+$.param(params.data.data);
  218. utils.openIframe(pathStr)
  219. });
  220. }
  221. /*dwr推送人工数据方法 */
  222. function dwrData(number){
  223. if(0!=top.dataSourceState) return;
  224. if(number== pageParam.number){
  225. loadChart(pageParam);
  226. }
  227. }
  228. /*dwr推送系统数据方法 */
  229. function dwrSysData(number){
  230. if(1!=top.dataSourceState) return;
  231. //如果需要关联通知单,放开注释即可
  232. // if(number== pageParam.number){
  233. changeSysData(pageParam);
  234. // }
  235. }
  236. /*********************************************************************************************************/
  237. function changeSysData(number){
  238. pageParam.number=number;
  239. changeSysDataLoadChart(pageParam)
  240. }
  241. function changeSysDataLoadChart(jsonParam){
  242. setTitle();
  243. if("C984DC9C294A486096C25FAA78C99AED"!= jsonParam.compId){
  244. if("C984DC9C294A486096C25FAA78C99AED"!= jsonParam.parentId){
  245. zeroChartIntoParam("本单位未提供系统数据源");
  246. return;
  247. }
  248. }
  249. $.post("/nwyj/ws/SystemDataSourceChartServiceImpl/SystemDataSourceChartServiceImpl/getLineChildTripByDept",
  250. {number:/* "防风防汛-F-2016-63" */ jsonParam.number,compId:jsonParam.compId},function(result){
  251. if("FAILURE"==result.state){
  252. zeroChartIntoParam(result.rows);
  253. return;
  254. }
  255. if(result.rows.length==0){
  256. zeroChart();
  257. return;
  258. }
  259. veriColor();
  260. removeNoData();
  261. var sArr=[
  262. {type:"bar",
  263. name:"跳闸数",
  264. data:[],
  265. barMaxWidth:40,
  266. itemStyle: {
  267. normal: {
  268. borderWidth: 1,
  269. borderColor:"tomato",
  270. color: pageStyle[jsonParam.style]["chartColor"][0],
  271. label:
  272. {
  273. show:true,
  274. position:"top",
  275. textStyle:
  276. {
  277. color: "rgb(255, 255, 255)",
  278. fontSize: 14,
  279. fontStyle: "normal",
  280. fontWeight: "bold"
  281. }
  282. }
  283. }
  284. },
  285. },
  286. {
  287. type:"bar",
  288. //stack:"sum",
  289. name:"未恢复",
  290. data:[],
  291. barMaxWidth:40,
  292. itemStyle: {
  293. normal: {borderWidth: 1,
  294. borderColor:"tomato",
  295. color: pageStyle[jsonParam.style]["chartColor"][1],
  296. label : { show : true,
  297. position:"top",
  298. textStyle: {
  299. color: "rgb(255, 255, 255)",
  300. fontSize: 14,
  301. fontStyle: "normal",
  302. fontWeight: "bold"
  303. }
  304. }
  305. }}
  306. }
  307. ];
  308. var xAxis=[];
  309. var data=result.rows[0];
  310. //alert(JSON.stringify(data));
  311. var total=0;
  312. var untotal=0;
  313. var max = 0;
  314. for(var index=0,len=result.rows.length;index<len;index++){
  315. var item=result.rows[index];
  316. //alert(JSON.stringify(item));
  317. var sum=utils.changeQ(item["mainT"])+utils.changeQ(item["helpT"]);
  318. var un=utils.changeQ(item["mainW"])+utils.changeQ(item["helpW"]);
  319. total+=sum;
  320. max = max < sum ? sum : max;
  321. untotal+=un;
  322. if(sum!=0 || un!=0 ){
  323. sArr[0].data.push({value:sum,
  324. data:{
  325. text:pageParam.title,
  326. compId:item["DEPT_ID"],
  327. text:jsonParam.title,
  328. style:jsonParam.style,
  329. reportId:data["REPORT_ID"],
  330. }
  331. });
  332. sArr[1].data.push({value:un,
  333. data:{
  334. text:pageParam.title,
  335. compId:item["DEPT_ID"],
  336. text:jsonParam.title,
  337. style:jsonParam.style,
  338. reportId:data["REPORT_ID"],
  339. }
  340. });
  341. xAxis.push(subStrDept(item["DEPT_NAME"]));
  342. }
  343. }
  344. if(xAxis.length==0){
  345. zeroChartIntoParam("目前子部门的数据全部为0");
  346. return;
  347. }
  348. var date = new Date();
  349. var appear_time = new SearchUtil().getNowFormatDateTime(date);
  350. max=(parseInt(max/10)+1)*10;
  351. pageParam.opParams={
  352. title:"截止:"+data["APPEAR_TIME"],//data["APPEAR_TIME"],//标题
  353. subtext:"220kV及以上电压跳闸总数:"+parseInt(data["mainT"])+"(条)\n220kV及以上电压跳闸未恢复总数:"+parseInt(data["mainW"])+"(条)",
  354. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  355. unit:"条",//单位
  356. leArr:["跳闸数","未恢复"],//图例
  357. xAxis:xAxis,//x轴
  358. sArr:sArr,//主数据
  359. legendColor:legendC,
  360. xAxisColor:xAxisC,
  361. yAxisColor:yAxisC,
  362. min:0,
  363. max:max
  364. };
  365. chart=getEchart($("#i_page_chart"),getOption,pageParam.opParams,null);
  366. bindSysEvent();
  367. //自适应
  368. $(window).resize(function(){
  369. chart.resize();
  370. });
  371. },"json");
  372. //设置标题的名称
  373. //$("#i_page_head_title").empty();
  374. }
  375. /**
  376. * 绑定系统点击事件
  377. */
  378. function bindSysEvent(){
  379. //点击事件
  380. chart.on("click",function(params){
  381. //var pathStr=url["http_path"]+"page/cockpit/echart_maticView/line_trip/line_trip_child_pie.html?"+$.param(params.data.data);
  382. /* var pathStr=url["http_path"]+"page/cockpit/echart_maticView/line_trip/sys_line_trip_sum_chart_by_dept_grid.html?"+$.param(params.data.data); */
  383. var pathStr=url["http_path"]+"page/cockpit/echart_maticView/line_trip/sys_Line_trip_sum_chart_zhuwang_grid.html?"+$.param(params.data.data);
  384. utils.openIframe(pathStr)
  385. });
  386. }
  387. function subStrDept(str){
  388. str=str.replace("供电局","");
  389. str=str.replace("供电所","");
  390. return str;
  391. }
  392. function subDate(str){
  393. if(str==null || str==undefined) return "-";
  394. return str.substring(0,str.indexOf("."));
  395. }
  396. </script>
  397. </body>
  398. </html>