From f8f85d653ff249f7f454f8e83be41ae325ae2127 Mon Sep 17 00:00:00 2001 From: jiangAB Date: Thu, 18 Dec 2025 17:02:09 +0800 Subject: [PATCH] update --- public/map/components/CompanyShorePower.vue | 102 +++- public/map/components/ShipShorePower.vue | 610 +++++--------------- public/map/components/ShorePowerUsage.vue | 10 +- public/map/components/cesiumMap.vue | 6 +- public/map/components/dictionaryTable.ts | 9 + public/map/index.vue | 98 +--- src/types/shorepower.d.ts | 5 +- 7 files changed, 277 insertions(+), 563 deletions(-) diff --git a/public/map/components/CompanyShorePower.vue b/public/map/components/CompanyShorePower.vue index e7f88c9..d723b29 100644 --- a/public/map/components/CompanyShorePower.vue +++ b/public/map/components/CompanyShorePower.vue @@ -24,7 +24,7 @@
+ @click="handleClickBerthItem(berth)">
{{ berth.measureValue?.toFixed(2) || 0 }}
@@ -36,6 +36,70 @@
+
+
+
+
+
+ + 岸电箱详情 +
+
+ 查看历史记录 +
+
+ + +
+
+
+ 名称: + {{ selectedShorePowerItem?.name }} +
+
+ 位置: + {{ selectedShorePowerItem?.position }} +
+
+ 电压: + {{ selectedShorePowerItem?.shorePowerEquipmentInfo?.voltage }} +
+
+ 频率: + {{ selectedShorePowerItem?.shorePowerEquipmentInfo?.frequency }} +
+
+ 容量: + {{ selectedShorePowerItem?.shorePowerEquipmentInfo?.capacity }} +
+
+ 当前电压: + {{ getValueById(realtimeDeviceData, selectedShorePowerItem.voltageDeviceId, + 'measureValue') }} +
+
+ 当前电流: + {{ getValueById(realtimeDeviceData, selectedShorePowerItem.currentDeviceId, + 'measureValue') }} +
+
+ 当前频率: + {{ getValueById(realtimeDeviceData, selectedShorePowerItem.frequencyDeviceId, + 'measureValue') }} +
+
+ 当前总用量: + {{ getValueById(realtimeDeviceData, selectedShorePowerItem.totalPowerDeviceId, + 'measureValue') }} +
+
+ 当前状态: + {{ selectedShorePowerItem.storePowerStatus }} +
+
+
+
+
@@ -45,9 +109,11 @@ import { ref } from 'vue' import { MapApi } from "@/api/shorepower/map"; import ShipHistoryDialog from './ShipHistoryDialog.vue'; -import { RealtimeDeviceData } from '@/types/shorepower'; +import { RealtimeDeviceData, ShorePowerBerth } from '@/types/shorepower'; +import { getValueById } from './utils'; // 定义组件属性 interface ChartDataItem { + id: number; name: string; value?: number; measureValue?: number; @@ -63,6 +129,14 @@ const historyVisible = ref({ } }) +interface Props { + realtimeDeviceData: RealtimeDeviceData[]; + shorePowerList: ShorePowerBerth[]; +} + +const props = defineProps() +const selectedShorePowerItem = ref() + // 计算总量的函数 const calculateTotal = (children?: ChartDataItem[]) => { if (!children || children.length === 0) return 0; @@ -71,6 +145,21 @@ const calculateTotal = (children?: ChartDataItem[]) => { }, 0); }; +/* 点击泊位box */ +const handleClickBerthItem = (berth: ChartDataItem) => { + console.log(props.shorePowerList) + console.log(berth) + const shorePower = props.shorePowerList.find(item => item.id === berth.id) + selectedShorePowerItem.value = shorePower + console.log(shorePower) +} + +const handleOpenHistory = () => { + if (selectedShorePowerItem.value) { + showShorePowerHistory(selectedShorePowerItem.value) + } +} + // 显示岸电箱历史记录 const showShorePowerHistory = (berth: ChartDataItem) => { console.log(berth) @@ -89,13 +178,6 @@ const showShorePowerHistory = (berth: ChartDataItem) => { } } } - -interface Props { - companyComparisonData?: ChartDataItem[]; - realtimeDeviceData: RealtimeDeviceData[]; -} - -const props = defineProps() const companyComparisonData = ref([]) const handleGetBuildData = async () => { const dockList = await MapApi.getDockIdAndNameList() @@ -107,8 +189,6 @@ const handleGetBuildData = async () => { ...props.realtimeDeviceData.find(item => (item.id === berth.id) && (item.deviceCode.includes('Kwh'))) })) })) - console.log('buildData', buildData) - console.log('props.realtimeDeviceData', props.realtimeDeviceData) companyComparisonData.value = buildData /* MapApi.getBerthIdAndNameList().then(res => { console.log(res) diff --git a/public/map/components/ShipShorePower.vue b/public/map/components/ShipShorePower.vue index 9d767a3..0696632 100644 --- a/public/map/components/ShipShorePower.vue +++ b/public/map/components/ShipShorePower.vue @@ -11,7 +11,7 @@
{{ berthingShips }}
-
在泊船舶数量
+
在港船舶数量
{{ shorePowerShips }}
@@ -46,28 +46,46 @@
- - - - + + + + + + + + + + + - -