99 lines
2.3 KiB
Vue
99 lines
2.3 KiB
Vue
|
|
<template>
|
|||
|
|
<div id="playWnd"></div>
|
|||
|
|
</template>
|
|||
|
|
<script>
|
|||
|
|
import {
|
|||
|
|
OpenVideo,
|
|||
|
|
unInitObjPlugin,
|
|||
|
|
InitObjPlugin,hidePluginWindow,showPluginWindow,resizeFn,isLoadPlugin
|
|||
|
|
} from "./video_isc_plugin.js";
|
|||
|
|
export default {
|
|||
|
|
props: ["devList","type"],
|
|||
|
|
watch: {
|
|||
|
|
//监听value的变化,进行相应的操作即可
|
|||
|
|
devList: function (a, b) {
|
|||
|
|
console.log('isc_plugin.vue获取到设备列表')
|
|||
|
|
//a是value的新值,b是旧值
|
|||
|
|
if(a.length>0){
|
|||
|
|
isLoadPlugin(a,this.layout)
|
|||
|
|
}else{
|
|||
|
|
// unInitObjPlugin()
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// a.forEach(element => {
|
|||
|
|
// setTimeout(()=>{
|
|||
|
|
// OpenVideo(element.serialNumber,1)
|
|||
|
|
// },500)
|
|||
|
|
|
|||
|
|
// });
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
isExpand:{
|
|||
|
|
immediate: true,
|
|||
|
|
handler: function (newval) {
|
|||
|
|
console.log('resizeFn')
|
|||
|
|
resizeFn()
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
computed: {
|
|||
|
|
isExpand() {
|
|||
|
|
return this.$store.state.isExpand;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
data(){
|
|||
|
|
return{
|
|||
|
|
layout:''
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
created(){
|
|||
|
|
this.$EventBus.$on("controlVideoShowOrHide", (data) => {
|
|||
|
|
console.log('controlVideoShowOrHide',data)
|
|||
|
|
if(data=='hide'){
|
|||
|
|
hidePluginWindow()
|
|||
|
|
}else{
|
|||
|
|
showPluginWindow()
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
},
|
|||
|
|
mounted(){
|
|||
|
|
var layout = '2x2'
|
|||
|
|
if(this.type=='company'){
|
|||
|
|
// layout='6x10'
|
|||
|
|
layout='4x6'
|
|||
|
|
}
|
|||
|
|
if(this.type.indexOf('x')!=-1){
|
|||
|
|
layout=this.type
|
|||
|
|
}
|
|||
|
|
this.layout=layout
|
|||
|
|
console.log('加载isc_plugin.vue')
|
|||
|
|
// console.log(this.type)
|
|||
|
|
// console.log('layout',layout)
|
|||
|
|
// InitObjPlugin(
|
|||
|
|
// this.devList[0].appId,
|
|||
|
|
// this.devList[0].appSecret,
|
|||
|
|
// this.devList[0].account,
|
|||
|
|
// this.devList[0].password,
|
|||
|
|
// false,
|
|||
|
|
// this.devList,layout
|
|||
|
|
// );
|
|||
|
|
if(this.devList.length>0){
|
|||
|
|
isLoadPlugin(this.devList,this.layout)
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
beforeDestroy() {
|
|||
|
|
//反初始化
|
|||
|
|
unInitObjPlugin();
|
|||
|
|
},
|
|||
|
|
methods:{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
<style lang="scss" scoped>
|
|||
|
|
#playWnd{
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
}
|
|||
|
|
</style>
|