Selaa lähdekoodia

根据电视墙摄像头数量选择播放插件

JX.LI 2 vuotta sitten
vanhempi
commit
b6eab3df3d
2 muutettua tiedostoa jossa 35 lisäystä ja 6 poistoa
  1. 21 4
      src/components/TVWall.vue
  2. 14 2
      src/components/TVWalls.vue

+ 21 - 4
src/components/TVWall.vue

@@ -362,6 +362,14 @@ export default {
       this.TVWallVisible = true
 
     },
+    realTimeVideoDialog(cameraParams) {
+      // 调用弹窗实时播放接口
+      if (!this.isLogin) {
+        this.$Message.info("正在登陆客户端,请稍等......");
+        return false;
+      }
+      this.ws.openVideo(cameraParams);
+    },
     create1(longitude,latitude,tvListJson,array,array1) { // 调用创建控件接口
       let _this = this
       const params = [
@@ -383,8 +391,12 @@ export default {
       ]
       this.setPos()
       this.customizeTree(tvListJson);
-      _this.ws.createCtrl(params);
-      _this.playRealMonitorVideo(array)
+      if(array1.length == 1){
+        _this.realTimeVideoDialog(array1);
+      }else{
+        _this.ws.createCtrl(params);
+        _this.playRealMonitorVideo(array)
+      }
       setTimeout(() => {
         _this.rotation(longitude,latitude,array1)
       }, 5000)
@@ -515,8 +527,13 @@ export default {
       for (let i = 1; i < length; i++) {
         bfArray.push({"channelId": tvListJson[0].treeLabels[i].labelCode})
       }
-      _this.ws.createCtrl(params);
-      _this.playRealMonitorVideo(bfArray)
+      
+      if(bfArray.length == 1){
+        _this.realTimeVideoDialog([tvListJson[0].treeLabels[1].labelCode]);
+      }else{
+        _this.ws.createCtrl(params);
+        _this.playRealMonitorVideo(bfArray)
+      }
     },
     setPos() {
       let target = document.getElementById(this.domId)

+ 14 - 2
src/components/TVWalls.vue

@@ -394,6 +394,14 @@ import Cookies from "js-cookie"
           }
         })
       },
+      realTimeVideoDialog(cameraParams) {
+        // 调用弹窗实时播放接口
+        if (!this.isLogin) {
+          this.$Message.info("正在登陆客户端,请稍等......");
+          return false;
+        }
+        this.ws.openVideo(cameraParams);
+      },
       create(tvListJson) { // 调用创建控件接口
         let _this = this
         const params = [
@@ -415,8 +423,12 @@ import Cookies from "js-cookie"
         ]
         this.setPos()
         this.customizeTree(tvListJson);
-        _this.ws.createCtrl(params);
-        _this.playRealMonitorVideo();
+        if(_this.stringList.length == 1){
+          _this.realTimeVideoDialog([_this.stringList[0]]);
+        }else{
+          _this.ws.createCtrl(params);
+          _this.playRealMonitorVideo();
+        }
         if (_this.data != undefined && _this.data != null) {
           setTimeout( _this.rotation(_this.data.longitude, _this.data.latitude, _this.stringList),5000)
         }