Эх сурвалжийг харах

实时视图-航站视图-排序修改、预警规则修改

zhongxiaoyu 2 жил өмнө
parent
commit
aa5b9e73ea

+ 2 - 1
src/views/realTime/components/AirportView/index.scss

@@ -57,7 +57,8 @@
             background-color: #d2d6df;
           }
           &.bg-light:not(.current-row, .hover-row) .el-table__cell {
-            background-color: #eef3d6;
+            // background-color: #eef3d6;
+            background-color: #d6f2f3;
           }
           &.underline-red {
             border-bottom: 2px solid #e83f82;

+ 32 - 9
src/views/realTime/components/AirportView/index.vue

@@ -222,6 +222,7 @@ const summaryMethod: SummaryMethod<CommonData> = ({ columns, data }) => {
 }
 
 /* 离港视图默认的排序方式:
+ * 0.国内离港-有收运核单的排在前
  * 1.已起飞排在前
  * 2.未起飞中已装机在前
  * 3.已起飞和未起飞分类中各自按照预计起飞时间排序
@@ -247,15 +248,7 @@ const defaultSortFunction = (a: CommonData, b: CommonData) => {
     }
   }
 
-  if (a.hasTakenOff === 'Y') {
-    if (b.hasTakenOff === 'Y') {
-      return departureTimeCompare(a, b)
-    } else {
-      return -1
-    }
-  } else if (b.hasTakenOff === 'Y') {
-    return 1
-  } else {
+  const loadCompare = (a: CommonData, b: CommonData) => {
     if (a.loadPlaneSureTime) {
       if (b.loadPlaneSureTime) {
         return departureTimeCompare(a, b)
@@ -268,6 +261,36 @@ const defaultSortFunction = (a: CommonData, b: CommonData) => {
       return departureTimeCompare(a, b)
     }
   }
+
+  const takeOffCompare = (a: CommonData, b: CommonData) => {
+    if (a.hasTakenOff === 'Y') {
+      if (b.hasTakenOff === 'Y') {
+        return departureTimeCompare(a, b)
+      } else {
+        return -1
+      }
+    } else if (b.hasTakenOff === 'Y') {
+      return 1
+    } else {
+      return loadCompare(a, b)
+    }
+  }
+
+  const receiveCompare = (a: CommonData, b: CommonData) => {
+    if (a.receiveSure) {
+      if (b.receiveSure) {
+        return takeOffCompare(a, b)
+      } else {
+        return -1
+      }
+    } else if (b.receiveSure) {
+      return 1
+    } else {
+      return takeOffCompare(a, b)
+    }
+  }
+
+  return receiveCompare(a, b)
 }
 
 const filterSortOptions = computed(() => ({

+ 7 - 2
src/views/realTime/components/AirportView/useFlightState.ts

@@ -33,7 +33,8 @@ export function useFlightState(
     data.forEach(row => {
       if (
         name.includes('DepartureAirport') &&
-        typeof row.planDepartureTime === 'string'
+        typeof row['planDepartureTime'] === 'string' &&
+        row['planDepartureTime']
       ) {
         const departureTime = new Date(
           row.planDepartureTime.replace('T', ' ')
@@ -41,7 +42,11 @@ export function useFlightState(
         // 判断已起飞
         if (now >= departureTime) {
           row.hasTakenOff = 'Y'
-          finishedCount.value++
+          if (name.includes('International')) {
+            finishedCount.value++
+          } else if (row['receiveSure']) {
+            finishedCount.value++
+          }
         } else {
           row.hasTakenOff = 'N'
 

+ 16 - 7
src/views/realTime/hooks/useTableStyle.ts

@@ -50,12 +50,21 @@ export function useTableStyle(tableName?: string) {
         classes.push('cell-warning')
       }
       if (
-        (['resure', 'resureTime'] as any[]).includes(column.property) &&
-        (cellData ?? '') !== '' &&
-        row['resure'] !== row['stowage'] &&
+        (['resure', 'resureTime'] as CommonValue[]).includes(column.property) &&
         (row['planeDownTime'] ?? '') !== ''
       ) {
-        classes.push('cell-warning')
+        const { stowage, resure } = row
+        let stowageNum = 0,
+          resureNum = 0
+        if (typeof stowage === 'string') {
+          stowageNum = Number(stowage.split('/')[0]) || 0
+        }
+        if (typeof resure === 'string') {
+          resureNum = Number(resure.split('/')[0]) || 0
+        }
+        if (stowageNum !== resureNum) {
+          classes.push('cell-warning')
+        }
       }
       if (column.property === 'loadPlaneTime') {
         if (row['warningState'] === 'alarm') {
@@ -71,15 +80,15 @@ export function useTableStyle(tableName?: string) {
           securityNum = 0
         if (tableName.includes('International')) {
           if (typeof receiveSure1 === 'string') {
-            receiveNum = Number(receiveSure1.split('/')[1]) || 0
+            receiveNum = Number(receiveSure1.split('/')[0]) || 0
           }
         } else {
           if (typeof receiveSure === 'string') {
-            receiveNum = Number(receiveSure.split('/')[1]) || 0
+            receiveNum = Number(receiveSure.split('/')[0]) || 0
           }
         }
         if (typeof securityYes === 'string') {
-          securityNum = Number(securityYes.split('/')[1]) || 0
+          securityNum = Number(securityYes.split('/')[0]) || 0
         }
         if (receiveNum !== securityNum) {
           classes.push('cell-warning')