修改电量显示单位, 新增策略运行效益页面

This commit is contained in:
lixiaoyuan
2026-03-03 15:55:24 +08:00
parent 6e0a00f271
commit 29f86de821
10 changed files with 279 additions and 117 deletions

View File

@@ -40,7 +40,7 @@ export default {
colorStart: ' rgba(10, 250, 106, 0.15)', colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)', colorEnd: ' rgba(171, 255, 249, 0.3)',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
}, },
{ {
name: '充电次数', name: '充电次数',
@@ -60,7 +60,7 @@ export default {
colorStart: ' rgba(10, 250, 106, 0.15)', colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)', colorEnd: ' rgba(171, 255, 249, 0.3)',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
}, },
{ {
name: '充电收益', name: '充电收益',

View File

@@ -37,14 +37,14 @@ export default {
key: 'storage_elect_in', key: 'storage_elect_in',
lineColor: '#22E4FF', lineColor: '#22E4FF',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
}, },
{ {
name: '放电电量', name: '放电电量',
key: 'storage_elect_out', key: 'storage_elect_out',
lineColor: '#0E68E4', lineColor: '#0E68E4',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
} }
], ],
energyChart: null, energyChart: null,
@@ -164,7 +164,7 @@ export default {
} }
}, },
yAxis: { yAxis: {
name: '电量(kW·h)', name: '电量(kWh)',
nameTextStyle: { color: '#fff' }, nameTextStyle: { color: '#fff' },
type: 'value', type: 'value',
splitNumber: 2, splitNumber: 2,

View File

@@ -23,14 +23,14 @@ export default {
key: 'storage_elect_in', key: 'storage_elect_in',
lineColor: '#9BD801', lineColor: '#9BD801',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
}, },
{ {
name: '放电电量', name: '放电电量',
key: 'storage_elect_out', key: 'storage_elect_out',
lineColor: '#3DFEFA', lineColor: '#3DFEFA',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
} }
], ],

View File

@@ -26,7 +26,7 @@ export default {
colorStart: ' rgba(10, 250, 106, 0.15)', colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)', colorEnd: ' rgba(171, 255, 249, 0.3)',
value:0, value:0,
d:'kW·h' d:'kWh'
}, },
], ],

View File

@@ -23,14 +23,14 @@ export default {
key: 'storage_elect_in', key: 'storage_elect_in',
lineColor: '#9BD801', lineColor: '#9BD801',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
}, },
{ {
name: '充电设备', name: '充电设备',
key: 'storage_elect_out', key: 'storage_elect_out',
lineColor: '#3DFEFA', lineColor: '#3DFEFA',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
} }
], ],

View File

@@ -23,29 +23,29 @@ export default {
key: 'storage_elect_in', key: 'storage_elect_in',
lineColor: '#9BD801', lineColor: '#9BD801',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
}, },
{ {
name: '充电设备', name: '充电设备',
key: 'storage_elect_out', key: 'storage_elect_out',
lineColor: '#3DFEFA', lineColor: '#3DFEFA',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
}, },
{ // {
name: '光伏设备', // name: '光伏设备',
key: 'storage_elect_out', // key: 'storage_elect_out',
lineColor: '#3DFEFA', // lineColor: '#3DFEFA',
value: 0, // value: 0,
d: 'kW·h' // d: 'kWh'
}, // },
{ // {
name: '电网侧', // name: '电网侧',
key: 'storage_elect_out', // key: 'storage_elect_out',
lineColor: '#3DFEFA', // lineColor: '#3DFEFA',
value: 0, // value: 0,
d: 'kW·h' // d: 'kWh'
} // }
], ],
myChart: null, myChart: null,

View File

@@ -23,14 +23,14 @@ export default {
key: 'storage_elect_in', key: 'storage_elect_in',
lineColor: '#9BD801', lineColor: '#9BD801',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
}, },
{ {
name: '充电设备', name: '充电设备',
key: 'storage_elect_out', key: 'storage_elect_out',
lineColor: '#3DFEFA', lineColor: '#3DFEFA',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
} }
], ],

View File

@@ -23,7 +23,7 @@ export default {
key: 'usage_rate', key: 'usage_rate',
lineColor: '#F69B52', lineColor: '#F69B52',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
} }
], ],

View File

@@ -35,14 +35,14 @@ export default {
key: 'solar_elect_gen', key: 'solar_elect_gen',
lineColor: '#22E4FF', lineColor: '#22E4FF',
value: 0, value: 0,
d: 'kW·h' d: 'kWh'
}, },
// { // {
// name: '入网电量', // name: '入网电量',
// key: 'solar_elect_grid', // key: 'solar_elect_grid',
// lineColor: '#0E68E4', // lineColor: '#0E68E4',
// value: 0, // value: 0,
// d: 'kW·h' // d: 'kWh'
// } // }
], ],
pvChart: null, pvChart: null,
@@ -161,7 +161,7 @@ export default {
} }
}, },
yAxis: { yAxis: {
name: '电量(kW·h)', name: '电量(kWh)',
nameTextStyle: { color: '#fff' }, nameTextStyle: { color: '#fff' },
type: 'value', type: 'value',
splitNumber: 2, splitNumber: 2,

View File

@@ -41,7 +41,7 @@
</template> </template>
</searchBox> </searchBox>
</div> </div>
<div class="main_content"> <div v-if="activeKey !== 4" class="main_content" >
<a-spin :spinning="loading.chart || loading.table"> <a-spin :spinning="loading.chart || loading.table">
<energyEchart <energyEchart
:key="`${activeKey}_${renderKey}`" :key="`${activeKey}_${renderKey}`"
@@ -53,12 +53,23 @@
:table-info="tableList[activeKey].tableInfo" :table-info="tableList[activeKey].tableInfo"
:table-data="tableList[activeKey].tableData" :table-data="tableList[activeKey].tableData"
@pagesizeChange="pagesizeChange" @pagesizeChange="pagesizeChange"
> >
</energyEchart> </energyEchart>
</a-spin> </a-spin>
</div> </div>
<div v-if="activeKey == 4" style="height:800px">
<ComTable
:columns="columns"
:table-data="tableData"
:table-option="{ page: false, select: false }">
<template #action="record">
<OperateCom :record="record" :operate-list="operateList" @operateForm="operateForm" />
</template>
</ComTable>
</div>
</div> </div>
</template> </template>
@@ -110,14 +121,13 @@ export default {
], ],
yAxisOption: [ yAxisOption: [
{ {
name: '电量(kW·h)', name: '电量(kWh)',
type: 'value', type: 'value',
nameTextStyle: { color: '#fff' }, nameTextStyle: { color: '#fff' },
splitLine: { lineStyle: { type: 'dashed', color: '#435463' } }, splitLine: { lineStyle: { type: 'dashed', color: '#435463' } },
axisLabel: { interval: 4, color: '#fff', fontSize: 12 }, axisLabel: { interval: 4, color: '#fff', fontSize: 12 },
} }
] ]
}, },
{ {
title: '运行状态分析', title: '运行状态分析',
@@ -125,20 +135,11 @@ export default {
dataKey: 'users', dataKey: 'users',
yAxisOption:[ yAxisOption:[
{ {
name: '日故障次数(V)', name: '日故障次数',
type: 'value', type: 'value',
nameTextStyle: { nameTextStyle: { color: '#fff' },
color: '#fff' splitLine: { lineStyle: { type: 'dashed', color: '#435463' } },
}, axisLabel: { interval: 4, color: '#fff', fontSize:12 },
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
}, },
// { // {
// name: '工作时长(h)', // name: '工作时长(h)',
@@ -220,6 +221,24 @@ export default {
title: '今日功率分析', title: '今日功率分析',
type: 'line', type: 'line',
dataKey: 'yearly', dataKey: 'yearly',
yAxisOption:[
{
name: '功率(kW)',
type: 'value',
nameTextStyle: {
color: '#fff'
},
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
],
infoKeys: [ infoKeys: [
{ {
key: 'P', key: 'P',
@@ -240,16 +259,34 @@ export default {
title: '充电分析', title: '充电分析',
type: 'bar', type: 'bar',
dataKey: 'sales', dataKey: 'sales',
infoKeys: [{ key: 'storage_elect_in', label: '日充电电量', lineColor: '#2A82E4' }] infoKeys: [{ key: 'charge_elect', label: '日充电电量', lineColor: '#2A82E4' }],
yAxisOption:[
{
name: '电量(kWh)',
type: 'value',
nameTextStyle: { color: '#fff' },
splitLine: { lineStyle: { type: 'dashed', color: '#435463' } },
axisLabel: { interval: 4, color: '#fff', fontSize:12 },
}
]
}, },
{ {
title: '运行状态分析', title: '运行状态分析',
type: 'bar', type: 'bar',
dataKey: 'users', dataKey: 'users',
infoKeys: [ infoKeys: [
{ key: 'storage_num_err', label: '日充电次数', lineColor: '#0CDAF5' }, { key: 'charge_num', label: '日充电次数', lineColor: '#0CDAF5' },
{ key: 'key3', label: '日故障次数', lineColor: '#5AABF2' }, { key: 'charge_num_err', label: '日故障次数', lineColor: '#5AABF2' },
// { key: 'key3', label: '日充电时长', lineColor: '#5AABF2' } // { key: 'key3', label: '日充电时长', lineColor: '#5AABF2' }
],
yAxisOption:[
{
name: '次数',
type: 'value',
nameTextStyle: { color: '#fff' },
splitLine: { lineStyle: { type: 'dashed', color: '#435463' } },
axisLabel: { interval: 4, color: '#fff', fontSize:12 },
}
] ]
}, },
{ {
@@ -311,12 +348,15 @@ export default {
type: 'line', type: 'line',
dataKey: 'yearly', dataKey: 'yearly',
infoKeys: [ infoKeys: [
{ key: 'P', label: '功率', lineColor: '#00FFFB', colorStart: ' rgba(10, 250, 106, 0.15)', colorEnd: ' rgba(171, 255, 249, 0.3)' }
],
yAxisOption:[
{ {
key: 'P', name: '功率(kW)',
label: '功率', type: 'value',
lineColor: '#00FFFB', nameTextStyle: { color: '#fff' },
colorStart: ' rgba(10, 250, 106, 0.15)', splitLine: { lineStyle: { type: 'dashed', color: '#435463' } },
colorEnd: ' rgba(171, 255, 249, 0.3)' axisLabel: { interval: 4, color: '#fff', fontSize:12 },
} }
] ]
} }
@@ -329,14 +369,23 @@ export default {
title: '发电电量分析', title: '发电电量分析',
type: 'bar', type: 'bar',
dataKey: 'sales', dataKey: 'sales',
infoKeys: [{ key: 'storage_elect_in', label: '日发电电量', lineColor: '#2A82E4' }] infoKeys: [{ key: 'solar_elect_gen', label: '日发电电量', lineColor: '#2A82E4' }],
yAxisOption:[
{
name: '电量(kWh)',
type: 'value',
nameTextStyle: { color: '#fff' },
splitLine: { lineStyle: { type: 'dashed', color: '#435463' } },
axisLabel: { interval: 4, color: '#fff', fontSize:12 },
}
]
}, },
{ {
title: '运行状态分析', title: '运行状态分析',
type: 'bar', type: 'bar',
dataKey: 'users', dataKey: 'users',
infoKeys: [ infoKeys: [
{ key: 'storage_num_err', label: '日故障次数', lineColor: '#0CDAF5' }, { key: 'solar_num_err', label: '日故障次数', lineColor: '#0CDAF5' },
// { key: 'key3', label: '日发电时长', lineColor: '#5AABF2' } // { key: 'key3', label: '日发电时长', lineColor: '#5AABF2' }
] ]
}, },
@@ -348,33 +397,16 @@ export default {
{ {
name: '电压(V)', name: '电压(V)',
type: 'value', type: 'value',
nameTextStyle: { nameTextStyle: { color: '#fff' },
color: '#fff' splitLine: { lineStyle: { type: 'dashed', color: '#435463' } },
}, axisLabel: { interval: 4, color: '#fff', fontSize:12 },
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
}, },
{ {
name: '电流(A)', name: '电流(A)',
type: 'value', type: 'value',
splitLine: { splitLine: {lineStyle: { type: 'dashed', color: '#435463' } },
lineStyle: { type: 'dashed', color: '#435463' } nameTextStyle: { color: '#fff' },
}, axisLabel: { interval: 4, color: '#fff', fontSize:12 },
nameTextStyle: {
color: '#fff'
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
}, },
], ],
infoKeys: [ infoKeys: [
@@ -406,6 +438,15 @@ export default {
colorStart: ' rgba(10, 250, 106, 0.15)', colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)' colorEnd: ' rgba(171, 255, 249, 0.3)'
} }
],
yAxisOption:[
{
name: '功率(kW)',
type: 'value',
nameTextStyle: { color: '#fff' },
splitLine: { lineStyle: { type: 'dashed', color: '#435463' } },
axisLabel: { interval: 4, color: '#fff', fontSize:12 },
}
] ]
} }
], ],
@@ -427,6 +468,10 @@ export default {
{ {
key: 3, key: 3,
name: '光伏设备' name: '光伏设备'
},
{
key: 4,
name: '策略运行效益'
} }
], ],
tableList: { tableList: {
@@ -612,17 +657,36 @@ export default {
count: 1 count: 1
} }
} }
} },
columns: [
{ title: '日期', dataIndex: 'dt', key: 'dt' },
{ title: '时段', dataIndex: 'period', key: 'period', ellipsis: true}, // fixed: 'left', // filterable: true
{ title: '储能充电电量(kWh)', dataIndex: 'E_in', key: 'E_in' },
{ title: '储能放电电量(kWh)', dataIndex: 'E_out', key: 'E_out' },
{ title: '电网价格(元/kWh)', dataIndex: 'grid_price', key: 'gridPrice' },
{ title: '充电价格(元/kWh)', dataIndex: 'charge_price', key: 'chargePrice' },
{ title: '收益(元)', dataIndex: 'income', key: 'income' },
{ title: '操作', dataIndex: 'operate', key: 'operate', scopedSlots: { customRender: 'action' } }
],
tableData: [
// {period: "谷", E_in: 30, E_out: 25, gridPrice: "0.32", chargePrice: "0.32", income: 0.00},
// {period: "平", gridPrice: "0.8", chargePrice: "0.6", income: "0.2", elect: "35", incomeTotal: "100"},
// {period: "峰", gridPrice: "0.8", chargePrice: "0.6", income: "0.2", elect: "35", incomeTotal: "100"},
// {period: "尖", gridPrice: "0.8", chargePrice: "0.6", income: "0.2", elect: "35", incomeTotal: "100"},
// {period: "总计", gridPrice: "0.8", chargePrice: "0.6", income: "0.2", elect: "35", incomeTotal: "100"}
]
} }
}, },
watch: { watch: {
activeKey: { activeKey: {
handler(newVal) { handler(newVal) {
if (!newVal) return if (!newVal) return
// 清除之前的数据 // 清除之前的数据
this.resetDataForInactiveKey() this.resetDataForInactiveKey()
if (newVal !== 4) {
// 并行加载新数据 // 并行加载新数据
Promise.all([ Promise.all([
this.getStationList(), this.getStationList(),
@@ -633,11 +697,18 @@ export default {
this.getStatCharts() this.getStatCharts()
}) })
}) })
}
else {
this.$nextTick(() => {
this.getEGridPeriod()
})
}
}, },
// immediate: true // 添加立即执行 // immediate: true // 添加立即执行
} }
}, },
mounted() { mounted() {
//this.operateList = this.$getBtns(['修改'])
console.log('mounted') console.log('mounted')
// 优先加载第一个页面(activeKey=1)所需的数据 // 优先加载第一个页面(activeKey=1)所需的数据
// this.btnOptionList = this.$getBtns(['导出']) // this.btnOptionList = this.$getBtns(['导出'])
@@ -689,6 +760,8 @@ export default {
this.renderKey += 1 this.renderKey += 1
}, },
resetDataForInactiveKey() { resetDataForInactiveKey() {
if (this.activeKey == 4) return
// 重置非当前激活页面的数据 // 重置非当前激活页面的数据
Object.keys(this.echartsInfo).forEach((key) => { Object.keys(this.echartsInfo).forEach((key) => {
if (key != this.activeKey) { if (key != this.activeKey) {
@@ -721,12 +794,15 @@ export default {
try { try {
const res = await getReq('/queryStatDayList', query) const res = await getReq('/queryStatDayList', query)
let chartInfo = this.echartsInfo[this.activeKey]
if (chartInfo) {
if (res.errcode === 0) { if (res.errcode === 0) {
this.echartsInfo[this.activeKey].chartData = res.data chartInfo.chartData = res.data
this.loading.chart = false this.loading.chart = false
} else { } else {
throw res throw res
} }
}
} catch (error) { } catch (error) {
this.loading.chart = false this.loading.chart = false
this.echartsInfo[this.activeKey].chartData = {} this.echartsInfo[this.activeKey].chartData = {}
@@ -749,15 +825,19 @@ export default {
try { try {
const res = await getReq('/queryStatDetailList', query) const res = await getReq('/queryStatDetailList', query)
let tableInfo = this.tableList[this.activeKey]
if (tableInfo) {
if (res.errcode === 0) { if (res.errcode === 0) {
this.tableList[this.activeKey].tableData = res.data.list || res.data tableInfo.tableData = res.data.list || res.data
this.tableList[this.activeKey].pageOption.count = res.count || 0 tableInfo.pageOption.count = res.count || 0
this.tableList[this.activeKey].pageOption.page = res.page || 0 tableInfo.pageOption.page = res.page || 0
this.tableList[this.activeKey].pageOption.pageSize = res.page_size || 0 tableInfo.pageOption.pageSize = res.page_size || 0
this.loading.table = false this.loading.table = false
} else { } else {
throw res throw res
} }
}
} catch (error) { } catch (error) {
this.tableList[this.activeKey].tableData = [] this.tableList[this.activeKey].tableData = []
this.tableList[this.activeKey].pageOption.count = 0 this.tableList[this.activeKey].pageOption.count = 0
@@ -811,16 +891,28 @@ export default {
onSearch(data) { onSearch(data) {
this.paramsDate.start_date = data.time ? data.time[0] : '' this.paramsDate.start_date = data.time ? data.time[0] : ''
this.paramsDate.end_date = data.time ? data.time[1] : '' this.paramsDate.end_date = data.time ? data.time[1] : ''
if (this.activeKey !== 4) {
this.tableList[this.activeKey].pageOption.page = 1 this.tableList[this.activeKey].pageOption.page = 1
this.getStationList(), this.getStatCharts(),this.getEchartsListForActiveKey(), this.getTableListForActiveKey() this.getStationList(), this.getStatCharts(),this.getEchartsListForActiveKey(), this.getTableListForActiveKey()
} else {
this.getEGridPeriod()
}
}, },
changeStation() { changeStation() {
if (this.activeKey != 4) {
this.getStatCharts() this.getStatCharts()
this.getEchartsListForActiveKey() this.getEchartsListForActiveKey()
this.getTableListForActiveKey() this.getTableListForActiveKey()
} else {
this.getEGridPeriod()
}
}, },
async getStatCharts() { async getStatCharts() {
if (this.activeKey == 4) return
const query = { const query = {
dt: this.paramsDate.end_date, dt: this.paramsDate.end_date,
station_id: this.stationId, station_id: this.stationId,
@@ -828,20 +920,49 @@ export default {
} }
try { try {
const res = await getReq('/queryStatCharts', query) const res = await getReq('/queryStatCharts', query)
let chartInfo = this.echartsInfo[this.activeKey]
if (chartInfo) {
if (res.errcode === 0) { if (res.errcode === 0) {
this.echartsInfo[this.activeKey].chartDatav = res.data chartInfo.chartDatav = res.data
} else {
throw res
}
}
} catch (error) {
this.echartsInfo[this.activeKey].chartDatav = {}
}
},
async getEGridPeriod() {
const query = {
dt: this.paramsDate.end_date,
station_id: this.stationId,
}
if (!query.dt) {
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0'); // 处理月份:先+1因为getMonth返回0-11再补零到2位
const day = String(today.getDate()).padStart(2, '0'); // 处理日期直接补零到2位
query.dt = `${year}-${month}-${day}`; // 拼接成指定格式
}
try {
const res = await getReq('/queryEGridPeriod', query)
if (res.errcode === 0) {
this.tableData = res.data
} else { } else {
throw res throw res
} }
} catch (error) { } catch (error) {
this.echartsInfo[this.activeKey].chartDatav = {} this.tableData = []
} }
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style lang="scss" scoped>
@import url(@/style/color.scss); @import url(@/style/color.scss);
.statisicalAn { .statisicalAn {
width: 100%; width: 100%;
@@ -880,4 +1001,45 @@ export default {
height: calc(100% - 40px); height: calc(100% - 40px);
// margin-top: 10px; // margin-top: 10px;
} }
.content-table {
height: 700px;
margin-top: 40px;
:deep(.ant-table-header tr th) {
background: $table-border !important;
color: #fff;
}
:deep(.ant-table-body tr td, .ant-table-cell) {
background: $table-bg !important;
color: #fff;
}
}
:deep(.ant-modal-body) {
:deep(.ant-table-wrapper .ant-table-row-expand-icon) {
color: $green !important;
}
//表格行悬浮样式
.no-hover-row:hover > td {
// background-color: transparent !important;
background-color: #f0f8ff !important;
}
}
:deep(.ant-table-cell) {
&::before {
width: 0 !important;
}
}
:deep(.ant-table-thead > tr > td) {
border-bottom: none !important;
border-top: none !important;
}
:deep(.ant-table-wrapper .ant-table-tbody > tr > td) {
border-top: none !important;
}
:deep(.ant-table-wrapper .ant-table-thead > tr > th) {
border-bottom: none !important;
}
</style> </style>