123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783 |
- //数据表格使用
- var g;
- // 公司名称数组--X轴数据
- var compIds = "";
- var series = "";
- var gridData = "";
- function showMsg(rowdata ,rowindex,value,column){
- if("总计"==rowdata.name){
- return value;
- }else{
- return '<a href="javascript:void(0)" '
- + 'onclick=showDetail("'
- + rowdata.compid
- + '",'+'"'+column.name+ '",'+'"'+value+'")>'+value+'</a>';
- }
- }
- function showDetail(index,name,val){
- if(index=="11111"){
- return;
- }
- //取name的值
- if(name=="hejiSum"){
- name ="IMPORT_LEVEL = '5' ";
- }
- if(name=="hejidmSum"){
- name ="IMPORT_LEVEL = '5' and (IS_MEET_OF_SUPPLY = '1') and ";
- }
- if(name=="hejizbSum"){
- name ="IMPORT_LEVEL = '5' and (IS_MEET_OF_SELF_PROVIDE = '1') and ";
- }
- if(name=="hejisfSum"){
- name ="IMPORT_LEVEL = '5' and (IS_MEET_OF_SELF_PROVIDE = '0') and (IS_MEET_OF_SUPPLY = '0') and";
- }
-
-
- return Dialog.open({URL:"/nwyj/page/business/am/customer/customer-focusZq2.jsp?"+index+"?"+name,ID:"window1",Title:"重点关注用户信息",ShowMaxButton:true,ShowMinButton:true,Width:1100,Height:700});
- }
-
- //单位ID
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //柱状图
- var option = {
- title : {
- text: '重点关注用户信息统计图',
- subtext: '/户'
- },
- tooltip : {
- trigger: 'axis',
- axisPointer : { // 坐标轴指示器,坐标轴触发有效
- type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- },
- formatter: function (params){
- return params[0].name + '<br/>'
- + params[0].seriesName + ' : ' + params[0].value + '<br/>'
- + params[1].seriesName + ' : ' + params[1].value + '<br/>'
- + params[2].seriesName + ' : ' + params[2].value + '<br/>'
- + params[3].seriesName + ' : ' + params[3].value;
- }
- },
- legend: {
- y : 'bottom',
- data:['总体情况','供电电源配置符合要求情况','自备应急电源配置符合要求情况','“双不满足”基本情况']
- },
- toolbox: {
- show : true,
- feature : {
- mark : {show: true},
- dataView : {show: false, readOnly: false},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- data : ['广东电网','清远','韶关','中山','东莞','佛山']
- }
- ],
- yAxis : [
- {
- type : 'value',
- boundaryGap: [0, 0.1]
- }
- ],
- series : [
- {
- name:'总体情况',
- type:'bar',
- stack: 'sum',
- barCategoryGap: '50%',
- itemStyle: {
- normal: {
- color: 'tomato',
- barBorderColor: 'tomato',
- barBorderWidth:0.2,
- barBorderRadius:0,
- label : {
- show: true, position: 'insideTop'
- }
- }
- },
- data:[100, 200, 220, 120, 100, 80]
- },
- {
- name:'供电电源配置符合要求情况',
- type:'bar',
- stack: 'sum',
- barCategoryGap: '50%',
- itemStyle: {
- normal: {
- color: 'yellow',
- barBorderColor: 'tomato',
- barBorderWidth:0.2,
- barBorderRadius:0,
- label : {
- show: true, position: 'insideTop',
- formatter: function (params) {
- for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
- if (option.xAxis[0].data[i] == params.name) {
- return option.series[0].data[i] + params.value;
- }
- }
- }
- }
- }
- },
- data:[200, 200, 220, 120, 100, 80]
- },
- {
- name:'自备应急电源配置符合要求情况',
- type:'bar',
- stack: 'sum',
- itemStyle: {
- normal: {
- color: 'blue',
- barBorderColor: 'tomato',
- barBorderWidth:0.2,
- barBorderRadius:0,
- label : {
- show: true,
- position: 'insideTop',
- formatter: function (params) {
- for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
- if (option.xAxis[0].data[i] == params.name) {
- return option.series[0].data[i] + option.series[1].data[i] + params.value;
- }
- }
- }
- }
- }
- },
- data:[300, 80, 50, 80,80, 70]
- },
- {
- name:'“双不满足”基本情况',
- type:'bar',
- stack: 'sum',
- itemStyle: {
- normal: {
- color: 'green',
- barBorderColor: 'tomato',
- barBorderWidth:0.2,
- barBorderRadius:0,
- label : {
- show: true,
- position: 'top',
- formatter: function (params) {
- for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
- if (option.xAxis[0].data[i] == params.name) {
- return option.series[0].data[i] + option.series[1].data[i] + option.series[2].data[i] + params.value;
- }
- }
- },
- textStyle: {
- color: 'tomato'
- }
- }
- }
- },
- data:[300, 80, 50, 80,80, 70]
- }
- ]
- };
- var series1={
- name:'总体情况',
- type:'bar',
- stack: 'sum',
- barCategoryGap: '50%',
- itemStyle: {
- normal: {
- color: 'tomato',
- barBorderColor: 'tomato',
- barBorderWidth:0.2,
- barBorderRadius:0,
- label : {
- show: true, position: 'insideTop'
- }
- }
- },
- data:[100, 200, 220, 120, 100, 80]
- };
- var series2={
- name:'供电电源配置符合要求情况',
- type:'bar',
- stack: 'sum',
- barCategoryGap: '50%',
- itemStyle: {
- normal: {
- color: 'yellow',
- barBorderColor: 'tomato',
- barBorderWidth:0.2,
- barBorderRadius:0,
- label : {
- show: true, position: 'insideTop',
- formatter: function (params) {
- for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
- if (option.xAxis[0].data[i] == params.name) {
- return parseInt(option.series[0].data[i]) + parseInt(params.value);
- }
- }
- }
- }
- }
- },
- data:[200, 200, 220, 120, 100, 80]
- };
- var series3={
- name:'自备应急电源配置符合要求情况',
- type:'bar',
- stack: 'sum',
- itemStyle: {
- normal: {
- color: 'blue',
- barBorderColor: 'tomato',
- barBorderWidth:0.2,
- barBorderRadius:0,
- label : {
- show: true,
- position: 'insideTop',
- formatter: function (params) {
- for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
- if (option.xAxis[0].data[i] == params.name) {
- return parseInt(option.series[0].data[i]) + parseInt(option.series[1].data[i]) + parseInt(params.value);
- }
- }
- }
- }
- }
- },
- data:[300, 80, 50, 80,80, 70]
- };
- var series4={
- name:'“双不满足”基本情况',
- type:'bar',
- stack: 'sum',
- itemStyle: {
- normal: {
- color: 'green',
- barBorderColor: 'tomato',
- barBorderWidth:0.2,
- barBorderRadius:0,
- label : {
- show: true,
- position: 'top',
- formatter: function (params) {
- for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
- if (option.xAxis[0].data[i] == params.name) {
- return parseInt(option.series[0].data[i]) + parseInt(option.series[1].data[i]) + parseInt(option.series[2].data[i]) + parseInt(params.value);
- }
- }
- },
- textStyle: {
- color: 'tomato'
- }
- }
- }
- },
- data:[300, 80, 50, 80,80, 70]
- };
- //柱状图方法
- //总体
- function changeBarOption1(data){
- series1.name='总体情况';
- series2.name='供电电源配置符合要求情况';
- series3.name='自备应急电源配置符合要求情况';
- series4.name='“双不满足”基本情况';
- var legendData=[];
- var data1=[];
- var data2=[];
- var data3=[];
- var data4=[];
- for(var i=0;i<data.rows.length-1;i++){
- legendData[i]=data.rows[i].name;
- data1[i]=data.rows[i].hejiSum;
- data2[i]=data.rows[i].hejidmSum;
- data3[i]=data.rows[i].hejizbSum;
- data4[i]=data.rows[i].hejisfSum;
- }
- series1.data=data1;
- series2.data=data2;
- series3.data=data3;
- series4.data=data4;
-
- option.series[0]=series1;
- option.series[1]=series2;
- option.series[2]=series3;
- option.series[3]=series4;
-
- option.xAxis[0].data=legendData;
- option.legend.data=['总体情况','供电电源配置符合要求情况','自备应急电源配置符合要求情况','“双不满足”基本情况'];
- option.tooltip.formatter=function (params){
- return params[0].name + '<br/>'
- + params[0].seriesName + ' : ' + params[0].value + '<br/>'
- + params[1].seriesName + ' : ' + params[1].value + '<br/>'
- + params[2].seriesName + ' : ' + params[2].value + '<br/>'
- + params[3].seriesName + ' : ' + params[3].value;
- };
-
- }
- //供电电源
- function changeBarOption2(data){
- series1.name='特级用户';
- series2.name='一级用户';
- series3.name='二级用户';
- var legendData=[];
- var data1=[];
- var data2=[];
- var data3=[];
- for(var i=0;i<data.rows.length-1;i++){
- legendData[i]=data.rows[i].name;
- data1[i]=data.rows[i].tjgdmzcustomerNum;
- data2[i]=data.rows[i].yjgdmzcustomerNum;
- data3[i]=data.rows[i].ejgdmzcustomerNum;
- }
- series1.data=data1;
- series2.data=data2;
- series3.data=data3;
-
- option.series[0]=series1;
- option.series[1]=series2;
- option.series[2]=series3;
-
- option.xAxis[0].data=legendData;
- option.legend.data=['特级用户', '一级用户','二级用户'];
- option.tooltip.formatter=function (params){
- return params[0].name + '<br/>'
- + params[0].seriesName + ' : ' + params[0].value + '<br/>'
- + params[1].seriesName + ' : ' + params[1].value + '<br/>'
- + params[2].seriesName + ' : ' + params[2].value;
- };
-
- }
- //自备应急
- function changeBarOption3(data){
- series1.name='特级用户';
- series2.name='一级用户';
- series3.name='二级用户';
- var legendData=[];
- var data1=[];
- var data2=[];
- var data3=[];
- for(var i=0;i<data.rows.length-1;i++){
- legendData[i]=data.rows[i].name;
- data1[i]=data.rows[i].tjzbmzcustomerNum;
- data2[i]=data.rows[i].yjzbmzcustomerNum;
- data3[i]=data.rows[i].ejzbmzcustomerNum;
- }
- series1.data=data1;
- series2.data=data2;
- series3.data=data3;
-
- option.series[0]=series1;
- option.series[1]=series2;
- option.series[2]=series3;
-
- option.xAxis[0].data=legendData;
- option.legend.data=['特级用户', '一级用户','二级用户'];
- option.tooltip.formatter=function (params){
- return params[0].name + '<br/>'
- + params[0].seriesName + ' : ' + params[0].value + '<br/>'
- + params[1].seriesName + ' : ' + params[1].value + '<br/>'
- + params[2].seriesName + ' : ' + params[2].value;
- };
-
- }
- //“双不满足”
- function changeBarOption4(data){
- series1.name='特级用户';
- series2.name='一级用户';
- series3.name='二级用户';
- var legendData=[];
- var data1=[];
- var data2=[];
- var data3=[];
- for(var i=0;i<data.rows.length-1;i++){
- legendData[i]=data.rows[i].name;
- data1[i]=data.rows[i].tjsfcustomerNum;
- data2[i]=data.rows[i].yjsfcustomerNum;
- data3[i]=data.rows[i].ejsfcustomerNum;
- }
- series1.data=data1;
- series2.data=data2;
- series3.data=data3;
-
- option.series[0]=series1;
- option.series[1]=series2;
- option.series[2]=series3;
-
- option.xAxis[0].data=legendData;
- option.legend.data=['特级用户', '一级用户','二级用户'];
- option.tooltip.formatter=function (params){
- return params[0].name + '<br/>'
- + params[0].seriesName + ' : ' + params[0].value + '<br/>'
- + params[1].seriesName + ' : ' + params[1].value + '<br/>'
- + params[2].seriesName + ' : ' + params[2].value;
- };
-
- }
-
- //折线图option1
- var option1 = {
- title : {
- text: '重点关注用户信息统计图',
- subtext: '/户'
- },
- tooltip : {
- trigger: 'axis'
- },
- legend: {
- y:'bottom',
- data:['广东','清远','中山']
- },
- toolbox: {
- show : true,
- feature : {
- mark : {show: true},
- dataView : {show: false, readOnly: false},
- magicType : {show: false, type: ['line', 'bar', 'stack', 'tiled']},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- boundaryGap : false,
- data : ['总体情况','供电电源配置符合要求情况','自备应急电源配置符合要求情况','“双不满足”基本情况']
- }
- ],
- yAxis : [
- {
- type : 'value'
- }
- ],
- series : [
- {
- name:'广东',
- type:'line',
-
- data:[20, 30, 50,40]
- },
- {
- name:'清远',
- type:'line',
-
- data:[10, 18, 19, 24]
- },
- {
- name:'中山',
- type:'line',
-
- data:[15, 22, 20, 15]
- }
- ]
- };
- function changeLineOption(data){
- var legendData=[];
- var seriesJson=[];
- for(var i=0;i<data.rows.length-1;i++){
- legendData[i]=data.rows[i].name;
- var d=[];
- var j=0;
- if(data.rows[i]["hejiSum"]!=undefined){
- d[j]=data.rows[i]["hejiSum"];
- j++;
- }
- if(data.rows[i]["hejidmSum"]!=undefined){
- d[j]=data.rows[i]["hejidmSum"];
- j++;
- }
- if(data.rows[i]["hejizbSum"]!=undefined){
- d[j]=data.rows[i]["hejizbSum"];
- j++;
- }
- if(data.rows[i]["hejisfSum"]!=undefined){
- d[j]=data.rows[i]["hejisfSum"];
- j++;
- }
- var json={name:data.rows[i].name,type:'line',data:d};
- seriesJson[i]=json;
- }
- option1.legend.data=legendData;
- option1.xAxis[0].data=['总体情况','供电电源配置符合要求情况','自备应急电源配置符合要求情况','“双不满足”基本情况'];
- option1.series=seriesJson;
- }
- //function changeLineOption2(data){
- // var legendData=[];
- // var seriesData=[];
- // var data1=[];
- // var data2=[];
- // var data3=[];
- // var data4=[];
- // for(var i=0;i<data.rows.length-1;i++){
- // //alert(data.rows[i].name);
- // legendData[i]=data.rows[i].name;
- // data1[i]=data.rows[i].national;
- // data2[i]=data.rows[i].occupation;
- // data3[i]=data.rows[i].provincial;
- // data4[i]=data.rows[i].international;
- // }
- // var series1={ name:'国家标准',
- // type:'line',
- // data:data1
- // };
- // var series2={ name:'行业标准',
- // type:'line',
- // data:data2
- // };
- // var series3={ name:'地方标准',
- // type:'line',
- // data:data3
- // };
- // var series4={ name:'国际标准',
- // type:'line',
- // data:data4
- // };
- //
- //
- // option1.legend.data=$("#CLASSES_242").attr("relText").split(",");
- // var getInput=$("#CLASSES_242").attr("relText").split(",");
- // var j=0;
- // if($.inArray('国家标准',getInput)!=-1){
- // seriesData[j]=series1;
- // j++;
- // }
- // if($.inArray('行业标准',getInput)!=-1){
- // seriesData[j]=series2;
- // j++;
- // }
- // if($.inArray('地方标准',getInput)!=-1){
- // seriesData[j]=series3;
- // j++;
- // }
- // if($.inArray('国际标准',getInput)!=-1){
- // seriesData[j]=series4;
- // j++;
- // }
- //
- // //seriesData=[series1,series2,series3,series4,series5];
- // option1.xAxis[0].data=legendData;
- // option1.series=seriesData;
- //}
- //饼图option2
- var option2 = {
- title : {
- text: '重点关注用户信息统计图',
- subtext: '/户'
- },
- tooltip : {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- legend: {
- y : 'bottom',
- data:['总体情况','供电电源配置符合要求情况','自备应急电源配置符合要求情况','“双不满足”基本情况']
- },
- toolbox: {
- show : true,
- feature : {
- mark : {show: true},
- dataView : {show: false, readOnly: false},
- magicType : {
- show: false,
- type: ['pie', 'funnel'],
- option: {
- funnel: {
- x: '25%',
- width: '50%',
- funnelAlign: 'left',
- max: 1548
- }
- }
- },
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- series : [
- {
- name:'重点关注用户信息',
- type:'pie',
- radius : '55%',
- center: ['50%', '55%'],
- data:[
- {value:335, name:'总体情况'},
- {value:310, name:'供电电源配置符合要求情况'},
- {value:234, name:'自备应急电源配置符合要求情况'},
- {value:256, name:'“双不满足”基本情况'}
- ]
- }
- ]
- };
- function changePieOption(data){
- /*************************************************** 初始化解析饼图数据 start**********************************************************/
- option2.legend.data=['总体情况','供电电源配置符合要求情况','自备应急电源配置符合要求情况','“双不满足”基本情况'];
- var index=data.rows.length-1;
- var seriesJson=[];
- var j=0;
- if(data.rows[index]["hejiSum"]!=undefined){
- var json={value:data.rows[index]["hejiSum"],name:'总体情况'};
- seriesJson[j]=json;
- j++;
- }
- if(data.rows[index]["hejidmSum"]!=undefined){
- var json={value:data.rows[index]["hejidmSum"],name:'供电电源配置符合要求情况'};
- seriesJson[j]=json;
- j++;
- }
- if(data.rows[index]["hejizbSum"]!=undefined){
- var json={value:data.rows[index]["hejizbSum"],name:'自备应急电源配置符合要求情况'};
- seriesJson[j]=json;
- j++;
- }
- if(data.rows[index]["hejisfSum"]!=undefined){
- var json={value:data.rows[index]["hejisfSum"],name:'“双不满足”基本情况'};
- seriesJson[j]=json;
- j++;
- }
- option2.series[0].data=seriesJson;
- /*************************************************** 初始化解析饼图数据 end **********************************************************/
- }
-
-
- // 表格的初始化
- function initComplete() {//gridData
-
- $("body").eq(0).showLoading();
- $.ajax({
- url : $.pathname()+ "/ws/customerHuiZong/customerHuiZongService/getZYCustomerInfo2",
- type : 'post',
- timeout : 60000,
- data : {id : deptName},
- dataType : 'json',
- success : function(data){
- g = $("#maingrid").quiGrid({
- columns : [{
- display : '供电单位',
- "name" : 'name',
- id : 'name',
- width : "20%",
- dept_id:'dept_id', frozen: true,
- align : 'left',render: addStatus
- },{
- display : '总体情况',
- name: 'hejiSum',
- width : "20%",
- align : 'center',render:showMsg
- },{
- display : '供电电源配置符合要求情况',
- name: 'hejidmSum',
- width : "20%",
- align : 'center',render:showMsg
- },{
- display : '自备应急电源配置符合要求情况',
- name: 'hejizbSum',
- width : "20%",
- align : 'center',render:showMsg
- },{
- display : '“双不满足”基本情况',
- name: 'hejisfSum',
- width : "20%",
- align : 'center',render:showMsg
-
- }],
- //url :$.pathname()+ "/ws/customerHuiZong/customerHuiZongService/getCustomerInfo",
- //params : {id : deptName},
- data:data,
- rownumbers : false,
- /*height : 600,*/
- width : "100%",
- usePager : false,
- autoCheckChildren : true,
- tree : {
- columnId : 'name'
- }
- // treeAjax : true,
- // treeChildDataPath : $.pathname()
- // + '/ws/customerHuiZong/customerHuiZongService/getPlanInfoList?deptId=',
- // treeAutoParam:"dept_id"
- });
-
- $("body").eq(0).hideLoading();
-
- //重设高度
- $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
- $(top.document.body).find("iframe").height($(window.document.body).height()+30);
-
- gridData=data;
-
- changeBarOption1(data);
- changeLineOption(data);
- changePieOption(data);
- var myChart = echarts.init(document.getElementById('main1'));
- myChart.setOption(option);
-
-
- $(".basicTab").bind('actived',function(e,i){
- if(i==0){
- /***************************************** 加载柱状图 *********************************************************/
- var myChart1 = echarts.init(document.getElementById('main1'));
- myChart1.setOption(option);
- }else if(i == 1){
- /***************************************** 加载折线图 *********************************************************/
- var myChart2 = echarts.init(document.getElementById('main2'));
- myChart2.setOption(option1);
- }else if(i==2){
- /***************************************** 加载饼图 *********************************************************/
- var myChart3 = echarts.init(document.getElementById('main3'));
- myChart3.setOption(option2);
- }
- });
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- function addStatus(rowdata, rowindex, value, column){
- if("总计"==rowdata.name){
- return value;
- }else{
- var comp_id='"'+rowdata.compid+'"';
- var name = '"'+value+'"';
- return "<a href='javascript:newHtml("+comp_id+","+name+")'>" + value +" </a>";
- }
- }
- function newHtml(comp_id,name){
- if(name=="总计"){
- return;
- }else if(deptName==comp_id){
- return;
- }else{
- // window.open("/nwyj/page/business/am/customer/customer-poll1.jsp?"+comp_id);
- $.indexOpenNextWindow("/nwyj/page/business/am/customer/customerZDGZYH-poll1.jsp?"+comp_id);
- }
-
- }
- //返回事件
- function goBack() {
- var url = "/nwyj/page/business/am/customer/"+"customer-focus.jsp";
- parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- }
|