Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master' into master

slowslo před 4 roky
rodič
revize
85e156af88

+ 13 - 0
src/api/device/gb/gbdevice.js

@@ -65,3 +65,16 @@ export const sync = (row) => {
   })
 }
 
+/**
+ * 获取监控设备统计数据
+ */
+export const getMonitoringaidsApi = (id) => {
+  return request({
+    url: '/api/cyzh-smart-device/gbdevicestatistics/monitoringaids',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+

+ 16 - 3
src/views/dashboard/smartsecurity/comps/func-list.vue

@@ -31,7 +31,7 @@
           <div class="data-box" v-for="(item1,index1) in item.data" :key="index1">
             <div>{{item1.label}}</div>
             <div>
-              <count-to :startVal='0' :endVal='item.value' :duration='2000'></count-to>
+              <count-to :startVal='0' :endVal='item1.value' :duration='2000'></count-to>
             </div>
           </div>
         </div>
@@ -42,6 +42,7 @@
 
 <script>
   import countTo from 'vue-count-to'
+  import {getMonitoringaidsApi} from '@/api/device/gb/gbdevice'
   export default {
     components: {
       countTo
@@ -106,10 +107,22 @@
       };
     },
     created() {
-
+      this.init()
     },
     methods: {
-
+      init(){
+        this.getMonitoringaids()
+      },
+      /**
+       * 获取监控设备数据
+       */
+      async getMonitoringaids(){
+        let data= (await getMonitoringaidsApi()).data.data
+        this.list[0].total=parseInt(data.total)
+        this.list[0].data[0].value=parseInt(data.total)
+        this.list[0].data[1].value=parseInt(data.offlineCount)
+        this.list[0].data[2].value=parseInt(data.waringCount)
+      }
     }
   };
 </script>