e53c0aeb9949f4637e21a057dfa1789cbf37debe.svn-base 11 KB

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