|
1 |
- import{g as x,w as D}from"./locationTransform.e2d22cb6.js";import{s as A,g as M}from"./tiandimap.7a5ad2ba.js";import{_ as S,d as V,r as y,o as q,A as O,f as m,g as $,p as j,w as c,e as g,h as L,L as B,M as F,b as I}from"./index.551f5afa.js";const z=l=>(B("data-v-f0ab4155"),l=l(),F(),l),N=z(()=>I("div",{id:"mapDiv",class:"map"},null,-1)),E=L("\u786E\u5B9A"),G=L(" \u5173\u95ED "),Q=V({name:"queryAddressDialog"}),U=Object.assign(Q,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(l,{emit:i}){const d=l,u=y(""),s=y({});q(()=>{setTimeout(function(){f()},100)});function w(a,e){A(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){M(a,e).then(o=>{const t=o.data.result,r=D(parseFloat(t.location.lon),parseFloat(t.location.lat));s.value.longitude=r[0],s.value.latitude=r[1],s.value.regionCode=t.addressComponent.county_code.replace("156",""),s.value.region=`${t.addressComponent.province}-${t.addressComponent.city}-${t.addressComponent.county}`,s.value.address=t.formatted_address})}O(()=>d.visible,a=>{a?(s.value.addressType=d.data.addressType,s.value.id=d.data.id,setTimeout(function(){f()},100)):(s.value={},u.value="")});var n,C=14;function f(){const a=x(parseFloat(d.data.lng),parseFloat(d.data.lat));n=new T.Map("mapDiv"),n.centerAndZoom(new T.LngLat(a[0],a[1]),C);const e=new T.Marker(new T.LngLat(a[0],a[1]));n.addOverLay(e),n.addEventListener("click",k)}function k(a){const e=a.lnglat.getLng(),o=a.lnglat.getLat();_(e,o),v(e,o)}function _(a,e){n.clearOverLays();const o=new T.LngLat(a,e);var t=new T.Marker(o);n.addOverLay(t),n.panTo(o)}const h=()=>{i("close",s.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"])}}}),J=S(U,[["__scopeId","data-v-f0ab4155"]]);export{J as default};
|