77350f4f1f1bfdad464b6509657138fc2dab25be.svn-base 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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/pie.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/dwr/engine.js'></script>
  16. <script type='text/javascript' src='/nwyj/dwr/util.js'></script>
  17. <script type="text/javascript" src="/nwyj/scripts/cockpit/search/search_util.js" ></script>
  18. </head>
  19. <body onload="dwr.engine.setActiveReverseAjax(true);dwr.engine.setNotifyServerOnPageUnload(true);">
  20. <div id="i_page_main" class="c_page_main">
  21. <div id="i_page_head" class="c_page_head">
  22. <div id="i_page_head_title">
  23. </div>
  24. <div id="i_page_head_subtitle"></div>
  25. </div>
  26. <div id="i_page_chart" class="c_page_chart">
  27. </div>
  28. </div>
  29. <script type="text/javascript">
  30. var pageParam={};
  31. var chart=null;
  32. var utils=new Util();
  33. var searchUtil = new SearchUtil();
  34. $(function(){
  35. pageParam.style=utils.resolveUrl()["style"]||"style1";
  36. pageParam.title=utils.resolveUrl()["title"]||"广东电网";
  37. pageParam.number=utils.resolveUrl()["number"]||warnningnumber;
  38. pageParam.compId=utils.resolveUrl()["dept_id"]||11;
  39. pageParam.startTime=start;
  40. pageParam.endTime=end;
  41. init();
  42. });
  43. function init(){
  44. if(utils.resolveUrl().dataSourceState==0){
  45. loadChart(pageParam);
  46. }else{
  47. changeSysDataLoadChart(pageParam);
  48. }
  49. }
  50. function loadChart(jsonParam){
  51. pageParam.isalert=null;
  52. if(pageParam.number.split("|")[0]=="预警"){
  53. pageParam.isalert="0";
  54. }else{
  55. pageParam.isalert="1";
  56. }
  57. pageParam.number=pageParam.number.split("|")[1];
  58. $.post("/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getChildDataOrSelfByWarnningNumber",{charType:"yonghutingdian",name:"getRecodeSumData",number:jsonParam.number,compId:jsonParam.compId,isalert:pageParam.isalert,viewName:"REPORT_GDSUNSHI_KEHUTD_VIEW"},function(result){
  59. if(result.rows.length==0){
  60. zeroChart();
  61. return;
  62. }
  63. removeNoData();
  64. var sArr=[{
  65. name:"重要用户停电数",
  66. type:"pie",
  67. data:[],
  68. radius : "55%",
  69. center: ["50%", "60%"],
  70. itemStyle: {
  71. normal: {borderWidth: 1,borderColor:"tomato",
  72. label : { show : true,
  73. position: "insideTop",
  74. textStyle: {fontSize: 14,fontStyle: "normal",fontWeight: "bold"},
  75. formatter: "{b} : {c} ({d}%)"
  76. }
  77. }
  78. }
  79. }];
  80. var xAxis=[];
  81. var item=result.rows[0];
  82. //alert(item["REPORT_ID"]);
  83. sArr[0].data.push({value:utils.changeQ(item["TJYH_TD_COUNT"]),name:"特级",color: pageStyle[jsonParam.style]["chartColor"][0],
  84. data:{recodeId:item["REPORT_ID"],
  85. level:"特级",
  86. levelLabel:"TJYH_TD_COUNT",
  87. text:pageParam.title,
  88. compId:item["PARENT_ID"]}});
  89. sArr[0].data.push({value:utils.changeQ(item["YJYH_TD_COUNT"]),name:"一级",color: pageStyle[jsonParam.style]["chartColor"][1],
  90. data:{recodeId:item["REPORT_ID"],
  91. text:pageParam.title,
  92. levelLabel:"YJYH_TD_COUNT",
  93. level:"一级",
  94. compId:item["PARENT_ID"]}});
  95. sArr[0].data.push({value:utils.changeQ(item["EJYH_TD_COUNT"]),name:"二级",color: pageStyle[jsonParam.style]["chartColor"][2],
  96. data:{recodeId:item["REPORT_ID"],
  97. level:"二级",
  98. levelLabel:"EJYH_TD_COUNT",
  99. text:pageParam.title,
  100. compId:item["PARENT_ID"]}});
  101. opParams={
  102. //title:"截止:"+item["APPEAR_TIME"],//标题
  103. title:"起始:"+item["SEND_TIME"]+":00"+" 截止:"+item["APPEAR_TIME"],//标题
  104. subtext:"重要用户停电总数:"+item["sum"]+" (户)",
  105. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  106. unit:"座",//单位
  107. leArr:["特级","一级","二级"],//图例
  108. xAxis:xAxis,//x轴
  109. sArr:sArr//主数据
  110. };
  111. chart=getEchart($("#i_page_chart"),getOption11,opParams,null);
  112. setTitle();
  113. bindEvent();
  114. },"json");
  115. }
  116. function setTitle(){
  117. $("#i_page_head_title").find("h2").remove();
  118. if(pageParam.title=="广东电网有限责任公司"){
  119. pageParam.title="广东电网公司";
  120. }
  121. $("#i_page_head_title").append("<h2>"+pageParam.title+"重要用户停电统计</h2>");
  122. }
  123. function bindEvent(){
  124. chart.on("click",function(params){
  125. var pathStr=url["http_path"]+"page/cockpit/echart_maticView/important_user_outage/important_user_grid.html?"+encodeURI($.param(params.data.data));
  126. utils.openIframe(pathStr)
  127. });
  128. $(window).resize(function(){
  129. chart.resize();
  130. });
  131. }
  132. /*dwr推送人工数据方法 */
  133. function dwrData(number){
  134. if(0!=top.dataSourceState) return;
  135. if(number== pageParam.number){
  136. loadChart(pageParam);
  137. }
  138. }
  139. /*dwr推送系统数据方法 */
  140. function dwrSysData(number){
  141. if(1!=top.dataSourceState) return;
  142. //如果需要关联通知单,放开注释即可
  143. // if(number== pageParam.number){
  144. changeSysData(pageParam);
  145. // }
  146. }
  147. /*************************************************************************************************************************/
  148. function changeSysData(number){
  149. pageParam.number=number;
  150. changeSysDataLoadChart(pageParam)
  151. }
  152. function changeSysDataLoadChart(jsonParam){
  153. setTitle();
  154. $.post("/nwyj/ws/SystemDataSourceChartServiceImpl/SystemDataSourceChartServiceImpl/getUserAndTaiQuByCompIdInfo",
  155. {compId:jsonParam.compId},function(result){
  156. if(result.state=="FAILURE"){
  157. zeroChartIntoParam(result.rows)
  158. return;
  159. }
  160. if(result.rows.length==0){
  161. zeroChart();
  162. return;
  163. }
  164. removeNoData();
  165. var sArr=[{
  166. name:"重要用户停电数",
  167. type:"pie",
  168. data:[],
  169. radius : "55%",
  170. center: ["50%", "60%"],
  171. itemStyle: {
  172. normal: {borderWidth: 1,borderColor:"tomato",
  173. label : { show : true,
  174. position: "insideTop",
  175. textStyle: {fontSize: 14,fontStyle: "normal",fontWeight: "bold"},
  176. formatter: "{b} : {c} ({d}%)"
  177. }
  178. }
  179. }
  180. }];
  181. var xAxis=[];
  182. var item=result.rows[result.rows.length-1];
  183. sArr[0].data.push({
  184. value:utils.changeQ(item["T_SUM"]),
  185. name:"特级",
  186. data:{
  187. deptPath:item["DEPT_PATH"],
  188. reportId:item["REPORT_ID"],
  189. type:1,
  190. text:pageParam.title,
  191. level:"特级",
  192. d:"T"
  193. },
  194. color: pageStyle[jsonParam.style]["chartColor"][0]
  195. });
  196. sArr[0].data.push({
  197. value:utils.changeQ(item["Y_SUM"]),
  198. name:"一级",
  199. data:{
  200. deptPath:item["DEPT_PATH"],
  201. reportId:item["REPORT_ID"],
  202. type:2,
  203. text:pageParam.title,
  204. level:"一级",
  205. d:"Y"
  206. },
  207. color: pageStyle[jsonParam.style]["chartColor"][1]
  208. });
  209. sArr[0].data.push({
  210. value:utils.changeQ(item["E_SUM"]),
  211. name:"二级",
  212. data:{
  213. deptPath:item["DEPT_PATH"],
  214. reportId:item["REPORT_ID"],
  215. type:3,
  216. text:pageParam.title,
  217. level:"二级",
  218. d:"E"
  219. },
  220. color: pageStyle[jsonParam.style]["chartColor"][2]
  221. });
  222. /* var date=new Date();
  223. su = new SearchUtil();
  224. var dateStr = su.getNowFormatDateTime(date); */
  225. opParams={
  226. title:"截止:"+item["APPEAR_TIME"],//标题
  227. subtext:"重要用户停电总数:"+(utils.changeQ(item["T_SUM"])+utils.changeQ(item["Y_SUM"])+utils.changeQ(item["E_SUM"]))+" (户)",
  228. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  229. unit:"座",//单位
  230. leArr:["特级","一级","二级"],//图例
  231. xAxis:xAxis,//x轴
  232. sArr:sArr//主数据
  233. };
  234. chart=getEchart($("#i_page_chart"),getOption11,opParams,null);
  235. bindSysEvent();
  236. },"json");
  237. }
  238. /**
  239. * 绑定系统数据源点击事件
  240. */
  241. function bindSysEvent(){
  242. chart.on("click",function(params){
  243. var pathStr=url["http_path"]+"page/cockpit/echart_maticView/important_user_outage/sys_important_user_pie_grid.html?"+encodeURI($.param(params.data.data));
  244. utils.openIframe(pathStr)
  245. });
  246. $(window).resize(function(){
  247. chart.resize();
  248. });
  249. }
  250. </script>
  251. </body>
  252. </html>