|
|
@@ -245,7 +245,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
// 遥控器信号
|
|
|
const controllerSignal = computed(() => {
|
|
|
const info = props.deviceInfo?.gateway;
|
|
|
- if (info && info.wireless_link) {
|
|
|
+ if (info?.wireless_link) {
|
|
|
return info.wireless_link['4g_gnd_quality'];
|
|
|
} else {
|
|
|
return 0;
|
|
|
@@ -255,7 +255,7 @@ const controllerSignal = computed(() => {
|
|
|
// 飞机信号
|
|
|
const aircraftSignal = computed(() => {
|
|
|
const info = props.deviceInfo?.gateway;
|
|
|
- if (info && info.wireless_link) {
|
|
|
+ if (info?.wireless_link) {
|
|
|
return info.wireless_link['4g_uav_quality'];
|
|
|
} else {
|
|
|
return 0;
|
|
|
@@ -264,7 +264,7 @@ const aircraftSignal = computed(() => {
|
|
|
|
|
|
const RTK = computed(() => {
|
|
|
const info = props.deviceInfo?.device;
|
|
|
- if (info) {
|
|
|
+ if (info?.position_state) {
|
|
|
return info.position_state.rtk_number;
|
|
|
} else {
|
|
|
return 0;
|
|
|
@@ -273,7 +273,7 @@ const RTK = computed(() => {
|
|
|
|
|
|
const GPS = computed(() => {
|
|
|
const info = props.deviceInfo?.device;
|
|
|
- if (info) {
|
|
|
+ if (info?.position_state) {
|
|
|
return info.position_state.gps_number;
|
|
|
} else {
|
|
|
return 0;
|
|
|
@@ -283,7 +283,7 @@ const GPS = computed(() => {
|
|
|
// 电池容量
|
|
|
const capacity = computed(() => {
|
|
|
const info = props.deviceInfo?.device;
|
|
|
- if (info) {
|
|
|
+ if (info?.battery) {
|
|
|
return info.battery.capacity_percent;
|
|
|
} else {
|
|
|
return 0;
|
|
|
@@ -292,7 +292,7 @@ const capacity = computed(() => {
|
|
|
|
|
|
const windDirection = computed(() => {
|
|
|
const info = props.deviceInfo?.device;
|
|
|
- if (info) {
|
|
|
+ if (info?.wind_direction) {
|
|
|
return getWindDirection(info.wind_direction);
|
|
|
} else {
|
|
|
return '';
|
|
|
@@ -301,66 +301,66 @@ const windDirection = computed(() => {
|
|
|
|
|
|
const windSpeed = computed(() => {
|
|
|
const info = props.deviceInfo?.device;
|
|
|
- if (info) {
|
|
|
+ if (info?.wind_speed) {
|
|
|
if (info.wind_speed === '--') {
|
|
|
return info.wind_speed;
|
|
|
} else {
|
|
|
return (info.wind_speed / 10).toFixed(2) + ' m/s';
|
|
|
}
|
|
|
} else {
|
|
|
- return '--';
|
|
|
+ return 0 + ' m/s';
|
|
|
}
|
|
|
});
|
|
|
|
|
|
const ASL = computed(() => {
|
|
|
const info = props.deviceInfo?.device;
|
|
|
- if (info) {
|
|
|
+ if (info?.height) {
|
|
|
if (info.height === '--') {
|
|
|
return info.height;
|
|
|
} else {
|
|
|
return info.height.toFixed(2) + ' m';
|
|
|
}
|
|
|
} else {
|
|
|
- return '--';
|
|
|
+ return 0 + ' m';
|
|
|
}
|
|
|
});
|
|
|
|
|
|
const AGL = computed(() => {
|
|
|
const info = props.deviceInfo?.device;
|
|
|
- if (info) {
|
|
|
+ if (info?.elevation) {
|
|
|
if (info.elevation === '--') {
|
|
|
return info.elevation;
|
|
|
} else {
|
|
|
return info.elevation.toFixed(2) + ' m';
|
|
|
}
|
|
|
} else {
|
|
|
- return '--';
|
|
|
+ return 0 + ' m';
|
|
|
}
|
|
|
});
|
|
|
|
|
|
const HS = computed(() => {
|
|
|
const info = props.deviceInfo?.device;
|
|
|
- if (info) {
|
|
|
+ if (info?.horizontal_speed) {
|
|
|
if (info.horizontal_speed === '--') {
|
|
|
return info.horizontal_speed;
|
|
|
} else {
|
|
|
return info.horizontal_speed.toFixed(2) + ' m/s';
|
|
|
}
|
|
|
} else {
|
|
|
- return '--';
|
|
|
+ return 0 + ' m/s';
|
|
|
}
|
|
|
});
|
|
|
|
|
|
const homeDistance = computed(() => {
|
|
|
const info = props.deviceInfo?.device;
|
|
|
- if (info) {
|
|
|
+ if (info?.home_distance) {
|
|
|
if (info.home_distance === '--') {
|
|
|
return info.home_distance;
|
|
|
} else {
|
|
|
return info.home_distance.toFixed(2) + ' m';
|
|
|
}
|
|
|
} else {
|
|
|
- return '--';
|
|
|
+ return 0 + ' m';
|
|
|
}
|
|
|
});
|
|
|
|