import{P as F}from"./index.e651cfa0.js";import{d as H}from"./index.e2bd5212.js";import{d as k,s as w,r as i,b as n,_ as Q,o as N,c as P,V as m,M as A,a as p,a1 as M,u as o,T as W}from"./@vue.96c135a1.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";import{t as q}from"./vue-qrcode.1c214cc4.js";import"./element-plus.55d71530.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.f4694335.js";import"./@element-plus.07bd0514.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./axios.c6b9fe3d.js";import"./@amap.8a62addd.js";import"./vue-router.64fdcd9a.js";import"./pinia.aebd7275.js";import"./css-color-function.7f53c13d.js";import"./color.4952d479.js";import"./clone.dd01d7ea.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.80787eb0.js";import"./tslib.60310f1a.js";import"./zrender.6f33727c.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.3d7ee361.js";import"./qrcode.70c525de.js";import"./dijkstrajs.045ee9e2.js";const C="/admin/assets/wx20241018090346.d52a687c.jpg",Y={class:"qrcode-popup"},$=["src"],G=k({name:"HeadQrcode"}),J=k({...G,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(K,{expose:b,emit:I}){const d=I;w();const u=w(),_=i("qrcode"),B=n(()=>(_.value=="qrcode","")),a=Q({id:"",qrValue:"",property_name:"",village_name:"",head_name:""}),R=async t=>{for(const e in a)t[e]!=null&&t[e]!=null&&(a[e]=t[e])},j=(t="qrcode")=>{var e;_.value=t,(e=u.value)==null||e.open()},E=()=>{d("close")},L=n(()=>a.village_name),S=n(()=>L.value.length*15),T=n(()=>300/2-S.value/2),D=n(()=>({left:`${T.value}px`,top:"15px"})),g=i(C),l=n(()=>"https://weixiu.kyjlkj.com/agent/company_h5/index.html?id="+a.id+"&property_name="+a.property_name),f=i(200),v=i("H"),c=i(null),s=new Image;s.src=C;const h=()=>{if(c.value){const t=document.createElement("canvas"),e=t.getContext("2d"),U=c.value.querySelector(".tw-qr-code");t.width=s.width,t.height=s.height,e.drawImage(s,0,0),e.drawImage(U,265,1055),e.font="110px Arial",e.fillStyle="white";const x=a.village_name,V=e.measureText(x).width,z=t.width/2-V/2,O=170;e.fillText(a.village_name,z,O),t.toBlob(X=>{const y=URL.createObjectURL(X),r=document.createElement("a");r.href=y,r.target="_blank",r.download=x+".png",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(y)})}d("close")};return b({originalImageUrl:g,qrCodeValue:l,qrCodeSize:f,qrCodeLevel:v,imageContainer:c,downloadImage:h,open:j,setFormData:R}),(t,e)=>(N(),P("div",Y,[m(F,{ref_key:"popupRef",ref:u,title:o(B),width:"550px",onClose:E,onConfirm:h,cancelButtonText:"",confirmButtonText:"\u4E0B\u8F7D\u56FE\u7247"},{default:A(()=>[p("div",{ref_key:"imageContainer",ref:c,class:"image-container"},[p("span",{class:"original-text",style:M(o(D))},W(o(a).village_name),5),p("img",{src:o(g),alt:"Original Image",class:"original-image"},null,8,$),m(o(q),{value:o(l),size:o(f),level:o(v),class:"qr-code",id:"qr-code"},null,8,["value","size","level"]),m(o(q),{value:o(l),width:1145,height:1145,class:"tw-qr-code"},null,8,["value"])],512)]),_:1},8,["title"])]))}});const Ve=H(J,[["__scopeId","data-v-3d26e4cd"]]);export{Ve as default};
