Bläddra i källkod

传感器实时数据

王通 2 år sedan
förälder
incheckning
86ffe1e97c
2 ändrade filer med 13 tillägg och 2 borttagningar
  1. 2 2
      src/api/monitor.js
  2. 11 0
      src/views/monitor.vue

+ 2 - 2
src/api/monitor.js

@@ -76,9 +76,9 @@ export function getDlblistBydeptId(deptId) {
   })
 }
 //根据部门id查询部门及部门以下的数据,没有则默认查询所有
-export function getMonitorDeviceAndDataList() {
+export function getMonitorDeviceAndDataList(deptId) {
   return request({
-    url: '/center-monitor/device/getMonitorDeviceAndDataList',
+    url: '/center-monitor/device/getMonitorDeviceAndDataList?deptId='+ deptId,
     method: 'get',
   })
 }

+ 11 - 0
src/views/monitor.vue

@@ -202,6 +202,7 @@ import {
       this.bottomMenuList() //获取底部公共组件消息和任务
       this.getTreeselect()
       this.deptId = Cookies.get("deptId")
+      this.chuanSet()
       this.getMonitorDeviceAndDataList()
       this.getDlblistBydeptIds()
       this.selectDeviceType(-1)
@@ -414,6 +415,15 @@ import {
         this.placeholderMsg = "请输入传感器名称"
         this.getMonitorDeviceAndDataList()
       },
+      chuanSet()
+      {
+        let that =this
+          setInterval(function() {
+
+             that.getMonitorDeviceAndDataList()
+
+          }, 300000)
+      },
       // 大喇叭
       getDlblistBydeptId() {
         let that = this;
@@ -474,6 +484,7 @@ import {
             console.error(error);
           });
       },
+
       getMonitorDeviceAndDataList()
       {
          let list=[]