var $url="/common/editor/layerVideo",data=utils.init({attributeName:utils.getQueryString("attributeName"),form:{siteId:utils.getQueryInt("siteId"),type:"upload",videoUrl:"",isPoster:!1,isAutoPlay:!1,isWidth:!1,isHeight:!1,imageUrl:"",width:"100%",height:"300px",isLinkToOriginal:!0},uploadVideoUrl:null,uploadImageUrl:null}),methods={btnSubmitClick:function(){if(!this.form.videoUrl)return utils.error("请上传需要插入的视频文件！"),!1;var i=this.form.isPoster&&this.form.imageUrl?' imageUrl="'+this.form.imageUrl+'"':"",t=' isAutoPlay="'+this.form.isAutoPlay+'"',e=this.form.isWidth?' width="'+this.form.width+'"':"",s=this.form.isHeight?' height="'+this.form.height+'"':"";parent.$vue.insertEditor(this.attributeName,'<img src="/sitefiles/assets/images/video-clip.png"'+i+t+e+s+' playUrl="'+this.form.videoUrl+'" class="siteserver-stl-player" style="width: 333px; height: 333px" /><br/>'),utils.closeLayer()},btnCancelClick:function(){utils.closeLayer()},uploadVideoBefore:i=>!!/(\.mp4|\.flv|\.f4v|\.webm|\.m4v|\.mov|\.3gp|\.3g2)$/i.exec(i.name)||(utils.error("文件只能是视频格式，请选择有效的文件上传!"),!1),uploadImageBefore:i=>/(\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.webp)$/i.exec(i.name)?!!(i.size/1024/1024<10)||(utils.error("上传图片大小不能超过 10MB!"),!1):(utils.error("文件只能是图片格式，请选择有效的文件上传!"),!1),uploadProgress:function(){utils.loading(this,!0)},uploadVideoSuccess:function(i){this.form.videoUrl=i.url,this.form.type="url",utils.loading(this,!1)},uploadImageSuccess:function(i){this.form.imageUrl=i.url,utils.loading(this,!1)},uploadError:function(i){utils.loading(this,!1);var t=JSON.parse(i.message);utils.error(t.message)}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.uploadVideoUrl=$apiUrl+$url+"/actions/uploadVideo?siteId="+this.form.siteId,this.uploadImageUrl=$apiUrl+$url+"/actions/uploadImage?siteId="+this.form.siteId,utils.loading(this,!1)}});