develop_cloud #1
@ -291,3 +291,11 @@ export function curveList({siteId,strategyId}) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//单站监控 首页 当日功率曲线
|
||||||
|
export function getPointData({siteId,startDate,endDate}) {
|
||||||
|
return request({
|
||||||
|
url: `/ems/siteMonitor/getPointData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -13,7 +13,7 @@
|
|||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import resize from '@/mixins/ems/resize'
|
import resize from '@/mixins/ems/resize'
|
||||||
import DateRangeSelect from '@/components/Ems/DateRangeSelect/index.vue'
|
import DateRangeSelect from '@/components/Ems/DateRangeSelect/index.vue'
|
||||||
import {getPcsNameList, getPowerData} from '@/api/ems/dzjk'
|
import { getPointData } from '@/api/ems/dzjk'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [resize],
|
mixins: [resize],
|
||||||
@ -23,7 +23,7 @@ export default {
|
|||||||
chart: null,
|
chart: null,
|
||||||
timeRange:[],
|
timeRange:[],
|
||||||
siteId:'',
|
siteId:'',
|
||||||
deviceId:''
|
isInit:true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -42,33 +42,23 @@ export default {
|
|||||||
// 更新时间范围 重置图表
|
// 更新时间范围 重置图表
|
||||||
updateDate(data){
|
updateDate(data){
|
||||||
this.timeRange=data
|
this.timeRange=data
|
||||||
this.getGVQXData()
|
!this.isInit && this.getGVQXData()
|
||||||
|
this.isInit = false
|
||||||
},
|
},
|
||||||
getGVQXData(){
|
getGVQXData(){
|
||||||
this.showLoading()
|
this.showLoading()
|
||||||
const {siteId,deviceId,timeRange}=this
|
const {siteId,timeRange}=this
|
||||||
if(!deviceId) return this.hideLoading()
|
getPointData({siteId,startDate:timeRange[0],endDate:timeRange[1]}).then(response => {
|
||||||
getPowerData({siteId,deviceId,startDate:timeRange[0],endDate:timeRange[1],dataType:'1'}).then(response => {
|
|
||||||
this.setOption(response?.data || [])
|
this.setOption(response?.data || [])
|
||||||
}).finally(()=>this.hideLoading())
|
}).finally(()=>this.hideLoading())
|
||||||
},
|
},
|
||||||
init(siteId){
|
init(siteId){
|
||||||
//初始化 清空数据
|
//初始化 清空数据
|
||||||
this.siteId = siteId
|
this.siteId = siteId
|
||||||
|
this.isInit = true
|
||||||
this.timeRange=[]
|
this.timeRange=[]
|
||||||
this.deviceId=''
|
|
||||||
this.$refs.dateRangeSelect.init(true)
|
this.$refs.dateRangeSelect.init(true)
|
||||||
this.showLoading()
|
this.getGVQXData()
|
||||||
getPcsNameList(siteId).then(response=>{
|
|
||||||
const data=response?.data || [];
|
|
||||||
if(data.length>0){
|
|
||||||
this.deviceId=data[0].id
|
|
||||||
//接口调用完成之后 设置图表、结束loading
|
|
||||||
this.getGVQXData()
|
|
||||||
}else{
|
|
||||||
this.hideLoading()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
initChart() {
|
initChart() {
|
||||||
this.chart = echarts.init(document.querySelector('#activeChart'))
|
this.chart = echarts.init(document.querySelector('#activeChart'))
|
||||||
@ -80,12 +70,12 @@ export default {
|
|||||||
this.chart && this.chart.hideLoading()
|
this.chart && this.chart.hideLoading()
|
||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(data) {
|
||||||
const source = [['日期','电网功率']]
|
const source = [['日期','电网功率','负载功率','储能功率','光伏功率','soc平均值','soh平均值','电池平均温度平均值']]
|
||||||
|
console.log('source.slice(1)',source[0].slice(1))
|
||||||
this.chart && data.forEach((item)=>{
|
this.chart && data.forEach((item)=>{
|
||||||
source.push([item.statisDate,item.gridPower])
|
source.push([item.statisDate,item.gridPower,item.loadPower,item.storagePower,item.pvPower,item.avgSoc,item.avgSoh,item.avgTemp])
|
||||||
})
|
})
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
color:['#FFBD00','#3C81FF'],
|
|
||||||
grid: {
|
grid: {
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
@ -105,16 +95,21 @@ export default {
|
|||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: [
|
||||||
type: 'value',
|
|
||||||
},
|
|
||||||
dataset:{source},
|
|
||||||
series: [
|
|
||||||
{
|
{
|
||||||
name:'电网功率',
|
type: 'value',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'value',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dataset:{source},
|
||||||
|
series: source[0].slice(1).map((item,index)=>{
|
||||||
|
return {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
yAxisIndex:index<=4 ? 0 : 1
|
||||||
}
|
}
|
||||||
]
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user