Explorar o código

离港航班视图-预警报警修改

zhongxiaoyu %!s(int64=2) %!d(string=hai) anos
pai
achega
2e7c74f5d8

+ 2 - 2
public/config.js

@@ -193,8 +193,8 @@ var DATACONTENT_ID = {
   internationalDepartureAirportCount: 1803542, // 国际离港统计
   internationalArrivalAirport: 1803523, // 国际进港航站
   internationalArrivalAirportCount: 1803552, // 国际进港统计
-  internationalTransferDepartureAirport: 1803525, // 中转航站
-  internationalTransferDepartureAirportCount: 1803542, // 中转统计
+  internationalTransferDepartureAirport: 1803645, // 中转航站
+  internationalTransferDepartureAirportCount: 1803646, // 中转统计
   warningRules: 18040, // 报警预警策略
   // 航班
   departureFlightInfo: 1803511, // 国内离港航班基础信息

+ 1 - 8
src/views/realTime/components/AirportView/index.vue

@@ -487,14 +487,7 @@ watch(
     }
   }
 )
-const flightTypeMap = ['货机', '客机', '其他']
-watch(tableData, async data => {
-  data.forEach(row => {
-    row.flightType =
-      typeof row.flightType === 'number'
-        ? flightTypeMap[row.flightType] ?? '其他'
-        : '其他'
-  })
+watch(tableData, async () => {
   await nextTick()
   if (hasSetTableScroll.value || !finishedCount.value) {
     return

+ 6 - 0
src/views/realTime/components/AirportView/useAirportTable.ts

@@ -1057,6 +1057,7 @@ export function useAirportTable(name: string, formData: CommonData) {
       []
     )
   }
+  const flightTypeMap = ['货机', '客机', '其他']
   const getTableData = async () => {
     try {
       const {
@@ -1103,6 +1104,11 @@ export function useAirportTable(name: string, formData: CommonData) {
         //       : null
         //   row.securityTime = row.addCargoTime
         // }
+        row.flightType =
+          typeof row.flightType === 'number'
+            ? flightTypeMap[row.flightType] ?? '其他'
+            : '其他'
+
         if (
           name === 'DepartureAirport' ||
           name === 'InternationalDepartureAirport'

+ 18 - 17
src/views/realTime/hooks/useTableStyle.ts

@@ -160,29 +160,30 @@ export function useTableStyle(tableName?: string) {
         }
       }
 
-      if (
-        tableName === 'DepartureAirport' &&
-        column.property === 'addCargoTime'
-      ) {
-        const { endLoadTime, addCargoTime } = row
-        if (getTime(endLoadTime) < getTime(addCargoTime)) {
-          classes.push('cell-warning')
+      if (row.flightType === '货机') {
+        if (
+          tableName === 'DepartureAirport' &&
+          column.property === 'addCargoTime'
+        ) {
+          const { endLoadTime, addCargoTime } = row
+          if (getTime(endLoadTime) < getTime(addCargoTime)) {
+            classes.push('cell-warning')
+          }
         }
-      }
-      if (
-        tableName === 'InternationalDepartureAirport' &&
-        column.property === 'securityTime'
-      ) {
-        const { endLoadTime, securityTime } = row
-        if (getTime(endLoadTime) < getTime(securityTime)) {
-          classes.push('cell-warning')
+        if (
+          tableName === 'InternationalDepartureAirport' &&
+          column.property === 'securityTime'
+        ) {
+          const { endLoadTime, securityTime } = row
+          if (getTime(endLoadTime) < getTime(securityTime)) {
+            classes.push('cell-warning')
+          }
         }
       }
 
       if (
         tableName?.includes('Departure') &&
-        column.property === 'planeDownTime' &&
-        row.flightType === '货机'
+        column.property === 'planeDownTime'
       ) {
         const { planDepartureTime, planeDownTime, takeOffStand } = row
         const { warning, alarm } = getDuration(tableName, takeOffStand)