Selaa lähdekoodia

传感器实施数据

王通 2 vuotta sitten
vanhempi
commit
c983c70303
1 muutettua tiedostoa jossa 20 lisäystä ja 3 poistoa
  1. 20 3
      src/views/monitor.vue

+ 20 - 3
src/views/monitor.vue

@@ -96,7 +96,7 @@
                 :class="{on:listCurrentIndex2 == index}" v-on:click="dropLocation(item.latitude,item.longitude,index)">
                 <div class="d-l-l-text">
                   <i class="iconfont sj-icon-jkzx icon-sxt"></i>
-                  <h4>{{ item.cameraName }}</h4>
+                  <h4>{{ item.cameraName }}</h4><h4 v-html="cgqData"></h4>
                 </div>
               </div>
             </div>
@@ -209,6 +209,7 @@
     data() {
       return {
         //摄像头名称
+        cgqData:'',
         rightDeptName: undefined,
         visuForestCloudCameraBOListSearch: [],
         // 部门名称
@@ -285,7 +286,22 @@
       }
     },
     methods: {
-
+      setcgqValue:function(){
+        let that=this
+        setInterval(function() {
+          var color = "green";
+          var value = Math.random();
+          var up = "▲";
+          var down = "▼";
+          if (value > 0.5) {
+            color = "red";
+            value = value + "" + up;
+          } else {
+            value = value + "" + down;
+          }
+          that.cgqData =  "<span style='color:" + color + "'>" + value + "</span>";
+        }, 1000)
+      },
       /* 电视墙替换开始 */
       showTVWall(channelCode, channelName) {
         let tvListJson = [{
@@ -443,6 +459,7 @@
         let that = this;
         let markersList = [];
         getSensorListByDeptId(that.deptId).then(function(res) {
+          that.setcgqValue()
             that.visuForestCloudCameraBOListSearch = []
             // that.sensorNum = res.data.length
             if (res.data != null && res.data.length > 0) {
@@ -459,7 +476,7 @@
                   lng: 124.59,
                   lat: 43.02,
                   icon: "marker",
-                  bindPopupHtml: "cgq",
+                  bindPopupHtml: "",
                   click: "",
                   parameter: "",
                   name: i,