var chart1;
var chart2;
var chart3;
var chart4;
var chart5;
var chart6;
var chart7;
var chart8;
var chart9;
var chart10;
var chart11;
var options1;
var options2;
var options3;
var options4;
var options5;
var options6;
var options7;
var options8;
var options9;
var options10;
var options11;
Highcharts.setOptions({
global : {
useUTC : false
}
});
String.prototype.endWith=function(oString){
var reg=new RegExp(oString+"$");
return reg.test(this);
}
var bl1;
var bl2;
function stateimg(obj,type)
{
switch (type)
{
case 0:
$(obj).attr("src",
"/resource/images/hbsj/standBy_Station.fw.png");
break;
case 1:
$(obj).attr("src",
"/resource/images/hbsj/run_Station.fw.png");
break;
case 2:
$(obj).attr("src",
"/resource/images/hbsj/stop_Station.fw.png");
break;
case 3:
$(obj).attr("src",
"/resource/images/hbsj/interrupt_Station.fw.png");
break;
case 4:
$(obj).attr("src",
"/resource/images/hbsj/repair_Station.fw.png");
break;
case 5:
$(obj).attr("src",
"/resource/images/hbsj/limit_Station.fw.png");
break;
case 6:
$(obj).attr("src",
"/resource/images/hbsj/limit_Station.fw.png");
break;
}
}
function statebtnimg(obj,type)
{
switch (type)
{
case 0:
$(obj).html("");
break;
case 1:
$(obj).html("");
break;
case 2:
$(obj).html("");
break;
case 3:
$(obj).html("");
break;
case 4:
$(obj).html("");
break;
case 5:
$(obj).html("");
break;
case 6:
$(obj).html("");
break;
}
}
function wpInfoAjax() {
var wpId = $("#wpId").val();
$.ajax({
url : "wpInfoAjax.action?wpId=" + wpId,
type : "post",
cache : false,
dataType : "json",
data : {},
ifModified : false,
success : function(res) {
$("#zjrl").html(res["zjrl"]*10);
$("#aqts").html(res["aqts"]);
$("#ydxkyxs").html(res["ysbklyl"]);
$("#ysbklyl").html(res["ysbklyl"]);
$("#ylyxs").html(res["ylyxs"]);
$("#nlyxs").html(res["nlyxs"]);
$("#rfdl").html(res["rfdl"]);
$("#yfdl").html(res["yfdl"]);
$("#nfdl").html(res["nfdl"]);
$("#rswdl").html(res["rswdl"]);
$("#yswdl").html(res["yswdl"]);
$("#nswdl").html(res["nswdl"]);
$("#jpeyht").html(res["jpeyht"]);
$("#jpeyhl").html(res["jpeyhl"]);
$("#jybm").html(res["jybm"]);
$("#jys").html(res["jys"]);
$("#whss").html(res["whss"]);
$("#whssy").html(res["whssy"]);
$("#whssn").html(res["whssn"]);
$("#gzss").html(res["gzss"]);
$("#gzssy").html(res["gzssy"]);
$("#gzssn").html(res["gzssn"]);
$("#xdss").html(res["xdss"]);
$("#xdssy").html(res["xdssy"]);
$("#xdssn").html(res["xdssn"]);
$("#slss").html(res["slss"]);
$("#slssy").html(res["slssy"]);
$("#slssn").html(res["slssn"]);
$("#xnss").html(res["xnss"]);
$("#xnssy").html(res["xnssy"]);
$("#xnssn").html(res["xnssn"]);
$("#yxts").html(res["yxts"]);
$("#djts").html(res["djts"]);
$("#whts").html(res["whts"]);
$("#gzts").html(res["gzts"]);
$("#xdts").html(res["xdts"]);
$("#lxts").html(res["lxts"]);
$("#jrts").html(res["yxts"]+res["djts"]+res["whts"]+res["gzts"]+res["xdts"]+res["lxts"]);
$("#yxtsc").html(res["yxts"]);
$("#djtsc").html(res["djts"]);
$("#whtsc").html(res["whts"]);
$("#gztsc").html(res["gzts"]);
$("#xdtsc").html(res["xdts"]);
$("#lxtsc").html(res["lxts"]);
$("#jrtsc").html(res["yxts"]+res["djts"]+res["whts"]+res["gzts"]+res["xdts"]+res["lxts"]);
$("#yxtsk").html(res["yxts"]);
$("#djtsk").html(res["djts"]);
$("#whtsk").html(res["whts"]);
$("#gztsk").html(res["gzts"]);
$("#xdtsk").html(res["xdts"]);
$("#lxtsk").html(res["lxts"]);
$("#jrtsk").html(res["yxts"]+res["djts"]+res["whts"]+res["gzts"]+res["xdts"]+res["lxts"]);
$("#yxtsk4").html(res["yxts"]);
$("#djtsk4").html(res["djts"]);
$("#whtsk4").html(res["whts"]);
$("#gztsk4").html(res["gzts"]);
$("#xdtsk4").html(res["xdts"]);
$("#lxtsk4").html(res["lxts"]);
$("#jrtsk4").html(res["yxts"]+res["djts"]+res["whts"]+res["gzts"]+res["xdts"]+res["lxts"]);
$("#yxtsd").html(res["yxts"]);
$("#djtsd").html(res["djts"]);
$("#whtsd").html(res["whts"]);
$("#gztsd").html(res["gzts"]);
$("#xdtsd").html(res["xdts"]);
$("#lxtsd").html(res["lxts"]);
$("#jrtsd").html(res["yxts"]+res["djts"]+res["whts"]+res["gzts"]+res["xdts"]+res["lxts"]);
/**********************************************************************************************/
statebtnimg("#cl_fczt", res["CL_FDC_FCZT"]);
statebtnimg("#kb_fczt", res["KB_FDC_FCZT"]);
statebtnimg("#dx_fczt", res["DX_FDC_FCZT"]);
/**********************************************************************************************/
//悬浮层
$("#CL_ZJTS").html(res["CL_FDC_ZJTS"]);
$("#CL_ZJRL").html(res["CL_FDC_ZJRL"]*10);
$("#CL_FS").html(res["CL_FDC_FS"]);
$("#CL_RFDL").html(res["CL_FDC_RFDL"]);
$("#CL_GL").html(res["CL_FDC_GL"]);
$("#KB_ZJTS").html(res["KB_FDC_ZJTS"]);
$("#KB_ZJRL").html(res["KB_FDC_ZJRL"]*10);
$("#KB_FS").html(res["KB_FDC_FS"]);
$("#KB_RFDL").html(res["KB_FDC_RFDL"]);
$("#KB_GL").html(res["KB_FDC_GL"]);
$("#DX_ZJTS").html(res["DX_FDC_ZJTS"]);
$("#DX_ZJRL").html(res["DX_FDC_ZJRL"]*10);
$("#DX_FS").html(res["DX_FDC_FS"]);
$("#DX_RFDL").html(res["DX_FDC_RFDL"]);
$("#DX_GL").html(res["DX_FDC_GL"]);
/**********************************************************************************************/
if(chart3.series[0])
{
var point = chart3.series[0].points[0];
point.update(res["fs"]);
}
if(chart4.series[0])
{
point = chart4.series[0].points[0];
point.update(res["llgl"]);
}
if(chart5.series[0])
{
point = chart5.series[0].points[0];
if(res["sjgl"]<0)
{
point.update(res["yfgl"]);
}else
{
point.update(res["sjgl"]);
}
}
if(chart7.series[0])
{
point = chart7.series[0].points[0];
point.update(res["yfgl"]);
}
/****************************************/
var jh=[];
var sj=[];
var bl=[];
jh.push(res["yfdljh"]);
jh.push(res["nfdljh"]);
sj.push(res["yfdl"]);
sj.push(res["nfdl"]);
bl.push("月计划完成率"+res["ywcl"]+"%");
bl.push("年计划完成率"+res["nwcl"]+"%");
options6.series[0].data = jh;
options6.series[1].data = sj;
//options6.series[2].data = bl;
if(bl1!=res["ywcl"])
{
bl1=res["ywcl"];
bl2=res["nwcl"];
options6.xAxis.categories=bl
chart6 = new Highcharts.Chart(options6);
}else if(bl2!=res["nwcl"])
{
bl1=res["ywcl"];
bl2=res["nwcl"];
options6.xAxis.categories=bl;
chart6 = new Highcharts.Chart(options6);
}
}
});
}
/*var yfdlForC2 = [];
var swdlForC2 = [];
var gwdlForC2 = [];
var lldlForC2 = [];
var xtimeForC2 = [];*/
function powerAjax() {
var wpId = $("#wpId").val();
var url = "powerAjax.action?wpId=" + wpId;
$.ajax({
url : url,
type : "post",
cache : false,
dataType : "json",
async : false,
data : {},
ifModified : false,
success : function(result) {
var yfdl = [];
var swdl = [];
var gwdl = [];
var lldl = [];
var xtimex = [];
$.each(result, function(m, obj) {
if (obj.value1 != null) {
yfdl.push( parseFloat(obj.value1) );
}
if (obj.value2 != null) {
swdl.push( parseFloat(obj.value2) );
}
if (obj.value3 != null) {
gwdl.push( parseFloat(obj.value3) );
//ycgl.push([ obj.time, parseFloat(obj.wggl) ]);
}
if (obj.value4 != null) {
lldl.push( parseFloat(obj.value4) );
//ycgl.push([ obj.time, parseFloat(obj.wggl) ]);
}
if(obj.timestr!="")
{
xtimex.push(obj.timestr);
}else
{
xtimex.push("");
}
});
//alert(xtime.length);
options2.series[0].data = yfdl;
options2.series[1].data = lldl;
options2.series[2].data = swdl;
options2.series[3].data = gwdl;
options2.xAxis.categories = xtimex;
chart2 = new Highcharts.Chart(options2);
}
});
}
var yfgl = [];
var sjgl = [];
var ycgl = [];
var pjfs = [];
var lvgl = [];
var bzgl = [];
var zygl = [];
var xtime=[];
var yfgl1 = [];
var sjgl1 = [];
var ycgl1 = [];
var pjfs1 = [];
var bzgl1 = [];
var yfgl2 = [];
var sjgl2 = [];
var ycgl2 = [];
var pjfs2 = [];
var bzgl2 = [];
var xtime1=[];
function realPowerAjax() {
var wpId = $("#wpId").val();
//console.log(wpId);
var url = "realPowerAjax.action?wpId=" + wpId;
$.ajax({
url : url,
type : "post",
cache : false,
dataType : "json",
data : {},
ifModified : false,
success : function(result) {
yfgl = [];
sjgl = [];
ycgl = [];
pjfs = [];
lvgl = [];
bzgl = [];
zygl = [];
xtime=[];
yfgl1 = [];
sjgl1 = [];
ycgl1 = [];
pjfs1 = [];
bzgl1 = [];
yfgl2 = [];
sjgl2 = [];
ycgl2 = [];
pjfs2 = [];
bzgl2 = [];
xtime1=[];
var index=0;
var count=0;
var vindex=0;
$.each(result, function(m, obj) {
//if(m == result.length -1){
if(m%2==0){
if(index
时间:'+
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x);
}*/
},
credits: {
enabled: false
},
plotOptions: {
spline: {
dataLabels : {
enabled :false
},
// pointPadding: 0.2,
borderWidth: 0
},
series: {
cursor: 'pointer',
marker: {
radius: 0,
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
}
}
},
series: [{
type: 'spline',
name: '理论功率(单位:MW)',
yAxis:0
},{
type: 'spline',
name: '保证功率(单位:MW)',
yAxis:0
},{
type: 'spline',
name: '实发功率(单位:MW)',
yAxis:0
},{
type: 'spline',
name: '预测功率(单位:MW)',
yAxis:0
}, {
type: 'spline',
name: '平均风速(单位:m/s)',
yAxis:1
/* },
{
type: 'spline',
name: '理论功率(单位:MW)',
yAxis:0
},{
type: 'spline',
name: '最优功率(单位:MW)',
yAxis:0*/
}]
};
options2 = {
chart: {
renderTo: 'container2',
type: 'column',
//backgroundColor:'#BFDFFF',
//plotBackgroundColor:'#BFDFFF',
zoomType: 'x',
events: {
click: function (event) {
var num=parseInt(Math.abs(event.xAxis[0].value).toFixed(0));
var temp=event.xAxis[0].axis.options.categories[num];
var day=temp.substring(0,temp.length-1);
powerDetailAjax(day,temp);
}
}
},title:null
,
xAxis: {
type: 'category'
},
yAxis: [{
title: {
//text: '电量(万kWh)'
text:null
}
}],
legend: {
enabled:false,
layout: 'vertical',
// backgroundColor: '#FFFFFF',
align: 'right',
verticalAlign: 'top',
x:-60,
floating: true
// shadow: true
// layout: 'vertical',
// align: 'right',
// verticalAlign: 'middle',
// borderWidth: 0
},
tooltip: {
shared:true,
xDateFormat:'%Y-%m-%d'
/*formatter: function() {
return ''+ this.series.name +':'+
Highcharts.numberFormat(this.y, 2) +' 万kW
时间:'+
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x);
}*/
},
credits: {
enabled: false
},
plotOptions: {
spline: {
dataLabels : {
enabled :false
},
// pointPadding: 0.2,
borderWidth: 0
},
column: {
pointPadding: 0.2,
borderWidth: 0
},
series: {
cursor: 'pointer',
marker: {
radius: 0,
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
}
}
},
series: [{
name: '日发电量(单位:万kWh)',
yAxis:0
}, {
name: '日理论发电量(单位:万kWh)',
yAxis:0
},
{
name: '上网电量(单位:万kWh)',
yAxis:0
},{
name: '购网电量(单位:万kWh)',
yAxis:0
}]
};
options3 = {
chart: {
renderTo: 'container3',
type: 'solidgauge',
events: {
click: function (event) {
findPJFSDetail();
}
}
},
title: null,
pane: {
center: ['50%', '100%'],
size: '200%',
startAngle: -90,
endAngle: 90,
background: {
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE',
innerRadius: '60%',
outerRadius: '100%',
shape: 'arc'
}
},
tooltip: {
enabled: false
},
// the value axis
yAxis: {
stops: [
[0.1, '#55BF3B'], // green
[0.3, '#33FFFF'], // 蓝
[0.7, '#DDDF0D'], // yellow
[0.9, '#DF5353'] // red
],
lineWidth: 0,
minorTickInterval: null,
tickPixelInterval: 400,
tickWidth: 0,
title: {
y: -10
},
labels: {
y: 0
},
min: 0,
max: 50,
title: {
text: null
}
},
plotOptions: {
solidgauge: {
dataLabels: {
y: 20,
borderWidth: 0,
useHTML: true
}
}
},
credits: {
enabled: false
},
series: [{
name: '风速(m/s)',
data: [12],
dataLabels: {
y:20,
format: '