qinhouyu 1 năm trước cách đây
mục cha
commit
f73c18684b
1 tập tin đã thay đổi với 128 bổ sung93 xóa
  1. 128 93
      src/components/TVWall.vue

+ 128 - 93
src/components/TVWall.vue

@@ -37,7 +37,7 @@ import { tvCameraList } from '@/api/haikang/haikang'
 import DHWs from '@/dahua/lib/DHWs'
 import { rotation } from '@/api/monitor'
 import Cookies from "js-cookie"
-
+import {selectConfigKey} from "@/api/system/config";
 
 /** ----------------------------------摄像头预览结束------------------------------------- */
 export default {
@@ -286,79 +286,96 @@ export default {
     },
     //火点联动电视墙调用
     showTVWall1(longitude,latitude,tvListJson) {
-
-      // let that=this;
-      /** ----------------------------------大华摄像头预览开始------------------------------------- */
-      this.ws.addEventListener('connectStateChange', data => {
-        if (data) {
-          console.log('连接成功')
-        } else {
-          console.log('连接失败,下载客户端')
-          this.alertReinstall()
-        }
-      })
-      getDahuaVideoServer().then(newResponse => {
-        this.ws.detectConnectQt().then(res => {
-          if (res) { // 连接客户端成功
-            this.alertLogin()
-            this.ws.login({
-              loginIp: newResponse.loginIp,
-              loginPort: newResponse.loginPort,
-              userName: newResponse.userName,
-              userPwd: newResponse.userPwd,
-              // loginIp: '192.168.100.100',
-              // loginPort: 8314,
-              // userName: 'system',
-              // userPwd: 'Admin@123',
-              token: '',
-              https: 1
-            })
-            this.ws.on('loginState', (res) => {
-              this.isLogin = res
-              console.log('---res-----', res)
-              if (res) {
-                this.alertLoginSuccess()
-                this.activePanel = 'key2'
-                console.log(tvListJson)
-                const array=[]
-                const array1=[]
-                if (tvListJson!=null)
-                {
-                  tvListJson[0].treeLabels.forEach((item,index)=>
-                  {
-                    if (index!=0)
+      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{
+          // let that=this;
+          /** ----------------------------------大华摄像头预览开始------------------------------------- */
+          this.ws.addEventListener('connectStateChange', data => {
+            if (data) {
+              console.log('连接成功')
+            } else {
+              console.log('连接失败,下载客户端')
+              this.alertReinstall()
+            }
+          })
+          getDahuaVideoServer().then(newResponse => {
+            this.ws.detectConnectQt().then(res => {
+              if (res) { // 连接客户端成功
+                this.alertLogin()
+                this.ws.login({
+                  loginIp: newResponse.loginIp,
+                  loginPort: newResponse.loginPort,
+                  userName: newResponse.userName,
+                  userPwd: newResponse.userPwd,
+                  // loginIp: '192.168.100.100',
+                  // loginPort: 8314,
+                  // userName: 'system',
+                  // userPwd: 'Admin@123',
+                  token: '',
+                  https: 1
+                })
+                this.ws.on('loginState', (res) => {
+                  this.isLogin = res
+                  console.log('---res-----', res)
+                  if (res) {
+                    this.alertLoginSuccess()
+                    this.activePanel = 'key2'
+                    console.log(tvListJson)
+                    const array=[]
+                    const array1=[]
+                    if (tvListJson!=null)
                     {
-                      const param =Object.assign({})
-                      param.channelId=item.labelCode
-                      array.push(param)
-                      array1.push(item.labelCode)
+                      tvListJson[0].treeLabels.forEach((item,index)=>
+                      {
+                        if (index!=0)
+                        {
+                          const param =Object.assign({})
+                          param.channelId=item.labelCode
+                          array.push(param)
+                          array1.push(item.labelCode)
+                        }
+
+                      })
                     }
-
-                  })
-                }
-                this.create1(longitude,latitude,tvListJson,array,array1)
-                // var obj=JSON.parse(tvListJson)
-              } else {
-                this.alertLoginFailed()
+                    this.create1(longitude,latitude,tvListJson,array,array1)
+                    // var obj=JSON.parse(tvListJson)
+                  } else {
+                    this.alertLoginFailed()
+                  }
+                })
+              } else { // 连接客户端失败
+                this.alertReinstall()
               }
             })
-          } else { // 连接客户端失败
-            this.alertReinstall()
-          }
-        })
 
+          })
+          /** ----------------------------------大华摄像头预览结束------------------------------------- */
+          /** ----------------------------------海康摄像头预览开始------------------------------------- */
+          // tvCameraList().then(response => {
+          //   this.cameraList=response.data
+          // })
+          // that.initPlugin()
+          // setTimeout(function() {
+          //   that.playhk();
+          // }, 5000)
+          // /** ----------------------------------海康摄像头预览结束------------------------------------- */
+          this.TVWallVisible = true
+
+        }
       })
-      /** ----------------------------------大华摄像头预览结束------------------------------------- */
-      /** ----------------------------------海康摄像头预览开始------------------------------------- */
-      // tvCameraList().then(response => {
-      //   this.cameraList=response.data
-      // })
-      // that.initPlugin()
-      // setTimeout(function() {
-      //   that.playhk();
-      // }, 5000)
-      // /** ----------------------------------海康摄像头预览结束------------------------------------- */
-      this.TVWallVisible = true
+
 
     },
     realTimeVideoDialog(cameraParams) {
@@ -420,33 +437,51 @@ export default {
       })
     },
     showTVWall(tvListJson,bfArray) {
-      if(tvListJson){
-        this.preview(tvListJson,bfArray);
-        this.TVWallVisible = true;
-        return;
-      }
-      // 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(tvListJson){
+            this.preview(tvListJson,bfArray);
+            this.TVWallVisible = true;
+            return;
+          }
+          // 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() {