chunk-61cf34a0.8e00044e.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-61cf34a0","chunk-65e3e776"],{"0d10":function(t,e,i){"use strict";i("9378")},5790:function(t,e,i){"use strict";i("d2b1")},"87d3":function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{ref:"app1",staticStyle:{width:"100%",height:"100%"},attrs:{id:"app1"}},[i("player",{directives:[{name:"show",rawName:"v-show",value:t.videoShow,expression:"videoShow"}],ref:"player",attrs:{"video-url":t.videoSrc,"camera-name":t.cameraName,fluent:"",autoplay:"",live:"","has-audio":!0},on:{destroy:t.close}}),i("div",{ref:"rectArea",staticClass:"rect"}),i("div",{ref:"videoZoom",staticClass:"video-zoom"},[t.videoZoomShow?i("player",{ref:"playerZoom",attrs:{id:"zoom"+t.videoId,"video-url":t.videoSrc,"camera-name":t.cameraName,showButtonBox:!1,fluent:"",autoplay:"",live:"","has-audio":!0}}):t._e()],1)],1)},r=[],n=i("5530"),o=(i("a9e3"),i("badc")),c=i("2f62"),a={name:"jessibucaBox",components:{player:o["a"]},props:{videoId:{type:Number,default:0},videoSrc:{type:String,default:""},cameraName:{type:String,default:""}},data:function(){return{videoZoomShow:!1,videoShow:!0,videoZoomFlag:!1,top:0,left:0,downX:0,downY:0,mouseX2:0,mouseY2:0,rect:null,select:!1,rectInfo:{videoWidth:0,videoHeight:0,rectWidth:0,rectHeight:0,rectCenterOffsetX:0,rectCenterOffsetY:0}}},computed:Object(n["a"])({},Object(c["c"])(["boxList"])),mounted:function(){this.rectZoomInit()},created:function(){},methods:{close:function(){this.$emit("destroy",this.videoId)},rectZoomInit:function(){this.$refs.app1.addEventListener("mousedown",this.down),this.$refs.app1.addEventListener("mousemove",this.move)},down:function(t){this.rect||(this.downX=t.clientX,this.downY=t.clientY,this.select=!0,this.rect=this.$refs.rectArea,this.top=this.$refs.app1.getBoundingClientRect().top,console.log("this.top",this.top),this.left=this.$refs.app1.getBoundingClientRect().left,console.log("this.left",this.left),this.rectInfo.videoHeight=this.$refs.app1.offsetHeight,this.rectInfo.videoWidth=this.$refs.app1.offsetWidth,document.addEventListener("mouseup",this.up))},move:function(t){this.select&&(this.mouseX2=t.clientX,this.mouseY2=t.clientY,this.mouseX2<this.downX&&this.mouseY2<this.downY&&(this.rect.style.left=this.mouseX2-this.left+"px",this.rect.style.top=this.mouseY2-this.top+"px",this.videoZoomFlag=!1),this.mouseX2>this.downX&&this.mouseY2<this.downY&&(this.rect.style.left=this.downX-this.left+"px",this.rect.style.top=this.mouseY2-this.top+"px",this.videoZoomFlag=!1),this.mouseX2<this.downX&&this.mouseY2>this.downY&&(this.rect.style.left=this.mouseX2-this.left+"px",this.rect.style.top=this.downY-this.top+"px",this.videoZoomFlag=!1),this.mouseX2>this.downX&&this.mouseY2>this.downY&&(this.rect.style.left=this.downX-this.left+"px",this.rect.style.top=this.downY-this.top+"px",this.videoZoomFlag=!0),this.rect.style.width=Math.abs(this.mouseX2-this.downX)+"px",this.rect.style.height=Math.abs(this.mouseY2-this.downY)+"px",this.rect.style.visibility="visible")},up:function(){if(this.select=!1,"hidden"!==this.rect.style.visibility){this.rectInfo.rectWidth=Math.abs(this.mouseX2-this.downX),this.rectInfo.rectHeight=Math.abs(this.mouseY2-this.downY),this.rectInfo.rectCenterOffsetX=parseInt(this.rect.style.left)+this.rectInfo.rectWidth/2,this.rectInfo.rectCenterOffsetY=parseInt(this.rect.style.top)+this.rectInfo.rectHeight/2;var t=this.rectInfo.rectWidth/this.rectInfo.rectHeight,e=this.rectInfo.videoWidth/this.rectInfo.videoHeight;t<e?(this.rectInfo.rectWidth=this.rectInfo.rectHeight*e,this.rectInfo.rectCenterOffsetX<this.rectInfo.rectWidth/2&&(this.rectInfo.rectCenterOffsetX=this.rectInfo.rectWidth/2),this.rectInfo.rectCenterOffsetX+this.rectInfo.rectWidth/2>this.rectInfo.videoWidth&&(this.rectInfo.rectCenterOffsetX=this.rectInfo.videoWidth-this.rectInfo.rectWidth/2)):t>e&&(this.rectInfo.rectHeight=this.rectInfo.rectWidth/e,this.rectInfo.rectCenterOffsetY<this.rectInfo.rectHeight/2&&(this.rectInfo.rectCenterOffsetY=this.rectInfo.rectHeight/2),this.rectInfo.rectCenterOffsetY+this.rectInfo.rectHeight/2>this.rectInfo.videoHeight&&(this.rectInfo.rectCenterOffsetY=this.rectInfo.videoHeight-this.rectInfo.rectHeight/2)),this.handleVideo()}this.resetRect()},handleVideo:function(){if(this.rectInfo.videoWidth/this.rectInfo.rectWidth<=10&&this.videoZoomFlag){var t=this.rectInfo.videoWidth/this.rectInfo.rectWidth;this.videoZoomShow||(this.$refs.videoZoom.style.width=this.rectInfo.videoWidth*t+"px",this.$refs.videoZoom.style.height=9/16*this.rectInfo.videoWidth*t+"px",this.$refs.videoZoom.style.top=-(this.rectInfo.rectCenterOffsetY-this.rectInfo.rectHeight/2)*t+"px",this.$refs.videoZoom.style.left=-(this.rectInfo.rectCenterOffsetX-this.rectInfo.rectWidth/2)*t+"px",this.videoShow=!1,this.videoZoomShow=!0)}else this.$refs.videoZoom.style.width="0px",this.$refs.videoZoom.style.height="0px",this.videoShow=!0,this.videoZoomShow=!1},resetRect:function(){document.removeEventListener("mouseup",this.up),this.rect.style.visibility="hidden",this.rect.style.width="0px",this.rect.style.height="0px",this.top=0,this.left=0,this.downX=0,this.downY=0,this.mouseX2=0,this.mouseY2=0,this.rect=null,this.rectInfo={videoWidth:0,videoHeight:0,rectWidth:0,rectHeight:0,rectCenterOffsetX:0,rectCenterOffsetY:0}}},destroyed:function(){}},d=a,h=(i("0d10"),i("2877")),l=Object(h["a"])(d,s,r,!1,null,"92372ab6",null);e["default"]=l.exports},9378:function(t,e,i){},a458:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"video-wall-container"},[i("transition-group",{staticClass:"video-grid",style:t.gridStyle,attrs:{name:"grid-fade",tag:"div"}},t._l(t.currentBoxList,(function(e,s){return i("div",{key:e.boxId,staticClass:"video-cell",class:{"is-active":t.selectedMonitor&&t.selectedMonitor.boxId===e.boxId,"is-dragging":t.draggedItem&&t.draggedItem.boxId===e.boxId,"is-recording":e.recording},attrs:{id:"childBox_"+e.boxId,draggable:"true"},on:{click:function(i){return t.setActiveBox(e)},dblclick:function(i){return t.changeToOne(e)},dragstart:function(i){return t.handleDragStart(e,i)},dragover:function(e){return t.handleDragOver(e)},drop:function(i){return t.handleDrop(e,i)},dragend:function(e){return t.handleDragEnd(e)}}},[i("div",{staticClass:"video-wrapper"},["H264"!==e.code&&"H265"===e.code||!e.mainUrl?"H265"===e.code&&e.mainUrl?i("jessibucaBox",{ref:"player",refInFor:!0,staticClass:"player-instance",attrs:{"video-src":1===t.active?e.mainUrl:e.auxiliaryUrl,"video-id":e.boxId,"camera-name":e.name},on:{destroy:t.close}}):i("div",{staticClass:"empty-state"},[i("i",{staticClass:"el-icon-video-camera"}),i("span",[t._v("无信号")])]):i("webrtc-player",{ref:"player",refInFor:!0,staticClass:"player-instance",attrs:{"video-src":1===t.active?e.mainUrl:e.auxiliaryUrl,"video-id":e.boxId,"camera-name":e.name},on:{destroy:t.close}})],1),i("div",{staticClass:"video-overlay"},[i("span",{staticClass:"video-title"},[t._v(t._s(e.name||"通道 "+e.boxId))]),i("div",{staticClass:"status-indicators"},[e.recording?i("i",{staticClass:"el-icon-loading recording-icon",attrs:{title:"录像中"}}):t._e()])])])})),0)],1)},r=[];i("a4d3");function n(t,e){if(null==t)return{};var i={};for(var s in t)if({}.hasOwnProperty.call(t,s)){if(e.indexOf(s)>=0)continue;i[s]=t[s]}return i}function o(t,e){if(null==t)return{};var i,s,r=n(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(s=0;s<o.length;s++)i=o[s],e.indexOf(i)>=0||{}.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}var c=i("5530"),a=(i("7db0"),i("c740"),i("fb6a"),i("e9c4"),i("b64b"),i("d3b7"),i("159b"),i("badc")),d=i("3724"),h=i("87d3"),l=i("2f62"),f=["boxId"],u=["boxId"],m={name:"VideoWall",components:{player:a["a"],webrtcPlayer:d["a"],jessibucaBox:h["default"]},data:function(){return{draggedItem:null,timer:null}},computed:Object(c["a"])(Object(c["a"])({},Object(l["c"])(["boxList","active","lastActive","selectedTreeData","selectedMonitor","boxListIndex"])),{},{currentBoxList:function(){var t=0;switch(this.active){case 1:t=1;break;case 4:t=4;break;case 9:t=9;break;case 16:t=16;break;case 36:t=36;break;case 64:t=64;break;default:t=this.active}return this.boxList.slice(this.boxListIndex,this.boxListIndex+t)},gridStyle:function(){var t=1;switch(this.active){case 1:t=1;break;case 4:t=2;break;case 9:t=3;break;case 16:t=4;break;case 36:t=6;break;case 64:t=8;break;default:t=Math.ceil(Math.sqrt(this.active))}return{"grid-template-columns":"repeat(".concat(t,", 1fr)"),"grid-template-rows":"repeat(".concat(t,", 1fr)")}}}),methods:{stopRecordings:function(t,e){var i=this;this.$refs.player&&0!==this.$refs.player.length&&t.forEach((function(t){var s=i.$refs.player.find((function(e){return e.videoId===t.boxId}));s&&"function"===typeof s.stopRecording&&s.stopRecording(e)}))},closeAllVideos:function(){var t=this;this.boxList.forEach((function(e){(e.mainUrl||e.auxiliaryUrl)&&(t.setActiveBox(e),Object.assign(e,{mainUrl:"",auxiliaryUrl:"",code:"",cameraId:"",name:"",rtc:"",rtsp:"",recording:!1}))})),this.$store.commit("updateSelectedMonitor",{}),this.$emit("clearTreeSelected"),this.$message.success("所有预览已关闭")},changeToOne:function(t){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.boxList.some((function(t){return t.recording}))&&1!==this.active&&this.$message.warning("正在录像中,切换分屏可能会中断录像!"),0!==this.lastActive)this.$store.commit("updateBoxListIndex",0),this.$store.commit("updateActive",this.lastActive),this.$store.commit("updateLastActive",0);else{if(1===this.active)return;this.$store.commit("updateLastActive",this.active);var e=t.boxId-1;this.$store.commit("updateBoxListIndex",e),this.$store.commit("updateActive",1)}},close:function(t){var e=JSON.parse(JSON.stringify(this.boxList)),i=e.findIndex((function(e){return e.boxId===t}));-1!==i&&(e[i]={boxId:t,mainUrl:"",auxiliaryUrl:"",code:"",cameraId:"",name:"",rtc:"",rtsp:"",recording:!1}),this.$store.commit("updateBoxList",e),this.showRedBorder=!1,this.$emit("clearTreeSelected")},setActiveBox:function(t){this.$store.commit("updateSelectedMonitor",t),t.cameraId?this.$emit("setCurrentKeyTree",t.cameraId):this.$emit("clearTreeSelected")},handleDragStart:function(t,e){if(t.recording)return this.$message.warning("无法拖拽正在录像的窗口!"),void e.preventDefault();this.draggedItem=t,e.dataTransfer.effectAllowed="move"},handleDragOver:function(t){t.preventDefault(),t.dataTransfer.dropEffect="move"},handleDragEnd:function(){this.draggedItem=null},handleDrop:function(t,e){e.preventDefault();var i=this.draggedItem;if(i&&i.boxId!==t.boxId)if(t.recording)this.$message.warning("无法拖拽到正在录像的窗口!");else{var s=JSON.parse(JSON.stringify(this.boxList)),r=s.findIndex((function(t){return t.boxId===i.boxId})),n=s.findIndex((function(e){return e.boxId===t.boxId}));if(-1!==r&&-1!==n){var a=s[r],d=a.boxId,h=o(a,f),l=s[n],m=l.boxId,p=o(l,u);if(s[r]=Object(c["a"])(Object(c["a"])({},p),{},{boxId:d}),s[n]=Object(c["a"])(Object(c["a"])({},h),{},{boxId:m}),this.$store.commit("updateBoxList",s),this.selectedMonitor&&(this.selectedMonitor.boxId===d||this.selectedMonitor.boxId===m))this.selectedMonitor.boxId}this.draggedItem=null}}}},p=m,v=(i("5790"),i("2877")),g=Object(v["a"])(p,s,r,!1,null,"15eba178",null);e["default"]=g.exports},c421:function(t,e,i){"use strict";i("b775")},d2b1:function(t,e,i){},ed08:function(t,e,i){"use strict";i.d(e,"e",(function(){return s})),i.d(e,"f",(function(){return r})),i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return o})),i.d(e,"h",(function(){return c})),i.d(e,"d",(function(){return a})),i.d(e,"a",(function(){return d})),i.d(e,"i",(function(){return h})),i.d(e,"g",(function(){return l}));i("53ca"),i("d9e2"),i("a630"),i("a15b"),i("d81d"),i("14d9"),i("fb6a"),i("b64b"),i("d3b7"),i("4d63"),i("c607"),i("ac1f"),i("2c3e"),i("00b4"),i("25f0"),i("6062"),i("3ca3"),i("466d"),i("5319"),i("159b"),i("ddb0"),i("c38a");function s(t){if(null==t||""==t)return"";var e=new Date(t),i=e.getFullYear(),s=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,r=e.getDate()<10?"0"+e.getDate():e.getDate(),n=e.getHours()<10?"0"+e.getHours():e.getHours(),o=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),c=e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds();return i+"-"+s+"-"+r+" "+n+":"+o+":"+c}function r(t){if(null==t||""==t)return"";var e=new Date(t),i=e.getFullYear(),s=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,r=e.getDate()<10?"0"+e.getDate():e.getDate();e.getHours(),e.getHours(),e.getMinutes(),e.getMinutes(),e.getSeconds(),e.getSeconds();return i+"/"+s+"/"+r}function n(t){for(var e=t.length,i=t.length-1;i>=0;i--){var s=t.charCodeAt(i);s>127&&s<=2047?e++:s>2047&&s<=65535&&(e+=2),s>=56320&&s<=57343&&i--}return e}function o(t,e,i){var s,r,n,o,c,a=function a(){var d=+new Date-o;d<e&&d>0?s=setTimeout(a,e-d):(s=null,i||(c=t.apply(n,r),s||(n=r=null)))};return function(){for(var r=arguments.length,d=new Array(r),h=0;h<r;h++)d[h]=arguments[h];n=this,o=+new Date;var l=i&&!s;return s||(s=setTimeout(a,e)),l&&(c=t.apply(n,d),n=d=null),c}}function c(t,e){for(var i=Object.create(null),s=t.split(","),r=0;r<s.length;r++)i[s[r]]=!0;return e?function(t){return i[t.toLowerCase()]}:function(t){return i[t]}}var a="export default ",d={html:{indent_size:"2",indent_char:" ",max_preserve_newlines:"-1",preserve_newlines:!1,keep_array_indentation:!1,break_chained_methods:!1,indent_scripts:"separate",brace_style:"end-expand",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"110",indent_inner_html:!0,comma_first:!1,e4x:!0,indent_empty_lines:!0},js:{indent_size:"2",indent_char:" ",max_preserve_newlines:"-1",preserve_newlines:!1,keep_array_indentation:!1,break_chained_methods:!1,indent_scripts:"normal",brace_style:"end-expand",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!0,end_with_newline:!0,wrap_line_length:"110",indent_inner_html:!0,comma_first:!1,e4x:!0,indent_empty_lines:!0}};function h(t){return t.replace(/( |^)[a-z]/g,(function(t){return t.toUpperCase()}))}function l(t){return/^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(t)}}}]);