|
@ -2,7 +2,7 @@ |
|
|
* @Author: Fuyuu 1805498209@qq.com |
|
|
* @Author: Fuyuu 1805498209@qq.com |
|
|
* @Date: 2024-01-05 14:18:33 |
|
|
* @Date: 2024-01-05 14:18:33 |
|
|
* @LastEditors: Fuyuu 1805498209@qq.com |
|
|
* @LastEditors: Fuyuu 1805498209@qq.com |
|
|
* @LastEditTime: 2024-01-25 15:11:06 |
|
|
* @LastEditTime: 2024-01-30 15:25:39 |
|
|
* @FilePath: \dt-admin-pc-v2\src\components\earthMap\AISInfoWindow.vue |
|
|
* @FilePath: \dt-admin-pc-v2\src\components\earthMap\AISInfoWindow.vue |
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
|
|
--> |
|
|
--> |
|
@ -10,140 +10,145 @@ |
|
|
<div class="shipInfo"> |
|
|
<div class="shipInfo"> |
|
|
<Window |
|
|
<Window |
|
|
:title="title" |
|
|
:title="title" |
|
|
:width="600" |
|
|
:width="280" |
|
|
:minWidth="600" |
|
|
:minWidth="280" |
|
|
:height="420" |
|
|
:height="700" |
|
|
:left="80" |
|
|
:right="0" |
|
|
:top="70" |
|
|
:top="0" |
|
|
@cancel="cancel" |
|
|
@cancel="cancel" |
|
|
:floatright="false" |
|
|
:floatright="true" |
|
|
:showCancelButton="true" |
|
|
:showCancelButton="true" |
|
|
:footervisible="false" |
|
|
:footervisible="false" |
|
|
:showcloseButton="true" |
|
|
:showcloseButton="true" |
|
|
id="aisInfoWindow" |
|
|
id="aisInfoWindow" |
|
|
|
|
|
class="fuckWindow" |
|
|
> |
|
|
> |
|
|
<div class="ais_content" v-if="title.includes('AIS')"> |
|
|
<div class="ais_content" v-if="title.includes('AIS')"> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">船名:</div> |
|
|
<div class="item_title">船名:</div> |
|
|
<div class="item_content">{{ infoData.name }}</div> |
|
|
<div class="item_content">{{ infoData.name }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">MMSI:</div> |
|
|
<div class="item_title">MMSI:</div> |
|
|
<div class="item_content">{{ infoData.mmsi }}</div> |
|
|
<div class="item_content">{{ infoData.mmsi }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">船首向:</div> |
|
|
<div class="item_title">船首向:</div> |
|
|
<div class="item_content">未知</div> |
|
|
<div class="item_content">未知</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">呼号:</div> |
|
|
<div class="item_title">呼号:</div> |
|
|
<div class="item_content">未知</div> |
|
|
<div class="item_content">未知</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">航迹向:</div> |
|
|
<div class="item_title">航迹向:</div> |
|
|
<div class="item_content">未知</div> |
|
|
<div class="item_content">未知</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">IMO:</div> |
|
|
<div class="item_title">IMO:</div> |
|
|
<div class="item_content">{{ infoData.imo }}</div> |
|
|
<div class="item_content">{{ infoData.imo }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">航速:</div> |
|
|
<div class="item_title">航速:</div> |
|
|
<div class="item_content">0.2节</div> |
|
|
<div class="item_content">0.2节</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">经度:</div> |
|
|
<div class="item_title">经度:</div> |
|
|
<div class="item_content">{{ infoData.longitude }}</div> |
|
|
<div class="item_content">{{ infoData.longitude }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">纬度:</div> |
|
|
<div class="item_title">纬度:</div> |
|
|
<div class="item_content">{{ infoData.latitude }}</div> |
|
|
<div class="item_content">{{ infoData.latitude }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">状态:</div> |
|
|
<div class="item_title">状态:</div> |
|
|
<div class="item_content">锚泊</div> |
|
|
<div class="item_content">锚泊</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">类型:</div> |
|
|
<div class="item_title">类型:</div> |
|
|
<div class="item_content">货船</div> |
|
|
<div class="item_content">货船</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">船长/宽:</div> |
|
|
<div class="item_title">船长/宽:</div> |
|
|
<div class="item_content">89米/20米</div> |
|
|
<div class="item_content">89米/20米</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">目的地:</div> |
|
|
<div class="item_title">目的地:</div> |
|
|
<div class="item_content">JIANGMEN,CN</div> |
|
|
<div class="item_content">JIANGMEN,CN</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">吃水:</div> |
|
|
<div class="item_title">吃水:</div> |
|
|
<div class="item_content">3.8米</div> |
|
|
<div class="item_content">3.8米</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">国籍:</div> |
|
|
<div class="item_title">国籍:</div> |
|
|
<div class="item_content">CN</div> |
|
|
<div class="item_content">CN</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">预到时间:</div> |
|
|
<div class="item_title">预到时间:</div> |
|
|
<div class="item_content">2024-01-08 17:00:00</div> |
|
|
<div class="item_content">2024-01-08 17:00:00</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">更新时间:</div> |
|
|
<div class="item_title">更新时间:</div> |
|
|
<div class="item_content"> 2024-01-08 14:40:11</div> |
|
|
<div class="item_content"> 2024-01-08 14:40:11</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="radar_content" v-if="title.includes('雷达')"> |
|
|
<div class="radar_content" v-if="title.includes('雷达')"> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">雷达ID:</div> |
|
|
<div class="item_title">目标号:</div> |
|
|
|
|
|
<div class="item_content">{{ infoData.trackId }}</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="content_item"> |
|
|
|
|
|
<div class="item_title">雷达编号:</div> |
|
|
<div class="item_content">{{ infoData.radarId }}</div> |
|
|
<div class="item_content">{{ infoData.radarId }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">时间:</div> |
|
|
<div class="item_title">时间:</div> |
|
|
<div class="item_content">{{ infoData.timestamp }}</div> |
|
|
<div class="item_content">{{ infoData.timestamp }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">距离:</div> |
|
|
<div class="item_title">距离:</div> |
|
|
<div class="item_content">{{ infoData.dis }}m</div> |
|
|
<div class="item_content">{{ infoData.dis }}m</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">方位角:</div> |
|
|
<div class="item_title">方位角:</div> |
|
|
<div class="item_content">{{ infoData.azimuth }}°</div> |
|
|
<div class="item_content">{{ infoData.azimuth }}°</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">速度:</div> |
|
|
<div class="item_title">速度:</div> |
|
|
<div class="item_content">{{ infoData.speed }}m/s</div> |
|
|
<div class="item_content">{{ infoData.speed }}m/s</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">航向:</div> |
|
|
<div class="item_title">航向:</div> |
|
|
<div class="item_content">{{ infoData.course }}°</div> |
|
|
<div class="item_content">{{ infoData.course }}°</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">经度:</div> |
|
|
<div class="item_title">经度:</div> |
|
|
<div class="item_content">{{ infoData.longitude }}</div> |
|
|
<div class="item_content">{{ infoData.longitude }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">纬度:</div> |
|
|
<div class="item_title">纬度:</div> |
|
|
<div class="item_content">{{ infoData.latitude }}</div> |
|
|
<div class="item_content">{{ infoData.latitude }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">海拔:</div> |
|
|
<div class="item_title">海拔:</div> |
|
|
<div class="item_content">{{ infoData.altitude }}m</div> |
|
|
<div class="item_content">{{ infoData.altitude }}m</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">类型:</div> |
|
|
<div class="item_title">类型:</div> |
|
|
<div class="item_content">{{ infoData.type }}</div> |
|
|
<div class="item_content">{{ infoData.type }}</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="opera_content"> |
|
|
<div class="opera_content"> |
|
|
<!-- 轨迹显示 --> |
|
|
<!-- 轨迹显示 --> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">航行轨迹:</div> |
|
|
<div class="item_title">航行轨迹:</div> |
|
|
<a-switch v-model:checked="checked" @change="changeTrack" /> |
|
|
<a-switch v-model:checked="checked" @change="changeTrack" /> |
|
|
</div> |
|
|
</div> |
|
|
<!-- 跟踪船只 --> |
|
|
<!-- 跟踪船只 --> |
|
|
<div class="content_item"> |
|
|
<div class="content_item"> |
|
|
<div class="item_title">跟踪船只:</div> |
|
|
<!-- <div class="item_title">跟踪船只:</div> --> |
|
|
<a-button size="small" type="primary" @click="tailAfter()"> |
|
|
<a-button class="tail_button" size="small" type="primary" @click="tailAfter()"> |
|
|
跟踪 |
|
|
跟踪 |
|
|
<EyeOutlined /> |
|
|
<EyeOutlined /> |
|
|
</a-button> |
|
|
</a-button> |
|
@ -154,13 +159,11 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
<script lang="ts"> |
|
|
import { defineComponent, getCurrentInstance, ref, watch } from 'vue'; |
|
|
import { defineComponent, getCurrentInstance, ref, watch, onMounted, onUnmounted, nextTick } from 'vue'; |
|
|
import Window from '@/components/earthMap/components/Window.vue'; |
|
|
import Window from '@/components/earthMap/components/Window.vue'; |
|
|
import { useEarthMapStore } from '/@/store/modules/earthMap'; |
|
|
import { useEarthMapStore } from '/@/store/modules/earthMap'; |
|
|
import $mitt from '@/utils/earthMap/mitt'; |
|
|
import $mitt from '@/utils/earthMap/mitt'; |
|
|
import { EyeOutlined } from '@ant-design/icons-vue'; |
|
|
import { EyeOutlined } from '@ant-design/icons-vue'; |
|
|
import { defHttp } from '/@/utils/http/axios'; |
|
|
|
|
|
import { info } from 'console'; |
|
|
|
|
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
export default defineComponent({ |
|
|
name: 'AISInfoWindow', |
|
|
name: 'AISInfoWindow', |
|
@ -226,46 +229,38 @@ |
|
|
// 关闭弹窗 |
|
|
// 关闭弹窗 |
|
|
function cancel() { |
|
|
function cancel() { |
|
|
proxy.$parent.AISInfoWindowShow = false; |
|
|
proxy.$parent.AISInfoWindowShow = false; |
|
|
|
|
|
// 同时打开场景树结构 |
|
|
|
|
|
window.$uia.tools.sceneTree.show = true; |
|
|
} |
|
|
} |
|
|
// 打开或关闭轨迹 |
|
|
// 打开或关闭轨迹 |
|
|
function changeTrack(e) { |
|
|
function changeTrack(e) { |
|
|
checked.value = e; |
|
|
checked.value = e; |
|
|
// 使用show字段控制轨迹显隐 |
|
|
// 使用show字段控制轨迹显隐+ |
|
|
trackData.value.show = e; |
|
|
trackData.value.show = e; |
|
|
} |
|
|
} |
|
|
// 跟踪船只 |
|
|
// 跟踪船只 |
|
|
function tailAfter() { |
|
|
function tailAfter() { |
|
|
|
|
|
// 通过mqtt发送跟踪船只的信息 |
|
|
|
|
|
let mqttClient = window.mqttClient; |
|
|
|
|
|
// 设置跟踪状态 1-跟踪 0-停止跟踪 |
|
|
|
|
|
infoData.value.trackStatus = 1; |
|
|
|
|
|
// 发布订阅 |
|
|
|
|
|
mqttClient.publish('/trackTarget', JSON.stringify(infoData.value)); |
|
|
// 打开光电跟踪窗口 |
|
|
// 打开光电跟踪窗口 |
|
|
proxy.$parent.TailAfterWindowShow = true; |
|
|
proxy.$parent.TailAfterWindowShow = true; |
|
|
|
|
|
// 关闭当前窗口 |
|
|
|
|
|
proxy.$parent.AISInfoWindowShow = false; |
|
|
|
|
|
} |
|
|
|
|
|
// 取消跟踪 |
|
|
|
|
|
function cancelTailAfter() { |
|
|
// 通过mqtt发送跟踪船只的信息 |
|
|
// 通过mqtt发送跟踪船只的信息 |
|
|
let mqttClient = window.mqttClient; |
|
|
let mqttClient = window.mqttClient; |
|
|
// 设置跟踪状态 1-跟踪 0-停止跟踪 |
|
|
// 设置跟踪状态 1-跟踪 0-停止跟踪 |
|
|
infoData.value.trackStatus = 1; |
|
|
infoData.value.trackStatus = 0; |
|
|
// 发布订阅 |
|
|
// 发布订阅 |
|
|
mqttClient.publish('/trackTarget', JSON.stringify(infoData.value)); |
|
|
mqttClient.publish('/trackTarget', JSON.stringify(infoData.value)); |
|
|
} |
|
|
} |
|
|
// 监听轨迹线变化 |
|
|
|
|
|
$mitt.on('trackChange', (e: boolean) => { |
|
|
|
|
|
// 当前船只轨迹线状态 |
|
|
|
|
|
if (trackData.value.name.includes(e)) { |
|
|
|
|
|
checked.value = false; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
// 监听开关轨迹变化 |
|
|
|
|
|
$mitt.on('trackAllChange', (data: any) => { |
|
|
|
|
|
if (trackData.value.name.includes(data.type)) { |
|
|
|
|
|
checked.value = data.status; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
// 实时监听船只信息变化(雷达) |
|
|
|
|
|
$mitt.on('deviceCmd', (message: any) => { |
|
|
|
|
|
let data = JSON.parse(message).radarTrack; |
|
|
|
|
|
if (data.trackId == trackId.value) { |
|
|
|
|
|
if (proxy.title.includes('雷达')) { |
|
|
|
|
|
infoData.value = data; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
// 监听船只guid变化,更新信息 |
|
|
// 监听船只guid变化,更新信息 |
|
|
watch( |
|
|
watch( |
|
|
() => proxy.ship_guid, |
|
|
() => proxy.ship_guid, |
|
@ -276,42 +271,94 @@ |
|
|
{ immediate: true } |
|
|
{ immediate: true } |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 时间戳转化为年月日时分秒 |
|
|
|
|
|
* @param timestamp 时间戳 |
|
|
|
|
|
*/ |
|
|
|
|
|
function toStringTime(timestamp) { |
|
|
|
|
|
let date = new Date(timestamp); |
|
|
|
|
|
let year = date.getFullYear(); |
|
|
|
|
|
let month = ('0' + (date.getMonth() + 1)).slice(-2); |
|
|
|
|
|
let day = ('0' + date.getDate()).slice(-2); |
|
|
|
|
|
let hour = ('0' + date.getHours()).slice(-2); |
|
|
|
|
|
let minute = ('0' + date.getMinutes()).slice(-2); |
|
|
|
|
|
let second = ('0' + date.getSeconds()).slice(-2); |
|
|
|
|
|
|
|
|
|
|
|
let datetime = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second; |
|
|
|
|
|
return datetime; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
|
// 监听轨迹线变化 |
|
|
|
|
|
$mitt.on('trackChange', (e: boolean) => { |
|
|
|
|
|
// 当前船只轨迹线状态 |
|
|
|
|
|
if (trackData.value.name.includes(e)) { |
|
|
|
|
|
checked.value = false; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
// 监听开关轨迹变化 |
|
|
|
|
|
$mitt.on('trackAllChange', (data: any) => { |
|
|
|
|
|
if (trackData.value.name.includes(data.type)) { |
|
|
|
|
|
checked.value = data.status; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
// 实时监听船只信息变化(雷达) |
|
|
|
|
|
$mitt.on('deviceCmd', (message: any) => { |
|
|
|
|
|
let data = JSON.parse(message).radarTrack; |
|
|
|
|
|
data.timestamp = toStringTime(data.timestamp); |
|
|
|
|
|
if (data.trackId == trackId.value) { |
|
|
|
|
|
if (proxy.title.includes('雷达')) { |
|
|
|
|
|
infoData.value = data; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
/** |
|
|
|
|
|
* 后续补充监听AIS数据、融合数据 |
|
|
|
|
|
*/ |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
checked, |
|
|
checked, |
|
|
infoData, |
|
|
infoData, |
|
|
cancel, |
|
|
cancel, |
|
|
changeTrack, |
|
|
changeTrack, |
|
|
tailAfter, |
|
|
tailAfter, |
|
|
|
|
|
cancelTailAfter, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
<style lang="less" scoped> |
|
|
#aisInfoWindow .xbsj-model-header .xbsj-model-arrow { |
|
|
.fuckWindow { |
|
|
right: 25px; |
|
|
width: 280px !important; |
|
|
|
|
|
left: calc(100% - 280px) !important; |
|
|
|
|
|
top: 6px !important; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.ais_content, |
|
|
.ais_content, |
|
|
.radar_content, |
|
|
.radar_content, |
|
|
.opera_content { |
|
|
.opera_content { |
|
|
width: 95%; |
|
|
width: 100%; |
|
|
margin: 0 auto; |
|
|
// margin: 0 auto; |
|
|
display: flex; |
|
|
|
|
|
flex-direaction: row; |
|
|
|
|
|
flex-wrap: wrap; |
|
|
flex-wrap: wrap; |
|
|
|
|
|
font-size: 14px; |
|
|
.content_item { |
|
|
.content_item { |
|
|
width: 50%; |
|
|
width: 100%; |
|
|
margin: 6px 0; |
|
|
margin: 10px 0; |
|
|
display: flex; |
|
|
display: flex; |
|
|
flex-direaction: row; |
|
|
flex-direaction: row; |
|
|
font-size: 14px; |
|
|
.tail_button { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: 26px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.item_title { |
|
|
.item_title { |
|
|
color: #fff; |
|
|
color: #fff; |
|
|
margin-right: 4px; |
|
|
// margin-right: 12px; |
|
|
} |
|
|
} |
|
|
.item_content { |
|
|
.item_content { |
|
|
color: #00ffe4; |
|
|
color: #00ffe4; |
|
|
|
|
|
// font-weight: bold; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|