|
|
@ -1176,9 +1176,16 @@ const handleBuildCompanyShorePower = (realtimeDeviceData: RealtimeDeviceData[]) |
|
|
|
|
|
|
|
|
const handleBuildCompanyShorePowerYear = async (shipData: any) => { |
|
|
const handleBuildCompanyShorePowerYear = async (shipData: any) => { |
|
|
const applyShipCount = await MapApi.getApplyShipCount() as number |
|
|
const applyShipCount = await MapApi.getApplyShipCount() as number |
|
|
|
|
|
// const aa = realtimeDeviceData. |
|
|
|
|
|
const aa = realtimeDeviceData.value.filter(item => getBerthingShipsIds.value.includes(item.deviceId)) |
|
|
|
|
|
const bb = aa.reduce((total, row) => { |
|
|
|
|
|
const rowSum = row.measureValue |
|
|
|
|
|
return total + rowSum; |
|
|
|
|
|
}, 0); |
|
|
|
|
|
// console.log(first) |
|
|
shipTotalData.value = { |
|
|
shipTotalData.value = { |
|
|
'allPortAreaCount': applyShipCount, |
|
|
'allPortAreaCount': applyShipCount, |
|
|
'berthingShips': shipData.length, |
|
|
'berthingShips': bb, |
|
|
'shorePowerShips': shipData.filter(ship => ['在用'].includes(ship.shipStatus || '')).length, |
|
|
'shorePowerShips': shipData.filter(ship => ['在用'].includes(ship.shipStatus || '')).length, |
|
|
'noShorePowerShips': applyShipCount - shipData.filter(ship => ['在用'].includes(ship.shipStatus || '')).length, |
|
|
'noShorePowerShips': applyShipCount - shipData.filter(ship => ['在用'].includes(ship.shipStatus || '')).length, |
|
|
} |
|
|
} |
|
|
@ -1232,7 +1239,7 @@ const handleGetBuildData = async () => { |
|
|
const handleBuildTimeComparison = async (): Promise<ComparativeData> => { |
|
|
const handleBuildTimeComparison = async (): Promise<ComparativeData> => { |
|
|
const now = dayjs(); |
|
|
const now = dayjs(); |
|
|
|
|
|
|
|
|
console.log(getShorePowerIds.value, getBerthingShipsIds.value, getDepartingShipsIds.value, getElectricityUsageIds.value) |
|
|
// console.log(getShorePowerIds.value, getBerthingShipsIds.value, getDepartingShipsIds.value, getElectricityUsageIds.value) |
|
|
/** |
|
|
/** |
|
|
* 计算每个分组的周期用量(last.measureValue - first.measureValue 的总和) |
|
|
* 计算每个分组的周期用量(last.measureValue - first.measureValue 的总和) |
|
|
*/ |
|
|
*/ |
|
|
|