5f51f1048fa2ddbaeccc3b5866f59ae06e6c51cc.svn-base 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996
  1. var compid = "";
  2. var deptName = "";
  3. var ind = "";
  4. var season_jidu = "1";
  5. var NavJsonData = {"name":"定期维护信息",
  6. "children":[{"name":"内部(外部)应急队伍人员登记表","value":"/page/business/am/resource/team/team.jsp","type":"wh"},
  7. {"name":"内部(外部)应急队伍人员统计表","value":"/page/business/am/resource/team/team-poll.jsp","type":"wh"},
  8. /* {"name":"应急协作队伍人员统计表","value":"/page/business/am/resource/team/team-poll.jsp","type":"wh"},*/
  9. {"name":"应急专家队伍人员登记表","value":"/page/business/am/resource/expert/expert-maintenance.jsp","type":"wh"},
  10. /* {"name":"应急指挥(通信)车登记表","value":"/page/business/am/resource/ledger/command-car.jsp","type":"wh"},*/
  11. {"name":"应急发电车登记表 ","value":"/page/business/am/resource/ledger/generator-car.jsp","type":"wh"},
  12. {"name":"应急发电机登记表","value":"/page/business/am/resource/ledger/generator.jsp","type":"wh"}
  13. ]};
  14. var url = window.location.href;
  15. if(url.indexOf("?")>-1){
  16. var params = window.location.href.split("?");
  17. compid = params[1];
  18. report_type = params[2];
  19. classid1 = params[2];
  20. if(params.length==4){
  21. ind = params[3];
  22. }
  23. season_jidu = params[4];
  24. }else{
  25. compid = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  26. deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  27. }
  28. var QuarterData = {"list":[{"key":"第一季度","value":"1"},
  29. {"key":"第二季度","value":"2"},
  30. {"key":"第三季度","value":"3"},
  31. {"key":"第四季度","value":"4"}
  32. ]};
  33. /*************获取当前日期*******************************************************/
  34. var currDate = getNowFormatDate();
  35. var month = currDate.substring(5,7);
  36. currDate = currDate.substring(0,4);
  37. /*************获取当前日期*******************************************************/
  38. var YearData = {"list":[{"key":currDate-6,"value":currDate-6},
  39. {"key":currDate-5,"value":currDate-5},
  40. {"key":currDate-4,"value":currDate-4},
  41. {"key":currDate-3,"value":currDate-3},
  42. {"key":currDate-2,"value":currDate-2},
  43. {"key":currDate-1,"value":currDate-1},
  44. {"key":currDate,"value":currDate}/*,
  45. {"key":currDate-(-1),"value":currDate-(-1)}*/
  46. ]};
  47. //数据表格
  48. var g;
  49. var myCols;
  50. $(function(){
  51. $(".isPrimaryKey").live("click",function(i,item){
  52. var compId = $(this).find("a").attr("data-compid");
  53. var rowindex = $(this).find("a").attr("data-rowindex");
  54. var reportype = $(this).find("a").attr("data-reportype");
  55. var fdId = $(this).find("a").attr("fdId");
  56. if(rowindex==0){
  57. return;
  58. }
  59. var index = $(".current").attr("data-index");
  60. var season = $("#BB_JIDU").attr("relValue");
  61. if (!!window.ActiveXObject || "ActiveXObject" in window){//ie
  62. $.indexOpenNextWindow("/nwyj/page/business/am/report/reportinput/huizong.jsp?"+compId+"?"+reportype+"?"+index+"?"+season,"_blank");
  63. //上级查看下级单位上报的数据
  64. if(compId!=compid && fdId!=""){
  65. getThing($.pathname() + "/ws/RcBaoBiao/RcBaoBiaoService/updateRollStat", {fd_id:fdId,stat:"0"}, "text");
  66. }
  67. }else{
  68. $.indexOpenNextWindow("/nwyj/page/business/am/report/reportinput/huizong.jsp?"+compId+"?"+reportype+"?"+index+"?"+season,"_blank");
  69. if(compId!=compid && fdId!=""){
  70. getThing($.pathname() + "/ws/RcBaoBiao/RcBaoBiaoService/updateRollStat", {fd_id:fdId,stat:"0"}, "text");
  71. }
  72. }
  73. });
  74. //****布局
  75. var layout = $("#layout1").layout({
  76. leftWidth : 250,
  77. space:10
  78. });
  79. $("#layout1").layout({
  80. onEndResize : function() {
  81. g.resetWidth();
  82. /*var wi = $(".layout_content").width();
  83. wi = wi*0.85;
  84. $(".layout_content .accordition").css("width",wi+"px");*/
  85. }
  86. });
  87. function customHeightSet(contentHeight) {
  88. $(".layout_content").height(contentHeight - 30);
  89. }
  90. function customHeightSet(contentHeight) {
  91. $(".cusBoxContent").height(contentHeight - 20);
  92. }
  93. var seasion = getThing($.pathname()+ "/ws/rcbaobiao/RcBbService/getSeasionByHz", "", "text");
  94. if(seasion !=""){
  95. season_jidu = seasion.split(";")[1];
  96. currDate = seasion.split(";")[0];
  97. }
  98. $("#BB_YEAR").data("data",YearData);
  99. $("#BB_YEAR").attr("selectedValue",currDate);
  100. $("#BB_YEAR").render();
  101. $("#BB_JIDU").data("data",QuarterData);
  102. $("#BB_JIDU").attr("selectedValue",season_jidu);
  103. $("#BB_JIDU").render();
  104. //后台读取数据创建左边导航
  105. getNavDatas();
  106. });
  107. /**
  108. * 字符串转时间(yyyy-MM-dd HH:mm:ss)
  109. * result (分钟)
  110. */
  111. String.prototype.stringToDate = function(){
  112. return new Date(Date.parse(this.replace(/-/g, "/")));
  113. };
  114. /***
  115. * 通过特定格式json数据,生成左边导航
  116. * @param json
  117. */
  118. function createNavJson(json){
  119. var $obj = $("#accordition");
  120. for(var k=0;k<json.length;k++){
  121. var navName = json[k].name;
  122. var navChildren = json[k].children;
  123. var $aa = $("<a class='titlebar '>"+navName+"</a>");
  124. $obj.append($aa);
  125. var $dd = $("<div style='display:none;'></div>");
  126. $obj.append($dd);
  127. for(var i=0;i<navChildren.length;i++){
  128. var name = navChildren[i].name;
  129. var value = navChildren[i].value;
  130. var type = navChildren[i].type;
  131. var $div = $('<div class="leftnav">'+name+'</div>');
  132. if(i==0&&type=="bs"){
  133. $div.addClass("current");
  134. }
  135. if(type=="bs"){//定期报送信息
  136. $div.attr("data-value",value);
  137. $div.attr("data-index",i);
  138. }else{//定期维护信息
  139. $div.data("data-url",value);
  140. }
  141. $div.data("type",type);
  142. $div.unbind("click").bind("click",selectOneNav);
  143. $dd.append($div);
  144. }
  145. }
  146. $obj.find("a").eq(0).click();
  147. if(ind=="" || ind==undefined){
  148. $obj.find(".current").click();
  149. }else{
  150. $obj.find(".leftnav").eq(ind).click();
  151. }
  152. }
  153. /****
  154. * 绑定左侧导航点击事件
  155. */
  156. function selectOneNav(){
  157. var type = $(this).data("type");
  158. $(".current").removeClass("current");
  159. $(this).addClass("current");
  160. if(type=="bs"){
  161. $("#i_grid").show();
  162. $("#ifrcontent").hide();
  163. var year_value = $("#BB_YEAR").attr("relvalue");
  164. var season_value = $("#BB_JIDU").attr("relvalue");
  165. dovalue = $(this).attr("data-value");
  166. showGridandCharts(dovalue,year_value,season_value);
  167. }else{
  168. $("#i_grid").hide();
  169. $("#ifrcontent").show();
  170. var showUrl = $(this).data("data-url");
  171. $("#frmrightChild").attr("src",$.pathname()+showUrl);
  172. $("#frmrightChild").height($(window.document.body).height()+30);
  173. $(top.document.body).find("#frmright").height($(window.document.body).height()+30);
  174. }
  175. //设置该菜单选中
  176. return false;
  177. }
  178. function export_report(){
  179. var year=$("#BB_YEAR").attr("relvalue");
  180. var season=$("#BB_JIDU").attr("relvalue");//若要季度文字,则把relvalue改成reltext
  181. var title= $("#accordition .current").text()+year+"年第"+season+"季度";//应急预警和响应统计表
  182. var sql = {
  183. "report_type" :dovalue,
  184. "id":compid,
  185. "json":JSON.stringify(g.getData()),
  186. "year":year,
  187. "season":season,
  188. condition:' 1=1',
  189. "title":title
  190. };
  191. excelExport(dovalue,sql,title,['FD_OBJECTID','REPORT_ID','COMP_ID','UPDATEDATE'],title,'rcreport');
  192. }
  193. /**
  194. * 访问后台,将导航数据读取出来
  195. */
  196. function getNavDatas() {
  197. var urls = $.pathname()+ "/ws/xianlutingyun/XianlutingyunService/getRcNavData";
  198. $.ajax({
  199. url : urls,
  200. type : 'post',
  201. timeout : 15000,
  202. async : false,
  203. dataType : 'json',
  204. success : function(data) {
  205. data.push(NavJsonData);
  206. //调用方法,创建左边导航
  207. createNavJson(data);
  208. },
  209. error : function(e) {
  210. $.messager.alert('查询数据失败!', '访问服务失败!', 'error');
  211. }
  212. });
  213. }
  214. function _addStatus(rowdata, rowindex, value, column){
  215. var value1 = "<a href='javascript:;' data-compid='"+rowdata.COMP_ID+"' data-rowindex='"+rowindex+"' data-reportype='438' data-fdId='"+rowdata.FD_OBJECTID+"'>"+value+"</a>";
  216. if(value=='总计'){
  217. return "<div style='background-color: #5582b9' class='zongji_td'>"+value1+"</div>";
  218. }else{
  219. return "<div style='background-color: #dde5f0'>"+value1+"</div>";
  220. }
  221. }
  222. /***
  223. * 从后台读取表头数据
  224. */
  225. function setColumn(reprotvalue){
  226. var urls = $.pathname()+ "/ws/rcbaobiao/RcBbService/getHuizongColumns";
  227. $.ajax({
  228. url : urls,
  229. type : 'post',
  230. timeout : 15000,
  231. async : false,
  232. data : {
  233. "report_type" : reprotvalue
  234. },
  235. dataType : 'text',
  236. success : function(data) {
  237. //alert("column=="+JSON.stringify(data));
  238. myCols = data;
  239. },
  240. error : function(e) {
  241. $.messager.alert('查询失败111!', '访问服务失败!', 'error');
  242. }
  243. });
  244. }
  245. /*访问后台,获取数据加载表格*/
  246. function _initgrid(reprotvalue,year_value,season_value){
  247. //alert(reprotvalue)
  248. if(!reprotvalue){
  249. return;
  250. }
  251. setColumn(reprotvalue);
  252. var url=$.pathname() + '/ws/rcbaobiao/RcBbService/getHuiZongData/';
  253. $.ajax({
  254. url : url,
  255. type : 'post',
  256. timeout : 15000,
  257. async : false,
  258. data : {
  259. comp_id : compid,
  260. report_type:reprotvalue,
  261. year:year_value,
  262. season:season_value
  263. },
  264. dataType : 'json',
  265. success : function(data) {
  266. if("438-439-440-441-442-444-445".match(new RegExp(reprotvalue))!=null){
  267. $(".c_chart_mainContent").show();
  268. EchartDoJo["echart"+reprotvalue]["fn_echart"](data.rows);
  269. }else{
  270. destoryEchart();
  271. $("#chartsContent").empty();
  272. $(".c_chart_mainContent").hide();
  273. }
  274. initgridcon(reprotvalue,data);
  275. //$(".zongji_td").parent().parent().parent().unbind("mouseover");
  276. },
  277. error : function(e) {
  278. $.messager.alert('查询失败!', '访问服务失败!', 'error');
  279. }
  280. })/*.done(function(){//该方法为ajax与后台交互时方能用,执行时间为数据获取到并加载完执行
  281. $(parent.document.body).find("iframe").height($(window.document.body).height()+40);
  282. $(top.document.body).find("#frmright").height($(window.document.body).height()+40);
  283. })*/;
  284. }
  285. function change() {
  286. //value = $(parent.document.body).find("#accordition .current").attr("data-value");
  287. var val = $("#sel").val();
  288. var year_value = $("#BB_YEAR").attr("relvalue");
  289. var season_value = $("#BB_JIDU").attr("relvalue");
  290. // alert(dovalue);
  291. _initgrid(dovalue,year_value,season_value);
  292. }
  293. /*传入data数据,加载表格对象,若ind=0,加载有分组模式的表格对象,否则没有分组,普通的表格
  294. *只有应急指挥与管理机构统计表有分组
  295. **/
  296. function initgridcon(reprotvalue,data){
  297. // alert("myCols=="+myCols);
  298. if(reprotvalue==438){
  299. g = $("#maingrid").quiGrid({
  300. //columns: myCols[ind].col,
  301. columns: eval('('+myCols+')'),
  302. data:data,
  303. rownumbers : true,
  304. width : "100%",
  305. onAfterShowData:function(){setHt();},
  306. //pageSize:10
  307. usePager : false,
  308. alternatingRow:false,
  309. rowAttrRender: function(rowdata, rowid){
  310. return "总计" == rowdata.COMP_NAME ? "style=\"background-color:#5582b9;\"" : '';
  311. },
  312. groupColumnName: "TYPE",
  313. groupColumnDisplay: ''});
  314. }else{
  315. if(g!=undefined){
  316. g.setOptions({groupColumnName: ""});
  317. }
  318. g = $("#maingrid").quiGrid({
  319. //columns: myCols[ind].col,
  320. columns: eval('('+myCols+')'),
  321. data:data,
  322. rownumbers : true,
  323. isScroll:false,
  324. width : "100%",
  325. usePager : false,
  326. rowAttrRender: function(rowdata, rowid){
  327. return "总计" == rowdata.COMP_NAME ? "style=\"background-color:#5582b9;\"" : '';
  328. },
  329. onAfterShowData:function(){setHt();}
  330. });
  331. }
  332. }
  333. function showGridandCharts(reportvalue,year_value,season_value){
  334. _initgrid(reportvalue,year_value,season_value);
  335. //_initCharts(reprotvalue);
  336. //setTimeout("setHt();", 100);
  337. };
  338. /*初始化图表
  339. * ind值为0时应急指挥与管理机构统计表
  340. * */
  341. /* function _initCharts(ind){
  342. if(ind==438){//应急指挥与管理机构统计表
  343. emergencyCommandAndRegulatoryAgency438();
  344. }else if(ind==439){//应急预案与修编
  345. emergencyCommandAndRegulatoryAgency439();
  346. }
  347. }*/
  348. function setHt(){
  349. var height = $("#layout1 .padding_right5").height()+$("#chartsContent").height()+$("#searchCondi").height()+90;
  350. $('#layout1').height(height);
  351. $('#layout1 .l-layout-left').height(height);
  352. $('#layout1 .l-layout-center').height(height);
  353. $('#searchPanel').height(height);
  354. $(window.document.body).height(height);
  355. $(parent.document.body).find("#frmright").height($(window.document.body).height());
  356. }
  357. /*****************************************************************************************************************/
  358. /******************************************** echart 图表方法 ***************************************************/
  359. /*****************************************************************************************************************/
  360. var echartImplArr=[];
  361. /*var */
  362. var EchartDoJo={
  363. //应急指挥与应急管理机构
  364. echart438:{fn_echart:YingJiZhiHuiAndGuanLiJiGou},
  365. //应急预案修订
  366. echart439:{fn_echart:YingJiYuAnXiuDing} ,
  367. //应急培训
  368. echart440: {fn_echart:YingJiPeiXun},
  369. //应急演练
  370. echart441: {fn_echart:YingJiYanLian},
  371. //应急预警和响应统计表
  372. echart442: {fn_echart:YingJiYuJingXiangYing},
  373. //保供电任务统计
  374. echart444: {fn_echart:BaoGongDianRenwu},
  375. //保供电任务明细
  376. echart445: {fn_echart:BaoGongDianMingXi}
  377. };
  378. function reSetContent($dom,count){
  379. $dom.empty();
  380. $("#i_chart_descripe").empty();
  381. if(count==2){
  382. $dom.append("<div id='i_echartContent1' class='c_echartContent'></div><div id='i_echartContent2' class='c_echartContent'></div>");
  383. $("#i_chart_descripe").append("<div id='i_echart_title1' class='c_echart_title'></div><div id='i_echart_title2' class='c_echart_title'></div>");
  384. }else{
  385. $dom.append("<div id='i_echartContent1' class='c_echartContent1'></div>");
  386. $("#i_chart_descripe").append("<div id='i_echart_title1' class='c_echart_title'></div>");
  387. }
  388. }
  389. var utils=new Util();
  390. /**
  391. * 报告明细
  392. */
  393. function BaoGongDianMingXi(dataParam){
  394. $("#i_chart_descripe").addClass("c_chart_descripe_change");
  395. destoryEchart();
  396. reSetContent($("#chartsContent"),1);
  397. var leArr=[];
  398. var select={};
  399. var xAxis=["投入人员","投入车辆","投入应急发电车","投入应急发电机"];
  400. var sArr=[];
  401. for(var index1=0,len=dataParam.length;index1<len;index1++){
  402. //临时数据
  403. var tempItem=new SingleItem("","bar",40);
  404. var item=dataParam[index1];
  405. tempItem.name=dataParam[index1]["COMP_NAME"];
  406. tempItem.data.push({value:utils.changeQ(item["BGD_TRRY"]),
  407. data:{jb:_(item["BGD_LEVEL"]),
  408. sj:_(item["BGD_RWSJ"]),
  409. mc:_(item["BGD_RWMC"])}});
  410. tempItem.data.push({value:utils.changeQ(item["BGD_TRCL"]),
  411. data:{jb:item["BGD_LEVEL"],sj:item["BGD_RWSJ"],mc:item["BGD_RWMC"]}});
  412. tempItem.data.push({value:utils.changeQ(item["BGD_TRYJFDC"]),
  413. data:{jb:item["BGD_LEVEL"],sj:item["BGD_RWSJ"],mc:item["BGD_RWMC"]}});
  414. tempItem.data.push({value:utils.changeQ(item["BGD_TRYJFDJ"]),
  415. data:{jb:item["BGD_LEVEL"],sj:item["BGD_RWSJ"],mc:item["BGD_RWMC"]}});
  416. if(index1==0){
  417. select[replaceStr(item["COMP_NAME"],"省")]=true;
  418. }else{
  419. select[replaceStr(item["COMP_NAME"],"省")]=false;
  420. }
  421. leArr.push(replaceStr(item["COMP_NAME"],"省"));
  422. sArr.push(tempItem);
  423. }
  424. var opParams={
  425. unit:"座",//单位
  426. leArr:[],//图例
  427. xAxis:xAxis,//x轴
  428. sArr:[sArr[0]],//主数据
  429. trigger:"axis",
  430. show:false,
  431. legendColor:"#000000", //图例字体颜色
  432. xAxisColor:"#5BB93C", //X轴字体颜色
  433. yAxisColor:"#5BB93C", //Y轴字体颜色
  434. y:100
  435. };
  436. createList(leArr,loadBaoGongDianMingXiData);
  437. var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
  438. echartImplArr.push(chart);
  439. setTitle(leArr[0]+"保供电明细统计图");
  440. var tempStr="<div><span>保供电级别:</span>"+sArr[0]["data"][0]["data"]["jb"]+"</div>";
  441. tempStr+="<div><span>保供电任务名称:</span>"+sArr[0]["data"][0]["data"]["mc"]+"</div>";
  442. tempStr+="<div><span>保供电任务时间:</span>"+sArr[0]["data"][0]["data"]["sj"]+"</div>";
  443. setSubTitle(tempStr);
  444. function loadBaoGongDianMingXiData($dom){
  445. var dataIndex=$dom.attr("data");
  446. setTitle(leArr[dataIndex]+"保供电明细统计图");
  447. var tempStr="<div><span>保供电级别:</span>"+sArr[dataIndex]["data"][0]["data"]["jb"]+"</div>";
  448. tempStr+="<div><span>保供电任务名称:</span>"+sArr[dataIndex]["data"][0]["data"]["mc"]+"</div>";
  449. tempStr+="<div><span>保供电任务时间:</span>"+sArr[dataIndex]["data"][0]["data"]["sj"]+"</div>";
  450. setSubTitle(tempStr);
  451. echartImplArr[0].setSeries([sArr[dataIndex]]);
  452. }
  453. }
  454. /**
  455. * 报告任务
  456. */
  457. function BaoGongDianRenwu(dataParam){
  458. $("#i_chart_descripe").removeClass("c_chart_descripe_change");
  459. destoryEchart();
  460. reSetContent($("#chartsContent"),1);
  461. var leArr=[];
  462. /*var select={};*/
  463. var xAxis=["特级","一级","二级","三级"];
  464. var sArr=[];
  465. for(var index1=0,len=dataParam.length;index1<len;index1++){
  466. //临时数据
  467. var tempItem=new SingleItem("","bar",40);
  468. var item=dataParam[index1];
  469. tempItem.name=dataParam[index1]["COMP_NAME"];
  470. tempItem.data.push({value:utils.changeQ(item["BGD_TJ"])});
  471. tempItem.data.push({value:utils.changeQ(item["BGD_YJ"])});
  472. tempItem.data.push({value:utils.changeQ(item["BGD_EJ"])});
  473. tempItem.data.push({value:utils.changeQ(item["BGD_SJ"])});
  474. /* if(index1==0){
  475. select[replaceStr(item["COMP_NAME"],"省")]=true;
  476. }else{
  477. select[replaceStr(item["COMP_NAME"],"省")]=false;
  478. }*/
  479. leArr.push(replaceStr(item["COMP_NAME"],"省"));
  480. sArr.push(tempItem);
  481. }
  482. createList(leArr,loadBaoGongDianRenwuData);
  483. var opParams={
  484. unit:"座",//单位
  485. leArr:[],//图例
  486. xAxis:xAxis,//x轴
  487. sArr:[sArr[0]],//主数据
  488. trigger:"axis",
  489. show:false,
  490. legendColor:"#000000", //图例字体颜色
  491. xAxisColor:"#5BB93C", //X轴字体颜色
  492. yAxisColor:"#5BB93C", //Y轴字体颜色
  493. y:10
  494. };
  495. var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
  496. echartImplArr.push(chart);
  497. setTitle(leArr[0]+"保供电任务统计图");
  498. function loadBaoGongDianRenwuData($dom){
  499. var dataIndex=$dom.attr("data");
  500. setTitle(leArr[dataIndex]+"保供电任务统计图");
  501. echartImplArr[0].setSeries([sArr[dataIndex]]);
  502. }
  503. }
  504. /**
  505. * 应急演练
  506. * @param dataParam
  507. */
  508. function YingJiYuJingXiangYing(dataParam){
  509. $("#i_chart_descripe").removeClass("c_chart_descripe_change");
  510. destoryEchart();
  511. reSetContent($("#chartsContent"),1);
  512. var leArr=[];
  513. var select={};
  514. var xAxis=["红色","橙色","黄色","蓝色","Ⅰ级","Ⅱ级","Ⅲ级","Ⅳ级"];
  515. var sArr=[];
  516. for(var index1=0,len=dataParam.length;index1<len;index1++){
  517. //临时数据
  518. var tempItem=new SingleItem("","bar",40);
  519. var item=dataParam[index1];
  520. tempItem.name=dataParam[index1]["COMP_NAME"];
  521. tempItem.data.push(utils.changeQ(item["RED_NUM"]));
  522. tempItem.data.push(utils.changeQ(item["ORANGE_NUM"]));
  523. tempItem.data.push(utils.changeQ(item["YELLOW_NUM"]));
  524. tempItem.data.push(utils.changeQ(item["BLUE_NUM"]));
  525. tempItem.data.push(utils.changeQ(item["FIRST_NUM"]));
  526. tempItem.data.push(utils.changeQ(item["SECOND_NUM"]));
  527. tempItem.data.push(utils.changeQ(item["THIRD_NUM"]));
  528. tempItem.data.push(utils.changeQ(item["FORTH_NUM"]));
  529. if(index1==0){
  530. select[replaceStr(item["COMP_NAME"],"省")]=true;
  531. }else{
  532. select[replaceStr(item["COMP_NAME"],"省")]=false;
  533. }
  534. leArr.push(replaceStr(item["COMP_NAME"],"省"));
  535. sArr.push(tempItem);
  536. }
  537. var opParams={
  538. //title:"停运最多时间:"+tempArr[0]["APPEAR_TIME"],//标题
  539. //subtext:"当前停运最多单位:"+/* (result["max"]["DEPT_NAME"] || "广东")+(result["max"]["sum"] || "100") */+ "(座)",
  540. unit:"座",//单位
  541. leArr:[],//图例
  542. xAxis:xAxis,//x轴
  543. sArr:[sArr[0]],//主数据
  544. trigger:"axis",
  545. show:false,
  546. legendColor:"#000000", //图例字体颜色
  547. xAxisColor:"#5BB93C", //X轴字体颜色
  548. yAxisColor:"#5BB93C", //Y轴字体颜色
  549. y:10
  550. };
  551. createList(leArr,loadYingJiYuJingXiangYingData);
  552. var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
  553. echartImplArr.push(chart);
  554. setTitle(leArr[0]+"应急预警响应统计图");
  555. function loadYingJiYuJingXiangYingData($dom){
  556. var dataIndex=$dom.attr("data");;
  557. setTitle(leArr[dataIndex]+"应急预警响应统计图");
  558. echartImplArr[0].setSeries([sArr[dataIndex]]);
  559. }
  560. }
  561. /**
  562. * 应急演练
  563. * dataParam
  564. */
  565. function YingJiYanLian(dataParam){
  566. $("#i_chart_descripe").addClass("c_chart_descripe_change");
  567. destoryEchart();
  568. reSetContent($("#chartsContent"),1);
  569. var leArr=[];
  570. var select={};
  571. var xAxis=["综合演练现场","综合演练桌面","专项演练现场","专项演练桌面"];
  572. var sArr=[];
  573. for(var index1=0,len=dataParam.length;index1<len;index1++){
  574. var tempItem=new SingleItem("","bar",40);
  575. var item=dataParam[index1];
  576. tempItem.name=dataParam[index1]["COMP_NAME"];
  577. tempItem.data.push({value:utils.changeQ(_(item["ZHYLXCCS"])),data:{trje:_(item["TRJE"]),jbcs:_(item["JBCS"]),cyrs:_(item["CYRS"])}});
  578. tempItem.data.push({value:utils.changeQ(item["ZHYLZMCS"]),data:{trje:item["TRJE"],jbcs:item["JBCS"],cyrs:item["CYRS"]}});
  579. tempItem.data.push({value:utils.changeQ(item["ZXYLXCCS"]),data:{trje:item["TRJE"],jbcs:item["JBCS"],cyrs:item["CYRS"]}});
  580. tempItem.data.push({value:utils.changeQ(item["ZXYLZMCS"]),data:{trje:item["TRJE"],jbcs:item["JBCS"],cyrs:item["CYRS"]}});
  581. if(index1==0){
  582. select[replaceStr(item["COMP_NAME"],"省")]=true;
  583. }else{
  584. select[replaceStr(item["COMP_NAME"],"省")]=false;
  585. }
  586. leArr.push(replaceStr(item["COMP_NAME"],"省"));
  587. sArr.push(tempItem);
  588. }
  589. var opParams={
  590. unit:"座",//单位
  591. leArr:[],//图例
  592. xAxis:xAxis,//x轴
  593. sArr:[sArr[0]],//主数据
  594. trigger:"axis",
  595. show:false,
  596. select:{},
  597. legendColor:"red", //图例字体颜色
  598. xAxisColor:"red", //X轴字体颜色
  599. yAxisColor:"red" , //Y轴字体颜色
  600. y:100
  601. };
  602. createList(leArr,loadYingJiYanLianData);
  603. var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
  604. echartImplArr.push(chart);
  605. setTitle(leArr[0]+"应急演练统计图");
  606. var tempStr="<div><span>举办次数:</span>"+sArr[0]["data"][0]["data"]["jbcs"]+"</div>";
  607. tempStr+="<div><span>参演人数:</span>"+sArr[0]["data"][0]["data"]["cyrs"]+"</div>";
  608. tempStr+="<div><span>投入金额:</span>"+sArr[0]["data"][0]["data"]["trje"]+"</div>";
  609. setSubTitle(tempStr);
  610. function loadYingJiYanLianData($dom){
  611. var dataIndex=$dom.attr("data");;
  612. setTitle(leArr[dataIndex]+"应急演练统计图");
  613. var tempStr="<div><span>举办次数:</span>"+sArr[dataIndex]["data"][0]["data"]["jbcs"]+"(次)</div>";
  614. tempStr+="<div><span>参演人数:</span>"+sArr[dataIndex]["data"][0]["data"]["cyrs"]+"(万元)</div>";
  615. tempStr+="<div><span>投入金额:</span>"+sArr[dataIndex]["data"][0]["data"]["trje"]+"(人)</div>";
  616. setSubTitle(tempStr);
  617. echartImplArr[0].setSeries([sArr[dataIndex]]);
  618. }
  619. }
  620. /**
  621. * 应急培训
  622. * dataParam
  623. */
  624. function YingJiPeiXun(dataParam){
  625. $("#i_chart_descripe").addClass("c_chart_descripe_change");
  626. destoryEchart();
  627. reSetContent($("#chartsContent"),1);
  628. var leArr=[];
  629. var select={};
  630. var xAxis=["集中脱产","网络","其他"];
  631. var sArr=[];
  632. for(var index1=0,len=dataParam.length;index1<len;index1++){
  633. //临时数据
  634. var tempItem=new SingleItem("","bar",40);
  635. var item=dataParam[index1];
  636. tempItem.name=dataParam[index1]["COMP_NAME"];
  637. tempItem.data.push({value:utils.changeQ(item["PXFS_JZTC"]),
  638. data:{jbcs:_(item["PXQK_JBCS"]),tu:_(item["PXQK_TR"]),pxsl:_(item["PXQK_PXSL"])}});
  639. tempItem.data.push(utils.changeQ(item["PXFS_WL"]));
  640. tempItem.data.push(utils.changeQ(item["PXFS_QT"]));
  641. if(index1==0){
  642. select[replaceStr(item["COMP_NAME"],"省")]=true;
  643. }else{
  644. select[replaceStr(item["COMP_NAME"],"省")]=false;
  645. }
  646. leArr.push(replaceStr(item["COMP_NAME"],"省"));
  647. sArr.push(tempItem);
  648. }
  649. var opParams={
  650. unit:"座",//单位
  651. leArr:[],//图例
  652. xAxis:xAxis,//x轴
  653. sArr:[sArr[0]],//主数据
  654. trigger:"axis",
  655. show:false,
  656. select:select,
  657. legendColor:"red", //图例字体颜色
  658. xAxisColor:"red", //X轴字体颜色
  659. yAxisColor:"red" , //Y轴字体颜色
  660. y:100
  661. };
  662. var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
  663. echartImplArr.push(chart);
  664. setTitle(leArr[0]+"应急培训统计图");
  665. var tempStr="<div><span>举办次数:</span>"+sArr[0]["data"][0]["data"]["jbcs"]+"(次)</div>";
  666. tempStr+="<div><span>投入:</span>"+sArr[0]["data"][0]["data"]["tu"]+"(万元)</div>";
  667. tempStr+="<div><span>培训数量:</span>"+sArr[0]["data"][0]["data"]["pxsl"]+"(人)</div>";
  668. setSubTitle(tempStr);
  669. createList(leArr,loadYingJiPeiXunData);
  670. function loadYingJiPeiXunData($dom){
  671. var dataIndex=$dom.attr("data");
  672. setTitle(leArr[dataIndex]+"应急培训统计图");
  673. var tempStr="<div><span>举办次数:</span>"+sArr[dataIndex]["data"][0]["data"]["jbcs"]+"(次)</div>";
  674. tempStr+="<div><span>投入:</span>"+sArr[dataIndex]["data"][0]["data"]["tu"]+"(万元)</div>";
  675. tempStr+="<div><span>培训数量:</span>"+sArr[dataIndex]["data"][0]["data"]["pxsl"]+"(人)</div>";
  676. setSubTitle(tempStr);
  677. echartImplArr[0].setSeries([sArr[dataIndex]]);
  678. }
  679. }
  680. /**
  681. * 应急预案修订
  682. */
  683. function YingJiYuAnXiuDing(dataParam){
  684. $("#i_chart_descripe").removeClass("c_chart_descripe_change");
  685. destoryEchart();
  686. reSetContent($("#chartsContent"),1);
  687. var leArr=[];
  688. var select={};
  689. var xAxis=["总体预案","事故灾难","自然灾害","社会安全事件","部门预案","现场处置方案"];
  690. var sArr=[];
  691. for(var index1=0,len=dataParam.length;index1<len;index1++){
  692. //临时数据
  693. var tempItem=new SingleItem("","bar",40);
  694. var item=dataParam[index1];
  695. tempItem.name=dataParam[index1]["COMP_NAME"];
  696. tempItem.data.push({value:utils.changeQ(item["ZTYAZS"])});
  697. tempItem.data.push({value:utils.changeQ(item["SGZNZS"])});
  698. tempItem.data.push({value:utils.changeQ(item["ZRZHZS"])});
  699. tempItem.data.push({value:utils.changeQ(item["SHAQSJZS"])});
  700. tempItem.data.push({value:utils.changeQ(item["BMYAZS"])});
  701. tempItem.data.push({value:utils.changeQ(item["XCCZFAZS"])});
  702. if(index1==0){
  703. select[replaceStr(item["COMP_NAME"],"省")]=true;
  704. }else{
  705. select[replaceStr(item["COMP_NAME"],"省")]=false;
  706. }
  707. leArr.push(replaceStr(item["COMP_NAME"],"省"));
  708. sArr.push(tempItem);
  709. }
  710. var opParams={
  711. unit:"座",//单位
  712. leArr:[],//图例
  713. xAxis:xAxis,//x轴
  714. sArr:[sArr[0]],//主数据
  715. trigger:"axis",
  716. show:false,
  717. legendColor:"red", //图例字体颜色
  718. xAxisColor:"red", //X轴字体颜色
  719. yAxisColor:"red" , //Y轴字体颜色
  720. y:10
  721. };
  722. var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
  723. echartImplArr.push(chart);
  724. setTitle(leArr[0]+"应急预案修订统计图");
  725. createList(leArr,loadYingJiYuAnXiuDingData);
  726. function loadYingJiYuAnXiuDingData($dom){
  727. var dataIndex=$dom.attr("data");;
  728. setTitle(leArr[dataIndex]+"应急预案修订统计图");
  729. echartImplArr[0].setSeries([sArr[dataIndex]]);
  730. }
  731. }
  732. /**
  733. * 应急指挥与应急管理机构
  734. * @param dataParam
  735. */
  736. function YingJiZhiHuiAndGuanLiJiGou(dataParam){
  737. $("#i_chart_descripe").removeClass("c_chart_descripe_change");
  738. destoryEchart();
  739. reSetContent($("#chartsContent"),2);
  740. var leArr=[];
  741. var select={};
  742. var xAxis=["机构总数","单独办公","合署办公","编制总数","到位总数"];
  743. var sArr1=[];
  744. var sArr2=[];
  745. for(var index1=0,len=dataParam.length;index1<len;index1++){
  746. //临时数据
  747. var tempItem=new SingleItem("","bar",40);
  748. var item=dataParam[index1];
  749. tempItem.name=dataParam[index1]["COMP_NAME"];
  750. tempItem.data.push(utils.changeQ(item["ZHJGZS"]));
  751. tempItem.data.push(utils.changeQ(item["ZHDDBG"]));
  752. tempItem.data.push(utils.changeQ(item["ZHHSBG"]));
  753. tempItem.data.push(utils.changeQ(item["ZHDWZS"]));
  754. tempItem.data.push(utils.changeQ(item["ZHDWZS"]));
  755. if(item["TYPE"]=="应急指挥机构"){
  756. if(index1==0){
  757. select[replaceStr(item["COMP_NAME"],"省")]=true;
  758. }else{
  759. select[replaceStr(item["COMP_NAME"],"省")]=false;
  760. }
  761. leArr.push(replaceStr(item["COMP_NAME"],"省"));
  762. sArr1.push(tempItem);
  763. }
  764. if(dataParam[index1]["TYPE"]=="应急管理机构"){
  765. sArr2.push(tempItem);
  766. }
  767. }
  768. var opParams1={
  769. //title:"停运最多时间:"+tempArr[0]["APPEAR_TIME"],//标题
  770. //subtext:"当前停运最多单位:"+/* (result["max"]["DEPT_NAME"] || "广东")+(result["max"]["sum"] || "100") */+ "(座)",
  771. unit:"座",//单位
  772. leArr:[],//图例
  773. xAxis:xAxis,//x轴
  774. sArr:[sArr1[0]],//主数据
  775. trigger:"axis",
  776. show:false,
  777. select:select,
  778. legendColor:"red", //图例字体颜色
  779. xAxisColor:"red", //X轴字体颜色
  780. yAxisColor:"red" , //Y轴字体颜色
  781. y:10
  782. };
  783. var chart1=getEchart($("#i_echartContent1"),getOption,opParams1,null);
  784. var opParams2={
  785. unit:"座",//单位
  786. leArr:[],//图例
  787. xAxis:xAxis,//x轴
  788. sArr:[sArr2[0]],//主数据
  789. trigger:"axis",
  790. show:false,
  791. select:select,
  792. legendColor:"red", //图例字体颜色
  793. xAxisColor:"red", //X轴字体颜色
  794. yAxisColor:"red" , //Y轴字体颜色
  795. y:10
  796. };
  797. var chart2=getEchart($("#i_echartContent2"),getOption,opParams2,null);
  798. echartImplArr.push(chart1);
  799. echartImplArr.push(chart2);
  800. setTitle(leArr[0]+"应急指挥与应急管理机构统计图");
  801. createList(leArr,loadYingJiZhiHuiAndGuanLiJiGouData);
  802. function loadYingJiZhiHuiAndGuanLiJiGouData($dom){
  803. var dataIndex=$dom.attr("data");;
  804. setTitle(leArr[dataIndex]+"应急指挥与应急管理机构统计图");
  805. echartImplArr[0].setSeries([sArr1[dataIndex]]);
  806. echartImplArr[1].setSeries([sArr2[dataIndex]]);
  807. }
  808. }
  809. //创建单条数据
  810. function SingleItem(name,type,width){
  811. var tem= {type:type,name:name,data:[],
  812. barWidth:width,
  813. itemStyle: {
  814. normal: {borderWidth: 1,
  815. borderColor:"tomato",
  816. color:"#5BB93C",
  817. label : { show : true,
  818. position: "top",
  819. textStyle: {
  820. color: "#000000",
  821. fontSize: 14,
  822. fontStyle: "normal",
  823. fontWeight: "bold"
  824. }
  825. }
  826. }
  827. }
  828. };
  829. return tem;
  830. }
  831. /**
  832. * 创建列表
  833. * @param arrData
  834. * @param callFn
  835. */
  836. function createList(arrData,callFn){
  837. if(arrData.length==0)return ;
  838. $("#i_department_list").empty();
  839. var htmlstr="<img id='i_list_text' data=1 class='icon_list' src='/nwyj/images/cockpit/picpiece/list_icon.png'><ul>";
  840. for(var index=0,len=arrData.length;index<len;index++){
  841. if(index==0){
  842. htmlstr+="<li class='c_department_li c_department_lionClick' data="+index+"><span>"+arrData[index]+"</span></li>";
  843. }else{
  844. htmlstr+="<li class='c_department_li' data="+index+"><span>"+arrData[index]+"</span></li>";
  845. }
  846. }
  847. $("#i_department_list").append(htmlstr);
  848. $("#i_list_text").on("click",function(){
  849. if($(this).attr("data")==1){
  850. var _this=this;
  851. $("#i_department_list").addClass("c_department_list_change");
  852. $("#i_department_list").find("ul").find("li").show();
  853. $("#i_department_list").on("mouseleave",function(){
  854. $("#i_department_list").removeClass("c_department_list_change");
  855. $("#i_department_list").find("ul").find("li").hide();
  856. $(_this).attr("data",1);
  857. });
  858. $(this).attr("data",2);
  859. }else{
  860. $("#i_department_list").removeClass("c_department_list_change");
  861. $("#i_department_list").find("ul").find("li").hide();
  862. $(this).attr("data",1);
  863. }
  864. });
  865. $("#i_department_list").find("ul").on("click","li",function(){
  866. $("#i_department_list").find("ul").find(".c_department_lionClick").removeClass("c_department_lionClick");
  867. $(this).addClass("c_department_lionClick");
  868. callFn($(this));
  869. });
  870. }
  871. /**
  872. * 设置标题
  873. * @param title
  874. */
  875. function setTitle(title){
  876. $("#i_chart_head").empty();
  877. $("#i_chart_head").text(title);
  878. }
  879. /**
  880. * 设置二级标题
  881. * @param title
  882. */
  883. function setSubTitle(title){
  884. $("#i_echart_title1").empty();
  885. $("#i_echart_title1").html(title);
  886. }
  887. /**
  888. *销毁echart
  889. */
  890. function destoryEchart(){
  891. if(!(echartImplArr.length>0))return;
  892. for(var index=0,len=echartImplArr.length;index<len;index++){
  893. echartImplArr[index].dispose();
  894. }
  895. echartImplArr=[];
  896. }
  897. /**
  898. * 替换字符
  899. * @param str
  900. * @param repalce_str
  901. * @returns
  902. */
  903. function replaceStr(str,repalce_str){
  904. return str.replace("广东电网", repalce_str);
  905. }
  906. function _(str){
  907. if(str==undefined)
  908. return "-";
  909. if(str=="")
  910. return "-";
  911. return str;
  912. }