安琪酵母(西藏)益生菌信息采集中心智能实验室
longyvfengyun
2023-08-24 fe936486ee0023e4be8d17625471aad6e8e284ff
src/views/video/components/hkVideo.vue
@@ -1,36 +1,12 @@
<script setup>
import {computed, onMounted, onUnmounted, ref, watch} from "vue";
import hkModule from "@/views/video/components/js/hkVideo/hkModule";
import FlexLayout from "@/components/FlexLayout.vue";
const props = defineProps({
   companyVideoData: {
      type: Object,
      default() {
         return [
            {
               ip: "192.168.10.5",
               port: 80,
               username: "admin",
               password: "a123456789"
            },
            {
               ip: "192.168.10.6",
               port: 80,
               username: "admin",
               password: "a123456789"
            },
            {
               ip: "192.168.10.4",
               port: 80,
               username: "admin",
               password: "a123456789"
            },
            {
               ip: "192.168.10.3",
               port: 80,
               username: "admin",
               password: "a123456789"
            }
         ];
         return [];
      },
   },
});
@@ -41,25 +17,25 @@
   videoInitPlugin, clickLogin
} = hkModule();
onMounted(()=>{
   for(let i=0; i<props.companyVideoData.length; i++) {
      let item = props.companyVideoData[i];
      WebVideoCtrl.I_Logout(item.ip+"_"+item.port);
   }
   videoInitPlugin(()=>{
const clickLogins = ()=>{
      for(let i=0; i<props.companyVideoData.length; i++) {
         let item = props.companyVideoData[i];
         setTimeout(()=>{
            clickLogin(item, i);
         }, 1000);
      }
}
onMounted(()=>{
   videoInitPlugin(()=>{
      clickLogins();
   });
});
onUnmounted(()=>{
   for(let i=0; i<props.companyVideoData.length; i++) {
      let item = props.companyVideoData[i];
      WebVideoCtrl.I_Logout(item.ip+"_"+item.port);
      WebVideoCtrl.I_Logout(item.ip);
   }
   WebVideoCtrl.I_GetPluginOBJECT().JS_DestroyPlugin();
});