Browse Source

fix(dashboard): cannot stop retrying when failed to get device list

Casper Dai 3 years ago
parent
commit
6b2cd45f22
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/views/dashboard/index.vue

+ 4 - 3
src/views/dashboard/index.vue

@@ -147,7 +147,7 @@ export default {
         firstLoadSize: 999
       },
       product: '',
-      monitor: { loading: false },
+      monitor: { loading: true },
       deviceOptions: {
         list: [],
         loaded: false
@@ -156,7 +156,7 @@ export default {
     }
   },
   created () {
-    this.refreshDevices()
+    this.refreshDevices(true)
     subscribe([
       '+/+/online',
       '+/+/offline',
@@ -164,6 +164,7 @@ export default {
     ], this.onMessage)
   },
   beforeDestroy () {
+    this.monitor.loading = true
     unsubscribe([
       '+/+/online',
       '+/+/offline',
@@ -259,7 +260,7 @@ export default {
         pageSize: total,
         productId: this.product,
         activate: 2
-      }).then(({ data }) => {
+      }, { custom: true }).then(({ data }) => {
         options.list = data.sort(this.sort)
         options.loaded = true
       }, () => {