Procházet zdrojové kódy

设备监测页面bug修改

bobo04052021@163.com před 3 měsíci
rodič
revize
38c42c93f7

+ 22 - 2
pages/home/detail/autodoor/autodoor.vue

@@ -134,9 +134,9 @@
               <div class="datacardtime" v-if="item.monitorcode == 'readTime'">
                 <view
                   class="demo-layout bg-purple-light"
-                  style="margin-top: 10rpx; color: #3787fe"
+                  style="padding: 20rpx; color: #3787fe"
                 >
-                  {{ tableData[item.monitorcode] }}
+                  {{ readTime }}
                 </view>
               </div>
               <div class="datacard" v-if="item.monitorcode !== 'readTime'">
@@ -155,6 +155,20 @@
                     }}
                   </view>
                   <view
+                    v-else-if="item.monitorcode == 'netStatus'"
+                    class="demo-layout bg-purple-light"
+                    style="margin-top: 10rpx; color: #3787fe"
+                  >
+                    {{ doorNetStatus == "1" ? "正常" : "异常" }}
+                  </view>
+                  <view
+                    v-else-if="item.monitorcode == 'warnFlag'"
+                    class="demo-layout bg-purple-light"
+                    style="margin-top: 10rpx; color: #3787fe"
+                  >
+                    {{ warnFlag == "1" ? "正常" : "异常" }}
+                  </view>
+                  <view
                     v-else
                     class="demo-layout bg-purple-light"
                     style="margin-top: 10rpx; color: #3787fe"
@@ -280,6 +294,9 @@ export default {
       frontGateStatus: "", //前门状态
       rearGateStatus: "", //后门状态
       midGateStatus: "", //状态
+      doorNetStatus: "", //风门通信状态
+      warnFlag: "", //风门报警
+      readTime: "", //时间
       windowAngle: 0, //前窗打开角度
       windowAngle1: 0, //后窗打开角度
       windowArea: "", //风窗面积设定值
@@ -386,6 +403,9 @@ export default {
               this.frontGateStatus = this.tableData.frontGateOpen;
               this.midGateStatus = this.tableData.midGateOpen;
               this.rearGateStatus = this.tableData.rearGateOpen;
+              this.doorNetStatus = result.netStatus;
+              this.warnFlag = result.warnLevel_str;
+              this.readTime = result.readTime;
               var maxarea = result.maxarea;
               this.windowAngle =
                 (this.tableData.forntArea / maxarea) * 100 * 0.9;

+ 12 - 50
pages/home/detail/doorAnimate/doorAnimate.vue

@@ -72,10 +72,10 @@
           <div
             class="left_door"
             v-bind:class="
-              gatestate2 == '1' ||
-              gatestate2 == '开启' ||
-              gatestate2 == '打开' ||
-              gatestate2 == 'true'
+              gatestate3 == '1' ||
+              gatestate3 == '开启' ||
+              gatestate3 == '打开' ||
+              gatestate3 == 'true'
                 ? 'open_left'
                 : 'close_left'
             "
@@ -84,10 +84,10 @@
           <div
             class="right_door"
             v-bind:class="
-              gatestate2 == '1' ||
-              gatestate2 == '开启' ||
-              gatestate2 == '打开' ||
-              gatestate2 == 'true'
+              gatestate3 == '1' ||
+              gatestate3 == '开启' ||
+              gatestate3 == '打开' ||
+              gatestate3 == 'true'
                 ? 'open_right'
                 : 'close_right'
             "
@@ -95,16 +95,6 @@
           ></div>
         </div>
         <div>
-         <!-- <video
-            v-if="item.type == 'flv'"
-            :id="'cameraElement' + item.id"
-            muted
-            autoplay
-            controls
-            width="100%"
-            height="100%"
-            style="width: 100%"
-          ></video> -->
         </div>
       </div>
       <div style="" v-show="doorcount == 3">
@@ -322,12 +312,10 @@
 </template>
 
 <script>
-// import flvjs from "flv.js";
 export default {
   data() {
     return {
       height: "200px",
-      flvPlayer: [], // flv 播放地址
     };
   },
   props: [
@@ -339,28 +327,8 @@ export default {
     "cameralist",
   ],
   methods: {
-    initData() {
-      if (this.cameralist.devicekind == "flv") {
-        // 根据id设置每个播放摄像头的地址
-        this.setVideoUrl(this.cameralist.addr, this.cameralist.deviceid);
-      }
-    },
-    setVideoUrl(url, id) {
-      if (flvjs.isSupported()) {
-        this.flvPlayer = [];
-        var videoElement = document.getElementById("cameraElement" + id);
-        // 控件设置地址信息
-        var vdo = flvjs.createPlayer({
-          type: "flv",
-          url: url,
-        });
-        // 控件绑定
-        vdo.attachMediaElement(videoElement);
-        vdo.load();
-        // 播放
-        vdo.play();
-        this.flvPlayer.push(vdo);
-      }
+    initData(val) {
+		
     },
   },
   watch: {
@@ -379,17 +347,11 @@ export default {
       }
     },
     cameralist(val) {
-      this.initData();
+      this.initData(val);
     },
   },
   onUnload() {
-    this.flvPlayer.forEach((element) => {
-      element.pause();
-      element.unload();
-      element.detachMediaElement();
-      element.destroy();
-      element = null;
-    });
+    
   },
 };
 </script>

+ 22 - 24
pages/home/home.vue

@@ -46,7 +46,7 @@
                       alt=""
                       class="icon-style"
                     />
-                    <span style="float: right">{{ item.warnLevel_str }}</span>
+                    <span style="float: right">连接</span>
                   </div>
                   <div v-else class="error-tag">
                     <image
@@ -54,7 +54,7 @@
                       alt=""
                       class="icon-style"
                     />
-                    <span style="float: right">{{ item.warnDes }}</span>
+                    <span style="float: right">断开</span>
                   </div>
                 </u-col>
                 <u-col span="5">
@@ -163,31 +163,29 @@ export default {
       colums: {},
     };
   },
-  props: ["showColum", 'deviceType'],
+  props: ["showColum", "deviceType"],
   watch: {
     showColum(data) {
       this.colums = data;
     },
-	deviceType: {
-		async handler (data) {
-			if(data){
-				this.TabCur = data;
-				this.curlist = this.deviceList[this.TabCur];
-				
-				if (this.curlist == null) {
-							this.curlist = [];
-				}
-				// 选择设备分类,重新获取数据
-				await this.loadData(this.TabCur);
-				this.$emit('setMenushow', {
-									menushow: false
-				});
-			}
-		  
-		  
-		},
-		immediate: true
-	}
+    deviceType: {
+      async handler(data) {
+        if (data) {
+          this.TabCur = data;
+          this.curlist = this.deviceList[this.TabCur];
+
+          if (this.curlist == null) {
+            this.curlist = [];
+          }
+          // 选择设备分类,重新获取数据
+          await this.loadData(this.TabCur);
+          this.$emit("setMenushow", {
+            menushow: false,
+          });
+        }
+      },
+      immediate: true,
+    },
   },
   created() {
     this.colums = this.showColum;
@@ -199,7 +197,7 @@ export default {
   methods: {
     startTimer() {
       // 每隔一段时间执行某个操作
-      this.timer = setInterval(async() => {
+      this.timer = setInterval(async () => {
         // 执行定时任务
         await this.loadData(this.deviceType);
         console.log("定时任务执行中...");