chunk-65e3e776.9ccfe671.js 7.9 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["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")),h=i("2f62"),c={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(h["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=c,f=(i("0d10"),i("2877")),a=Object(f["a"])(d,s,o,!1,null,"92372ab6",null);e["default"]=a.exports},9378:function(t,e,i){},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 h})),i.d(e,"d",(function(){return c})),i.d(e,"a",(function(){return d})),i.d(e,"i",(function(){return f})),i.d(e,"g",(function(){return a}));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(),h=e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds();return i+"-"+s+"-"+o+" "+n+":"+r+":"+h}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,h,c=function c(){var d=+new Date-r;d<e&&d>0?s=setTimeout(c,e-d):(s=null,i||(h=t.apply(n,o),s||(n=o=null)))};return function(){for(var o=arguments.length,d=new Array(o),f=0;f<o;f++)d[f]=arguments[f];n=this,r=+new Date;var a=i&&!s;return s||(s=setTimeout(c,e)),a&&(h=t.apply(n,d),n=d=null),h}}function h(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 c="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 f(t){return t.replace(/( |^)[a-z]/g,(function(t){return t.toUpperCase()}))}function a(t){return/^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(t)}}}]);