| 1 |
- import{d as k,r as h,w as z,o as M,b as O,e as B,f as e,c as C,y as I,x as _,u as F}from"./index-c54217e7.js";import{p as L}from"./index-7f5d7c19.js";import{_ as N}from"./CusNavigation-3200bc8b.js";import{s as b}from"./function-call-102d45d5.js";import"./axios-f1c2e4fa.js";import"./index-a36092f2.js";import"./index-9dbe4825.js";import"./index-4fbba587.js";import"./use-expose-983d5cb3.js";import"./constant-eba5e2d8.js";import"./on-popup-reopen-54e0afb1.js";import"./index-4386145e.js";const R={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),T={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"}},V={style:{padding:"30px 40px"}},Z={style:{display:"flex","align-items":"flex-end"}},E=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"设备编号:")],-1),G={style:{"font-weight":"bold"}},J={style:{display:"flex","align-items":"flex-end","margin-top":"5px"}},j=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"坐标(lng):")],-1),q={style:{"font-weight":"bold"}},H={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),P={style:{"font-weight":"bold"}},Q={style:{display:"flex","align-items":"flex-start","margin-top":"5px"}},U=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"地址:")],-1),X={style:{"font-weight":"bold",width:"0px","flex-grow":"1"}},pe=k({__name:"Location",setup(Y){const s=window.BMapGL,a=h(null),m=()=>{a.value||(a.value=new s.Map("map_1"),a.value.centerAndZoom(new s.Point(116.404,39.915),15),a.value.enableScrollWheelZoom(!0))},f=()=>{var o,i,n,d;if(console.log(t.value),a.value.clearOverlays(),(o=t.value)!=null&&o.data.lat&&((i=t.value)!=null&&i.data.lng)){const r=(n=t.value)==null?void 0:n.data.lng.value,c=(d=t.value)==null?void 0:d.data.lat.value;let l=new s.Point(r,c);console.log(r,c);let u=new s.Marker(l),v=new s.Circle(l,500,{strokeColor:"red",strokeWeight:1,strokeOpacity:1,fillOpacity:0});a.value.addOverlay(u),a.value.addOverlay(v),setTimeout(()=>{a.value.setCenter(l)},300)}else console.log("hhhh"),b({message:"暂无定位"})},t=h(),g=async()=>{await L({url:"/device/search",data:{size:200,page:1,sort:"createtime",order:"desc",keyWord:p.value}}).then(o=>{o.data[0]?(t.value=o.data[0],t.value.data=JSON.parse(o.data[0].data),console.log(t.value)):b("设备不存在")})},y=F(),p=h("");return z(()=>y.currentRoute.value.params,async(o,i)=>{console.log("路由参数发生了变化",o,i),o.deviceId&&(p.value=o.deviceId,await g(),m(),f())}),M(async()=>{console.log("deviceDetail onMounted"),p.value=y.currentRoute.value.params.deviceId,await g(),m(),f()}),(o,i)=>{var n,d,r,c,l,u,v,x,w;return O(),B("div",R,[e("div",S,[C(I(N),{gobackabled:"",title:"设备位置"})]),e("div",W,[e("div",A,[D,e("div",T,[e("div",V,[e("div",Z,[E,e("div",G,[e("span",null,_(p.value),1)])]),e("div",J,[j,e("div",q,[e("span",null,[e("span",null,_((r=(d=(n=t.value)==null?void 0:n.data)==null?void 0:d.lng)==null?void 0:r.value),1)])])]),e("div",H,[K,e("div",P,[e("span",null,[e("span",null,_((u=(l=(c=t.value)==null?void 0:c.data)==null?void 0:l.lat)==null?void 0:u.value),1)])])]),e("div",Q,[U,e("div",X,[e("span",null,_((w=(x=(v=t.value)==null?void 0:v.data)==null?void 0:x.address)==null?void 0:w.value),1)])])])])])])])}}});export{pe as default};
|