From 14c198b985c83348fb55e69087b35472e99ffc00 Mon Sep 17 00:00:00 2001 From: jiangAB Date: Mon, 5 Jan 2026 17:16:08 +0800 Subject: [PATCH] update --- public/map/components/dictionaryTable.ts | 1 + public/map/index.vue | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/public/map/components/dictionaryTable.ts b/public/map/components/dictionaryTable.ts index 2548743..17ddef1 100644 --- a/public/map/components/dictionaryTable.ts +++ b/public/map/components/dictionaryTable.ts @@ -146,6 +146,7 @@ export const SHORE_POWER_SECOND_STATUS_MAP = [ { label: '合闸', value: 3 }, { label: '分闸', value: 4 }, { label: '通信异常', value: 5 }, + { label: '超出最大容量', value: 6 }, { label: '无法解析设备状态', value: 8 }, { label: '未开始采集数据', value: 9 }, ] diff --git a/public/map/index.vue b/public/map/index.vue index 18f5dc7..1df0a65 100644 --- a/public/map/index.vue +++ b/public/map/index.vue @@ -1176,9 +1176,16 @@ const handleBuildCompanyShorePower = (realtimeDeviceData: RealtimeDeviceData[]) const handleBuildCompanyShorePowerYear = async (shipData: any) => { 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 = { 'allPortAreaCount': applyShipCount, - 'berthingShips': shipData.length, + 'berthingShips': bb, 'shorePowerShips': 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 => { 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 的总和) */