Browse Source

是否适合飞行

李富豪 1 year ago
parent
commit
a9534afa79

+ 23 - 3
Web/src/components/airport/components/InfoModal.vue

@@ -48,13 +48,15 @@
         </div>
         <div class="content-dock-info-cell">
           <div class="content-dock-info-cell-style">
-            <div v-if="1">
+            <div v-if="airworthiness">
               <img :src="weatherSrc">
               适合飞行
             </div>
             <div v-else>
-              <img :src="weatherSrc">
-              不适合飞行
+              <img :src="weatherErrorSrc">
+              <span style="color: #FF0000;">
+                不适合飞行
+              </span>
             </div>
           </div>
           <div class="content-dock-info-cell-row">
@@ -365,6 +367,7 @@ import dock2Src from '../icons/info/dock2.png';
 import M30Src from '../icons/info/m30.png';
 import M3tdSrc from '../icons/info/m3td.png';
 import weatherSrc from '../icons/info/weather.svg';
+import weatherErrorSrc from '../icons/info/weatherError.svg';
 import temperatureSrc from '../icons/info/temperature.svg';
 import networkSrc from '../icons/info/network.svg';
 import uploadSrc from '../icons/info/upload.svg';
@@ -413,6 +416,23 @@ const { dockControlPanelVisible, setDockControlPanelVisible, onCloseControlPanel
 
 const hmsInfo = computed(() => store.state.hmsInfo);
 
+// 适合飞行
+const airworthiness = computed(() => {
+  const info = props.deviceInfo?.dock?.basic_osd;
+  if (info) {
+    const { rainfall, wind_speed } = info;
+    if (rainfall === 3) {
+      return false;
+    }
+    if (wind_speed > 8) {
+      return false
+    }
+    return true;
+  } else {
+    return true;
+  }
+})
+
 // 飞行器告警信息
 const aircraftLogInfo = computed(() => {
   const hmsList = hmsInfo.value[props.osdInfo.sn] || [];

+ 1 - 0
Web/src/components/airport/icons/info/weatherError.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1726210901925" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16906" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M880.96 520.832s-0.064 0 0 0a164.672 164.672 0 0 0-156.928-214.08c-39.04 0-75.264 13.632-103.744 36.864a278.4 278.4 0 0 0-42.176-93.376 273.92 273.92 0 0 0-177.792-112.896 274.624 274.624 0 0 0-318.72 223.616 273.088 273.088 0 0 0 25.856 172.096l0.256-0.128-0.128 0.64A187.776 187.776 0 0 0 0 703.168a188.032 188.032 0 0 0 187.776 187.776h648.512a187.968 187.968 0 0 0 187.776-187.776 188.16 188.16 0 0 0-143.104-182.336z m-44.736 304.576H187.776a122.368 122.368 0 0 1-122.24-122.24c0-53.76 34.88-99.456 83.136-115.776l-0.064-0.064a40.512 40.512 0 0 0 47.36-38.976v-0.96a40.64 40.64 0 0 0-16-32.256h0.064a202.496 202.496 0 0 1-27.328-141.76 202.688 202.688 0 0 1 235.072-164.992 201.6 201.6 0 0 1 131.2 83.456 201.6 201.6 0 0 1 32.256 159.04 37.248 37.248 0 0 0 73.088 13.888 41.216 41.216 0 0 1 0.576-5.504 99.712 99.712 0 0 1 116.544-86.72 100.352 100.352 0 0 1 72.448 143.168h0.064a39.936 39.936 0 0 0-8.64 24.96c0 22.464 18.048 40.768 40.448 40.768l0.832-0.128-0.256 0.256c62.656 5.12 112.128 57.792 112.128 121.728a122.24 122.24 0 0 1-122.24 122.112z" fill="#FF0000" p-id="16907"></path><path d="M281.088 279.232c-30.016 12.928-61.056 29.504-76.864 59.584-14.336 27.264-7.744 58.944 3.072 86.08 9.664 24.256 49.344 13.696 39.488-10.88-7.424-18.56-15.04-39.552-5.12-58.56 11.072-21.12 39.616-32.064 60.032-40.896 24.256-10.368 3.392-45.632-20.608-35.328z" fill="#ffffff" p-id="16908"></path></svg>

+ 1 - 1
Web/src/pages/page-pilot/pilot-index.vue

@@ -19,7 +19,7 @@
       </a-form-item>
       <a-form-item>
         <a-button class="m0" type="primary" html-type="submit"
-          :disabled="formState.user === '' || formState.password === ''" @click="onSubmit">
+          :disabled="formState.username === '' || formState.password === ''" @click="onSubmit">
           登录
         </a-button>
       </a-form-item>