Browse Source

航班类型格式化条件修改

zhongxiaoyu 2 năm trước cách đây
mục cha
commit
09b79b0418

+ 1 - 1
src/views/dataQuery/components/DataQueryView/index.vue

@@ -404,7 +404,7 @@ const formatter: CommonTableFormatter = (row, column, cellValue, index) => {
     return value ? flightStateMap[value] ?? "正常" : "正常";
   }
   if (column.property === "flightType") {
-    return typeof cellValue === "number"
+    return cellValue
       ? flightTypeMap[cellValue] ?? "其他"
       : "其他";
   }

+ 3 - 4
src/views/realTime/components/AirportView/useAirportTable.ts

@@ -1106,10 +1106,9 @@ export function useAirportTable(name: string, formData: CommonData) {
         //       : null
         //   row.securityTime = row.addCargoTime
         // }
-        row.flightType =
-          typeof row.flightType === 'number'
-            ? flightTypeMap[row.flightType] ?? '其他'
-            : '其他'
+        row.flightType = row.flightType
+          ? flightTypeMap[row.flightType] ?? '其他'
+          : '其他'
 
         if (
           (name === 'DepartureAirport' ||

+ 2 - 6
src/views/realTime/components/FlightView/useFlightInfo.ts

@@ -30,9 +30,7 @@ const flightInfoItemsMap = {
       {
         label: '航班类型',
         getter: info =>
-          typeof info.flightType === 'number'
-            ? flightTypeMap[info.flightType] ?? '其他'
-            : '其他',
+          info.flightType ? flightTypeMap[info.flightType] ?? '其他' : '其他',
       },
       {
         label: '航班状态',
@@ -116,9 +114,7 @@ const flightInfoItemsMap = {
       {
         label: '航班类型',
         getter: info =>
-          typeof info.flightType === 'number'
-            ? flightTypeMap[info.flightType] ?? '其他'
-            : '其他',
+          info.flightType ? flightTypeMap[info.flightType] ?? '其他' : '其他',
       },
       {
         label: '航班状态',