设备统计分析页面表格接口修改

This commit is contained in:
ym1026
2025-09-16 14:42:05 +08:00
parent 640225a76b
commit e33fcba99a
2 changed files with 127 additions and 162 deletions

View File

@@ -2,6 +2,7 @@
<div class="treetable" ref="treetable"> <div class="treetable" ref="treetable">
<a-table <a-table
bordered bordered
:loading="loading" :loading="loading"
:scroll="tableOption.scroll" :scroll="tableOption.scroll"
:columns="columns" :columns="columns"

View File

@@ -73,23 +73,6 @@ export default {
}, },
stationId: undefined, stationId: undefined,
renderKey: 0, renderKey: 0,
categoryArr: [
{
type: 1,
label: '储能设备',
infoKey: 'energy'
},
{
type: 2,
label: '充电设备',
infoKey: 'charge'
},
{
type: 3,
label: '光伏设备',
infoKey: 'pv'
}
],
paramsDate: {}, paramsDate: {},
searchOptions: [ searchOptions: [
{ {
@@ -169,61 +152,6 @@ export default {
chartDatav: {} chartDatav: {}
}, },
2: { 2: {
chartOptions: [
{
title: '发电电量分析',
type: 'bar',
dataKey: 'sales',
infoKeys: [{ key: 'storage_elect_in', label: '日发电电量', lineColor: '#2A82E4' }]
},
{
title: '运行状态分析',
type: 'bar',
dataKey: 'users',
infoKeys: [
{ key: 'storage_num_err', label: '日故障次数', lineColor: '#0CDAF5' },
{ key: 'key3', label: '日发电时长', lineColor: '#5AABF2' }
]
},
{
title: '今日电压与电流分析',
type: 'line',
dataKey: 'stock',
infoKeys: [
{
key: 'V',
label: '电压',
lineColor: '#3F80F2',
colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)'
},
{
key: 'I',
label: '电流',
lineColor: '#A9A6FF',
colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)'
}
]
},
{
title: '今日功率分析',
type: 'line',
dataKey: 'yearly',
infoKeys: [
{
key: 'P',
label: '功率',
lineColor: '#00FFFB',
colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)'
}
]
}
],
chartData: {}
},
3: {
chartOptions: [ chartOptions: [
{ {
title: '充电分析', title: '充电分析',
@@ -278,6 +206,61 @@ export default {
} }
], ],
chartData: {} chartData: {}
},
3: {
chartOptions: [
{
title: '发电电量分析',
type: 'bar',
dataKey: 'sales',
infoKeys: [{ key: 'storage_elect_in', label: '日发电电量', lineColor: '#2A82E4' }]
},
{
title: '运行状态分析',
type: 'bar',
dataKey: 'users',
infoKeys: [
{ key: 'storage_num_err', label: '日故障次数', lineColor: '#0CDAF5' },
{ key: 'key3', label: '日发电时长', lineColor: '#5AABF2' }
]
},
{
title: '今日电压与电流分析',
type: 'line',
dataKey: 'stock',
infoKeys: [
{
key: 'V',
label: '电压',
lineColor: '#3F80F2',
colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)'
},
{
key: 'I',
label: '电流',
lineColor: '#A9A6FF',
colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)'
}
]
},
{
title: '今日功率分析',
type: 'line',
dataKey: 'yearly',
infoKeys: [
{
key: 'P',
label: '功率',
lineColor: '#00FFFB',
colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)'
}
]
}
],
chartData: {}
} }
}, },
activeKey: 1, activeKey: 1,
@@ -289,38 +272,17 @@ export default {
}, },
{ {
key: 3, key: 2,
name: '充电设备' name: '充电设备'
}, },
{ {
key: 2, key: 3,
name: '光伏设备' name: '光伏设备'
} }
], ],
tableList: { tableList: {
1: { 1: {
columns: [ columns: [
{
title: '设备ID',
dataIndex: 'ID',
key: 'ID',
width: 120,
ellipsis: true
},
{
title: '设备名称',
dataIndex: 'key2',
key: 'key2',
width: 120,
ellipsis: true
},
{
title: '设备类型',
dataIndex: 'key3',
key: 'key3',
width: 120,
ellipsis: true
},
{ {
title: '充电电量', title: '充电电量',
dataIndex: 'storage_elect_in', dataIndex: 'storage_elect_in',
@@ -328,24 +290,46 @@ export default {
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{
title: '放电电量',
dataIndex: 'storage_elect_out',
key: 'storage_elect_out',
width: 120,
ellipsis: true
},
{
title: '充电次数',
dataIndex: 'storage_num_in',
key: 'storage_num_in',
width: 120,
ellipsis: true
},
{
title: '放电次数',
dataIndex: 'storage_num_out',
key: 'storage_num_out',
width: 120,
ellipsis: true
},
{ {
title: '充电时长', title: '充电时长',
dataIndex: 'key5', dataIndex: 'storage_t_in',
key: 'key5', key: 'storage_t_in',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '放电时长', title: '放电时长',
dataIndex: 'key6', dataIndex: 'storage_t_out',
key: 'key6', key: 'storage_t_out',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '放电电量', title: '利用率',
dataIndex: 'storage_elect_out', dataIndex: 'storage_usage',
key: 'storage_elect_out', key: 'storage_usage',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
@@ -375,44 +359,37 @@ export default {
2: { 2: {
columns: [ columns: [
{ {
title: '设备ID', title: '充电电量',
dataIndex: 'ID', dataIndex: 'charge_elect',
key: 'ID', key: 'charge_elect',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '设备名称', title: '充电次数',
dataIndex: 'key2', dataIndex: 'charge_num',
key: 'key2', key: 'charge_num',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '设备类型', title: '充电时长',
dataIndex: 'key3', dataIndex: 'charge_t',
key: 'key3', key: 'charge_t',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '发电电量', title: '利用率',
dataIndex: 'storage_elect_in', dataIndex: 'charge_usage',
key: 'storage_elect_in', key: 'charge_usage',
width: 120,
ellipsis: true
},
{
title: '发电时长',
dataIndex: 'key5',
key: 'key5',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '故障次数', title: '故障次数',
dataIndex: 'key6', dataIndex: 'charge_num_err',
key: 'key6', key: 'charge_num_err',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
@@ -436,54 +413,41 @@ export default {
3: { 3: {
columns: [ columns: [
{ {
title: '设备ID', title: '发电电量',
dataIndex: 'ID', dataIndex: 'solar_elect_gen',
key: 'ID', key: 'solar_elect_gen',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '设备名称', title: '入网电量',
dataIndex: 'key2', dataIndex: 'solar_elect_grid',
key: 'key2', key: 'solar_elect_grid',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '设备类型', title: '发电时长',
dataIndex: 'key3', dataIndex: 'solar_t',
key: 'key3', key: 'solar_t',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '充电电量', title: '利用率',
dataIndex: 'storage_elect_in', dataIndex: 'solar_usage',
key: 'storage_elect_in', key: 'solar_usage',
width: 120,
ellipsis: true
},
{
title: '充电时长',
dataIndex: 'key5',
key: 'key5',
width: 120,
ellipsis: true
},
{
title: '充电次数',
dataIndex: 'key6',
key: 'key6',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '故障次数', title: '故障次数',
dataIndex: 'key6', dataIndex: 'solar_num_err',
key: 'key6', key: 'solar_num_err',
width: 120, width: 120,
ellipsis: true ellipsis: true
}, },
{ {
title: '日期', title: '日期',
dataIndex: 'dt', dataIndex: 'dt',
@@ -492,6 +456,7 @@ export default {
ellipsis: true ellipsis: true
} }
], ],
geturl: '', geturl: '',
tableData: [], tableData: [],
pageOption: { pageOption: {
@@ -512,13 +477,15 @@ export default {
this.resetDataForInactiveKey() this.resetDataForInactiveKey()
// 并行加载新数据 // 并行加载新数据
Promise.all([this.getStationList(),this.getEchartsListForActiveKey(), this.getTableListForActiveKey()]).then( Promise.all([
() => { this.getStationList(),
this.$nextTick(() => { this.getEchartsListForActiveKey(),
this.getStatCharts() this.getTableListForActiveKey()
}) ]).then(() => {
} this.$nextTick(() => {
) this.getStatCharts()
})
})
}, },
immediate: true // 添加立即执行 immediate: true // 添加立即执行
} }
@@ -593,7 +560,7 @@ export default {
} }
try { try {
const res = await getReq('/queryStatDayList', query) const res = await getReq('/queryStatDetailList', query)
if (res.errcode === 0) { if (res.errcode === 0) {
this.tableList[this.activeKey].tableData = res.data.list || res.data this.tableList[this.activeKey].tableData = res.data.list || res.data
this.tableList[this.activeKey].pageOption.count = res.data.count || 0 this.tableList[this.activeKey].pageOption.count = res.data.count || 0
@@ -660,7 +627,6 @@ export default {
this.getStatCharts() this.getStatCharts()
}, },
async getStatCharts() { async getStatCharts() {
const currentInfo = this.echartsInfo[this.activeKey] const currentInfo = this.echartsInfo[this.activeKey]
const query = { const query = {
@@ -684,8 +650,6 @@ export default {
} }
} }
} }
} }
} }
</script> </script>