Explorar el Código

大华,警报音乐,

qinhouyu hace 1 año
padre
commit
70ec749fd9
Se han modificado 4 ficheros con 115 adiciones y 61 borrados
  1. 54 36
      src/components/TVWalls.vue
  2. 35 18
      src/dahua/TVWalllib/DHWs.js
  3. 22 5
      src/dahua/lib/DHWs.js
  4. 4 2
      src/views/forest.vue

+ 54 - 36
src/components/TVWalls.vue

@@ -43,7 +43,7 @@ import {tvCameraList} from '@/api/haikang/haikang'
 import {findCameraByEventCoordinate, rotation} from '@/api/monitor'
 import DHWs from '@/dahua/lib/DHWs'
 import Cookies from "js-cookie"
-
+import {selectConfigKey} from "@/api/system/config";
 /** ----------------------------------摄像头预览结束------------------------------------- */
 export default {
   dicts: ['event_source'],
@@ -226,43 +226,61 @@ export default {
       }
     },
     showTVWall(data, val, item) {
-      if(item != null){
-        this.userData = item;
-        this.userDataShow = true;
-      }
-      this.tvListJson = data
-      this.data = val
-      this.autoList = []
-      this.stringList = []
-      let length = data[0].treeLabels.length > 4 ? 5 : data[0].treeLabels.length
-      for (let i = 1; i < length; i++) {
-        this.autoList.push({"channelId": data[0].treeLabels[i].labelCode})
-        this.stringList.push(data[0].treeLabels[i].labelCode)
-      }
-      console.log("this.autoList",this.autoList);
-      console.log("this.stringList",this.stringList);
-      // let that=this;
-      /** ----------------------------------大华摄像头预览开始------------------------------------- */
-      this.ws.addEventListener('connectStateChange', data => {
-        if (data) {
-          console.log('连接成功')
-        } else {
-          console.log('连接失败,下载客户端')
-          this.alertReinstall()
+
+      selectConfigKey("DssVersion").then(res => {
+        if(this.ws.getLocalDssVersion()!=res.data){
+          this.$modal.confirm('系统检测到新客户端版本,请更新后使用', '系统提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
+            }
+          ).then(() => {
+            window.open("https://pan.baidu.com/s/1MlWyhFw6pEYiaLvzsje-BA?pwd=3jps");
+          }).catch(() => {
+            return
+          });
+          return
+        }else{
+          if(item != null){
+            this.userData = item;
+            this.userDataShow = true;
+          }
+          this.tvListJson = data
+          this.data = val
+          this.autoList = []
+          this.stringList = []
+          let length = data[0].treeLabels.length > 4 ? 5 : data[0].treeLabels.length
+          for (let i = 1; i < length; i++) {
+            this.autoList.push({"channelId": data[0].treeLabels[i].labelCode})
+            this.stringList.push(data[0].treeLabels[i].labelCode)
+          }
+          console.log("this.autoList",this.autoList);
+          console.log("this.stringList",this.stringList);
+          // let that=this;
+          /** ----------------------------------大华摄像头预览开始------------------------------------- */
+          this.ws.addEventListener('connectStateChange', data => {
+            if (data) {
+              console.log('连接成功')
+            } else {
+              console.log('连接失败,下载客户端')
+              this.alertReinstall()
+            }
+          })
+          this.preview()
+          /** ----------------------------------大华摄像头预览结束------------------------------------- */
+          /** ----------------------------------海康摄像头预览开始------------------------------------- */
+          // tvCameraList().then(response => {
+          //   this.cameraList=response.data
+          // })
+          // that.initPlugin()
+          // setTimeout(function() {
+          //   that.playhk();
+          // }, 5000)
+          // /** ----------------------------------海康摄像头预览结束------------------------------------- */
+          this.TVWallVisible = true
+
         }
       })
-      this.preview()
-      /** ----------------------------------大华摄像头预览结束------------------------------------- */
-      /** ----------------------------------海康摄像头预览开始------------------------------------- */
-      // tvCameraList().then(response => {
-      //   this.cameraList=response.data
-      // })
-      // that.initPlugin()
-      // setTimeout(function() {
-      //   that.playhk();
-      // }, 5000)
-      // /** ----------------------------------海康摄像头预览结束------------------------------------- */
-      this.TVWallVisible = true
     },
     /** ----------------------------------大华摄像头预览开始------------------------------------- */
     alertLogin: function () {

+ 35 - 18
src/dahua/TVWalllib/DHWs.js

@@ -7381,24 +7381,41 @@
 	        let _this = this;
 	        this.getVersion();
 	        console.log(`ws-getLocalDssVersion-getVersionEnd-${this.getVersionEnd}`);
-	        return new Promise((resolve, reject) => {
-	            if (!this.getVersionEnd) { // 连接中或者获取中
-	                // let now = Date.now();
-	                // if((now - _this.getVersionStartTime) > _this.getVersionTimeOut) {
-	                // 	console.log(`ws-this.getVersionEndTime-${now}`);
-	                // 	reject('get version timeout');
-	                // }
-	                let _interval = setInterval(() => {
-	                    if (_this.getVersionEnd) {
-	                        clearInterval(_interval);
-	                        resolve(_this.currentDssVersion);
-	                    }
-	                }, 50);
-	            }
-	            else {
-	                resolve(_this.currentDssVersion);
-	            }
-	        });
+        if (!this.getVersionEnd) { // 连接中或者获取中
+          // let now = Date.now();
+          // if((now - _this.getVersionStartTime) > _this.getVersionTimeOut) {
+          // 	console.log(`ws-this.getVersionEndTime-${now}`);
+          // 	reject('get version timeout');
+          // }
+          let _interval = setInterval(() => {
+            if (_this.getVersionEnd) {
+              clearInterval(_interval);
+              return _this.currentDssVersion;
+            }
+          }, 50);
+        }
+        else {
+          return _this.currentDssVersion;
+        }
+
+        // return new Promise((resolve, reject) => {
+        //   if (!this.getVersionEnd) { // 连接中或者获取中
+        //     // let now = Date.now();
+        //     // if((now - _this.getVersionStartTime) > _this.getVersionTimeOut) {
+        //     // 	console.log(`ws-this.getVersionEndTime-${now}`);
+        //     // 	reject('get version timeout');
+        //     // }
+        //     let _interval = setInterval(() => {
+        //       if (_this.getVersionEnd) {
+        //         clearInterval(_interval);
+        //         resolve(_this.currentDssVersion);
+        //       }
+        //     }, 50);
+        //   }
+        //   else {
+        //     resolve(_this.currentDssVersion);
+        //   }
+        // });
 	    }
 	    /**
 	     * @description 比较客户端版本

+ 22 - 5
src/dahua/lib/DHWs.js

@@ -7367,7 +7367,6 @@
 	        let _this = this;
 	        this.getVersion();
 	        console.log(`ws-getLocalDssVersion-getVersionEnd-${this.getVersionEnd}`);
-	        return new Promise((resolve, reject) => {
 	            if (!this.getVersionEnd) { // 连接中或者获取中
 	                // let now = Date.now();
 	                // if((now - _this.getVersionStartTime) > _this.getVersionTimeOut) {
@@ -7377,14 +7376,32 @@
 	                let _interval = setInterval(() => {
 	                    if (_this.getVersionEnd) {
 	                        clearInterval(_interval);
-	                        resolve(_this.currentDssVersion);
+	                        return _this.currentDssVersion;
 	                    }
 	                }, 50);
 	            }
 	            else {
-	                resolve(_this.currentDssVersion);
-	            }
-	        });
+                return _this.currentDssVersion;
+	            }
+
+        // return new Promise((resolve, reject) => {
+        //   if (!this.getVersionEnd) { // 连接中或者获取中
+        //     // let now = Date.now();
+        //     // if((now - _this.getVersionStartTime) > _this.getVersionTimeOut) {
+        //     // 	console.log(`ws-this.getVersionEndTime-${now}`);
+        //     // 	reject('get version timeout');
+        //     // }
+        //     let _interval = setInterval(() => {
+        //       if (_this.getVersionEnd) {
+        //         clearInterval(_interval);
+        //         resolve(_this.currentDssVersion);
+        //       }
+        //     }, 50);
+        //   }
+        //   else {
+        //     resolve(_this.currentDssVersion);
+        //   }
+        // });
 	    }
 	    /**
 	     * @description 比较客户端版本

+ 4 - 2
src/views/forest.vue

@@ -1599,6 +1599,8 @@
                 this.eventList.splice(10, 1)
               // 将收到的数据在地图上添加
               this.getWebSocketEvent(res.data)
+              this.$refs.bottomMenu.updateAlert();
+              this.$refs.up.play();
             }
           })
         }
@@ -1626,8 +1628,8 @@
           this.getEventByReportorOrder(this.getCurrentDataStr(), true);
           this.getExposureStage(this.getCurrentDataStr(), true);
 
-          this.$refs.bottomMenu.updateAlert();
-          this.$refs.up.play();
+          // this.$refs.bottomMenu.updateAlert();
+          // this.$refs.up.play();
           // thes.$refs.up.pause();//停止播放音乐
         }
       },