Browse Source

在线设备详情

李富豪 1 year ago
parent
commit
70afac9790

+ 183 - 41
Web/src/components/onLineDevice/components/InfoModal.vue

@@ -11,7 +11,7 @@
     <div class="content-osd">
       <div class="content-osd-head">
         <div class="content-osd-head-icon">
-          <a-image style="width: 80%;" :src="M30" :preview="false" />
+          <a-image style="width: 80%;" :src="M30Src" :preview="false" />
           <div class="content-osd-head-icon-text">
             {{ osdInfo.model }}
           </div>
@@ -64,73 +64,115 @@
       </div>
       <LivePlayer :text="state.playerText" :url="state.playerUrl" v-if="state.deviceLiveStatus" />
       <div class="content-osd-info">
-        <a-row>
+        <a-row style="margin-bottom: 5px;">
           <a-col span="6">
-            <a-tooltip title="GPS卫星数">
-              <span>
-                GPS
-                <WifiOutlined />
-              </span>
-              <span class="ml10">{{ deviceInfo.device.position_state.gps_number }}</span>
-            </a-tooltip>
+            <div class="content-osd-info-item">
+              <a-tooltip title="遥控器信号">
+                <div style="display: flex;align-items: center;">
+                  <img style="margin-right: 5px;" :src="controllerSrc">
+                  <div>
+                    <img :src="signalThreeSrc" v-if="controllerSignal <= 3">
+                    <img :src="signalFourSrc" v-else-if="controllerSignal === 4">
+                    <img :src="signalFiveSrc" v-else-if="controllerSignal === 5">
+                  </div>
+                </div>
+              </a-tooltip>
+              <a-tooltip title="飞行器信号">
+                <div style="display: flex;align-items: center;">
+                  <img style="margin-right: 5px;" :src="networkSrc">
+                  <div>
+                    <img :src="signalThreeSrc" v-if="aircraftSignal <= 3">
+                    <img :src="signalFourSrc" v-else-if="aircraftSignal === 4">
+                    <img :src="signalFiveSrc" v-else-if="aircraftSignal === 5">
+                  </div>
+                </div>
+              </a-tooltip>
+            </div>
           </a-col>
           <a-col span="6">
             <a-tooltip title="RTK">
-              <span>
-                RTK
-              </span>
-              <span class="ml10">{{ deviceInfo.device.position_state.rtk_number }}</span>
+              <div class="content-osd-info-item">
+                <div style="margin-right: 5px;">
+                  RTK
+                </div>
+                <img style="margin-right: 5px;" :src="gpsSrc">
+                <div>
+                  {{ RTK }}
+                </div>
+              </div>
             </a-tooltip>
           </a-col>
           <a-col span="6">
             <a-tooltip title="电量">
-              <span>电量</span>
-              <span class="ml10">
-                {{ deviceInfo.device.battery.capacity_percent + '%' }}
-              </span>
+              <div class="content-osd-info-item">
+                <div style="margin-right: 5px;">
+                  <img :src="batteryOneSrc" v-if="capacity >= 75 && capacity < 100">
+                  <img :src="batteryTwoSrc" v-else-if="capacity >= 50 && capacity < 75">
+                  <img :src="batteryThreeSrc" v-else-if="capacity >= 25 && capacity < 50">
+                  <img :src="batteryFourSrc" v-else-if="capacity < 25">
+                </div>
+                <div>
+                  {{ capacity + '%' }}
+                </div>
+              </div>
             </a-tooltip>
           </a-col>
           <a-col span="6">
             <a-tooltip title="风向速度">
-              <span>W.S</span>
-              <span class="ml10">{{ deviceInfo.device.wind_speed === str ? str : (deviceInfo.device.wind_speed /
-                10).toFixed(2) + ' m/s' }}</span>
+              <div class="content-osd-info-item">
+                <img style="margin-right: 5px;" :src="windSrc">
+                <div>
+                  {{ windSpeed }}
+                </div>
+              </div>
             </a-tooltip>
           </a-col>
         </a-row>
         <a-row>
           <a-col span="6">
             <a-tooltip title="海拔高度">
-              <span>ASL</span>
-              <span class="ml10">
-                {{ deviceInfo.device.height === str ? str : deviceInfo.device.height.toFixed(2) + ' m' }}
-              </span>
+              <div class="content-osd-info-item">
+                <div style="margin-right: 5px;">
+                  ASL
+                </div>
+                <div>
+                  {{ ASL }}
+                </div>
+              </div>
             </a-tooltip>
           </a-col>
           <a-col span="6">
             <a-tooltip title="离地高度">
-              <span>ALT</span>
-              <span class="ml10">
-                {{ deviceInfo.device.elevation === str ? str : deviceInfo.device.elevation.toFixed(2) + ' m' }}
-              </span>
+              <div class="content-osd-info-item">
+                <div style="margin-right: 5px;">
+                  AGL
+                </div>
+                <div>
+                  {{ AGL }}
+                </div>
+              </div>
             </a-tooltip>
           </a-col>
           <a-col span="6">
             <a-tooltip title="水平速度">
-              <span>H.S</span>
-              <span class="ml10">
-                {{ deviceInfo.device.horizontal_speed === str ? str :
-                  deviceInfo.device.horizontal_speed.toFixed(2) + ' m/s' }}
-              </span>
+              <div class="content-osd-info-item">
+                <div style="margin-right: 5px;">
+                  H.S
+                </div>
+                <div>
+                  {{ HS }}
+                </div>
+              </div>
             </a-tooltip>
           </a-col>
           <a-col span="6">
             <a-tooltip title="当前高度">
-              <span>H</span>
-              <span class="ml10">
-                {{ deviceInfo.device.home_distance === str ? str : deviceInfo.device.home_distance.toFixed(2) + ' m'
-                }}
-              </span>
+              <div class="content-osd-info-item">
+                <img style="margin-right: 5px;" :src="homeSrc">
+                <div>
+                  {{ homeDistance }}
+                </div>
+              </div>
             </a-tooltip>
           </a-col>
         </a-row>
@@ -140,11 +182,23 @@
 </template>
 
 <script lang="ts" setup>
-import { h, reactive, onMounted } from 'vue';
+import { h, computed, reactive, onMounted } from 'vue';
 import { message } from 'ant-design-vue';
 import { CloseOutlined, PlaySquareOutlined, PoweroffOutlined } from '@ant-design/icons-vue'
 import LivePlayer from '/@/components/livePlayer/index.vue';
-import M30 from '/@/assets/icons/m30.png'
+import M30Src from '/@/assets/icons/m30.png';
+import controllerSrc from '../icons/info/controller.svg';
+import networkSrc from '../icons/info/network.svg';
+import signalThreeSrc from '../icons/info/signalThree.svg';
+import signalFourSrc from '../icons/info/signalFour.svg';
+import signalFiveSrc from '../icons/info/signalFive.svg';
+import gpsSrc from '../icons/info/gps.svg';
+import batteryOneSrc from '../icons/batteryOne.svg';
+import batteryTwoSrc from '../icons/batteryTwo.svg';
+import batteryThreeSrc from '../icons/batteryThree.svg';
+import batteryFourSrc from '../icons/batteryFour.svg';
+import windSrc from '../icons/info/wind.svg';
+import homeSrc from '../icons/info/home.svg';
 import { CURRENT_CONFIG as config } from '/@/api/http/config';
 import { getLiveCapacity, startLivestream, stopLivestream } from '/@/api/manage';
 import { getTextByModeCode } from '/@/utils/index'
@@ -159,7 +213,85 @@ const props = withDefaults(defineProps<Props>(), {
 
 });
 
-const str: string = '--';
+// 遥控器信号
+const controllerSignal = computed(() => {
+  const info = props.deviceInfo.gateway;
+  if (info && info.wireless_link) {
+    return info.wireless_link['4g_gnd_quality'];
+  } else {
+    return 0;
+  }
+});
+
+// 飞机信号
+const aircraftSignal = computed(() => {
+  const info = props.deviceInfo.gateway;
+  if (info && info.wireless_link) {
+    return info.wireless_link['4g_uav_quality'];
+  } else {
+    return 0;
+  }
+});
+
+const RTK = computed(() => {
+  const info = props.deviceInfo.device;
+  return info.position_state.rtk_number;
+});
+
+// 电池容量
+const capacity = computed(() => {
+  const info = props.deviceInfo.device;
+  if (info) {
+    return info.battery.capacity_percent;
+  } else {
+    return 0;
+  }
+});
+
+const windSpeed = computed(() => {
+  const info = props.deviceInfo.device;
+  if (info.wind_speed === '--') {
+    return info.wind_speed;
+  } else {
+    return (info.wind_speed / 10).toFixed(2) + ' m/s';
+  }
+});
+
+const ASL = computed(() => {
+  const info = props.deviceInfo.device;
+  if (info.height === '--') {
+    return info.height;
+  } else {
+    return info.height.toFixed(2) + ' m';
+  }
+});
+
+const AGL = computed(() => {
+  const info = props.deviceInfo.device;
+  if (info.elevation === '--') {
+    return info.elevation;
+  } else {
+    return info.elevation.toFixed(2) + ' m';
+  }
+});
+
+const HS = computed(() => {
+  const info = props.deviceInfo.device;
+  if (info.horizontal_speed === '--') {
+    return info.horizontal_speed;
+  } else {
+    return info.horizontal_speed.toFixed(2) + ' m/s';
+  }
+});
+
+const homeDistance = computed(() => {
+  const info = props.deviceInfo.device;
+  if (info.home_distance === '--') {
+    return info.home_distance;
+  } else {
+    return info.home_distance.toFixed(2) + ' m';
+  }
+});
 
 interface SelectOption {
   value: any,
@@ -402,6 +534,16 @@ const onStop = async () => {
 
     &-info {
       padding: 5px;
+
+      &-item {
+        display: flex;
+        align-items: center;
+
+        img {
+          width: 13px;
+          height: 13px;
+        }
+      }
     }
   }
 }

+ 11 - 0
Web/src/components/onLineDevice/icons/info/controller.svg

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>Icons/rc_controller</title>
+    <g id="Icons/rc_controller" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="controller" fill="#F0F1F0">
+            <path d="M10,0 L10,12 L22,12 L22,0 L26,0 L26,12 L32,12 L32,32 L0,32 L0,12 L6,12 L6,0 L10,0 Z M8,16 C4.6862915,16 2,18.6862915 2,22 C2,25.3137085 4.6862915,28 8,28 C11.3137085,28 14,25.3137085 14,22 C14,18.6862915 11.3137085,16 8,16 Z M24,16 C20.6862915,16 18,18.6862915 18,22 C18,25.3137085 20.6862915,28 24,28 C27.3137085,28 30,25.3137085 30,22 C30,18.6862915 27.3137085,16 24,16 Z" id="形状结合"></path>
+            <circle id="椭圆形" cx="8" cy="22" r="4"></circle>
+            <circle id="椭圆形" cx="24" cy="22" r="4"></circle>
+        </g>
+    </g>
+</svg>

+ 10 - 0
Web/src/components/onLineDevice/icons/info/gps.svg

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>Icons/GPS</title>
+    <g id="Icons/GPS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="GPS" transform="translate(15.604200, 15.715800) scale(-1, 1) translate(-15.604200, -15.715800) translate(1.000000, 1.000000)" fill="#FFFFFF" fill-rule="nonzero">
+            <path d="M23.6084,16.6316 C24.0502278,16.6316 24.4084,16.9897722 24.4084,17.4316 C24.4084,21.4080502 21.1848502,24.6316 17.2084,24.6316 C16.7665722,24.6316 16.4084,24.2734278 16.4084,23.8316 C16.4084,23.3897722 16.7665722,23.0316 17.2084,23.0316 C20.3011946,23.0316 22.8084,20.5243946 22.8084,17.4316 C22.8084,16.9897722 23.1665722,16.6316 23.6084,16.6316 L23.6084,16.6316 Z" id="路径"></path>
+            <path d="M28.4084,16.6316 C28.8502278,16.6316 29.2084,16.9897722 29.2084,17.4316 C29.2084,24.059017 23.835817,29.4316 17.2084,29.4316 C16.7665722,29.4316 16.4084,29.0734278 16.4084,28.6316 C16.4084,28.1897722 16.7665722,27.8316 17.2084,27.8316 C22.9521614,27.8316 27.6084,23.1753614 27.6084,17.4316 C27.6084,16.9897722 27.9665722,16.6316 28.4084,16.6316 L28.4084,16.6316 Z M20.9428,0.3804 C21.4468,-0.1268 22.1188,-0.1268 22.6228,0.3804 L27.9972,5.7852 C28.4996,6.2924 28.4996,6.9692 27.9972,7.4748 L22.6564,12.7116 C22.1524,13.2188 21.482,13.2188 20.9764,12.7116 L19.13,10.854 L18.122,11.8668 L19.97,13.7244 C20.474,14.2316 20.474,14.9084 19.97,15.414 L15.4356,19.974 C14.9316,20.4812 14.2596,20.4812 13.7556,19.974 L11.9092,18.118 L10.7332,19.2988 L12.5812,21.1564 C13.0852,21.6636 13.0852,22.3404 12.7492,22.6764 L7.5972,27.7708 C7.0948,28.2764 6.4228,28.2764 5.9188,27.7708 L0.378,22.534 C-0.126,22.0268 -0.126,21.35 0.378,20.8444 L5.5284,15.7516 C6.0324,15.2444 6.7028,15.2444 7.2084,15.7516 L9.0548,17.6092 L10.2292,16.4268 L3.6804,9.8396 C3.1764,9.3324 3.1764,8.6572 3.6804,8.15 L8.2164,3.5916 C8.7204,3.0844 9.3924,3.0844 9.8964,3.5916 L16.2772,10.3484 L17.2852,9.334 L15.4372,7.478 C14.9332,6.9692 14.9332,6.294 15.4372,5.7868 L20.9428,0.3804 Z M11.1636,7.8316 L7.8164,11.0988 L9.0868,12.3036 L12.4084,9.1244 L11.1636,7.8316 Z" id="形状"></path>
+        </g>
+    </g>
+</svg>

+ 10 - 0
Web/src/components/onLineDevice/icons/info/home.svg

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>Icons/Home</title>
+    <g id="Icons/Home" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <circle id="椭圆形" stroke="#C7A443" stroke-width="2" cx="16" cy="16" r="14"></circle>
+        <g id="H" transform="translate(8.000000, 6.000000)" fill="#C7A443" fill-rule="nonzero">
+            <polygon id="路径" points="0 0 0 20 3.1409396 20 3.1409396 11.1484594 12.8590604 11.1484594 12.8590604 20 16 20 16 0 12.8590604 0 12.8590604 8.34733894 3.1409396 8.34733894 3.1409396 0"></polygon>
+        </g>
+    </g>
+</svg>

+ 10 - 0
Web/src/components/onLineDevice/icons/info/network.svg

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>Icons/4G</title>
+    <g id="Icons/4G" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="4G" transform="translate(0.000000, 11.000000)" fill="#FFFFFF" fill-rule="nonzero">
+            <path d="M24.0961265,0 C26.4556952,0 28.3037969,0.562613943 29.6336116,1.68784183 C30.9634264,2.81306972 31.7544957,4.45317463 32,6.60474669 L28.0071459,6.60474669 C27.8230177,5.46587965 27.4206634,4.63048322 26.7966734,4.10196711 C26.1726834,3.57345101 25.3134185,3.31089779 24.2188786,3.31089779 C22.8208682,3.31089779 21.763836,3.83259435 21.030733,4.87939729 C20.3044495,5.92960996 19.9327833,7.49128993 19.9259638,9.5576175 L19.9259638,10.8294659 C19.9259638,12.919662 20.3214984,14.4949811 21.1125677,15.5622427 C21.9070468,16.6295043 23.0697823,17.1648399 24.6007742,17.1648399 C26.1419954,17.1648399 27.239945,16.8340911 27.8980329,16.1760033 L27.8980329,12.749173 L24.1643222,12.749173 L24.1643222,9.72810655 L32,9.72810655 L32,17.6728974 C31.2600774,18.5594405 30.2166843,19.2413969 28.8698206,19.7289956 C27.4279346,20.2315468 25.9093753,20.4784858 24.3825481,20.4586888 C22.6606085,20.4586888 21.1500753,20.0836129 19.8475388,19.333461 C18.5378088,18.5691535 17.4895385,17.4269906 16.8401116,16.0566609 C16.1342868,14.6245527 15.7728499,12.9401207 15.7523912,11.0101844 L15.7523912,9.65650114 C15.7523912,7.66859851 16.0899596,5.94665892 16.7582768,4.49409201 C17.3629019,3.11192468 18.3737754,1.94644699 19.656591,1.15250611 C20.9182102,0.38530528 22.3980553,0 24.0961265,0 L24.0961265,0 Z" id="路径"></path>
+            <path d="M12.295672,0.272782491 L12.295672,12.6912066 L14.5495376,12.6912066 L14.5495376,15.8759425 L12.295672,15.8759425 L12.295672,20.1859064 L8.34032551,20.1859064 L8.34032551,15.8759425 L0.180718392,15.8759425 L0,13.386802 L8.29940814,0.272782491 L12.295672,0.272782491 Z M8.34373524,5.66023728 L8.34032551,5.66023728 L8.0811821,6.11373816 L3.9382976,12.6912066 L8.34373524,12.6912066 L8.34373524,5.66023728 Z" id="形状结合"></path>
+        </g>
+    </g>
+</svg>

+ 7 - 0
Web/src/components/onLineDevice/icons/info/signalFive.svg

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>Icons/rc_4G</title>
+    <g id="Icons/rc_4G" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <path d="M4,25 C4.55228475,25 5,25.4477153 5,26 L5,31 C5,31.5522847 4.55228475,32 4,32 L2,32 C1.44771525,32 1,31.5522847 1,31 L1,26 C1,25.4477153 1.44771525,25 2,25 L4,25 Z M10.5,20 C11.0522847,20 11.5,20.4477153 11.5,21 L11.5,31 C11.5,31.5522847 11.0522847,32 10.5,32 L8.5,32 C7.94771525,32 7.5,31.5522847 7.5,31 L7.5,21 C7.5,20.4477153 7.94771525,20 8.5,20 L10.5,20 Z M17,15 C17.5522847,15 18,15.4477153 18,16 L18,31 C18,31.5522847 17.5522847,32 17,32 L15,32 C14.4477153,32 14,31.5522847 14,31 L14,16 C14,15.4477153 14.4477153,15 15,15 L17,15 Z M23.5,10 C24.0522847,10 24.5,10.4477153 24.5,11 L24.5,31 C24.5,31.5522847 24.0522847,32 23.5,32 L21.5,32 C20.9477153,32 20.5,31.5522847 20.5,31 L20.5,11 C20.5,10.4477153 20.9477153,10 21.5,10 L23.5,10 Z M30,5 C30.5522847,5 31,5.44771525 31,6 L31,31 C31,31.5522847 30.5522847,32 30,32 L28,32 C27.4477153,32 27,31.5522847 27,31 L27,6 C27,5.44771525 27.4477153,5 28,5 L30,5 Z" id="形状结合" fill="#FFFFFF"></path>
+    </g>
+</svg>

+ 7 - 0
Web/src/components/onLineDevice/icons/info/signalFour.svg

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>Icons/rc_4G_4</title>
+    <g id="Icons/rc_4G_4" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <path d="M4,25 C4.55228475,25 5,25.4477153 5,26 L5,31 C5,31.5522847 4.55228475,32 4,32 L2,32 C1.44771525,32 1,31.5522847 1,31 L1,26 C1,25.4477153 1.44771525,25 2,25 L4,25 Z M10.5,20 C11.0522847,20 11.5,20.4477153 11.5,21 L11.5,31 C11.5,31.5522847 11.0522847,32 10.5,32 L8.5,32 C7.94771525,32 7.5,31.5522847 7.5,31 L7.5,21 C7.5,20.4477153 7.94771525,20 8.5,20 L10.5,20 Z M17,15 C17.5522847,15 18,15.4477153 18,16 L18,31 C18,31.5522847 17.5522847,32 17,32 L15,32 C14.4477153,32 14,31.5522847 14,31 L14,16 C14,15.4477153 14.4477153,15 15,15 L17,15 Z M23.5,10 C24.0522847,10 24.5,10.4477153 24.5,11 L24.5,31 C24.5,31.5522847 24.0522847,32 23.5,32 L21.5,32 C20.9477153,32 20.5,31.5522847 20.5,31 L20.5,11 C20.5,10.4477153 20.9477153,10 21.5,10 L23.5,10 Z" id="形状结合" fill="#FFFFFF"></path>
+    </g>
+</svg>

+ 7 - 0
Web/src/components/onLineDevice/icons/info/signalThree.svg

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>Icons/rc_4G_3</title>
+    <g id="Icons/rc_4G_3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <path d="M4,25 C4.55228475,25 5,25.4477153 5,26 L5,31 C5,31.5522847 4.55228475,32 4,32 L2,32 C1.44771525,32 1,31.5522847 1,31 L1,26 C1,25.4477153 1.44771525,25 2,25 L4,25 Z M10.5,20 C11.0522847,20 11.5,20.4477153 11.5,21 L11.5,31 C11.5,31.5522847 11.0522847,32 10.5,32 L8.5,32 C7.94771525,32 7.5,31.5522847 7.5,31 L7.5,21 C7.5,20.4477153 7.94771525,20 8.5,20 L10.5,20 Z M17,15 C17.5522847,15 18,15.4477153 18,16 L18,31 C18,31.5522847 17.5522847,32 17,32 L15,32 C14.4477153,32 14,31.5522847 14,31 L14,16 C14,15.4477153 14.4477153,15 15,15 L17,15 Z" id="形状结合" fill="#FFFFFF"></path>
+    </g>
+</svg>

File diff suppressed because it is too large
+ 5 - 0
Web/src/components/onLineDevice/icons/info/wind.svg


Some files were not shown because too many files changed in this diff