|
|
@ -532,26 +532,36 @@ const handleGetStorePower = async () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getShipStatus = (ship: ShipRespVo) => { |
|
|
const getShipStatus = (ship: ShipRespVo) => { |
|
|
// console.log(props.realtimeDeviceData) |
|
|
if (ship.shorePowerAndShip.status === 9) { |
|
|
if (ship.applyInfo.reason !== 0) { |
|
|
|
|
|
return '未使用' |
|
|
return '未使用' |
|
|
} else if ([2, 5, 8].includes(ship.shorePowerAndShip.status)) { |
|
|
} else { |
|
|
|
|
|
const shorePower = realtimeDeviceData.value.find(item => item.deviceId === ship.shorePowerAndShip.shorePowerId) |
|
|
|
|
|
if (!shorePower) { |
|
|
|
|
|
return '未知' |
|
|
|
|
|
} |
|
|
|
|
|
// const shorePower = ShorePowerList.value.find(item => item.shorePowerId === ship.shorePowerAndShip.shorePowerId) |
|
|
|
|
|
// return shorePower?.storePowerStatus || '故障' |
|
|
|
|
|
if ([2, 5, 8].includes(shorePower.deviceStatus)) { |
|
|
return '故障' |
|
|
return '故障' |
|
|
|
|
|
} else if (shorePower?.deviceStatus === 6) { |
|
|
|
|
|
return '超容' |
|
|
} else { |
|
|
} else { |
|
|
const Vobj = realtimeDeviceData.value.find(item => item.deviceId === ship.shorePower.voltageDeviceld) |
|
|
const Vobj = realtimeDeviceData.value.find(item => item.deviceId === ship.shorePower.voltageDeviceId) |
|
|
const Cobj = realtimeDeviceData.value.find(item => item.deviceId === ship.shorePower.currentDeviceld) |
|
|
const Cobj = realtimeDeviceData.value.find(item => item.deviceId === ship.shorePower.currentDeviceId) |
|
|
let capacity = 0 |
|
|
let capacity = 0 |
|
|
try { |
|
|
try { |
|
|
capacity = Number(ship.shorePowerEquipment.capacity) |
|
|
capacity = Number(ship.shorePowerEquipment.capacity) |
|
|
|
|
|
console.log('capacity', capacity, Vobj.measureValue, Cobj?.measureValue) |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
return '获取岸电容量失败' |
|
|
return '获取岸电容量失败' |
|
|
} |
|
|
} |
|
|
const power = (Vobj?.measureValue ?? 0) * (Cobj?.measureValue ?? 0); |
|
|
const power = (Vobj?.measureValue ?? 0) * (Cobj?.measureValue ?? 0); |
|
|
if (power > capacity) { |
|
|
if (power / 1000 > capacity) { |
|
|
return '超容' |
|
|
return '超容' |
|
|
} |
|
|
} |
|
|
return '正常' |
|
|
return '正常' |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const handleGetShipData = async () => { |
|
|
const handleGetShipData = async () => { |
|
|
|