浏览代码

航站视图修改

zhongxiaoyu 2 年之前
父节点
当前提交
c9c4917a7b
共有 2 个文件被更改,包括 9 次插入8 次删除
  1. 8 8
      src/hooks/useLoop.ts
  2. 1 0
      src/views/realTime/components/AirportView/index.vue

+ 8 - 8
src/hooks/useLoop.ts

@@ -9,25 +9,19 @@ export function useLoop(
   let querying = false
   let stopFlag = false
   const startQuery = async () => {
-    if (querying) {
-      return
-    }
-
     querying = true
     stopFlag = false
 
-    await Promise.all(loopFunctions.map(func => func()))
-
+    await Promise.allSettled(loopFunctions.map(func => func()))
     if (stopFlag) {
       return
     }
-
     queryLoop = window.setTimeout(
       startQuery,
       typeof interval === 'string'
         ? LOOP_INTERVAL[interval]
           ? LOOP_INTERVAL[interval]
-          : 5 * 1000
+          : 15 * 1000
         : interval
     )
   }
@@ -46,9 +40,15 @@ export function useLoop(
     })
   }
   onMounted(() => {
+    if (querying) {
+      return
+    }
     startQuery()
   })
   onActivated(() => {
+    if (querying) {
+      return
+    }
     startQuery()
   })
   onDeactivated(() => {

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

@@ -40,6 +40,7 @@
         :data="tableData"
         sequence
         highlight-current-row
+        scrollbar-always-on
         :stripe="false"
         show-summary
         :cache-keys="cacheKeys"