zy před 1 rokem
rodič
revize
e1a72834e3
1 změnil soubory, kde provedl 14 přidání a 2 odebrání
  1. 14 2
      wps-ui/src/views/largeScreenPage/index.vue

+ 14 - 2
wps-ui/src/views/largeScreenPage/index.vue

@@ -142,6 +142,7 @@ export default {
       time: null,
       wsTime: null,
       tunnelTime:null,
+      dTime:null,
       eqData: [],
       eqNo: '',
       eqName: '',
@@ -167,6 +168,8 @@ export default {
     this.wsTime = null
     clearInterval(this.tunnelTime)
     this.tunnelTime = null
+    clearInterval(this.dTime)
+    this.dTime = null
   },
   mounted() {
     this.getTimeArray()
@@ -177,9 +180,8 @@ export default {
   methods: {
     init(){
       this.getWeatherLookInfo()
-      this.wsTime = setInterval(this.getWeatherLookInfo, 1000 * 60 * 10)
       this.getTunnelInfo()
-      this.tunnelTime = setInterval(this.getWeatherLookInfo, 1000 * 60 * 10)
+      this.tunnelTime = setInterval(this.getTunnelInfo, 1000 * 60 * 5)
     },
     getWeatherLookInfo() {
       selectHomePageByPTR().then(res => {
@@ -187,7 +189,17 @@ export default {
         this.eqData = res.data
         this.eqNo = this.eqData[0].weatherLookNo
         this.eqName = this.eqData[0].weatherLookName
+        const _this = this
+        /*环境数据定时*/
+        this.dTime = setInterval(function (){
+          selectHomePageByPTR().then(res => {
+            _this.eqData = res.data
+          }).catch(err => {
+            console.log('首页获取环境监测仪信息异常:' + err)
+          })
+        }, 1000 * 60 * 10)
         this.getWindData()
+        this.wsTime = setInterval(this.getWindData, 1000 * 60 * 10)
       }).catch(err => {
         console.log('首页获取环境监测仪信息异常:' + err)
       })