This commit is contained in:
2026-04-01 14:27:35 +08:00
parent 9272a0162a
commit f88e9bedc2
18 changed files with 2264 additions and 353 deletions

View File

@ -8,6 +8,14 @@ export function getDzjkHomeView(siteId) {
})
}
//获取单个站点总累计运行数据(基于日表)
export function getDzjkHomeTotalView(siteId) {
return request({
url: `/ems/siteMonitor/homeTotalView?siteId=${siteId}`,
method: 'get'
})
}
// 单站监控项目点位配置(供单站监控功能查询)
export function getProjectPointMapping(siteId) {
return request({
@ -738,88 +746,25 @@ export function getLoadNameList(siteId) {
// 电表报表
export function getAmmeterData({siteId, startTime, endTime, pageSize, pageNum}) {
const kind = 'day'
const aliasMap = {
activePeakKwh: 'activePeakKwh',
activeHighKwh: 'activeHighKwh',
activeFlatKwh: 'activeFlatKwh',
activeValleyKwh: 'activeValleyKwh',
activeTotalKwh: 'activeTotalKwh',
reActivePeakKwh: 'reActivePeakKwh',
reActiveHighKwh: 'reActiveHighKwh',
reActiveFlatKwh: 'reActiveFlatKwh',
reActiveValleyKwh: 'reActiveValleyKwh',
reActiveTotalKwh: 'reActiveTotalKwh',
effect: 'effect',
}
return queryMenuPointCurves({
siteId,
menuCode: 'TJBB_DBBB',
startDate: startTime,
endDate: endTime,
}).then((records) => {
const rowMap = new Map()
records.forEach((record) => {
const alias = aliasMap[record.fieldName]
if (!alias) return
;(record.curve || []).forEach((point) => {
const time = point?.dataTime ? new Date(point.dataTime) : null
if (!time || isNaN(time.getTime())) return
const label = formatTimeLabelByKind(time, kind)
if (!rowMap.has(label)) rowMap.set(label, {dataTime: label})
rowMap.get(label)[alias] = normalizePointValue(point?.pointValue)
})
})
const labels = buildSortedLabels(new Set(Array.from(rowMap.keys())), kind)
const fullRows = labels.map(label => rowMap.get(label))
return {
rows: paginateRows(fullRows, pageNum, pageSize),
total: fullRows.length,
return request({
url: `/ems/statsReport/getAmmeterDataFromDaily`,
method: 'get',
params: {
siteId,
startTime,
endTime,
pageSize,
pageNum,
}
})
}
// 电价报表
export function getAmmeterRevenueData(data) {
const {siteId, startTime, endTime, pageNum, pageSize} = data || {}
const kind = 'day'
const aliasMap = {
activePeakPrice: 'activePeakPrice',
activeHighPrice: 'activeHighPrice',
activeFlatPrice: 'activeFlatPrice',
activeValleyPrice: 'activeValleyPrice',
activeTotalPrice: 'activeTotalPrice',
reActivePeakPrice: 'reActivePeakPrice',
reActiveHighPrice: 'reActiveHighPrice',
reActiveFlatPrice: 'reActiveFlatPrice',
reActiveValleyPrice: 'reActiveValleyPrice',
reActiveTotalPrice: 'reActiveTotalPrice',
actualRevenue: 'actualRevenue',
}
return queryMenuPointCurves({
siteId,
menuCode: 'TJBB_SYBB',
startDate: startTime,
endDate: endTime,
}).then((records) => {
const rowMap = new Map()
records.forEach((record) => {
const alias = aliasMap[record.fieldName]
if (!alias) return
;(record.curve || []).forEach((point) => {
const time = point?.dataTime ? new Date(point.dataTime) : null
if (!time || isNaN(time.getTime())) return
const label = formatTimeLabelByKind(time, kind)
if (!rowMap.has(label)) rowMap.set(label, {dataTime: label})
rowMap.get(label)[alias] = normalizePointValue(point?.pointValue)
})
})
const labels = buildSortedLabels(new Set(Array.from(rowMap.keys())), kind)
const fullRows = labels.map(label => rowMap.get(label))
return {
rows: paginateRows(fullRows, pageNum, pageSize),
total: fullRows.length,
}
return request({
url: `/ems/statsReport/getAmmeterRevenueData`,
method: 'get',
params: data
})
}