import{g as x,w as D}from"./locationTransform.e2d22cb6.js";import{s as S,g as V}from"./tiandimap.f7d8cf54.js";import{_ as q,d as A,r as y,o as M,z as O,f as m,g as $,n as j,w as c,e as g,h as L,J as z,L as B,b as F}from"./index.2f2d2ba5.js";const I=l=>(z("data-v-f0ab4155"),l=l(),B(),l),N=I(()=>F("div",{id:"mapDiv",class:"map"},null,-1)),E=L("\u786E\u5B9A"),G=L(" \u5173\u95ED "),J=A({name:"queryAddressDialog"}),Q=Object.assign(J,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(l,{emit:i}){const d=l,u=y(""),n=y({});M(()=>{setTimeout(function(){f()},100)});function w(a,e){S(a).then(o=>{if(o.code===200){const t=o.data.pois;e(t)}})}function b(a){const e=a.lonlat.split(",");_(e[0],e[1]),v(e[0],e[1])}function v(a,e){V(a,e).then(o=>{const t=o.data.result,r=D(parseFloat(t.location.lon),parseFloat(t.location.lat));n.value.longitude=r[0],n.value.latitude=r[1],n.value.regionCode=t.addressComponent.county_code.replace("156",""),n.value.region=`${t.addressComponent.province}-${t.addressComponent.city}-${t.addressComponent.county}`,n.value.address=t.formatted_address})}O(()=>d.visible,a=>{a?(n.value.addressType=d.data.addressType,n.value.id=d.data.id,setTimeout(function(){f()},100)):(n.value={},u.value="")});var s,C=14;function f(){const a=x(parseFloat(d.data.lng),parseFloat(d.data.lat));s=new T.Map("mapDiv"),s.centerAndZoom(new T.LngLat(a[0],a[1]),C);const e=new T.Marker(new T.LngLat(a[0],a[1]));s.addOverLay(e),s.addEventListener("click",k)}function k(a){const e=a.lnglat.getLng(),o=a.lnglat.getLat();_(e,o),v(e,o)}function _(a,e){s.clearOverLays();const o=new T.LngLat(a,e);var t=new T.Marker(o);s.addOverLay(t),s.panTo(o)}const h=()=>{i("close",n.value)};return(a,e)=>{const o=m("el-autocomplete"),t=m("el-button"),r=m("el-dialog");return $(),j(r,{"model-value":l.visible,title:"\u5730\u70B9\u67E5\u8BE2",width:"840px","destroy-on-close":"",onClose:e[2]||(e[2]=p=>i("close"))},{footer:c(()=>[g(t,{type:"primary",size:"small",onClick:h},{default:c(()=>[E]),_:1}),g(t,{type:"info",size:"small",onClick:e[1]||(e[1]=p=>i("close"))},{default:c(()=>[G]),_:1})]),default:c(()=>[g(o,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=p=>u.value=p),"fetch-suggestions":w,placeholder:"\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740","trigger-on-focus":!1,"value-key":"name",class:"mb-16 w-full",onSelect:b},null,8,["modelValue"]),N]),_:1},8,["model-value"])}}}),H=q(Q,[["__scopeId","data-v-f0ab4155"]]);export{H as default};
