|
@@ -6,20 +6,23 @@
|
|
|
element="div"
|
|
|
v-model="signalPreList"
|
|
|
:options="dragOptions2"
|
|
|
- :class="['split_screen', bigScreenObj[item.ID].splitStatus === 0 ? 'split_screen_one' : bigScreenObj[item.ID].splitStatus === 1 ? 'split_screen_four' : bigScreenObj[item.ID].splitStatus === 2 ? 'split_screen_nine' : 'split_screen_sixteen']"
|
|
|
+ :class="['split_screen',
|
|
|
+ bigScreenObj[item.ID] ?
|
|
|
+ bigScreenObj[item.ID].splitStatus === 0 ? 'split_screen_one' :
|
|
|
+ bigScreenObj[item.ID].splitStatus === 1 ? 'split_screen_four' :
|
|
|
+ bigScreenObj[item.ID].splitStatus === 2 ? 'split_screen_nine' : 'split_screen_sixteen' : '']"
|
|
|
:style="{
|
|
|
float:'left',
|
|
|
width:item.Width*bigScale + 'px',
|
|
|
height:item.Height*bigScale + 'px',
|
|
|
- left:item.Left*bigScale+'px',
|
|
|
- top:item.Top*bigScale+'px',
|
|
|
+ left:(item.Left-window.Left)*bigScale+'px',
|
|
|
+ top:(item.Top-window.Top)*bigScale+'px',
|
|
|
zIndex:item.ZIndex,
|
|
|
- display:item.IsVisibility ? 'black' : 'none',
|
|
|
}"
|
|
|
:id="item.ID"
|
|
|
>
|
|
|
<VueDragResize
|
|
|
- v-for="itemV in bigScreenObj[item.ID].signalArr" :key="itemV.Id" class="sitem"
|
|
|
+ v-for="itemV in bigScreenObj[item.ID] ? bigScreenObj[item.ID].signalArr : []" :key="itemV.Id" class="sitem"
|
|
|
:w="itemV.width" :h="itemV.height" :parentLimitation="false"
|
|
|
:x="itemV.left" :y="itemV.top"
|
|
|
@dragstop="(position) => dragStop(position,itemV,bigScreenObj,curOpeBigscreenId)"
|
|
@@ -36,7 +39,7 @@
|
|
|
</div>
|
|
|
</VueDragResize>
|
|
|
|
|
|
- <div v-for="itemD in bigScreenObj[item.ID].bindList" class="sitem2">
|
|
|
+ <div v-for="itemD in bigScreenObj[item.ID] ? bigScreenObj[item.ID].bindList : []" class="sitem2">
|
|
|
{{itemD}}
|
|
|
</div>
|
|
|
</draggable>
|
|
@@ -47,7 +50,6 @@
|
|
|
import {mapState} from 'vuex'
|
|
|
import draggable from 'vuedraggable'
|
|
|
import VueDragResize from 'vue-drag-resize'
|
|
|
- import PubSub from 'pubsub-js'
|
|
|
|
|
|
import '../assets/less/splitscreen.less'
|
|
|
import {elePosition, getElementLeft, getElementTop, getStaticFile, guId} from "../../utils/tools"
|
|
@@ -80,6 +82,7 @@
|
|
|
screenPosition:{}, // 大屏在视口中的位置
|
|
|
videoPlayObj:{}, // 视频播放配置对象
|
|
|
savePreWh:{}, // 保存旧的开窗宽高
|
|
|
+ window:this.$attrs.window
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -90,55 +93,52 @@
|
|
|
},
|
|
|
|
|
|
async beforeCreate() {
|
|
|
- /*this.updateCurrentBigScreen = PubSub.subscribe('updateCurrentBigScreen',(msg,data) => {
|
|
|
- this.currentBigshow = data
|
|
|
- })*/
|
|
|
-
|
|
|
// 加载大屏json文件
|
|
|
const bigScreenJson = await getStaticFile('EnityBigScreen.Data')
|
|
|
// 过滤出显示的大屏
|
|
|
- this.currentBigshow = bigScreenJson.filter(item => item.IsVisibility === true)
|
|
|
+ this.currentBigshow = bigScreenJson.filter(item => item.WindowID === this.window.ID)
|
|
|
+ if(this.currentBigshow.length){
|
|
|
+ // 给大屏对象进行初始化显示
|
|
|
+ const obj = {}
|
|
|
+ this.currentBigshow.forEach(item => {
|
|
|
+ obj[item.ID] = {
|
|
|
+ bindList:[],
|
|
|
+ splitStatus:0,
|
|
|
+ signalArr:[],
|
|
|
+ width:item.Width,
|
|
|
+ height:item.Height
|
|
|
+ }
|
|
|
+ const num = item.BindList.filter(item => item.DeviceID).length
|
|
|
+ // 拼接屏数量
|
|
|
+ for(let i=0;i<num;i++){
|
|
|
+ obj[item.ID].bindList.push(i+1)
|
|
|
+ }
|
|
|
+ // 根据拼接屏数量得到分屏状态
|
|
|
+ obj[item.ID].splitStatus = Math.floor(Math.sqrt(num)-1)
|
|
|
+ })
|
|
|
+ this.$store.dispatch('updateBigscreenObj',obj)
|
|
|
|
|
|
- // 给大屏对象进行初始化显示
|
|
|
- const obj = {}
|
|
|
- this.currentBigshow.forEach(item => {
|
|
|
- obj[item.ID] = {
|
|
|
- bindList:[],
|
|
|
- splitStatus:0,
|
|
|
- signalArr:[],
|
|
|
- width:item.Width,
|
|
|
- height:item.Height
|
|
|
- }
|
|
|
- const num = item.BindList.length
|
|
|
- // 拼接屏数量
|
|
|
- for(let i=0;i<num;i++){
|
|
|
- obj[item.ID].bindList.push(i+1)
|
|
|
- }
|
|
|
- // 根据拼接屏数量得到分屏状态
|
|
|
- obj[item.ID].splitStatus = Math.floor(Math.sqrt(num)-1)
|
|
|
- })
|
|
|
- this.$store.dispatch('updateBigscreenObj',obj)
|
|
|
-
|
|
|
- // 获取视频播放的配置对象
|
|
|
- const preSingleList = await reqPreviewSourceList()
|
|
|
- const videoPlayObj = {}
|
|
|
- for(const item of preSingleList){
|
|
|
- videoPlayObj[item.sourceId] = {
|
|
|
- sources: [
|
|
|
- {
|
|
|
- "src": item.previewUrl,
|
|
|
- "type": "rtmp/flv"
|
|
|
- }
|
|
|
- ],
|
|
|
- techOrder: ['flash'],
|
|
|
- autoplay: true,
|
|
|
- controls: false,
|
|
|
- fluid:true,
|
|
|
- preload: 'auto',
|
|
|
- notSupportedMessage: '此视频暂无法播放,请稍后再试',
|
|
|
+ // 获取视频播放的配置对象
|
|
|
+ const preSingleList = await reqPreviewSourceList()
|
|
|
+ const videoPlayObj = {}
|
|
|
+ for(const item of preSingleList){
|
|
|
+ videoPlayObj[item.sourceId] = {
|
|
|
+ sources: [
|
|
|
+ {
|
|
|
+ "src": item.previewUrl,
|
|
|
+ "type": "rtmp/flv"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ techOrder: ['flash'],
|
|
|
+ autoplay: true,
|
|
|
+ controls: false,
|
|
|
+ fluid:true,
|
|
|
+ preload: 'auto',
|
|
|
+ notSupportedMessage: '此视频暂无法播放,请稍后再试',
|
|
|
+ }
|
|
|
}
|
|
|
+ this.videoPlayObj = videoPlayObj
|
|
|
}
|
|
|
- this.videoPlayObj = videoPlayObj
|
|
|
},
|
|
|
|
|
|
updated() {
|
|
@@ -152,10 +152,6 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- beforeDestroy() {
|
|
|
- // PubSub.unsubscribe(this.updateCurrentBigScreen)
|
|
|
- },
|
|
|
-
|
|
|
methods: {
|
|
|
// 大屏开窗接口提交
|
|
|
async refreshBigScreen(obj,Id) {
|
|
@@ -293,17 +289,5 @@
|
|
|
return this.$refs.videoPlayer.player
|
|
|
},
|
|
|
},
|
|
|
-
|
|
|
- watch: {
|
|
|
- // 监视分屏的状态
|
|
|
- /*splitScreenStatus: function(num) {
|
|
|
- console.log(num)
|
|
|
- this.$data.bindList = []
|
|
|
- for (let i=0;i<(num+1)*(num+1);i++){
|
|
|
- this.$data.bindList.push(i+1)
|
|
|
- }
|
|
|
- this.rfreshBigScreen(this.$data.streamWindows)
|
|
|
- }*/
|
|
|
- }
|
|
|
}
|
|
|
</script>
|