| 1 |
- import{d as b,r as h,o as k,b as z,e as C,f as e,c as M,K as B,t as u,u as O}from"./index-9eb9d650.js";import{p as N}from"./index-e0011abb.js";import{C as F}from"./CusNavigation-4e4b2dd5.js";import{a as g}from"./function-call-18d3e7d7.js";import"./axios-9cbf0d09.js";import"./index-b5c8f4e4.js";import"./index-3d3c8543.js";import"./index-df29ad3d.js";import"./use-expose-e21a3d46.js";import"./use-touch-8facda50.js";import"./on-popup-reopen-6be05b9e.js";import"./interceptor-de829546.js";import"./index-d3d6bab0.js";const L={style:{display:"flex","flex-direction":"column",height:"100vh"}},S={style:{padding:"10px"}},W={class:"container",style:{"overflow-y":"auto","flex-grow":"1","background-color":"#F7F8FA"}},A={style:{height:"100%",position:"relative"}},D=e("div",{id:"map_1",style:{height:"100%","background-color":"#aaa"}},null,-1),I={style:{position:"absolute",width:"100%","z-index":"99999999","border-top-left-radius":"20px","border-top-right-radius":"20px","background-color":"#fff","border-top":"2px solid #eee",bottom:"0px"}},P={style:{padding:"30px 40px"}},R={style:{display:"flex","align-items":"flex-end"}},T=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"设备编号:")],-1),V={style:{"font-weight":"bold"}},Z={style:{display:"flex","align-items":"flex-end","margin-top":"5px"}},E=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"坐标(lng):")],-1),G={style:{"font-weight":"bold"}},J={style:{display:"flex","align-items":"flex-end","margin-top":"5px"}},K=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"坐标(lat):")],-1),j={style:{"font-weight":"bold"}},q={style:{display:"flex","align-items":"flex-start","margin-top":"5px"}},H=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"地址:")],-1),Q={style:{"font-weight":"bold",width:"0px","flex-grow":"1"}},ce=b({__name:"Location",setup(U){const s=window.BMapGL,o=h(null),y=()=>{var a,_,i,n;if(!o.value)if(o.value=new s.Map("map_1"),o.value.centerAndZoom(new s.Point(116.404,39.915),15),o.value.enableScrollWheelZoom(!0),(a=t.value)!=null&&a.data.lat&&((_=t.value)!=null&&_.data.lng)){const d=(i=t.value)==null?void 0:i.data.lng.value,r=(n=t.value)==null?void 0:n.data.lat.value;let l=new s.Point(d,r);console.log(d,r);let c=new s.Marker(l),p=new s.Circle(l,500,{strokeColor:"red",strokeWeight:1,strokeOpacity:1,fillOpacity:0});o.value.addOverlay(c),o.value.addOverlay(p),setTimeout(()=>{o.value.setCenter(l)},300)}else console.log("hhhh"),g({message:"暂无定位"})},t=h(),x=async()=>{await N({url:"/device/search",data:{size:200,page:1,sort:"createtime",order:"desc",keyWord:v.value}}).then(a=>{a.data[0]?(t.value=a.data[0],t.value.data=JSON.parse(a.data[0].data),console.log(t.value)):g("设备不存在")}),console.log("init_map"),y()},w=O(),v=h("");return k(()=>{console.log("deviceDetail onMounted"),v.value=w.currentRoute.value.params.deviceId,x()}),(a,_)=>{var i,n,d,r,l,c,p,m,f;return z(),C("div",L,[e("div",S,[M(B(F),{gobackabled:"",title:"设备位置"})]),e("div",W,[e("div",A,[D,e("div",I,[e("div",P,[e("div",R,[T,e("div",V,[e("span",null,u(v.value),1)])]),e("div",Z,[E,e("div",G,[e("span",null,[e("span",null,u((d=(n=(i=t.value)==null?void 0:i.data)==null?void 0:n.lng)==null?void 0:d.value),1)])])]),e("div",J,[K,e("div",j,[e("span",null,[e("span",null,u((c=(l=(r=t.value)==null?void 0:r.data)==null?void 0:l.lat)==null?void 0:c.value),1)])])]),e("div",q,[H,e("div",Q,[e("span",null,u((f=(m=(p=t.value)==null?void 0:p.data)==null?void 0:m.address)==null?void 0:f.value),1)])])])])])])])}}});export{ce as default};
|