Browse Source

update

feature
jiangAB 1 week ago
parent
commit
14c198b985
  1. 1
      public/map/components/dictionaryTable.ts
  2. 11
      public/map/index.vue

1
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 },
]

11
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<ComparativeData> => {
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 的总和
*/

Loading…
Cancel
Save