bf6dc4dff738ae00644a4734b6dcedb4c3ca7de4.svn-base 14 KB

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