2025-06-18 01:01:17 +08:00
|
|
|
|
|
|
|
<template>
|
|
|
|
<el-row style="background:#fff;margin-top:30px;">
|
|
|
|
<el-col :xs="24" :sm="24" :lg="24">
|
|
|
|
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding">
|
|
|
|
<div slot="header">
|
|
|
|
<span class="card-title">能量流转</span>
|
|
|
|
</div>
|
|
|
|
<div style="height: 310px" id="nllzChart"></div>
|
|
|
|
</el-card>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import * as echarts from 'echarts'
|
|
|
|
import resize from '@/mixins/ems/resize'
|
2025-06-30 18:56:33 +08:00
|
|
|
import {formatNumber} from "@/filters/ems";
|
2025-06-18 01:01:17 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
mixins: [resize],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
chart: null
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.initChart()
|
|
|
|
})
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
if (!this.chart) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
this.chart.dispose()
|
|
|
|
this.chart = null
|
|
|
|
},
|
|
|
|
methods: {
|
2025-06-28 14:52:49 +08:00
|
|
|
initChart() {
|
2025-06-20 13:53:36 +08:00
|
|
|
this.chart = echarts.init(document.querySelector('#nllzChart'))
|
2025-06-18 01:01:17 +08:00
|
|
|
},
|
2025-06-20 13:53:36 +08:00
|
|
|
setOption(data) {
|
|
|
|
const {siteMonitorDataVo=[],gridNrtPower,loadNrtPower,energyStorageNrtPower,energyStorageAvailElec} = data
|
|
|
|
const source = [['日期','充电量','放电量']]
|
|
|
|
siteMonitorDataVo.forEach(item=>{
|
|
|
|
source.push([item.ammeterDate, item.chargedCap,item.disChargedCap])
|
|
|
|
})
|
2025-06-18 01:01:17 +08:00
|
|
|
this.chart.setOption({
|
|
|
|
title: [
|
|
|
|
// 右上角
|
|
|
|
{
|
2025-06-30 18:56:33 +08:00
|
|
|
text: `电网 实时功率:${formatNumber(gridNrtPower)} kW`,
|
2025-06-18 01:01:17 +08:00
|
|
|
top: 10,
|
|
|
|
right: 10,
|
|
|
|
textStyle:{
|
|
|
|
fontSize:12,
|
|
|
|
color:'#666666'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 右下角
|
|
|
|
{
|
2025-06-30 18:56:33 +08:00
|
|
|
text: `负载 实时功率:${formatNumber(loadNrtPower)} kW`,
|
2025-06-18 01:01:17 +08:00
|
|
|
bottom: 10,
|
|
|
|
right: 10,
|
|
|
|
textStyle:{
|
|
|
|
fontSize:12,
|
|
|
|
color:'#666666'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 左下角第一行
|
|
|
|
{
|
|
|
|
text: '储能',
|
|
|
|
bottom: 40,
|
|
|
|
left: 10,
|
|
|
|
textStyle:{
|
|
|
|
fontSize:12,
|
|
|
|
color:'#666666'
|
|
|
|
}
|
|
|
|
},
|
2025-06-20 13:53:36 +08:00
|
|
|
// 左下角第二行
|
2025-06-18 01:01:17 +08:00
|
|
|
{
|
2025-06-30 18:56:33 +08:00
|
|
|
text: `实时功率:${formatNumber(energyStorageNrtPower)} kW`,
|
2025-06-18 01:01:17 +08:00
|
|
|
bottom: 26,
|
|
|
|
left: 10,
|
|
|
|
textStyle:{
|
|
|
|
fontSize:12,
|
|
|
|
color:'#666666'
|
|
|
|
}
|
|
|
|
},
|
2025-06-20 13:53:36 +08:00
|
|
|
// 左下角第三行
|
2025-06-18 01:01:17 +08:00
|
|
|
{
|
2025-06-30 18:56:33 +08:00
|
|
|
text: `可用电量:${formatNumber(energyStorageAvailElec)} kWh`,
|
2025-06-18 01:01:17 +08:00
|
|
|
bottom: 10,
|
|
|
|
left: 10,
|
|
|
|
textStyle:{
|
|
|
|
fontSize:12,
|
|
|
|
color:'#666666'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
grid:{
|
|
|
|
left:200
|
|
|
|
},
|
|
|
|
tooltip: {
|
|
|
|
trigger: 'axis',
|
|
|
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
|
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
textStyle:{
|
|
|
|
color:"#333333",
|
|
|
|
},
|
|
|
|
xAxis: {
|
2025-06-20 13:53:36 +08:00
|
|
|
type: 'category',
|
2025-06-18 01:01:17 +08:00
|
|
|
axisLine: {
|
|
|
|
lineStyle:{
|
|
|
|
color: '#333333',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
yAxis: {
|
|
|
|
type: 'value',
|
|
|
|
axisLine: {
|
|
|
|
lineStyle:{
|
|
|
|
color: '#333333',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2025-06-20 13:53:36 +08:00
|
|
|
dataset:{
|
|
|
|
source
|
2025-06-28 14:52:49 +08:00
|
|
|
// source: [['日期','充电量','放电量']]
|
2025-06-20 13:53:36 +08:00
|
|
|
},
|
2025-06-18 01:01:17 +08:00
|
|
|
series: [
|
|
|
|
{
|
|
|
|
name:'充电量',
|
|
|
|
type: 'line',
|
|
|
|
},{
|
|
|
|
name:'放电量',
|
|
|
|
type: 'line',
|
|
|
|
}]
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|