|
|
@ -147,21 +147,24 @@ |
|
|
|
// }) |
|
|
|
}, |
|
|
|
initTotal(){ |
|
|
|
// request({ |
|
|
|
// url: 'business/device/properties/deviceAnalysis', |
|
|
|
// method: 'post', |
|
|
|
// data:{ |
|
|
|
// dateTime: this.date, |
|
|
|
// deviceType: item.deviceType, |
|
|
|
// deviceId: item.deviceId |
|
|
|
// } |
|
|
|
// }).then(result => {}) |
|
|
|
this.titles[0].value='22.4512'; |
|
|
|
this.titles[1].value='22.4512'; |
|
|
|
this.titles[2].value='88.88'; |
|
|
|
this.titles[3].value='8888'; |
|
|
|
this.titles[4].value='8888'; |
|
|
|
this.titles[5].value='1'; |
|
|
|
request({ |
|
|
|
url: 'business/device/properties/latestOne', |
|
|
|
method: 'get' |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return; |
|
|
|
this.titles[0].value= result.data.theAccumulatedChargeOfTheYear; |
|
|
|
this.titles[1].value= result.data.cumulativeElectricityConsumptionInTheYear; |
|
|
|
this.titles[2].value= result.data.carbonEmissionReduction; |
|
|
|
this.titles[3].value= result.data.equivalentTree; |
|
|
|
this.titles[4].value= result.data.standardCoal; |
|
|
|
}) |
|
|
|
request({ |
|
|
|
url: 'business/device/properties/solarDeviceStatistics', |
|
|
|
method: 'get' |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return; |
|
|
|
this.titles[5].value= result.data.count; |
|
|
|
}) |
|
|
|
}, |
|
|
|
initChart(){ |
|
|
|
const _chartsOptions = { |
|
|
@ -181,7 +184,8 @@ |
|
|
|
}, |
|
|
|
xAxis: { |
|
|
|
type: 'category', |
|
|
|
data: ['0点', '2点', '4点', '6点', '8点', '10点', '12点', '14点', '16点', '18点', '20点', '22点'], |
|
|
|
data: ['0点', '1点', '2点','3点', '4点','5点','6点','7点','8点', '9点','10点','11点', |
|
|
|
'12点','13点','14点','15点','16点','17点','18点','19点','20点','21点','22点','23点'], |
|
|
|
axisLine:{ |
|
|
|
show:true, |
|
|
|
lineStyle:{ |
|
|
@ -235,24 +239,64 @@ |
|
|
|
if(!this.chart1){ |
|
|
|
this.chart1 = echarts.init(document.getElementById("charts1")); |
|
|
|
let option1 = JSON.parse(JSON.stringify(_chartsOptions)); |
|
|
|
this.chart1Total1 = 1212; |
|
|
|
option1.series[0].data=[820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934,832] |
|
|
|
this.chart1.setOption(option1)//{..._chartsOptions,...{title:{text:'今日发电统计'}}}); |
|
|
|
this.chart1.resize(); |
|
|
|
|
|
|
|
request({ |
|
|
|
url: 'business/device/properties/history/oneDay/dailyAccumulatedCharge', |
|
|
|
method: 'get' |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return; |
|
|
|
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] |
|
|
|
const total = 0; |
|
|
|
for(let i in result.data){ |
|
|
|
total += result.data[i] |
|
|
|
const idx = parseInt(i.substr(11,2)); |
|
|
|
data[idx] = result.data[i]; |
|
|
|
} |
|
|
|
this.chart1Total1 = total; |
|
|
|
option1.series[0].data = data; |
|
|
|
this.chart1.setOption(option1); |
|
|
|
this.chart1.resize(); |
|
|
|
}) |
|
|
|
|
|
|
|
this.chart2 = echarts.init(document.getElementById("charts2")); |
|
|
|
let option2 = JSON.parse(JSON.stringify(_chartsOptions)); |
|
|
|
this.chart1Total2 = 1212; |
|
|
|
option2.series[0].data=[820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934,832] |
|
|
|
this.chart2.setOption(option2)//{..._chartsOptions,...{title:{text:'今日发电统计'}}}); |
|
|
|
this.chart2.resize(); |
|
|
|
|
|
|
|
request({ |
|
|
|
url: 'business/device/properties/history/oneDay/cumulativeElectricityConsumptionOnTheDay', |
|
|
|
method: 'get' |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return; |
|
|
|
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] |
|
|
|
const total = 0; |
|
|
|
for(let i in result.data){ |
|
|
|
total += result.data[i] |
|
|
|
const idx = parseInt(i.substr(11,2)); |
|
|
|
data[idx] = result.data[i]; |
|
|
|
} |
|
|
|
this.chart1Total2 = total; |
|
|
|
option2.series[0].data = data; |
|
|
|
this.chart2.setOption(option2); |
|
|
|
this.chart2.resize(); |
|
|
|
}) |
|
|
|
// 发电功率 |
|
|
|
this.chart3 = echarts.init(document.getElementById("charts3")); |
|
|
|
let option3 = JSON.parse(JSON.stringify(_chartsOptions)); |
|
|
|
this.chart1Total3 = 1212; |
|
|
|
option3.series[0].data=[820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934,832] |
|
|
|
this.chart3.setOption(option3)//{..._chartsOptions,...{title:{text:'今日发电统计'}}}); |
|
|
|
this.chart3.resize() |
|
|
|
request({ |
|
|
|
url: 'business/device/properties/history/oneDay/generatingPower', |
|
|
|
method: 'get' |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return; |
|
|
|
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] |
|
|
|
const total = 0; |
|
|
|
for(let i in result.data){ |
|
|
|
total += result.data[i] |
|
|
|
const idx = parseInt(i.substr(11,2)); |
|
|
|
data[idx] = result.data[i]; |
|
|
|
} |
|
|
|
this.chart1Total3 = total; |
|
|
|
option3.series[0].data = data; |
|
|
|
this.chart3.setOption(option3); |
|
|
|
this.chart3.resize() |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
window.addEventListener("resize", () => { |
|
|
|
if(this.chart1){ |
|
|
|