717e7f028568d40e49d9fe096a78b1322b818249.svn-base 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. var map = null ;
  2. var chart = null ;//图表对象
  3. var i = 0;
  4. var timer ;
  5. var comp_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  6. var dept_name = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  7. var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  8. var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  9. var allPath = window.location.href;
  10. var indexPath = window.location.pathname;
  11. var index = allPath.indexOf(indexPath);
  12. var path = allPath.substring(0,index+1);
  13. var pathIcon = path + "nwyj/images/cockpit/gis/" ;
  14. var pu = null;
  15. var su = null;
  16. var mu = null;
  17. var msu = null;
  18. var zoomMLShow = 7;
  19. var isShow = false;
  20. var isHied = false;
  21. var MarkerList = [];
  22. $(function(){
  23. su = new SearchUtil();
  24. });
  25. $(function(){
  26. setIframe("index_right_1");
  27. /*var param = getDataChartMap("team");
  28. loadChart(changeBarOptionTeam(param));
  29. loadMapMarker(param);*/
  30. });
  31. LoadApi(function () {
  32. map = new BMap.Map("bd_map", { mapType: getDefaultMapType() });
  33. LoadOverlayImage(map);//加载瓦片图
  34. ShowControl(map);//显示缩放控件
  35. ShowZoom(map);//启动鼠标拖动
  36. InitCenterAndZoom(map, 117.165632, 21.903823, 7);
  37. // InitCenterAndZoom(map, 110.146236,21.777578, 16);
  38. map.addEventListener("zoomend", showInfo);
  39. pu = new PositionTransition();
  40. });
  41. $(function(){
  42. $(".ewer_btn").toggle(
  43. function(){
  44. $(this).removeClass("ewer_off").addClass("ewer_on");
  45. var paramsProv = {
  46. // RELEASE_UNIT : subDept["prov"]+"",//单位
  47. USER_NAME : realName,
  48. USER_ID : user_id,
  49. RELEASE_UNIT : comp_id,//单位
  50. WULEVEL : "'0','1'",
  51. RULEVEL : "'0','1'",
  52. SKEW : "0.3",
  53. // BEGINTIME : beginTime ,//开始时间
  54. // ENDTIME : endTime //截止时间
  55. } ;
  56. var paramsPref = {
  57. // RELEASE_UNIT : subDept["prov"]+"",//单位
  58. USER_NAME : realName,
  59. USER_ID : user_id,
  60. RELEASE_UNIT : comp_id,
  61. WULEVEL : "'2','3','4'",
  62. RULEVEL : "'2','3','4'",
  63. SKEW : "0.03",
  64. // BEGINTIME : beginTime ,//开始时间
  65. // ENDTIME : endTime //截止时间
  66. } ;
  67. getEwer(paramsProv,paramsPref);
  68. },function(){
  69. $(this).removeClass("ewer_on").addClass("ewer_off");
  70. var allOverlay = map.getOverlays();
  71. for (var i = 0; i < allOverlay.length; i++){
  72. if(allOverlay[i].ext_category == "ewer"){
  73. map.removeOverlay(allOverlay[i]);
  74. };
  75. };
  76. }
  77. );
  78. //展开/关闭地图资源按钮级
  79. $(".offon_menu_btn").toggle(
  80. function(){
  81. $(this).removeClass("offon_menu_btn_on").addClass("offon_menu_btn_off");
  82. timer = setInterval(menu_btn_open,1);
  83. },function(){
  84. $(this).removeClass("offon_menu_btn_off").addClass("offon_menu_btn_on");
  85. timer = setInterval(menu_btn_close,1);
  86. }
  87. );
  88. $(".offon_menu_btn").click();
  89. /*$(".er_menu_btn").on("click",function(){
  90. $(".er_menu_btn").each(function(){
  91. var ert = $(this).attr("ertype");
  92. if($(this).hasClass("er_menu_btn_"+ert+"_on")){
  93. $(this).removeClass("er_menu_btn_"+ert+"_on").addClass("er_menu_btn_"+ert+"_off");
  94. }
  95. });
  96. var ert = $(this).attr("ertype");
  97. $(this).removeClass("er_menu_btn_"+ert+"_off").addClass("er_menu_btn_"+ert+"_on");
  98. if(ert=="team"){
  99. var param = getDataChartMap("team");
  100. loadChart(changeBarOptionTeam(param));
  101. loadMapTeamMarker(param);
  102. }
  103. });*/
  104. $(".er_menu_btn").on("click",function(){
  105. var allOverlay = map.getOverlays();
  106. for (var i = 0; i < allOverlay.length; i++){
  107. if(allOverlay[i].ext_category != "ewer"){
  108. map.removeOverlay(allOverlay[i]);
  109. };
  110. };
  111. var ert = $(this).attr("ertype");
  112. if($(this).attr("status")=="on"){
  113. $(this).attr("status","off").removeClass("er_menu_btn_"+ert+"_on").addClass("er_menu_btn_"+ert+"_off");
  114. }else{
  115. var ert_old = $(".er_menu_btn[status='on']").attr("ertype");
  116. $(".er_menu_btn[status='on']").attr("status","off").removeClass("er_menu_btn_"+ert_old+"_on").addClass("er_menu_btn_"+ert_old+"_off");
  117. $(this).attr("status","on").removeClass("er_menu_btn_"+ert+"_off").addClass("er_menu_btn_"+ert+"_on");
  118. if(ert=="team"){
  119. var param = getDataChartMap("team");
  120. loadChart(changeBarOptionTeam(param));
  121. loadMapTeamMarker(param);
  122. }else if(ert=="gen"){
  123. var param = getDataChartMap("gen");
  124. loadChart(changeBarOptionGen(param));
  125. loadMapGenMarker(param);
  126. }else if(ert=="car"){
  127. var param = getDataChartMap("car");
  128. loadChart(changeBarOptionCar(param));
  129. loadMapCarMarker(param);
  130. };
  131. };
  132. });
  133. //图表开关切换按钮
  134. $(".chart_btn").toggle(
  135. function(){
  136. $(this).removeClass("chart_btn_off").addClass("chart_btn_on");
  137. $(".chart_box").fadeIn(300);
  138. },function(){
  139. $(this).removeClass("chart_btn_on").addClass("chart_btn_off");
  140. $(".chart_box").fadeOut(300);
  141. }
  142. );
  143. });
  144. function getEwer(paramsProv,paramsPref){
  145. var url ;
  146. if(paramsProv){
  147. //查询应急预警图标(网省级)
  148. url = "/nwyj/ws/cockpit/CockpitService/getEwErMarker";
  149. var data = su.getJsonData(url,paramsProv) ;
  150. getEwErMarker(data, "ewer_porv", "ewer");
  151. // pointPro = pointPro.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  152. // ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_prov.name) ;
  153. // _this.addGisLengen(ewJsonData);
  154. // addResourceIco(ewJsonData);//添加图标
  155. }
  156. if(paramsPref){
  157. //查询应急预警图标(地市级)
  158. url = "/nwyj/ws/cockpit/CockpitService/getEwErMarker";
  159. var data = su.getJsonData(url,paramsPref) ;
  160. getEwErMarker(data, "ewer_prev", "ewer");
  161. // pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  162. // ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
  163. // _this.addGisLengen(ewJsonData);
  164. // addResourceIco(ewJsonData);//添加图标
  165. }
  166. };
  167. function getEwErMarker(data, sl, category){
  168. for(var i = 0; i < data.length; i++){
  169. var icon = {path:pathIcon + data[i].extraData.name + ".png", width:35, height:30,
  170. title:data[i].title, ext_id:data[i].extraData.FD_OBJECTID,
  171. ext_mt:sl, ext_category:category, event:[{eve:"click",fun:clickMarker}]};
  172. /*if(iconInfo.ext_category) marker.ext_category = iconInfo.ext_category;
  173. if(iconInfo.ext_json) marker.ext_json = iconInfo.ext_json;*/
  174. var sContent = getBmapMarkerCont({type:"ew",name:data[i].title},data[i]);
  175. addBdMarker(data[i].posX, data[i].posY,icon,sContent);
  176. };
  177. };
  178. function showInfo(){
  179. var zoomLevel=map.getZoom();//获取地图级别
  180. if(zoomLevel >= zoomMLShow){
  181. isHied=false;
  182. if(!isShow){
  183. var allOverlay = map.getOverlays();
  184. for (var i = 0; i < allOverlay.length; i++){
  185. if(allOverlay[i].ext_mt == "er_prev" || allOverlay[i].ext_mt == "ewer_prev"){
  186. allOverlay[i].show();
  187. };
  188. if(allOverlay[i].ext_mt == "er_porv" || allOverlay[i].ext_mt == "ewer_porv"){
  189. allOverlay[i].hide();
  190. };
  191. };
  192. };
  193. }else{
  194. isShow=false;
  195. if(!isHied){
  196. isHied=true;//避免下次再隐藏
  197. var allOverlay = map.getOverlays();
  198. for (var i = 0; i < allOverlay.length; i++){
  199. if(allOverlay[i].ext_mt == "er_prev" || allOverlay[i].ext_mt == "ewer_prev"){
  200. allOverlay[i].hide();
  201. };
  202. if(allOverlay[i].ext_mt == "er_porv" || allOverlay[i].ext_mt == "ewer_porv"){
  203. allOverlay[i].show();
  204. };
  205. };
  206. };
  207. };
  208. };
  209. function getDataChartMap(ert){
  210. $("#chart_box").attr("chartType",ert);
  211. if(ert=="team"){
  212. return su.getJsonData("/nwyj/ws/Team/TeamService/getTeamInfo",{id : comp_id});
  213. }else if(ert=="gen"){
  214. return su.getJsonData("/nwyj/ws/generator/GeneratorService/getGeneratorInfo",{id : comp_id});
  215. }else if(ert=="car"){
  216. return su.getJsonData("/nwyj/ws/generatorcar/GeneratorCarService/getCarInfo",{id : comp_id});
  217. };
  218. };
  219. function loadMapTeamMarker(param){
  220. param = getBmapXY(param);
  221. for(var i = 0; i < param.rows.length; i++){
  222. var icon = {path:pathIcon + "team_prev.png", width:30, height:30, title:param.rows[i].name + "应急队伍",
  223. ext_id:param.rows[i].dept_id,ext_mt:param.rows[i].sl, event:[{eve:"click",fun:clickMarker}]};
  224. var sContent = getBmapMarkerCont({type:"team",name:param.rows[i].name + "应急队伍"},param.rows[i]);
  225. addBdMarker(param.rows[i].posX, param.rows[i].posY,icon,sContent);
  226. };
  227. };
  228. function loadMapGenMarker(param){
  229. param = getBmapXY(param);
  230. for(var i = 0; i < param.rows.length; i++){
  231. var icon = {path:pathIcon + "edui_prev.png", width:45, height:30, title:param.rows[i].name + "应急发电机",
  232. ext_id:param.rows[i].dept_id,ext_mt:param.rows[i].sl, event:[{eve:"click",fun:clickMarker}]};
  233. var sContent = getBmapMarkerCont({type:"gen",name:param.rows[i].name + "应急发电机"},param.rows[i]);
  234. addBdMarker(param.rows[i].posX, param.rows[i].posY,icon,sContent);
  235. };
  236. };
  237. function loadMapCarMarker(param){
  238. param = getBmapXY(param);
  239. for(var i = 0; i < param.rows.length; i++){
  240. var icon = {path:pathIcon + "car_prev.png", width:45, height:30, title:param.rows[i].name + "应急发电车",
  241. ext_id:param.rows[i].dept_id,ext_mt:param.rows[i].sl, event:[{eve:"click",fun:clickMarker}]};
  242. var sContent = getBmapMarkerCont({type:"car",name:param.rows[i].name + "应急发电车"},param.rows[i]);
  243. addBdMarker(param.rows[i].posX, param.rows[i].posY,icon,sContent);
  244. };
  245. };
  246. function clickMarker(){
  247. };
  248. function getBmapXY(param){
  249. var data = su.getJsonData("/nwyj/ws/map/MapService/getBmapPosXY",{deptArr : param.deptIdArr});
  250. for(var i = 0; i < param.rows.length; i++){
  251. for(var j = 0; j < data.rows.length; j++){
  252. if(param.rows[i].dept_id == data.rows[j].DEPT_ID && data.rows[j].DEPT_ID != comp_id){
  253. param.rows[i] = su.addJsonAttribute(param.rows[i],"posX",data.rows[j].POS_X);
  254. param.rows[i] = su.addJsonAttribute(param.rows[i],"posY",data.rows[j].POS_Y);
  255. param.rows[i] = su.addJsonAttribute(param.rows[i],"sl","er_prev");
  256. }else if(data.rows[j].DEPT_ID == comp_id){
  257. param.rows[param.rows.length-1].name = dept_name;
  258. param.rows[param.rows.length-1].dept_id = comp_id;
  259. param.rows[param.rows.length-1] = su.addJsonAttribute(param.rows[param.rows.length-1],"sl","er_porv");
  260. param.rows[param.rows.length-1] = su.addJsonAttribute(param.rows[param.rows.length-1],"posX",data.rows[j].POS_X);
  261. param.rows[param.rows.length-1] = su.addJsonAttribute(param.rows[param.rows.length-1],"posY",data.rows[j].POS_Y);
  262. }
  263. }
  264. }
  265. return param;
  266. };
  267. function loadChart(param){
  268. var opParams = {
  269. title:param.title,//标题
  270. //unit:"单位:台",//单位
  271. legend:param.legend,
  272. yAxis:param.yArr,//y轴
  273. sArr:param.sArr//主数据
  274. //color:param.color
  275. };
  276. chart=getEchart($("#chart_box"),getOption,opParams,chart);
  277. };
  278. function getEchart($dom,fn,op,myChart){
  279. if(myChart!=null){ myChart.clear(); }
  280. if(myChart==null){ myChart = echarts.init($dom.get(0)); }
  281. myChart.setOption(fn(op));
  282. return myChart;
  283. };
  284. function getOption(op){
  285. var option={
  286. title : { text: op.title },
  287. tooltip : { trigger: 'axis' },
  288. backgroundColor:"#ffffff",
  289. // color:[op.color],
  290. // legend: { show:false },
  291. legend: {
  292. itemGap:5,
  293. itemWidth:10,
  294. itemHeight:7,
  295. y:40,
  296. data:op.legend },
  297. toolbox: {
  298. show : true,
  299. y : 'center',
  300. orient:'vertical',
  301. feature : {
  302. restore : {show: true},
  303. saveAsImage : {show: true}
  304. }
  305. },
  306. calculable : true,
  307. xAxis : [{ type : 'value', boundaryGap : [0, 0.01],
  308. axisLabel:{ textStyle:{color:op.color,fontFamily:"微软雅黑",fontSize: 14} },
  309. splitLine:{ lineStyle:{ color: '#f0fcff', width: 0, type: 'solid' } }
  310. }],
  311. yAxis : [{ type : 'category', data :op.yAxis,
  312. axisLabel:{ interval: 0, textStyle:{color:op.color,fontFamily:"微软雅黑",fontSize: 10} },
  313. splitLine:{ lineStyle:{color: '#f0fcff', width: 1, type: 'solid' } }
  314. }],
  315. series : op.sArr
  316. };
  317. return option;
  318. };
  319. /* 展开事件 */
  320. function menu_btn_open(){
  321. i++ ;
  322. if(i <= 45){
  323. $(".er_menu_btn_team").removeClass("hidden_yes") ;
  324. $(".er_menu_btn_team").css("top", i) ;
  325. };
  326. if(i > 47 && i < 90){
  327. $(".er_menu_btn_gen").removeClass("hidden_yes") ;
  328. $(".er_menu_btn_gen").css("top", i) ;
  329. };
  330. if(i > 92 && i <= 135){
  331. $(".er_menu_btn_car").removeClass("hidden_yes") ;
  332. $(".er_menu_btn_car").css("top", i) ;
  333. };
  334. if (i > 140){
  335. clearInterval(timer);
  336. return ;
  337. };
  338. };
  339. /* 关闭事件 */
  340. function menu_btn_close(){
  341. i-- ;
  342. if(i > 92 && i <= 140){ $(".er_menu_btn_car").css("top", i); };
  343. if(i==92){ $(".er_menu_btn_car").addClass("hidden_yes") ; };
  344. if(i > 47 && i < 92){ $(".er_menu_btn_gen").css("top", i); };
  345. if(i==42){ $(".er_menu_btn_gen").addClass("hidden_yes"); }
  346. if(i <= 45){ $(".er_menu_btn_team").css("top", i); };
  347. if(i==0){
  348. $(".er_menu_btn_team").addClass("hidden_yes");
  349. clearInterval(timer);
  350. return ;
  351. };
  352. };
  353. function changeBarOptionTeam(data){
  354. var legendData=[];
  355. var seriesData=[];
  356. var data1=[];
  357. var data2=[];
  358. var param = {};
  359. var deptIdArr = [];
  360. for(var i=0;i<data.rows.length-1;i++){
  361. //alert(data.rows[i].name);
  362. legendData[i]=data.rows[i].name;
  363. data1[i]=data.rows[i].kused;
  364. data2[i]=data.rows[i].bused;
  365. deptIdArr[i]=data.rows[i].dept_id;
  366. }
  367. deptIdArr[data.rows.length] = comp_id;
  368. var series1={ name:'可调拨',
  369. type:'bar',
  370. itemStyle: {
  371. normal: {
  372. label : {
  373. show: true, position: 'insideRight'
  374. }
  375. }
  376. },
  377. data:data1
  378. };
  379. var series2={ name:'不可调拨',
  380. type:'bar',
  381. itemStyle: {
  382. normal: {
  383. label : {
  384. show: true, position: 'insideRight'
  385. }
  386. }
  387. },
  388. data:data2
  389. };
  390. seriesData=[series1,series2];
  391. param = {title:"应急队伍统计图", yArr:legendData, sArr:seriesData, legend:['可调拨','不可调拨'], color:"#cc6600", deptIdArr:deptIdArr};
  392. return param;
  393. };
  394. function changeBarOptionGen(data){
  395. var legendData=[];
  396. var data1=[];
  397. var data2=[];
  398. var data3=[];
  399. var deptIdArr = [];
  400. for(var i=0;i<data.rows.length-1;i++){
  401. data.rows[i].name = data.rows[i].name.replace("供电局","");
  402. legendData[i]=data.rows[i].name;
  403. data1[i]=data.rows[i].content_min;
  404. data2[i]=data.rows[i].content_mid;
  405. data3[i]=data.rows[i].content_max;
  406. deptIdArr[i]=data.rows[i].dept_id;
  407. }
  408. deptIdArr[data.rows.length] = comp_id;
  409. var series1={ name:'0-10kw', type:'bar',
  410. itemStyle: {
  411. normal: { label : { show: true, position: 'insideRight' } }
  412. },
  413. data:data1
  414. };
  415. var series2={ name:'11-50kw', type:'bar',
  416. itemStyle: {
  417. normal: { label : { show: true, position: 'insideRight' } }
  418. },
  419. data:data2
  420. };
  421. var series3={ name:'51kw及以上', type:'bar',
  422. itemStyle: {
  423. normal: { label : { show: true, position: 'insideRight' } }
  424. },
  425. data:data3
  426. };
  427. var seriesData=[series1,series2,series3];
  428. var param = {title:"发电机统计图", yArr:legendData, sArr:seriesData, legend:['0-10kw', '11-50kw','51kw及以上'],
  429. color:"#cc6600", deptIdArr:deptIdArr};
  430. return param;
  431. };
  432. function changeBarOptionCar(data){
  433. var legendData=[];
  434. var data1=[];
  435. var data2=[];
  436. var data3=[];
  437. var deptIdArr = [];
  438. for(var i=0;i<data.rows.length-1;i++){
  439. data.rows[i].name = data.rows[i].name.replace("供电局","");
  440. legendData[i]=data.rows[i].name;
  441. data1[i]=data.rows[i].content_min;
  442. data2[i]=data.rows[i].content_mid;
  443. data3[i]=data.rows[i].content_max;
  444. deptIdArr[i]=data.rows[i].dept_id;
  445. };
  446. deptIdArr[data.rows.length] = comp_id;
  447. var series1={ name:'N≤250', type:'bar',
  448. itemStyle: {
  449. normal: { label : { show: true, position: 'insideRight' } }
  450. },
  451. data:data1
  452. };
  453. var series2={ name:'250<N≤500', type:'bar',
  454. itemStyle: {
  455. normal: { label : { show: true, position: 'insideRight' } }
  456. },
  457. data:data2
  458. };
  459. var series3={ name:'N>500', type:'bar',
  460. itemStyle: {
  461. normal: { label : { show: true, position: 'insideRight' } }
  462. },
  463. data:data3
  464. };
  465. var seriesData=[series1,series2,series3];
  466. /*option.tooltip.formatter=function (params){
  467. return params[0].name + '<br/>'
  468. + params[0].seriesName + ' : ' + params[0].value + '<br/>'
  469. + params[1].seriesName + ' : ' + params[1].value + '<br/>'
  470. + params[2].seriesName + ' : ' + params[2].value;
  471. };*/
  472. var param = {title:"发电车统计图", yArr:legendData, sArr:seriesData, legend:['N≤250', '250<N≤500','N>500'],
  473. color:"#cc6600", deptIdArr:deptIdArr};
  474. return param;
  475. };
  476. function addBdMarker(x,y,icon,sContent) {
  477. if(!(pu.verfXY(x, y))){
  478. return;
  479. };
  480. var marker = SetMarker(map, x, y, icon, "red", "#000", 12);
  481. var style = {
  482. boxStyle: {
  483. backgroundColor: "#fff",
  484. backgroundSize:"100% 100%",
  485. width: "480px",
  486. height: "240px",
  487. overflow:"hidden",
  488. cursor: "default",
  489. padding: "20px 20px 20px 20px",
  490. border: "1px solid #000"
  491. },
  492. closeIconMargin: "0px 20px 0px 0px",
  493. offset: new BMap.Size(0, 20),
  494. closeIconUrl: "/nwyj/page/cockpit/EmergencyresourceMainShow/images/close1.png",
  495. enableAutoPan: true,
  496. alignBottom: true
  497. };
  498. addClickHandler(map, sContent, marker[0], style,function(){
  499. //searchMarkerUnit.deg({type:icon.type,id:icon.ext_id});
  500. timeOutGetDate() ;
  501. });//添加标注点击事件
  502. };
  503. function timeOutGetDate(){}
  504. /**
  505. * 得到Marker点的4种类型的信息窗
  506. */
  507. function getBmapMarkerCont(param, data){
  508. var cont_style = "display:block; border-bottom:1px dotted #CCCCCC; line-height: 30px;";
  509. var b_style = "color:#663300; font-size:12px; vertical-align:top;";
  510. var sub_title = "color:#663300; font-size:12px;";
  511. var chart_btn = "float:right; cursor:pointer; margin-top:5px; " +
  512. "width:75px; height: 25px; line-height: 25px; border: 1px solid #C0C0C0; " +
  513. "text-align: center; " ;
  514. var cont = "";
  515. var fgx = "<hr style='border:1px solid #663300; margin-top:5px;margin-bottom:5px;'>";
  516. if(param.type=="team"){//队伍
  517. cont = "<span style='font-weight: bold;'>" + param.name + "</span><span style='"+sub_title +
  518. "'>&nbsp;共" + data.team_count+"支("+data.team_member+"人),其中可调拨"+data.kused+"支</span>";
  519. cont += fgx;
  520. cont += "<span style='" + cont_style + "'><b style='" + b_style + "'>输电队伍:</b>" + data.sd_sum + "(人)</span>" +
  521. "<span style='" + cont_style + "'><b style='" + b_style + "'>变电队伍:</b>" + data.bd_sum + "(人)</span>" +
  522. "<span style='" + cont_style + "'><b style='" + b_style + "'>配电队伍:</b>" + data.pd_sum + "(人)</span>" +
  523. "<span style='" + cont_style + "'><b style='" + b_style + "'>通信队伍:</b>" + data.tongxing + "(人)</span>" +
  524. "<span style='" + cont_style + "'><b style='" + b_style + "'>网络信息队伍:</b>" + data.wangluo + "(人)</span>" +
  525. "<span style='" + cont_style + "'><b style='" + b_style + "'>试验队伍:</b>" + data.shiyan + "(人)</span>" +
  526. "<div style='" + chart_btn + "' deptId=" + data.dept_id + " onclick='showSubTeamChart(\"" + data.dept_id +
  527. "\")'>查看图表</div>";
  528. }else if(param.type=="gen"){//发电机
  529. cont = "<span style='font-weight: bold;'>" + param.name + "</span><span style='"+sub_title +
  530. "'>&nbsp;共" + data.num+"台(总容量:"+data.sum+"kW),其中可调用"+data.kused+"台</span>";
  531. cont += fgx;
  532. cont += "<span style='" + cont_style + "'><b style='" + b_style + "'>0-10kW(台):</b>" + data.content_min + "</span>" +
  533. "<span style='" + cont_style + "'><b style='" + b_style + "'>11-50kW(台):</b>" + data.content_mid + "</span>" +
  534. "<span style='" + cont_style + "'><b style='" + b_style + "'>51kW及以上(台):</b>" + data.content_max + "</span>" +
  535. "<div style='" + chart_btn + "' deptId=" + data.dept_id + " onclick='showSubGenChart(\"" + data.dept_id +
  536. "\")'>查看图表</div>";
  537. }else if(param.type=="car"){//发电车
  538. cont = "<span style='font-weight: bold;'>" + param.name + "</span><span style='"+sub_title +
  539. "'>&nbsp;共" + data.num+"辆(总容量:"+data.sum+"kVA),其中可调拨"+data.kused+"辆</span>";
  540. cont += fgx;
  541. cont += "<span style='" + cont_style + "'><b style='" + b_style + "'>容量N≤250(辆/kVA)&nbsp;&nbsp;:&nbsp;&nbsp;</b>" + data.content_min + "</span>" +
  542. "<span style='" + cont_style + "'><b style='" + b_style + "'>容量250<N≤500(辆/kVA):&nbsp;&nbsp;</b>" + data.content_mid + "</span>" +
  543. "<span style='" + cont_style + "'><b style='" + b_style + "'>容量N>500(辆/kVA)&nbsp;&nbsp;&nbsp:&nbsp;&nbsp;</b>" + data.content_max + "</span>" +
  544. "<span style='" + cont_style + "'><b style='" + b_style + "'>380V:&nbsp;&nbsp;</b>" + data.level_max + "</span>" +
  545. "<span style='" + cont_style + "'><b style='" + b_style + "'>10kV:&nbsp;&nbsp;</b>" + data.level_min + "</span>" +
  546. "<div style='" + chart_btn + "' deptId=" + data.dept_id + " onclick='showSubCarChart(\"" + data.dept_id +
  547. "\")'>查看图表</div>";
  548. }else if(param.type=="ew"){//预警
  549. cont = "<span style='font-weight: bold;'>" + param.name + "</span>";
  550. cont += fgx;
  551. cont += "<span style='" + cont_style + "'><b style='" + b_style + "'>事件名称:</b>" + data.extraData.ICON_DESCRIBE + "</span>" +
  552. "<span style='" + cont_style + "'><b style='" + b_style + "'>预警名称:</b>" + data.extraData.ICON_DESCRIBE + "</span>" +
  553. "<span style='" + cont_style + "'><b style='" + b_style + "'>发布时间:</b>" + data.extraData.WRITE_TIME + "</span>" +
  554. "<span style='" + cont_style + "'><b style='" + b_style + "'>预警编号:</b>" + data.extraData.EARLY_WARNING_ID + "</span>" +
  555. "<span style='" + cont_style + "'><b style='" + b_style + "'>录 入 人:</b>" + data.extraData.WRITER + "</span>" +
  556. "<div style='" + chart_btn + "' deptId=" + data.dept_id + " onclick='showEwErInfo(\"" + data.extraData.FD_OBJECTID +
  557. "\")'>查看详情</div>" ;
  558. };
  559. return cont;
  560. };
  561. function showSubTeamChart(deptId){
  562. var data = su.getJsonData("/nwyj/ws/Team/TeamService/getTeamInfo",{id:deptId});
  563. loadChart(getSubTeamChartOption(data));
  564. if($(".chart_btn").hasClass("chart_btn_off")){
  565. $(".chart_btn").click();
  566. };
  567. };
  568. function showSubGenChart(deptId){
  569. var data = su.getJsonData("/nwyj/ws/generator/GeneratorService/getGeneratorInfo",{id:deptId});
  570. loadChart(changeBarOptionGen(data));
  571. if($(".chart_btn").hasClass("chart_btn_off")){
  572. $(".chart_btn").click();
  573. };
  574. };
  575. function showSubCarChart(deptId){
  576. var data = su.getJsonData("/nwyj/ws/generatorcar/GeneratorCarService/getCarInfo",{id:deptId});
  577. loadChart(changeBarOptionCar(data));
  578. if($(".chart_btn").hasClass("chart_btn_off")){
  579. $(".chart_btn").click();
  580. };
  581. };
  582. function getSubTeamChartOption(data){
  583. var legendData=[];
  584. var seriesData=[];
  585. var data1=[];
  586. var data2=[];
  587. var data3=[];
  588. var data4=[];
  589. var data5=[];
  590. var data6=[];
  591. for(var i=0;i<data.rows.length-1;i++){
  592. //alert(data.rows[i].name);
  593. legendData[i]=data.rows[i].name;
  594. data1[i]=data.rows[i].sd_sum;
  595. data2[i]=data.rows[i].bd_sum;
  596. data3[i]=data.rows[i].pd_sum;
  597. data4[i]=data.rows[i].tongxing;
  598. data5[i]=data.rows[i].wangluo;
  599. data6[i]=data.rows[i].shiyan;
  600. };
  601. var series1={ name:'输电队伍', type:'bar', data:data1 };
  602. var series2={ name:'变电队伍', type:'bar', data:data2 };
  603. var series3={ name:'配电队伍', type:'bar', data:data3 };
  604. var series4={ name:'通信队伍', type:'bar', data:data4 };
  605. var series5={ name:'网络信息队伍', type:'bar', data:data5 };
  606. var series6={ name:'试验队伍', type:'bar', data:data6 };
  607. seriesData=[series1,series2,series3,series4,series5,series6];
  608. var param = {title:"应急队伍统计图", yArr:legendData, sArr:seriesData,
  609. legend:['输电队伍','变电队伍','配电队伍','通信队伍','网络信息队伍','试验队伍'],
  610. color:"#cc6600"};
  611. return param;
  612. };
  613. function showEwErInfo(fd_id){
  614. window.open('/nwyj/page/cockpit/webgis/EventAllInfo.jsp?fd_id=' + fd_id + "&dept_id=" + comp_id);
  615. };