zhongxiaoyu 2 жил өмнө
parent
commit
8c39ea42b5

+ 27 - 20
src/views/realTime/components/AirportView/index.vue

@@ -173,23 +173,26 @@ const summaryMethod: SummaryMethod<CommonData> = ({ columns, data }) => {
     )
     if (countColumn) {
       if (countColumn.countMode === 'split') {
-        let sumArr = data.reduce((prev: number[], curr: CommonData) => {
-          const cellData = curr[column.property]
-          if (typeof cellData === 'string') {
-            const splitData = cellData.split('/')
-            splitData.forEach((str, i) => {
-              const num = Number(str)
-              if (!Number.isNaN(num)) {
-                if (prev[i]) {
-                  prev[i] += num
-                } else {
-                  prev[i] = num
+        let sumArr = data.reduce(
+          (prev: number[], curr: CommonData) => {
+            const cellData = curr[column.property]
+            if (typeof cellData === 'string') {
+              const splitData = cellData.split('/')
+              splitData.forEach((str, i) => {
+                const num = Number(str)
+                if (!Number.isNaN(num)) {
+                  if (prev[i]) {
+                    prev[i] += num
+                  } else {
+                    prev[i] = num
+                  }
                 }
-              }
-            })
-          }
-          return prev
-        }, [0])
+              })
+            }
+            return prev
+          },
+          [0]
+        )
         const matched = column.label.match(/(?<=\()\S+(?=\))/)
         if (matched && !countFlag.value) {
           const machedStr = matched[0]
@@ -319,7 +322,8 @@ const defaultDepartureSortFunction = (a: CommonData, b: CommonData) => {
     }
   }
 
-  return isInternational ? enterCompare(a, b) : receiveCompare(a, b)
+  // return isInternational ? enterCompare(a, b) : receiveCompare(a, b)
+  return takeOffCompare(a, b)
 }
 
 const defaultArrivalSortFunction = (a: CommonData, b: CommonData) => {
@@ -377,9 +381,12 @@ const defaultArrivalSortFunction = (a: CommonData, b: CommonData) => {
 const filterSortOptions = computed(() => ({
   defaultFilterValueMap,
   extraFilterValueMap: flightStateFilter,
-  defaultSortFunction: isDeparture
-    ? defaultDepartureSortFunction
-    : defaultArrivalSortFunction,
+  defaultSortFunction: isDeparture ? defaultDepartureSortFunction : undefined,
+  defaultSortRuleMap: isDeparture
+    ? undefined
+    : {
+        planLandingTime: 'ascending',
+      },
 }))
 
 const sortRuleMap = ref({})

+ 15 - 13
src/views/realTime/components/AirportView/useFlightState.ts

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