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