Merge branch 'develop' into single-develop

This commit is contained in:
白菜
2025-09-17 14:57:30 +08:00
31 changed files with 1527 additions and 555 deletions

View File

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

View File

@ -72,7 +72,7 @@ export default {
source.push([item.ammeterDate, item.chargedCap,item.disChargedCap])
})
this.chart && this.chart.setOption({
color:['#FFBD00','#3C81FF','#05AEA3'],
color:['#4472c4','#70ad47'],//所有充放电颜色保持统一
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
@ -107,11 +107,11 @@ export default {
series: [
{
yAxisIndex:0,
type: 'line',
type: 'bar',
},
{
yAxisIndex:0,
type: 'line',
type: 'bar',
},
]
})

View File

@ -13,7 +13,7 @@
class="common-card-container common-card-container-body-no-padding"
>
<div slot="header">
<span class="card-title">静态信息</span>
<span class="card-title">站点信息</span>
</div>
<div
style="box-sizing: border-box; height: 250px; padding: 20px 15px"
@ -105,11 +105,11 @@ export default {
],
sjglData: [
{
title: "今日充电量(MWh",
title: "今日充电量(kWh",
attr: "dayChargedCap",
},
{
title: "今日放电量(MWh",
title: "今日放电量(kWh",
attr: "dayDisChargedCap",
},
{
@ -202,20 +202,4 @@ export default {
}
}
}
/* card标题里的时间选择器 */
.time-range-card {
&.common-card-container .el-card__header {
padding-top: 0;
padding-bottom: 0;
.time-range-header {
height: 40px;
display: flex;
justify-content: space-between;
align-items: center;
.card-title {
line-height: 40px;
}
}
}
}
</style>