Bläddra i källkod

实时视图-国际航站视图-默认排序修改

zhongxiaoyu 2 år sedan
förälder
incheckning
8cf781f4f6

+ 30 - 2
src/views/realTime/components/AirportView/index.vue

@@ -291,7 +291,35 @@ const defaultDepartureSortFunction = (a: CommonData, b: CommonData) => {
     }
   }
 
-  return isInternational ? takeOffCompare(a, b) : receiveCompare(a, b)
+  const receiveSureCompare = (a: CommonData, b: CommonData) => {
+    if (a.receiveSure1) {
+      if (b.receiveSure1) {
+        return takeOffCompare(a, b)
+      } else {
+        return -1
+      }
+    } else if (b.receiveSure1) {
+      return 1
+    } else {
+      return takeOffCompare(a, b)
+    }
+  }
+
+  const enterCompare = (a: CommonData, b: CommonData) => {
+    if (a.enterPark) {
+      if (b.enterPark) {
+        return receiveSureCompare(a, b)
+      } else {
+        return -1
+      }
+    } else if (b.enterPark) {
+      return 1
+    } else {
+      return receiveSureCompare(a, b)
+    }
+  }
+
+  return isInternational ? enterCompare(a, b) : receiveCompare(a, b)
 }
 
 const defaultArrivalSortFunction = (a: CommonData, b: CommonData) => {
@@ -343,7 +371,7 @@ const defaultArrivalSortFunction = (a: CommonData, b: CommonData) => {
     }
   }
 
-  return isInternational ? landingTimeCompare(a, b) : unloadCompare(a, b)
+  return unloadCompare(a, b)
 }
 
 const filterSortOptions = computed(() => ({

+ 8 - 5
src/views/realTime/components/AirportView/useFlightState.ts

@@ -42,9 +42,14 @@ export function useFlightState(
         // 判断已起飞
         if (now >= departureTime) {
           row.hasTakenOff = 'Y'
-          if (name.includes('International')) {
+          if (
+            name.includes('International') &&
+            row['enterPark'] &&
+            row['receiveSure1']
+          ) {
             finishedCount.value++
-          } else if (row['receiveSure']) {
+          }
+          if (!name.includes('International') && row['receiveSure']) {
             finishedCount.value++
           }
         } else {
@@ -81,9 +86,7 @@ export function useFlightState(
         // 判断已降落
         if (now >= landingTime) {
           row.hasLanded = 'Y'
-          if (name.includes('International')) {
-            finishedCount.value++
-          } else if (row['unLoad'] && row['tally']) {
+          if (row['unLoad'] && row['tally']) {
             finishedCount.value++
           }
         } else {