Prechádzať zdrojové kódy

[UPDATE] fix bug in *hkcamara

11868 1 rok pred
rodič
commit
63123e76fc

+ 29 - 6
src/components/hk/hkv.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="video-player">
-    <div id="divPlugin" class="divPlugin"></div>
+    <div id="divPlugin2" class="divPlugin"></div>
     <!-- <div id="divPlugin" class="divPlugin" ref="divPlugin" v-if="plugin">
         </div> -->
     <!-- <div class="down" v-else>
@@ -52,11 +52,22 @@ export default {
   methods: {
     handleResize() {
       this.zoom = window.devicePixelRatio;
+      let h
+      let w
+      if(document.body.clientWidth>=(document.body.clientHeight*2)){
+        h=document.body.clientHeight
+        w=document.body.clientHeight*(2200/1080)
+      }else{
+        h=document.body.clientWidth/(2200/1080)
+        w=document.body.clientWidth
+      }
       setTimeout(() => {
         console.log("this.zoom :>> ", this.zoom);
         WebVideoCtrl.I_Resize(
-          380 / (this.zoom / 1.25),
-          260 / (this.zoom / 1.25)
+          // 380 / (this.zoom / 1.25),
+          // 260 / (this.zoom / 1.25)
+            w/3.9,
+            h/2.8
         );
       }, 1000);
     },
@@ -95,10 +106,22 @@ export default {
       });
       console.log("🚀 初始化插件完成 >> ", that.g_iWndIndex);
       console.log("🚀 插入插件");
-      WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin").then(() => {
+      let h
+      let w
+      console.log("0: ",document.body.clientWidth ,document.body.clientHeight)
+      if(document.body.clientWidth>=(document.body.clientHeight*2)){
+        h=document.body.clientHeight
+        w=document.body.clientHeight*(2200/1080)
+      }else{
+        h=document.body.clientWidth/(2200/1080)
+        w=document.body.clientWidth
+      }
+      WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin2").then(() => {
         WebVideoCtrl.I_Resize(
-          380 / (this.zoom / 1.25),
-          260 / (this.zoom / 1.25)
+          // 380 / (this.zoom / 1.25),
+          // 260 / (this.zoom / 1.25)
+        w/3.9,
+        h/2.8
         ).then(() => {
           console.log("🚀 data >> ", that.companyVideoData);
           this.getLoginParams().then((res) => {

+ 16 - 0
src/components/hk/monitorHK.vue

@@ -13,8 +13,11 @@ export default {
       type: Array,
     },
     num:Number,
+    bofang:Number,
     //分屏
     videoType: Number,
+    chooseData:{},
+    chooseWindow:Number,
     dangqianchuangkou:Number,
   },
   data() {
@@ -497,6 +500,19 @@ export default {
       }
     },
 
+    bofang: {
+      handler(val, oldval) {
+        console.log("chooseData666:", this.chooseData)
+        console.log("chooseData6662:", val, oldval)
+      },
+    },
+    chooseData: {
+      handler(val, oldval) {
+        console.log("chooseData666:", this.chooseData)
+        console.log("chooseData6662:", val, oldval)
+      },
+    },
+
     num:{
       handler(val, oldval) {
         console.log("watchnum21:", this.currentnum, this.num)

+ 56 - 6
src/views/monitorScreen.vue

@@ -31,6 +31,9 @@
             <MonitorHK  v-if="HKbigCamaraShow"
                         @change-window="handleChangeWindow"
                         :num="selectedScreen"
+                        :bofang="issbofang"
+                        :chooseWindow="selectWindow"
+                        :chooseData="bofangyuan"
                         :companyVideoData="this.bigData.data"
                         @init="HKbigCamaraInit"
                         ref="hkbigCamara" />
@@ -159,7 +162,20 @@ export default {
         label: '25'
       }],
       selectedScreen: 1,
-
+      selectWindow:0,
+
+      bofangyuan:{
+        window:0,
+        data:[],
+        Password: "sgw123456",
+        Port: "80",
+        Username: "admin",
+        channelName: "test1",
+        ip: "172.3.11.115",
+        name: "11",
+        isbofang:0,
+      },
+      issbofang:0,
       dataSrc:'https://cctvwbndbd.a.bdydns.com/cctvwbnd/cctv1_2/index.m3u8?BR=single',
       playerList:[],
       isShow: false,
@@ -239,7 +255,8 @@ export default {
   methods:{
     async handleChangeWindow(value) {
       console.log("当前更新的窗口",value)
-      // this.num = value;
+      this.selectWindow=value
+      console.log("this.selectWindow",this.selectWindow)
     },
 
     updateSelectedButton(button) {
@@ -259,12 +276,45 @@ export default {
       this.bigData=this.bigcamaraData
     },
     onTiaozhuan_bigcamaraData (a) {
-      console.log("a",a)
-
+      // console.log("a",a)
+
+      this.bofangyuan.Password= a.Password
+      this.bofangyuan.Port=a.Port
+      this.bofangyuan.Username=a.Username
+      this.bofangyuan.channelName=a.channelName
+      this.bofangyuan.ip=a.ip
+      this.bofangyuan.name=a.name
+
+      this.bofangyuan.window=this.selectWindow
+      this.bofangyuan.isbofang=1
+      this.issbofang=1
+      console.log("this.bofangyuan",this.bofangyuan)
+      // 定义一个空数组对象
+      let myArray = [];
+      // 将对象添加到数组中
+      myArray.push(this.bofangyuan);
+      console.log(myArray);
+      this.$refs.hkbigCamara.login(myArray)
     },
     onTiaozhuan_bigcardData (a) {
-      console.log("a",a)
-
+      // console.log("a",a)
+
+      this.bofangyuan.Password= a.Password
+      this.bofangyuan.Port=a.Port
+      this.bofangyuan.Username=a.Username
+      this.bofangyuan.channelName=a.channelName
+      this.bofangyuan.ip=a.ip
+      this.bofangyuan.name=a.name
+      this.bofangyuan.window=this.selectWindow
+      this.bofangyuan.isbofang=1
+      this.issbofang=1
+      console.log("this.bofangyuan",this.bofangyuan)
+      // 定义一个空数组对象
+      let myArray = [];
+      // 将对象添加到数组中
+      myArray.push(this.bofangyuan);
+      console.log(myArray);
+      this.$refs.hkbigCamara.login(myArray)
     },
     /**
      * 表格排序字段变化