var $url="/cms/settings/settingsWaterMark",data=utils.init({siteId:utils.getQueryInt("siteId"),urlUpload:null,pageType:null,form:null,families:null,imageUrl:null}),methods={apiGet:function(){var t=this;utils.loading(this,!0),$api.get($url,{params:{siteId:this.siteId}}).then(function(i){var a=i.data;t.urlUpload=$apiUrl+$url+"/actions/upload?siteId="+t.siteId,t.form={siteId:t.siteId,isWaterMark:a.site.isWaterMark,waterMarkPosition:a.site.waterMarkPosition,waterMarkTransparency:a.site.waterMarkTransparency,waterMarkMinWidth:a.site.waterMarkMinWidth,waterMarkMinHeight:a.site.waterMarkMinHeight,isImageWaterMark:a.site.isImageWaterMark,waterMarkFormatString:a.site.waterMarkFormatString,waterMarkFontName:a.site.waterMarkFontName,waterMarkFontSize:a.site.waterMarkFontSize,waterMarkImagePath:a.site.waterMarkImagePath},t.families=a.families,t.imageUrl=a.imageUrl}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiSubmit:function(){var t=this;utils.loading(this,!0),$api.post($url,this.form).then(function(t){t.data;utils.success("图片水印设置保存成功！")}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},uploadBefore:t=>/(\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.webp)$/i.exec(t.name)?!!(t.size/1024/1024<10)||(utils.error("上传图片大小不能超过 10MB!"),!1):(utils.error("文件只能是图片格式，请选择有效的文件上传!"),!1),uploadProgress:function(){utils.loading(this,!0)},uploadSuccess:function(t,i){utils.loading(this,!1),this.imageUrl=t.imageUrl,this.form.waterMarkImagePath=t.virtualUrl},uploadError:function(t){utils.loading(this,!1);var i=JSON.parse(t.message);utils.error(i.message)},btnSubmitClick:function(){var t=this;this.$refs.form.validate(function(i){i&&t.apiSubmit()})}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});