2 lines
1.9 KiB
JavaScript
2 lines
1.9 KiB
JavaScript
import{q as t,u as e,o as a,c as r,w as s,a as o,v as n,x as m,y as d,F as l,h as i,e as p,d as u,z as h,j as c}from"./index.953fb5a2.js";import{_ as w}from"./plugin-vue_export-helper.21dcd24c.js";var f=w({data:()=>({top:0,forLength:0}),props:{maxWidth:{type:Number,default:180},rotate:{type:Number,default:-21},margin:{type:Number,default:50},watermark:{type:String,default:"水印文字"},color:{type:String,default:"#000000"},opacity:{type:Number,default:.15},show:{type:Boolean,default:!0}},mounted(){this.getstatusBarHeight()},methods:{getstatusBarHeight(){var a=t();this.top=a.safeArea.top+a.windowTop;var r=parseInt(a.screenHeight*(1.2*a.screenWidth)),s=0;e().in(this).select("#getwh").boundingClientRect((t=>{s=parseInt((t.height+this.margin)*t.width)})).exec();var o=setInterval((()=>{0==s||(clearInterval(o),this.forLength=parseInt(r/s))}),500)}}},[["render",function(t,e,h,c,w,f){const g=p,y=u;return h.show?(a(),r(y,{key:0},{default:s((()=>[o(y,{class:"zmm-watermark-box",style:n([{top:w.top+"px"},{opacity:h.opacity}])},{default:s((()=>[o(y,{class:"zmm-watermark-getwh",ref:"getwh",id:"getwh",style:n([{"max-width":h.maxWidth+"px"}])},{default:s((()=>[o(g,{nodes:h.watermark},null,8,["nodes"])])),_:1},8,["style"]),o(y,{class:"zmm-watermark-content"},{default:s((()=>[(a(!0),m(l,null,d(w.forLength,((t,e)=>(a(),r(y,{class:"zmm-watermark-text",style:n([{color:h.color},{"margin-bottom":h.margin+"px"},{"max-width":h.maxWidth+"px"},{transform:"rotate("+h.rotate+"deg)"}]),key:e},{default:s((()=>[o(g,{nodes:h.watermark},null,8,["nodes"])])),_:2},1032,["style"])))),128))])),_:1})])),_:1},8,["style"])])),_:1})):i("",!0)}],["__scopeId","data-v-7e01d3b5"]]);function g(t,e){return h(t)?e:t}var y=w({name:"watermark",data:()=>({}),computed:{watermark(){return this.$store.state.watermark}}},[["render",function(t,e,s,o,n,m){const d=g(c("zmm-watermark"),f);return a(),r(d,{opacity:.05,watermark:m.watermark},null,8,["opacity","watermark"])}]]);export{y as _,g as r};
|