var P=(o,d,u)=>new Promise((W,f)=>{var r=a=>{try{s(u.next(a))}catch(l){f(l)}},n=a=>{try{s(u.throw(a))}catch(l){f(l)}},s=a=>a.done?W(a.value):Promise.resolve(a.value).then(r,n);s((u=u.apply(o,d)).next())});import{r as I,d as R,C as S,__tla as $}from"./index-7a87ec93.js";import{aP as z,z as x,_ as B,__tla as H}from"./index-f0df2f76.js";import{u as m,I as L,k as E,g as N,x as T,d as V,a7 as b,_ as j,a8 as A,a9 as p,f as C,E as v}from"./vue-1631514e.js";import{P as D,__tla as G}from"./index-e26b3a3c.js";import{__tla as J}from"./index-a2613349.js";import"./antd-057b41b1.js";import{__tla as O}from"./useContentViewHeight-c315421e.js";import{__tla as U}from"./useWindowSizeFn-53b82e7c.js";import"./onMountedOrActivated-5690e97c.js";let M,q=Promise.all([(()=>{try{return $}catch(o){}})(),(()=>{try{return H}catch(o){}})(),(()=>{try{return G}catch(o){}})(),(()=>{try{return J}catch(o){}})(),(()=>{try{return O}catch(o){}})(),(()=>{try{return U}catch(o){}})()]).then(()=>P(void 0,null,function*(){const o=Symbol("watermark-dom"),d=new WeakMap;function u(r=E(document.body)){const n=m(r);if(n&&d.has(n))return d.get(n);const s=z(function(){const e=m(r);if(!e)return;const{clientHeight:t,clientWidth:i}=e;h({height:t,width:i})}),a=o.toString(),l=L(),g=()=>{const e=m(l);l.value=void 0;const t=m(r);t&&(e&&t.removeChild(e),I(t,s))};function _(e){const t=document.createElement("canvas"),i=300,k=240;Object.assign(t,{width:i,height:k});const c=t.getContext("2d");return c&&(c.rotate(-20*Math.PI/120),c.font="15px Vedana",c.fillStyle="rgba(0, 0, 0, 0.15)",c.textAlign="left",c.textBaseline="middle",c.fillText(e,i/20,k)),t.toDataURL("image/png")}function h(e={}){const t=m(l);t&&(x(e.width)&&(t.style.width=`${e.width}px`),x(e.height)&&(t.style.height=`${e.height}px`),x(e.str)&&(t.style.background=`url(${_(e.str)}) left top repeat`))}const w=e=>{if(m(l))return h({str:e}),a;const t=document.createElement("div");l.value=t,t.id=a,t.style.pointerEvents="none",t.style.top="0px",t.style.left="0px",t.style.position="absolute",t.style.zIndex="100000";const i=m(r);if(!i)return a;const{clientHeight:k,clientWidth:c}=i;return h({str:e,width:c,height:k}),i.appendChild(t),d.set(i,{setWatermark:y,clear:g}),a};function y(e){w(e),R(document.documentElement,s),N()&&T(()=>{g()})}return{setWatermark:y,clear:g}}const W=V({components:{CollapseContainer:S,PageWrapper:D},setup(){const r=E(null),{setWatermark:n,clear:s}=u();return{setWatermark:n,clear:s,areaRef:r}}});function f(r,n,s,a,l,g){const _=b("a-button"),h=b("CollapseContainer"),w=b("PageWrapper");return j(),A(w,{title:"\u6C34\u5370\u793A\u4F8B"},{default:p(()=>[C(h,{class:"w-full h-32 bg-white rounded-md",title:"Global WaterMark"},{default:p(()=>[C(_,{type:"primary",class:"mr-2",onClick:n[0]||(n[0]=y=>r.setWatermark("WaterMark Info"))},{default:p(()=>[v(" Create ")]),_:1}),C(_,{color:"error",class:"mr-2",onClick:r.clear},{default:p(()=>[v(" Clear ")]),_:1},8,["onClick"]),C(_,{color:"warning",class:"mr-2",onClick:n[1]||(n[1]=y=>r.setWatermark("WaterMark Info New"))},{default:p(()=>[v(" Reset ")]),_:1})]),_:1})]),_:1})}M=B(W,[["render",f]])}));export{q as __tla,M as default};
|