123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996 |
- var compid = "";
- var deptName = "";
- var ind = "";
- var season_jidu = "1";
- var NavJsonData = {"name":"定期维护信息",
- "children":[{"name":"内部(外部)应急队伍人员登记表","value":"/page/business/am/resource/team/team.jsp","type":"wh"},
- {"name":"内部(外部)应急队伍人员统计表","value":"/page/business/am/resource/team/team-poll.jsp","type":"wh"},
- /* {"name":"应急协作队伍人员统计表","value":"/page/business/am/resource/team/team-poll.jsp","type":"wh"},*/
- {"name":"应急专家队伍人员登记表","value":"/page/business/am/resource/expert/expert-maintenance.jsp","type":"wh"},
- /* {"name":"应急指挥(通信)车登记表","value":"/page/business/am/resource/ledger/command-car.jsp","type":"wh"},*/
- {"name":"应急发电车登记表 ","value":"/page/business/am/resource/ledger/generator-car.jsp","type":"wh"},
- {"name":"应急发电机登记表","value":"/page/business/am/resource/ledger/generator.jsp","type":"wh"}
- ]};
- var url = window.location.href;
- if(url.indexOf("?")>-1){
- var params = window.location.href.split("?");
- compid = params[1];
- report_type = params[2];
- classid1 = params[2];
- if(params.length==4){
- ind = params[3];
- }
- season_jidu = params[4];
- }else{
- compid = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- }
- var QuarterData = {"list":[{"key":"第一季度","value":"1"},
- {"key":"第二季度","value":"2"},
- {"key":"第三季度","value":"3"},
- {"key":"第四季度","value":"4"}
- ]};
- /*************获取当前日期*******************************************************/
- var currDate = getNowFormatDate();
- var month = currDate.substring(5,7);
- currDate = currDate.substring(0,4);
- /*************获取当前日期*******************************************************/
- var YearData = {"list":[{"key":currDate-6,"value":currDate-6},
- {"key":currDate-5,"value":currDate-5},
- {"key":currDate-4,"value":currDate-4},
- {"key":currDate-3,"value":currDate-3},
- {"key":currDate-2,"value":currDate-2},
- {"key":currDate-1,"value":currDate-1},
- {"key":currDate,"value":currDate}/*,
- {"key":currDate-(-1),"value":currDate-(-1)}*/
- ]};
- //数据表格
- var g;
- var myCols;
- $(function(){
- $(".isPrimaryKey").live("click",function(i,item){
- var compId = $(this).find("a").attr("data-compid");
- var rowindex = $(this).find("a").attr("data-rowindex");
- var reportype = $(this).find("a").attr("data-reportype");
- var fdId = $(this).find("a").attr("fdId");
- if(rowindex==0){
- return;
- }
- var index = $(".current").attr("data-index");
- var season = $("#BB_JIDU").attr("relValue");
- if (!!window.ActiveXObject || "ActiveXObject" in window){//ie
- $.indexOpenNextWindow("/nwyj/page/business/am/report/reportinput/huizong.jsp?"+compId+"?"+reportype+"?"+index+"?"+season,"_blank");
- //上级查看下级单位上报的数据
- if(compId!=compid && fdId!=""){
- getThing($.pathname() + "/ws/RcBaoBiao/RcBaoBiaoService/updateRollStat", {fd_id:fdId,stat:"0"}, "text");
- }
- }else{
- $.indexOpenNextWindow("/nwyj/page/business/am/report/reportinput/huizong.jsp?"+compId+"?"+reportype+"?"+index+"?"+season,"_blank");
- if(compId!=compid && fdId!=""){
- getThing($.pathname() + "/ws/RcBaoBiao/RcBaoBiaoService/updateRollStat", {fd_id:fdId,stat:"0"}, "text");
- }
- }
- });
-
- //****布局
- var layout = $("#layout1").layout({
- leftWidth : 250,
- space:10
- });
- $("#layout1").layout({
- onEndResize : function() {
- g.resetWidth();
- /*var wi = $(".layout_content").width();
- wi = wi*0.85;
- $(".layout_content .accordition").css("width",wi+"px");*/
- }
- });
- function customHeightSet(contentHeight) {
- $(".layout_content").height(contentHeight - 30);
- }
- function customHeightSet(contentHeight) {
- $(".cusBoxContent").height(contentHeight - 20);
- }
-
- var seasion = getThing($.pathname()+ "/ws/rcbaobiao/RcBbService/getSeasionByHz", "", "text");
- if(seasion !=""){
- season_jidu = seasion.split(";")[1];
- currDate = seasion.split(";")[0];
- }
-
- $("#BB_YEAR").data("data",YearData);
- $("#BB_YEAR").attr("selectedValue",currDate);
- $("#BB_YEAR").render();
- $("#BB_JIDU").data("data",QuarterData);
- $("#BB_JIDU").attr("selectedValue",season_jidu);
- $("#BB_JIDU").render();
-
- //后台读取数据创建左边导航
- getNavDatas();
- });
- /**
- * 字符串转时间(yyyy-MM-dd HH:mm:ss)
- * result (分钟)
- */
- String.prototype.stringToDate = function(){
- return new Date(Date.parse(this.replace(/-/g, "/")));
- };
- /***
- * 通过特定格式json数据,生成左边导航
- * @param json
- */
- function createNavJson(json){
- var $obj = $("#accordition");
- for(var k=0;k<json.length;k++){
- var navName = json[k].name;
- var navChildren = json[k].children;
- var $aa = $("<a class='titlebar '>"+navName+"</a>");
- $obj.append($aa);
- var $dd = $("<div style='display:none;'></div>");
- $obj.append($dd);
- for(var i=0;i<navChildren.length;i++){
- var name = navChildren[i].name;
- var value = navChildren[i].value;
- var type = navChildren[i].type;
- var $div = $('<div class="leftnav">'+name+'</div>');
- if(i==0&&type=="bs"){
- $div.addClass("current");
- }
- if(type=="bs"){//定期报送信息
- $div.attr("data-value",value);
- $div.attr("data-index",i);
- }else{//定期维护信息
- $div.data("data-url",value);
- }
-
- $div.data("type",type);
- $div.unbind("click").bind("click",selectOneNav);
- $dd.append($div);
- }
-
- }
-
-
-
-
-
- $obj.find("a").eq(0).click();
- if(ind=="" || ind==undefined){
- $obj.find(".current").click();
- }else{
- $obj.find(".leftnav").eq(ind).click();
- }
- }
- /****
- * 绑定左侧导航点击事件
- */
- function selectOneNav(){
- var type = $(this).data("type");
- $(".current").removeClass("current");
- $(this).addClass("current");
- if(type=="bs"){
- $("#i_grid").show();
- $("#ifrcontent").hide();
- var year_value = $("#BB_YEAR").attr("relvalue");
- var season_value = $("#BB_JIDU").attr("relvalue");
- dovalue = $(this).attr("data-value");
- showGridandCharts(dovalue,year_value,season_value);
-
- }else{
- $("#i_grid").hide();
- $("#ifrcontent").show();
- var showUrl = $(this).data("data-url");
- $("#frmrightChild").attr("src",$.pathname()+showUrl);
- $("#frmrightChild").height($(window.document.body).height()+30);
- $(top.document.body).find("#frmright").height($(window.document.body).height()+30);
- }
- //设置该菜单选中
- return false;
- }
-
-
- function export_report(){
-
-
- var year=$("#BB_YEAR").attr("relvalue");
- var season=$("#BB_JIDU").attr("relvalue");//若要季度文字,则把relvalue改成reltext
- var title= $("#accordition .current").text()+year+"年第"+season+"季度";//应急预警和响应统计表
- var sql = {
-
- "report_type" :dovalue,
- "id":compid,
- "json":JSON.stringify(g.getData()),
- "year":year,
- "season":season,
- condition:' 1=1',
- "title":title
- };
- excelExport(dovalue,sql,title,['FD_OBJECTID','REPORT_ID','COMP_ID','UPDATEDATE'],title,'rcreport');
- }
-
- /**
- * 访问后台,将导航数据读取出来
- */
- function getNavDatas() {
- var urls = $.pathname()+ "/ws/xianlutingyun/XianlutingyunService/getRcNavData";
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 15000,
- async : false,
- dataType : 'json',
- success : function(data) {
- data.push(NavJsonData);
- //调用方法,创建左边导航
- createNavJson(data);
- },
- error : function(e) {
- $.messager.alert('查询数据失败!', '访问服务失败!', 'error');
- }
- });
- }
-
- function _addStatus(rowdata, rowindex, value, column){
- var value1 = "<a href='javascript:;' data-compid='"+rowdata.COMP_ID+"' data-rowindex='"+rowindex+"' data-reportype='438' data-fdId='"+rowdata.FD_OBJECTID+"'>"+value+"</a>";
- if(value=='总计'){
- return "<div style='background-color: #5582b9' class='zongji_td'>"+value1+"</div>";
- }else{
- return "<div style='background-color: #dde5f0'>"+value1+"</div>";
- }
- }
-
-
- /***
- * 从后台读取表头数据
- */
- function setColumn(reprotvalue){
- var urls = $.pathname()+ "/ws/rcbaobiao/RcBbService/getHuizongColumns";
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 15000,
- async : false,
- data : {
- "report_type" : reprotvalue
- },
- dataType : 'text',
- success : function(data) {
- //alert("column=="+JSON.stringify(data));
- myCols = data;
- },
- error : function(e) {
- $.messager.alert('查询失败111!', '访问服务失败!', 'error');
- }
- });
- }
-
- /*访问后台,获取数据加载表格*/
- function _initgrid(reprotvalue,year_value,season_value){
- //alert(reprotvalue)
- if(!reprotvalue){
- return;
- }
- setColumn(reprotvalue);
- var url=$.pathname() + '/ws/rcbaobiao/RcBbService/getHuiZongData/';
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- async : false,
- data : {
- comp_id : compid,
- report_type:reprotvalue,
- year:year_value,
- season:season_value
- },
- dataType : 'json',
- success : function(data) {
- if("438-439-440-441-442-444-445".match(new RegExp(reprotvalue))!=null){
- $(".c_chart_mainContent").show();
- EchartDoJo["echart"+reprotvalue]["fn_echart"](data.rows);
- }else{
- destoryEchart();
- $("#chartsContent").empty();
- $(".c_chart_mainContent").hide();
- }
- initgridcon(reprotvalue,data);
- //$(".zongji_td").parent().parent().parent().unbind("mouseover");
- },
- error : function(e) {
- $.messager.alert('查询失败!', '访问服务失败!', 'error');
- }
- })/*.done(function(){//该方法为ajax与后台交互时方能用,执行时间为数据获取到并加载完执行
- $(parent.document.body).find("iframe").height($(window.document.body).height()+40);
- $(top.document.body).find("#frmright").height($(window.document.body).height()+40);
- })*/;
- }
-
- function change() {
- //value = $(parent.document.body).find("#accordition .current").attr("data-value");
- var val = $("#sel").val();
- var year_value = $("#BB_YEAR").attr("relvalue");
- var season_value = $("#BB_JIDU").attr("relvalue");
- // alert(dovalue);
- _initgrid(dovalue,year_value,season_value);
- }
-
- /*传入data数据,加载表格对象,若ind=0,加载有分组模式的表格对象,否则没有分组,普通的表格
- *只有应急指挥与管理机构统计表有分组
- **/
- function initgridcon(reprotvalue,data){
- // alert("myCols=="+myCols);
- if(reprotvalue==438){
- g = $("#maingrid").quiGrid({
- //columns: myCols[ind].col,
- columns: eval('('+myCols+')'),
- data:data,
- rownumbers : true,
- width : "100%",
- onAfterShowData:function(){setHt();},
- //pageSize:10
- usePager : false,
- alternatingRow:false,
- rowAttrRender: function(rowdata, rowid){
- return "总计" == rowdata.COMP_NAME ? "style=\"background-color:#5582b9;\"" : '';
- },
- groupColumnName: "TYPE",
- groupColumnDisplay: ''});
- }else{
- if(g!=undefined){
- g.setOptions({groupColumnName: ""});
- }
- g = $("#maingrid").quiGrid({
- //columns: myCols[ind].col,
- columns: eval('('+myCols+')'),
- data:data,
- rownumbers : true,
- isScroll:false,
- width : "100%",
- usePager : false,
- rowAttrRender: function(rowdata, rowid){
- return "总计" == rowdata.COMP_NAME ? "style=\"background-color:#5582b9;\"" : '';
- },
- onAfterShowData:function(){setHt();}
- });
-
- }
-
- }
-
-
- function showGridandCharts(reportvalue,year_value,season_value){
- _initgrid(reportvalue,year_value,season_value);
- //_initCharts(reprotvalue);
- //setTimeout("setHt();", 100);
- };
- /*初始化图表
- * ind值为0时应急指挥与管理机构统计表
- * */
- /* function _initCharts(ind){
- if(ind==438){//应急指挥与管理机构统计表
- emergencyCommandAndRegulatoryAgency438();
- }else if(ind==439){//应急预案与修编
- emergencyCommandAndRegulatoryAgency439();
- }
- }*/
- function setHt(){
- var height = $("#layout1 .padding_right5").height()+$("#chartsContent").height()+$("#searchCondi").height()+90;
- $('#layout1').height(height);
- $('#layout1 .l-layout-left').height(height);
- $('#layout1 .l-layout-center').height(height);
- $('#searchPanel').height(height);
- $(window.document.body).height(height);
- $(parent.document.body).find("#frmright").height($(window.document.body).height());
- }
-
-
- /*****************************************************************************************************************/
-
- /******************************************** echart 图表方法 ***************************************************/
-
- /*****************************************************************************************************************/
-
- var echartImplArr=[];
- /*var */
- var EchartDoJo={
- //应急指挥与应急管理机构
- echart438:{fn_echart:YingJiZhiHuiAndGuanLiJiGou},
- //应急预案修订
- echart439:{fn_echart:YingJiYuAnXiuDing} ,
- //应急培训
- echart440: {fn_echart:YingJiPeiXun},
- //应急演练
- echart441: {fn_echart:YingJiYanLian},
- //应急预警和响应统计表
- echart442: {fn_echart:YingJiYuJingXiangYing},
- //保供电任务统计
- echart444: {fn_echart:BaoGongDianRenwu},
- //保供电任务明细
- echart445: {fn_echart:BaoGongDianMingXi}
-
- };
-
- function reSetContent($dom,count){
- $dom.empty();
- $("#i_chart_descripe").empty();
- if(count==2){
- $dom.append("<div id='i_echartContent1' class='c_echartContent'></div><div id='i_echartContent2' class='c_echartContent'></div>");
- $("#i_chart_descripe").append("<div id='i_echart_title1' class='c_echart_title'></div><div id='i_echart_title2' class='c_echart_title'></div>");
- }else{
- $dom.append("<div id='i_echartContent1' class='c_echartContent1'></div>");
- $("#i_chart_descripe").append("<div id='i_echart_title1' class='c_echart_title'></div>");
- }
-
- }
-
-
- var utils=new Util();
- /**
- * 报告明细
- */
- function BaoGongDianMingXi(dataParam){
- $("#i_chart_descripe").addClass("c_chart_descripe_change");
- destoryEchart();
- reSetContent($("#chartsContent"),1);
- var leArr=[];
- var select={};
- var xAxis=["投入人员","投入车辆","投入应急发电车","投入应急发电机"];
- var sArr=[];
- for(var index1=0,len=dataParam.length;index1<len;index1++){
- //临时数据
- var tempItem=new SingleItem("","bar",40);
- var item=dataParam[index1];
- tempItem.name=dataParam[index1]["COMP_NAME"];
- tempItem.data.push({value:utils.changeQ(item["BGD_TRRY"]),
- data:{jb:_(item["BGD_LEVEL"]),
- sj:_(item["BGD_RWSJ"]),
- mc:_(item["BGD_RWMC"])}});
- tempItem.data.push({value:utils.changeQ(item["BGD_TRCL"]),
- data:{jb:item["BGD_LEVEL"],sj:item["BGD_RWSJ"],mc:item["BGD_RWMC"]}});
- tempItem.data.push({value:utils.changeQ(item["BGD_TRYJFDC"]),
- data:{jb:item["BGD_LEVEL"],sj:item["BGD_RWSJ"],mc:item["BGD_RWMC"]}});
- tempItem.data.push({value:utils.changeQ(item["BGD_TRYJFDJ"]),
- data:{jb:item["BGD_LEVEL"],sj:item["BGD_RWSJ"],mc:item["BGD_RWMC"]}});
-
- if(index1==0){
- select[replaceStr(item["COMP_NAME"],"省")]=true;
- }else{
- select[replaceStr(item["COMP_NAME"],"省")]=false;
- }
- leArr.push(replaceStr(item["COMP_NAME"],"省"));
- sArr.push(tempItem);
- }
- var opParams={
- unit:"座",//单位
- leArr:[],//图例
- xAxis:xAxis,//x轴
- sArr:[sArr[0]],//主数据
- trigger:"axis",
- show:false,
- legendColor:"#000000", //图例字体颜色
- xAxisColor:"#5BB93C", //X轴字体颜色
- yAxisColor:"#5BB93C", //Y轴字体颜色
- y:100
- };
- createList(leArr,loadBaoGongDianMingXiData);
- var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
- echartImplArr.push(chart);
- setTitle(leArr[0]+"保供电明细统计图");
- var tempStr="<div><span>保供电级别:</span>"+sArr[0]["data"][0]["data"]["jb"]+"</div>";
- tempStr+="<div><span>保供电任务名称:</span>"+sArr[0]["data"][0]["data"]["mc"]+"</div>";
- tempStr+="<div><span>保供电任务时间:</span>"+sArr[0]["data"][0]["data"]["sj"]+"</div>";
- setSubTitle(tempStr);
- function loadBaoGongDianMingXiData($dom){
- var dataIndex=$dom.attr("data");
- setTitle(leArr[dataIndex]+"保供电明细统计图");
- var tempStr="<div><span>保供电级别:</span>"+sArr[dataIndex]["data"][0]["data"]["jb"]+"</div>";
- tempStr+="<div><span>保供电任务名称:</span>"+sArr[dataIndex]["data"][0]["data"]["mc"]+"</div>";
- tempStr+="<div><span>保供电任务时间:</span>"+sArr[dataIndex]["data"][0]["data"]["sj"]+"</div>";
- setSubTitle(tempStr);
- echartImplArr[0].setSeries([sArr[dataIndex]]);
-
- }
-
- }
- /**
- * 报告任务
- */
- function BaoGongDianRenwu(dataParam){
- $("#i_chart_descripe").removeClass("c_chart_descripe_change");
- destoryEchart();
- reSetContent($("#chartsContent"),1);
- var leArr=[];
- /*var select={};*/
- var xAxis=["特级","一级","二级","三级"];
- var sArr=[];
- for(var index1=0,len=dataParam.length;index1<len;index1++){
- //临时数据
- var tempItem=new SingleItem("","bar",40);
- var item=dataParam[index1];
- tempItem.name=dataParam[index1]["COMP_NAME"];
- tempItem.data.push({value:utils.changeQ(item["BGD_TJ"])});
- tempItem.data.push({value:utils.changeQ(item["BGD_YJ"])});
- tempItem.data.push({value:utils.changeQ(item["BGD_EJ"])});
- tempItem.data.push({value:utils.changeQ(item["BGD_SJ"])});
-
- /* if(index1==0){
- select[replaceStr(item["COMP_NAME"],"省")]=true;
- }else{
- select[replaceStr(item["COMP_NAME"],"省")]=false;
- }*/
- leArr.push(replaceStr(item["COMP_NAME"],"省"));
- sArr.push(tempItem);
- }
- createList(leArr,loadBaoGongDianRenwuData);
- var opParams={
- unit:"座",//单位
- leArr:[],//图例
- xAxis:xAxis,//x轴
- sArr:[sArr[0]],//主数据
- trigger:"axis",
- show:false,
- legendColor:"#000000", //图例字体颜色
- xAxisColor:"#5BB93C", //X轴字体颜色
- yAxisColor:"#5BB93C", //Y轴字体颜色
- y:10
- };
- var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
- echartImplArr.push(chart);
- setTitle(leArr[0]+"保供电任务统计图");
- function loadBaoGongDianRenwuData($dom){
- var dataIndex=$dom.attr("data");
- setTitle(leArr[dataIndex]+"保供电任务统计图");
- echartImplArr[0].setSeries([sArr[dataIndex]]);
-
- }
-
-
- }
- /**
- * 应急演练
- * @param dataParam
- */
- function YingJiYuJingXiangYing(dataParam){
- $("#i_chart_descripe").removeClass("c_chart_descripe_change");
- destoryEchart();
- reSetContent($("#chartsContent"),1);
- var leArr=[];
- var select={};
- var xAxis=["红色","橙色","黄色","蓝色","Ⅰ级","Ⅱ级","Ⅲ级","Ⅳ级"];
- var sArr=[];
- for(var index1=0,len=dataParam.length;index1<len;index1++){
- //临时数据
- var tempItem=new SingleItem("","bar",40);
- var item=dataParam[index1];
- tempItem.name=dataParam[index1]["COMP_NAME"];
- tempItem.data.push(utils.changeQ(item["RED_NUM"]));
- tempItem.data.push(utils.changeQ(item["ORANGE_NUM"]));
- tempItem.data.push(utils.changeQ(item["YELLOW_NUM"]));
- tempItem.data.push(utils.changeQ(item["BLUE_NUM"]));
- tempItem.data.push(utils.changeQ(item["FIRST_NUM"]));
- tempItem.data.push(utils.changeQ(item["SECOND_NUM"]));
- tempItem.data.push(utils.changeQ(item["THIRD_NUM"]));
- tempItem.data.push(utils.changeQ(item["FORTH_NUM"]));
- if(index1==0){
- select[replaceStr(item["COMP_NAME"],"省")]=true;
- }else{
- select[replaceStr(item["COMP_NAME"],"省")]=false;
- }
- leArr.push(replaceStr(item["COMP_NAME"],"省"));
- sArr.push(tempItem);
- }
- var opParams={
- //title:"停运最多时间:"+tempArr[0]["APPEAR_TIME"],//标题
- //subtext:"当前停运最多单位:"+/* (result["max"]["DEPT_NAME"] || "广东")+(result["max"]["sum"] || "100") */+ "(座)",
- unit:"座",//单位
- leArr:[],//图例
- xAxis:xAxis,//x轴
- sArr:[sArr[0]],//主数据
- trigger:"axis",
- show:false,
- legendColor:"#000000", //图例字体颜色
- xAxisColor:"#5BB93C", //X轴字体颜色
- yAxisColor:"#5BB93C", //Y轴字体颜色
- y:10
- };
-
- createList(leArr,loadYingJiYuJingXiangYingData);
- var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
- echartImplArr.push(chart);
- setTitle(leArr[0]+"应急预警响应统计图");
- function loadYingJiYuJingXiangYingData($dom){
- var dataIndex=$dom.attr("data");;
- setTitle(leArr[dataIndex]+"应急预警响应统计图");
- echartImplArr[0].setSeries([sArr[dataIndex]]);
-
- }
-
-
- }
- /**
- * 应急演练
- * dataParam
- */
- function YingJiYanLian(dataParam){
- $("#i_chart_descripe").addClass("c_chart_descripe_change");
- destoryEchart();
- reSetContent($("#chartsContent"),1);
- var leArr=[];
- var select={};
- var xAxis=["综合演练现场","综合演练桌面","专项演练现场","专项演练桌面"];
- var sArr=[];
- for(var index1=0,len=dataParam.length;index1<len;index1++){
- var tempItem=new SingleItem("","bar",40);
- var item=dataParam[index1];
- tempItem.name=dataParam[index1]["COMP_NAME"];
- tempItem.data.push({value:utils.changeQ(_(item["ZHYLXCCS"])),data:{trje:_(item["TRJE"]),jbcs:_(item["JBCS"]),cyrs:_(item["CYRS"])}});
- tempItem.data.push({value:utils.changeQ(item["ZHYLZMCS"]),data:{trje:item["TRJE"],jbcs:item["JBCS"],cyrs:item["CYRS"]}});
- tempItem.data.push({value:utils.changeQ(item["ZXYLXCCS"]),data:{trje:item["TRJE"],jbcs:item["JBCS"],cyrs:item["CYRS"]}});
- tempItem.data.push({value:utils.changeQ(item["ZXYLZMCS"]),data:{trje:item["TRJE"],jbcs:item["JBCS"],cyrs:item["CYRS"]}});
- if(index1==0){
- select[replaceStr(item["COMP_NAME"],"省")]=true;
- }else{
- select[replaceStr(item["COMP_NAME"],"省")]=false;
- }
- leArr.push(replaceStr(item["COMP_NAME"],"省"));
- sArr.push(tempItem);
- }
- var opParams={
- unit:"座",//单位
- leArr:[],//图例
- xAxis:xAxis,//x轴
- sArr:[sArr[0]],//主数据
- trigger:"axis",
- show:false,
- select:{},
- legendColor:"red", //图例字体颜色
- xAxisColor:"red", //X轴字体颜色
- yAxisColor:"red" , //Y轴字体颜色
- y:100
- };
- createList(leArr,loadYingJiYanLianData);
- var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
- echartImplArr.push(chart);
- setTitle(leArr[0]+"应急演练统计图");
- var tempStr="<div><span>举办次数:</span>"+sArr[0]["data"][0]["data"]["jbcs"]+"</div>";
- tempStr+="<div><span>参演人数:</span>"+sArr[0]["data"][0]["data"]["cyrs"]+"</div>";
- tempStr+="<div><span>投入金额:</span>"+sArr[0]["data"][0]["data"]["trje"]+"</div>";
- setSubTitle(tempStr);
- function loadYingJiYanLianData($dom){
- var dataIndex=$dom.attr("data");;
- setTitle(leArr[dataIndex]+"应急演练统计图");
- var tempStr="<div><span>举办次数:</span>"+sArr[dataIndex]["data"][0]["data"]["jbcs"]+"(次)</div>";
- tempStr+="<div><span>参演人数:</span>"+sArr[dataIndex]["data"][0]["data"]["cyrs"]+"(万元)</div>";
- tempStr+="<div><span>投入金额:</span>"+sArr[dataIndex]["data"][0]["data"]["trje"]+"(人)</div>";
- setSubTitle(tempStr);
- echartImplArr[0].setSeries([sArr[dataIndex]]);
-
- }
-
-
- }
-
- /**
- * 应急培训
- * dataParam
- */
- function YingJiPeiXun(dataParam){
- $("#i_chart_descripe").addClass("c_chart_descripe_change");
- destoryEchart();
- reSetContent($("#chartsContent"),1);
- var leArr=[];
- var select={};
- var xAxis=["集中脱产","网络","其他"];
- var sArr=[];
- for(var index1=0,len=dataParam.length;index1<len;index1++){
- //临时数据
- var tempItem=new SingleItem("","bar",40);
- var item=dataParam[index1];
- tempItem.name=dataParam[index1]["COMP_NAME"];
- tempItem.data.push({value:utils.changeQ(item["PXFS_JZTC"]),
- data:{jbcs:_(item["PXQK_JBCS"]),tu:_(item["PXQK_TR"]),pxsl:_(item["PXQK_PXSL"])}});
- tempItem.data.push(utils.changeQ(item["PXFS_WL"]));
- tempItem.data.push(utils.changeQ(item["PXFS_QT"]));
- if(index1==0){
- select[replaceStr(item["COMP_NAME"],"省")]=true;
- }else{
- select[replaceStr(item["COMP_NAME"],"省")]=false;
- }
- leArr.push(replaceStr(item["COMP_NAME"],"省"));
- sArr.push(tempItem);
- }
- var opParams={
- unit:"座",//单位
- leArr:[],//图例
- xAxis:xAxis,//x轴
- sArr:[sArr[0]],//主数据
- trigger:"axis",
- show:false,
- select:select,
- legendColor:"red", //图例字体颜色
- xAxisColor:"red", //X轴字体颜色
- yAxisColor:"red" , //Y轴字体颜色
- y:100
- };
- var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
- echartImplArr.push(chart);
- setTitle(leArr[0]+"应急培训统计图");
-
- var tempStr="<div><span>举办次数:</span>"+sArr[0]["data"][0]["data"]["jbcs"]+"(次)</div>";
- tempStr+="<div><span>投入:</span>"+sArr[0]["data"][0]["data"]["tu"]+"(万元)</div>";
- tempStr+="<div><span>培训数量:</span>"+sArr[0]["data"][0]["data"]["pxsl"]+"(人)</div>";
- setSubTitle(tempStr);
- createList(leArr,loadYingJiPeiXunData);
- function loadYingJiPeiXunData($dom){
- var dataIndex=$dom.attr("data");
- setTitle(leArr[dataIndex]+"应急培训统计图");
- var tempStr="<div><span>举办次数:</span>"+sArr[dataIndex]["data"][0]["data"]["jbcs"]+"(次)</div>";
- tempStr+="<div><span>投入:</span>"+sArr[dataIndex]["data"][0]["data"]["tu"]+"(万元)</div>";
- tempStr+="<div><span>培训数量:</span>"+sArr[dataIndex]["data"][0]["data"]["pxsl"]+"(人)</div>";
- setSubTitle(tempStr);
- echartImplArr[0].setSeries([sArr[dataIndex]]);
-
- }
-
- }
- /**
- * 应急预案修订
- */
- function YingJiYuAnXiuDing(dataParam){
- $("#i_chart_descripe").removeClass("c_chart_descripe_change");
- destoryEchart();
- reSetContent($("#chartsContent"),1);
- var leArr=[];
- var select={};
- var xAxis=["总体预案","事故灾难","自然灾害","社会安全事件","部门预案","现场处置方案"];
- var sArr=[];
- for(var index1=0,len=dataParam.length;index1<len;index1++){
- //临时数据
- var tempItem=new SingleItem("","bar",40);
- var item=dataParam[index1];
- tempItem.name=dataParam[index1]["COMP_NAME"];
- tempItem.data.push({value:utils.changeQ(item["ZTYAZS"])});
- tempItem.data.push({value:utils.changeQ(item["SGZNZS"])});
- tempItem.data.push({value:utils.changeQ(item["ZRZHZS"])});
- tempItem.data.push({value:utils.changeQ(item["SHAQSJZS"])});
- tempItem.data.push({value:utils.changeQ(item["BMYAZS"])});
- tempItem.data.push({value:utils.changeQ(item["XCCZFAZS"])});
- if(index1==0){
- select[replaceStr(item["COMP_NAME"],"省")]=true;
- }else{
- select[replaceStr(item["COMP_NAME"],"省")]=false;
- }
- leArr.push(replaceStr(item["COMP_NAME"],"省"));
- sArr.push(tempItem);
- }
- var opParams={
-
- unit:"座",//单位
- leArr:[],//图例
- xAxis:xAxis,//x轴
- sArr:[sArr[0]],//主数据
- trigger:"axis",
- show:false,
- legendColor:"red", //图例字体颜色
- xAxisColor:"red", //X轴字体颜色
- yAxisColor:"red" , //Y轴字体颜色
- y:10
- };
- var chart=getEchart($("#i_echartContent1"),getOption,opParams,null);
- echartImplArr.push(chart);
- setTitle(leArr[0]+"应急预案修订统计图");
- createList(leArr,loadYingJiYuAnXiuDingData);
- function loadYingJiYuAnXiuDingData($dom){
- var dataIndex=$dom.attr("data");;
- setTitle(leArr[dataIndex]+"应急预案修订统计图");
- echartImplArr[0].setSeries([sArr[dataIndex]]);
- }
- }
-
- /**
- * 应急指挥与应急管理机构
- * @param dataParam
- */
- function YingJiZhiHuiAndGuanLiJiGou(dataParam){
- $("#i_chart_descripe").removeClass("c_chart_descripe_change");
- destoryEchart();
- reSetContent($("#chartsContent"),2);
- var leArr=[];
- var select={};
- var xAxis=["机构总数","单独办公","合署办公","编制总数","到位总数"];
- var sArr1=[];
- var sArr2=[];
- for(var index1=0,len=dataParam.length;index1<len;index1++){
- //临时数据
- var tempItem=new SingleItem("","bar",40);
- var item=dataParam[index1];
- tempItem.name=dataParam[index1]["COMP_NAME"];
- tempItem.data.push(utils.changeQ(item["ZHJGZS"]));
- tempItem.data.push(utils.changeQ(item["ZHDDBG"]));
- tempItem.data.push(utils.changeQ(item["ZHHSBG"]));
- tempItem.data.push(utils.changeQ(item["ZHDWZS"]));
- tempItem.data.push(utils.changeQ(item["ZHDWZS"]));
- if(item["TYPE"]=="应急指挥机构"){
- if(index1==0){
- select[replaceStr(item["COMP_NAME"],"省")]=true;
- }else{
- select[replaceStr(item["COMP_NAME"],"省")]=false;
- }
- leArr.push(replaceStr(item["COMP_NAME"],"省"));
- sArr1.push(tempItem);
-
- }
- if(dataParam[index1]["TYPE"]=="应急管理机构"){
- sArr2.push(tempItem);
- }
- }
-
- var opParams1={
- //title:"停运最多时间:"+tempArr[0]["APPEAR_TIME"],//标题
- //subtext:"当前停运最多单位:"+/* (result["max"]["DEPT_NAME"] || "广东")+(result["max"]["sum"] || "100") */+ "(座)",
- unit:"座",//单位
- leArr:[],//图例
- xAxis:xAxis,//x轴
- sArr:[sArr1[0]],//主数据
- trigger:"axis",
- show:false,
- select:select,
- legendColor:"red", //图例字体颜色
- xAxisColor:"red", //X轴字体颜色
- yAxisColor:"red" , //Y轴字体颜色
- y:10
- };
- var chart1=getEchart($("#i_echartContent1"),getOption,opParams1,null);
- var opParams2={
- unit:"座",//单位
- leArr:[],//图例
- xAxis:xAxis,//x轴
- sArr:[sArr2[0]],//主数据
- trigger:"axis",
- show:false,
- select:select,
- legendColor:"red", //图例字体颜色
- xAxisColor:"red", //X轴字体颜色
- yAxisColor:"red" , //Y轴字体颜色
- y:10
- };
- var chart2=getEchart($("#i_echartContent2"),getOption,opParams2,null);
- echartImplArr.push(chart1);
- echartImplArr.push(chart2);
- setTitle(leArr[0]+"应急指挥与应急管理机构统计图");
- createList(leArr,loadYingJiZhiHuiAndGuanLiJiGouData);
- function loadYingJiZhiHuiAndGuanLiJiGouData($dom){
- var dataIndex=$dom.attr("data");;
- setTitle(leArr[dataIndex]+"应急指挥与应急管理机构统计图");
- echartImplArr[0].setSeries([sArr1[dataIndex]]);
- echartImplArr[1].setSeries([sArr2[dataIndex]]);
- }
-
- }
- //创建单条数据
- function SingleItem(name,type,width){
- var tem= {type:type,name:name,data:[],
- barWidth:width,
- itemStyle: {
- normal: {borderWidth: 1,
- borderColor:"tomato",
- color:"#5BB93C",
- label : { show : true,
- position: "top",
- textStyle: {
- color: "#000000",
- fontSize: 14,
- fontStyle: "normal",
- fontWeight: "bold"
- }
- }
- }
- }
- };
- return tem;
- }
- /**
- * 创建列表
- * @param arrData
- * @param callFn
- */
- function createList(arrData,callFn){
- if(arrData.length==0)return ;
- $("#i_department_list").empty();
- var htmlstr="<img id='i_list_text' data=1 class='icon_list' src='/nwyj/images/cockpit/picpiece/list_icon.png'><ul>";
- for(var index=0,len=arrData.length;index<len;index++){
- if(index==0){
- htmlstr+="<li class='c_department_li c_department_lionClick' data="+index+"><span>"+arrData[index]+"</span></li>";
- }else{
- htmlstr+="<li class='c_department_li' data="+index+"><span>"+arrData[index]+"</span></li>";
- }
- }
- $("#i_department_list").append(htmlstr);
- $("#i_list_text").on("click",function(){
- if($(this).attr("data")==1){
- var _this=this;
- $("#i_department_list").addClass("c_department_list_change");
- $("#i_department_list").find("ul").find("li").show();
- $("#i_department_list").on("mouseleave",function(){
- $("#i_department_list").removeClass("c_department_list_change");
- $("#i_department_list").find("ul").find("li").hide();
- $(_this).attr("data",1);
- });
- $(this).attr("data",2);
- }else{
- $("#i_department_list").removeClass("c_department_list_change");
- $("#i_department_list").find("ul").find("li").hide();
- $(this).attr("data",1);
- }
- });
- $("#i_department_list").find("ul").on("click","li",function(){
- $("#i_department_list").find("ul").find(".c_department_lionClick").removeClass("c_department_lionClick");
- $(this).addClass("c_department_lionClick");
- callFn($(this));
- });
-
- }
- /**
- * 设置标题
- * @param title
- */
- function setTitle(title){
- $("#i_chart_head").empty();
- $("#i_chart_head").text(title);
- }
- /**
- * 设置二级标题
- * @param title
- */
- function setSubTitle(title){
- $("#i_echart_title1").empty();
- $("#i_echart_title1").html(title);
- }
- /**
- *销毁echart
- */
- function destoryEchart(){
- if(!(echartImplArr.length>0))return;
- for(var index=0,len=echartImplArr.length;index<len;index++){
- echartImplArr[index].dispose();
- }
- echartImplArr=[];
- }
- /**
- * 替换字符
- * @param str
- * @param repalce_str
- * @returns
- */
- function replaceStr(str,repalce_str){
- return str.replace("广东电网", repalce_str);
- }
-
- function _(str){
- if(str==undefined)
- return "-";
- if(str=="")
- return "-";
- return str;
- }
-
-
|