飞行作业画面机场图标有时不显示问题修改
parent
c0b7153688
commit
29e52e9fc9
|
|
@ -73,7 +73,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, onBeforeUnmount, reactive, watch } from 'vue';
|
||||
import { onMounted, ref, onBeforeUnmount, reactive, watch, computed } from 'vue';
|
||||
import {
|
||||
SelectComponent,
|
||||
AirportInformation,
|
||||
|
|
@ -122,12 +122,16 @@
|
|||
const connectCallback = () => {
|
||||
connected.value = true;
|
||||
};
|
||||
const topicUrl = computed(() => {
|
||||
return 'thing/product/' + airPortInfo.sn + '/osd'
|
||||
})
|
||||
const topicUAVUrl = computed(() => {
|
||||
return 'thing/product/' + UAVinfo.sn + '/osd'
|
||||
})
|
||||
onMounted(() => {
|
||||
destroyConnection();
|
||||
createConnection(connectCallback);
|
||||
setTimeout(() => {
|
||||
const topicUrl = 'thing/product/' + airPortInfo.sn + '/osd';
|
||||
const topicUAVUrl = 'thing/product/' + UAVinfo.sn + '/osd';
|
||||
// 接收消息
|
||||
getClient().on('message', (topic, message) => {
|
||||
const rs = JSON.parse(message);
|
||||
|
|
@ -137,11 +141,11 @@
|
|||
message: rs,
|
||||
};
|
||||
|
||||
if (topic == topicUAVUrl) {
|
||||
if (topic == topicUAVUrl.value) {
|
||||
if (rs.data.latitude && rs.data.longitude) {
|
||||
uavTrack.value = rs.data;
|
||||
}
|
||||
} else if (topic == topicUrl) {
|
||||
} else if (topic == topicUrl.value) {
|
||||
if (rs.data.latitude && rs.data.longitude) {
|
||||
airPort.value.latitude = rs.data.latitude;
|
||||
airPort.value.longitude = rs.data.longitude;
|
||||
|
|
|
|||
Loading…
Reference in New Issue