chunk-d77a869e.f60a9d04.js 12 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d77a869e","chunk-65e3e776"],{"0d10":function(t,e,i){"use strict";i("9378")},"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)},o=[],n=i("5530"),r=(i("a9e3"),i("badc")),c=i("2f62"),h={name:"jessibucaBox",components:{player:r["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(){}},a=h,d=(i("0d10"),i("2877")),l=Object(d["a"])(a,s,o,!1,null,"92372ab6",null);e["default"]=l.exports},"8e68":function(t,e,i){},9378:function(t,e,i){},a18b: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("el-card",{staticStyle:{border:"none","border-radius":"0",height:"100%","background-color":"transparent"},attrs:{"body-style":{height:"100%",padding:"0px",background:"transparent",textAlign:"-webkit-center"}}},[i("el-row",{staticClass:"mainBox",style:t.mainBoxStyle},t._l(t.boxList.slice(t.boxListIndex),(function(e,s){return i("el-col",{key:e.boxId,staticClass:"childBox",class:{redBorder:t.ifShowRedBorder(e)},style:{height:t.heightActive},attrs:{span:t.number,id:"childBox_"+e.boxId},nativeOn:{click:function(i){return t.setActiveBox(e)},dblclick:function(i){return t.changeToOne(e)}}},[i("div",[i("span",{staticClass:"title"},[t._v(t._s(e.name))])]),"H264"!==e.code&&"H265"===e.code||!e.mainUrl?t._e():i("webrtc-player",{key:s,ref:"player",refInFor:!0,staticStyle:{width:"100%"},attrs:{"video-src":1===t.active?e.mainUrl:e.auxiliaryUrl,"video-id":e.boxId,"camera-name":e.name},on:{destroy:t.close}}),"H265"===e.code&&e.mainUrl?i("jessibucaBox",{ref:"player",refInFor:!0,attrs:{"video-src":1===t.active?e.mainUrl:e.auxiliaryUrl,"video-id":e.boxId,"camera-name":e.name},on:{destroy:t.close}}):t._e(),e.mainUrl?t._e():i("span",{staticStyle:{color:"white"}},[t._v("无信号")])],1)})),1)],1)},o=[],n=i("5530"),r=(i("d81d"),i("b0c0"),i("a9e3"),i("d3b7"),i("159b"),i("badc")),c=i("3724"),h=i("2f62"),a=i("87d3"),d={name:"videoBox1",components:{player:r["a"],webrtcPlayer:c["a"],jessibucaBox:a["default"]},data:function(){return{clickBoxId:"",showRedBorder:!0,mainBoxStyle:{},resizeObserver:null}},computed:Object(n["a"])(Object(n["a"])({},Object(h["c"])(["boxList","active","lastActive","selectedTreeData","selectedMonitor","boxListIndex"])),{},{number:function(){switch(this.active){case 1:return 24;case 4:return 12;case 9:return 8;case 16:return 6}},heightActive:function(){switch(this.active){case 1:return"100%";case 4:return"50%";case 9:return"33.33%";case 16:return"25%"}},setImageSize:function(){switch(this.active){case 1:return 200;case 4:return 100;case 9:return 66;case 16:return 50}}}),mounted:function(){var t=this;this.updateMainBoxSize(),this.resizeObserver=new ResizeObserver((function(){return t.updateMainBoxSize()})),this.resizeObserver.observe(this.$el),window.addEventListener("resize",this.updateMainBoxSize)},beforeDestroy:function(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),window.removeEventListener("resize",this.updateMainBoxSize)},methods:{closeAllVideos:function(){var t=this;this.boxList.forEach((function(e){(e.mainUrl||e.auxiliaryUrl)&&(t.setActiveBox(e),e.mainUrl="",e.auxiliaryUrl="",e.code="",e.cameraId="",e.name="",e.rtc="",e.rtsp="")})),this.$store.commit("updateSelectedMonitor",{}),this.showRedBorder=!1,this.$emit("clearTreeSelected"),this.$message.success("所有预览已关闭")},updateMainBoxSize:function(){var t=this.$el,e=t.clientWidth,i=t.clientHeight,s=9*e/16;this.mainBoxStyle=s<=i?{width:"".concat(e,"px"),height:"100%"}:{width:"100%",height:"".concat(i,"px")}},changeToOne:function(t){console.log(this.boxList);var e=this.timer;if(e&&(window.clearTimeout(e),this.timer=null),0!==this.lastActive)return console.log("lastActive",this.lastActive),this.$store.commit("updateBoxListIndex",0),this.$store.commit("updateActive",this.lastActive),void this.$store.commit("updateLastActive",0);1!==this.active&&(this.boxList.some((function(t){return!0===t.recording}))?this.$message.warning("正在录像中,请先结束录像!"):(this.$store.commit("updateLastActive",this.active),1===t.boxId||this.$store.commit("updateBoxListIndex",Number(t.boxId-1)),this.$store.commit("updateActive",1)))},close:function(t){var e=this;this.setActiveBox(this.boxList[t-1]),this.$nextTick((function(){e.boxList.map((function(e){e.boxId===t&&(e.mainUrl="",e.auxiliaryUrl="",e.code="",e.cameraId="",e.name="",e.rtc="",e.rtsp="")})),e.showRedBorder=!1}))},setActiveBox:function(t){var e=this;this.$nextTick((function(){t.cameraId?(e.$emit("setCurrentKeyTree",t.cameraId),e.$store.commit("updateSelectedMonitor",t),e.showRedBorder=!0):e.showRedBorder=!1}))},setShowBorder:function(t){this.showRedBorder=t},ifShowRedBorder:function(t){return this.showRedBorder&&this.selectedMonitor.boxId==t.boxId}},destroyed:function(){this.showRedBorder=!1}},l=d,u=(i("f12a"),i("2877")),f=Object(u["a"])(l,s,o,!1,null,"e0b5ac60",null);e["default"]=f.exports},c421:function(t,e,i){"use strict";i("b775")},ed08:function(t,e,i){"use strict";i.d(e,"e",(function(){return s})),i.d(e,"f",(function(){return o})),i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"h",(function(){return c})),i.d(e,"d",(function(){return h})),i.d(e,"a",(function(){return a})),i.d(e,"i",(function(){return d})),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,o=e.getDate()<10?"0"+e.getDate():e.getDate(),n=e.getHours()<10?"0"+e.getHours():e.getHours(),r=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),c=e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds();return i+"-"+s+"-"+o+" "+n+":"+r+":"+c}function o(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,o=e.getDate()<10?"0"+e.getDate():e.getDate();e.getHours(),e.getHours(),e.getMinutes(),e.getMinutes(),e.getSeconds(),e.getSeconds();return i+"/"+s+"/"+o}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 r(t,e,i){var s,o,n,r,c,h=function h(){var a=+new Date-r;a<e&&a>0?s=setTimeout(h,e-a):(s=null,i||(c=t.apply(n,o),s||(n=o=null)))};return function(){for(var o=arguments.length,a=new Array(o),d=0;d<o;d++)a[d]=arguments[d];n=this,r=+new Date;var l=i&&!s;return s||(s=setTimeout(h,e)),l&&(c=t.apply(n,a),n=a=null),c}}function c(t,e){for(var i=Object.create(null),s=t.split(","),o=0;o<s.length;o++)i[s[o]]=!0;return e?function(t){return i[t.toLowerCase()]}:function(t){return i[t]}}var h="export default ",a={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 d(t){return t.replace(/( |^)[a-z]/g,(function(t){return t.toUpperCase()}))}function l(t){return/^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(t)}},f12a:function(t,e,i){"use strict";i("8e68")}}]);