f4e19bde670cb41b19de041d97df6f0b267663b1.svn-base 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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. 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,
  65. viewName:"REPORT_GDSUNSHI_KEHUTD_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: {borderWidth: 1,
  79. borderColor:"tomato",
  80. color: pageStyle[jsonParam.style]["chartColor"][0],
  81. label : { show : true,
  82. position:"top",
  83. textStyle: {
  84. color: "rgb(255, 255, 255)",
  85. fontSize: 14,
  86. fontStyle: "normal",
  87. fontWeight: "bold"
  88. }
  89. }
  90. }}
  91. }];
  92. var xAxis=[];
  93. var total=0;
  94. var data=result.rows[0];
  95. //alert(JSON.stringify(data));
  96. var max=0;
  97. for(var index=0,len=result.rows.length;index<len;index++){
  98. var item=result.rows[index];
  99. //alert("-----"+JSON.stringify(item));
  100. var sum=floatQ(item["ENERGY_LOSS"]);
  101. max=max>sum?max:sum;
  102. total+=sum;
  103. if(sum!=0){
  104. sArr[0].data.push(sum);
  105. xAxis.push(subStr(item["DEPT_NAME"],"供电局"));
  106. }else{
  107. sArr[0].data.push("");
  108. xAxis.push("");
  109. }
  110. }
  111. /* if(xAxis.length==0){
  112. zeroChartIntoParam("部门数据全部为0");
  113. return ;
  114. } */
  115. max=(parseInt(max/10)+1)*10;
  116. //设置x轴显示1行或两行
  117. var showHang=0;
  118. if(pageParam.compId=="8F6F2D6B24494CB6B1F1E0931E7AF87D"){
  119. showHang=1;
  120. }else{
  121. showHang=2;
  122. }
  123. opParams={
  124. //title:"截止:"+data["APPEAR_TIME"],//标题
  125. title:"起始:"+data["SEND_TIME"]+":00"+" 截止:"+data["APPEAR_TIME"],//标题
  126. subtext:"合计损失电量:"+total+"万kWh",
  127. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  128. unit:"kV",//单位
  129. leArr:["电量损失"],//图例
  130. xAxis:xAxis,//x轴
  131. sArr:sArr,//主数据
  132. show:false,
  133. legendColor:legendC, //图例字体颜色
  134. xAxisColor:xAxisC, //X轴字体颜色
  135. yAxisColor:yAxisC, //Y轴字体颜色
  136. min:0,
  137. max:max,
  138. isVertical:true,
  139. fold:showHang
  140. };
  141. chart=getEchart($("#i_page_chart"),getOption,opParams,null);
  142. $(window).resize(function(){
  143. chart.resize();
  144. });
  145. },"json");
  146. setTitle();
  147. }
  148. function floatQ(param){
  149. var value="";
  150. if(param == undefined) return 0;
  151. if(param == null)return 0;
  152. if(isNaN(parseFloat(param)))return 0;
  153. return parseFloat(param);
  154. }
  155. function setTitle(){
  156. $("#i_page_head_title").find("h2").remove();
  157. if(pageParam.title=="广东电网有限责任公司"){
  158. pageParam.title="广东电网公司";
  159. }
  160. $("#i_page_head_title").append("<h2>"+pageParam.title+"电量损失统计</h2>");
  161. }
  162. /*dwr推送人工数据方法 */
  163. function dwrData(number){
  164. if(0!=top.dataSourceState) return;
  165. if(number== pageParam.number){
  166. loadChart(pageParam);
  167. }
  168. }
  169. /*dwr推送系统数据方法 */
  170. function dwrSysData(number){
  171. if(1!=top.dataSourceState) return;
  172. //如果需要关联通知单,放开注释即可
  173. // if(number== pageParam.number){
  174. changeSysData(pageParam);
  175. // }
  176. }
  177. /*******************************************************************************************************************/
  178. function changeSysData(number){
  179. pageParam.number=number;
  180. changeSysDataLoadChart(pageParam)
  181. }
  182. function changeSysDataLoadChart(jsonParam){
  183. $.post("/nwyj/ws/SystemDataSourceChartServiceImpl/SystemDataSourceChartServiceImpl/getLoadLossByCompIdInfo",
  184. {compId:jsonParam.compId},function(result){
  185. if("FAILURE"==result.state){
  186. zeroChartIntoParam(result.rows);
  187. return;
  188. }
  189. if(result.rows.length==0){
  190. zeroChart();
  191. return;
  192. }
  193. veriColor(); //根据首页的传值判断样式
  194. removeNoData();
  195. var sArr=[
  196. {type:"bar",
  197. name:"电量损失",
  198. data:[],
  199. barMaxWidth:40,
  200. itemStyle: {
  201. normal: {borderWidth: 1,
  202. borderColor:"tomato",
  203. color: pageStyle[jsonParam.style]["chartColor"][0],
  204. label : { show : true,
  205. position:"top",
  206. textStyle: {
  207. color: "rgb(255, 255, 255)",
  208. fontSize: 14,
  209. fontStyle: "normal",
  210. fontWeight: "bold"
  211. }
  212. }
  213. }}
  214. }];
  215. var xAxis=[];
  216. var total=0;
  217. var data=result.rows[0];
  218. var max=0;
  219. for(var index=0,len=result.rows.length;index<len;index++){
  220. var item=result.rows[index];
  221. var sum=utils.changeQ(item["BATTERY_LOSS"]);
  222. max=max>sum?max:sum;
  223. total+=sum
  224. /* if(sum!=0){ */
  225. sArr[0].data.push({value:sum,data:{
  226. deptPath:item["DEPT_PATH"],
  227. reportId:item["REPORT_ID"]
  228. }});
  229. xAxis.push(subStrDept(item["DEPT_NAME"]));
  230. /* } */
  231. }
  232. if(xAxis.length==0){
  233. zeroChartIntoParam("部门数据全部为0");
  234. return ;
  235. }
  236. /* var date=new Date();
  237. su = new SearchUtil();
  238. var dateStr = su.getNowFormatDateTime(date); */
  239. max=(parseInt(max/10)+1)*10;
  240. opParams={
  241. title:"截止:"+data["APPEAR_TIME"],//标题
  242. subtext:"合计损失电量:"+total+"万kWh",
  243. saveName:$("#i_page_head_title").find("h2").html()+searchUtil.getNowFormatDateTime(new Date),
  244. unit:"kV",//单位
  245. leArr:["电量损失"],//图例
  246. xAxis:xAxis,//x轴
  247. sArr:sArr,//主数据
  248. show:false,
  249. legendColor:legendC, //图例字体颜色
  250. xAxisColor:xAxisC, //X轴字体颜色
  251. yAxisColor:yAxisC , //Y轴字体颜色
  252. min:0,
  253. max:max,
  254. isVertical:true,
  255. fold:1
  256. };
  257. chart=getEchart($("#i_page_chart"),getOption,opParams,null);
  258. $(window).resize(function(){
  259. chart.resize();
  260. });
  261. },"json");
  262. setTitle();
  263. }
  264. function subStrDept(str){
  265. str=str.replace("供电局","");
  266. str=str.replace("供电所","");
  267. return str;
  268. }
  269. </script>
  270. </body>
  271. </html>