039d432beaf7feaa431301915979264fbf68fa7c.svn-base 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>用户停电024</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. <script type="text/javascript" src="/nwyj/scripts/cockpit/search/search_util.js" ></script>
  17. <!-- dwr 实现消息推送功能 star-->
  18. <script type='text/javascript' src='/nwyj/dwr/engine.js'></script>
  19. <script type='text/javascript' src='/nwyj/dwr/util.js'></script>
  20. <!-- dwr 实现消息推送功能 end-->
  21. <!-- 驾驶舱与首页显示的样式 star -->
  22. <script type="text/javascript" src="/nwyj/scripts/cockpit/cockpitIndex/cockpitANDmainIndex.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 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. pageParam.startTime=start;
  46. pageParam.endTime=end;
  47. pageParam.isalert=null;
  48. if(pageParam.number.split("|")[0]=="预警"){
  49. pageParam.isalert="0";
  50. }else{
  51. pageParam.isalert="1";
  52. }
  53. pageParam.number=pageParam.number.split("|")[1];
  54. init();
  55. });
  56. function init(){
  57. if(utils.resolveUrl().dataSourceState==0){
  58. loadChart(pageParam);
  59. }else{
  60. changeSysDataLoadChart(pageParam);
  61. }
  62. }
  63. function loadChart(jsonParam){
  64. $.post("/nwyj/ws/ChartServiceImpl/ChartServiceImpl/getChildDataOrSelfByWarnningNumber",{charType:"yonghutingdian",name:"getChildsRecodeSumData",number:jsonParam.number,isalert:pageParam.isalert,compId:jsonParam.compId,viewName:"REPORT_GDSUNSHI_KEHUTD_VIEW"},function(result){
  65. if(result.rows.length==0){
  66. zeroChart();
  67. return;
  68. }
  69. veriColor(); //根据首页的传值判断样式
  70. var sArr=[
  71. {type:"bar",name:"未恢复数量",data:[],
  72. barMaxWidth:40,
  73. itemStyle: {
  74. normal: {borderWidth: 1,borderColor:"tomato",color: pageStyle[jsonParam.style]["chartColor"][1],
  75. label : { show : true,
  76. position: "top",
  77. textStyle: { color: "rgb(255, 255, 255)",fontSize: 14,fontStyle: "normal",fontWeight: "bold"}
  78. }
  79. }}
  80. }
  81. ];
  82. var xAxis=[];
  83. var total=0;
  84. var data=result.rows[0];
  85. var max=0;
  86. for(var index=0,len=result.rows.length;index<len;index++){
  87. var item=result.rows[index];
  88. var sum=utils.changeQ(item["YH_UNRECOVERED"]);
  89. max = max < sum ? sum : max;
  90. total+=sum;
  91. if(sum!=0){
  92. sArr[0].data.push({value:sum,data:{compId:item["COMP_ID"],
  93. parentId:jsonParam.compId,
  94. style:jsonParam.style,number:jsonParam.number,
  95. text: item["DEPT_NAME"],
  96. sum:item["sum"],
  97. YH_TD_COUNT:item["YH_TD_COUNT"],YH_UNRECOVERED:item["YH_UNRECOVERED"],
  98. APPEAR_TIME:item["APPEAR_TIME"]}});
  99. xAxis.push(subStr(item["DEPT_NAME"],"供电局"));
  100. }else{
  101. sArr[0].data.push("");
  102. xAxis.push("");
  103. }
  104. }
  105. var date=new Date();
  106. su = new SearchUtil();
  107. var dateStr = su.getNowFormatDateTime(date);
  108. max=(parseInt(max/10)+1)*10;
  109. //设置x轴显示1行或两行
  110. var showHang=0;
  111. if(pageParam.compId=="C984DC9C294A486096C25FAA78C99AED"){
  112. showHang=1;
  113. }else{
  114. showHang=2;
  115. }
  116. pageParam.opParams={
  117. //title:"截止:"+data["APPEAR_TIME"],//标题
  118. title:"起始:"+data["SEND_TIME"]+":00"+" 截止:"+data["APPEAR_TIME"],//标题
  119. subtext:"停电用户未恢复总数:"+total+"(户)",
  120. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  121. unit:"座",//单位
  122. leArr:["未恢复数量"],//图例
  123. xAxis:xAxis,//x轴
  124. sArr:sArr,//主数据
  125. show:false,
  126. legendColor:legendC, //图例字体颜色
  127. xAxisColor:xAxisC, //X轴字体颜色
  128. yAxisColor:yAxisC, //Y轴字体颜色
  129. min:0,
  130. max:max,
  131. isVertical:true,
  132. fold:showHang
  133. };
  134. chart=getEchart($("#i_page_chart"),getOption,pageParam.opParams,null);
  135. setTitle();
  136. bindEvent();
  137. },"json");
  138. }
  139. function setTitle(){
  140. $("#i_page_head_title").find("h2").remove();
  141. if(pageParam.title=="广东电网有限责任公司"){
  142. pageParam.title="广东电网公司";
  143. }
  144. $("#i_page_head_title").append("<h2>"+pageParam.title+"停电未恢复用户统计</h2>");
  145. }
  146. /**
  147. * 绑定事件
  148. */
  149. function bindEvent(){
  150. chart.on("click",function(params){
  151. var pathStr=url["http_path"]+"page/cockpit/echart_maticView/important_user_outage/important_user_pie_chart.html?"+$.param(params.data.data);
  152. utils.openIframe(pathStr)
  153. });
  154. $(window).resize(function(){
  155. chart.resize();
  156. });
  157. }
  158. /*dwr推送人工数据方法 */
  159. function dwrData(number){
  160. if(0!=top.dataSourceState) return;
  161. if(number== pageParam.number){
  162. loadChart(pageParam);
  163. }
  164. }
  165. /*dwr推送系统数据方法 */
  166. function dwrSysData(number){
  167. if(1!=top.dataSourceState) return;
  168. //如果需要关联通知单,放开注释即可
  169. // if(number== pageParam.number){
  170. changeSysData(pageParam);
  171. // }
  172. }
  173. /*******************************************************************************************************/
  174. function changeSysData(number){
  175. pageParam.number=number;
  176. changeSysDataLoadChart(pageParam)
  177. }
  178. function changeSysDataLoadChart(jsonParam){
  179. setTitle();
  180. $.post("/nwyj/ws/SystemDataSourceChartServiceImpl/SystemDataSourceChartServiceImpl/getUserByCompIdInfo",
  181. {compId:jsonParam.compId},function(result){
  182. if("FAILURE"==result.state){
  183. zeroChartIntoParam(result.rows);
  184. return;
  185. }
  186. if(result.rows.length==0){
  187. zeroChart();
  188. return;
  189. }
  190. veriColor(); //根据首页的传值判断样式
  191. var sArr=[
  192. {type:"bar",name:"未恢复数量",data:[],
  193. barMaxWidth:40,
  194. itemStyle: {
  195. normal: {borderWidth: 1,borderColor:"tomato",color: pageStyle[jsonParam.style]["chartColor"][1],
  196. label : { show : true,
  197. position: "top",
  198. textStyle: { color: "rgb(255, 255, 255)",fontSize: 14,fontStyle: "normal",fontWeight: "bold"}
  199. }
  200. }}
  201. }
  202. ];
  203. var xAxis=[];
  204. var total=0;
  205. var max=0;
  206. var data=result.rows[0];
  207. for(var index=0,len=result.rows.length;index<len;index++){
  208. var item=result.rows[index];
  209. var sum=utils.changeQ(item["Y_UNRECOVERED_NUM"]);
  210. max = max < sum ? sum : max;
  211. total+=sum;
  212. //if(sum!=0){
  213. sArr[0].data.push({
  214. value:sum,
  215. data:{
  216. text:item["DEPT_NAME"],
  217. deptPath:item["DEPT_PATH"],
  218. reportId:item["REPORT_ID"],
  219. type:"2"
  220. }
  221. });
  222. xAxis.push(subStrDept(item["DEPT_NAME"]));
  223. //}
  224. }
  225. /* var date=new Date();
  226. su = new SearchUtil();
  227. var dateStr = su.getNowFormatDateTime(date); */
  228. max=(parseInt(max/10)+1)*10;
  229. pageParam.opParams={
  230. title:"截止:"+item["APPEAR_TIME"],//标题
  231. subtext:"停电用户未恢复总数:"+total+"(户)",
  232. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  233. unit:"座",//单位
  234. leArr:["未恢复数量"],//图例
  235. xAxis:xAxis,//x轴
  236. sArr:sArr,//主数据
  237. show:false,
  238. legendColor:legendC, //图例字体颜色
  239. xAxisColor:xAxisC, //X轴字体颜色
  240. yAxisColor:yAxisC, //Y轴字体颜色
  241. min:0,
  242. max:max,
  243. isVertical:true
  244. };
  245. chart=getEchart($("#i_page_chart"),getOption,pageParam.opParams,null);
  246. bindSysEvent();
  247. },"json");
  248. }
  249. /**
  250. * 绑定系统数据源点击事件
  251. */
  252. function bindSysEvent(){
  253. chart.on("click",function(params){
  254. var pathStr=url["http_path"]+"page/cockpit/echart_maticView/important_user_outage/sys_important_user_pie_chart.html?"+encodeURI($.param(params.data.data));
  255. utils.openIframe(pathStr)
  256. });
  257. $(window).resize(function(){
  258. chart.resize();
  259. });
  260. }
  261. function subStrDept(str){
  262. str=str.replace("供电局","");
  263. str=str.replace("供电所","");
  264. return str;
  265. }
  266. </script>
  267. </body>
  268. </html>