Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

2 рядки
3.2KB

  1. import{g as O,w as B}from"./locationTransform.e2d22cb6.js";import{s as I,g as M}from"./tiandimap.7a5ad2ba.js";import{d as $,_ as S,r as f,o as V,A,f as v,g as w,p as D,w as u,e as p,h as y,L as N,M as j,b as F,c as q}from"./index.551f5afa.js";const z=s=>(N("data-v-95183349"),s=s(),j(),s),E=z(()=>F("div",{id:"mapDiv",class:"map"},null,-1)),G=y("\u786E\u5B9A"),R=y(" \u5173\u95ED "),U=$({name:"TiandiChooseLocation"}),W=Object.assign(U,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(s,{emit:d}){const l=s,i=f(""),n=f({});V(()=>{setTimeout(function(){h()},100)});function _(o,e){I(o).then(a=>{if(console.log(a),a.code===200){const t=a.data.pois;e(t)}})}function C(o){const e=o.lonlat.split(",");L(e[0],e[1]),m(e[0],e[1])}function m(o,e){M(o,e).then(a=>{const t=a.data.result,r=B(parseFloat(t.location.lon),parseFloat(t.location.lat));console.log(r),console.log(t.location.lon,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})}A(()=>l.visible,o=>{o?(n.value.addressType=l.data.addressType,n.value.id=l.data.id,setTimeout(function(){h()},100)):(n.value={},i.value="")});var c,b=14;function h(){const o=O(parseFloat(l.data.lng),parseFloat(l.data.lat));c=new T.Map("mapDiv"),c.centerAndZoom(new T.LngLat(o[0],o[1]),b);const e=new T.Marker(new T.LngLat(o[0],o[1]));c.addOverLay(e),c.addEventListener("click",k)}function k(o){const e=o.lnglat.getLng(),a=o.lnglat.getLat();L(e,a),m(e,a)}function L(o,e){c.clearOverLays();const a=new T.LngLat(o,e);var t=new T.Marker(a);c.addOverLay(t),c.panTo(a)}const x=()=>{d("close",n.value)};return(o,e)=>{const a=v("el-autocomplete"),t=v("el-button"),r=v("el-dialog");return w(),D(r,{"model-value":s.visible,title:"\u5730\u70B9\u67E5\u8BE2",width:"840px","destroy-on-close":"",onClose:e[2]||(e[2]=g=>d("close"))},{footer:u(()=>[p(t,{type:"primary",size:"small",onClick:x},{default:u(()=>[G]),_:1}),p(t,{type:"info",size:"small",onClick:e[1]||(e[1]=g=>d("close"))},{default:u(()=>[R]),_:1})]),default:u(()=>[p(a,{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=g=>i.value=g),"fetch-suggestions":_,placeholder:"\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740","trigger-on-focus":!1,"value-key":"name",class:"mb-16 w-full",onSelect:C},null,8,["modelValue"]),E]),_:1},8,["model-value"])}}}),Z=S(W,[["__scopeId","data-v-95183349"]]),H=y("\u663E\u793A"),Q={__name:"testChooseMap",setup(s){const d={id:768,orderId:261,region:"\u6D59\u6C5F\u7701-\u676D\u5DDE\u5E02-\u6EE8\u6C5F\u533A",regionCode:330108,address:"\u6D59\u6C5F\u7701\u676D\u5DDE\u5E02\u6EE8\u6C5F\u533A\u6D66\u6CBF\u676D\u5DDE\u7B2C\u4E8C\u4E2D\u5B66(\u6EE8\u6C5F\u6821\u533A)",lat:"30.201463",lng:"120.204171",addressType:"BOARDING_LOCATION",deleted:!1,createBy:91,updateBy:91,createOn:"2024-05-16 10:14:21",updateOn:"2024-05-16 10:14:21"},l=f(!0);function i(_){console.log(_)}function n(){l.value=!0}return(_,C)=>{const m=v("el-button");return w(),q("div",null,[p(Z,{visible:l.value,style:{height:"500px"},data:d,onClose:i},null,8,["visible"]),p(m,{onClick:n},{default:u(()=>[H]),_:1})])}}};export{Q as default};