| 1 |
- import{d as k,r as f,w as z,o as B,b as C,c as M,B as O,e,t as m,u as I,j as N}from"./index-ddf66cb5.js";import{p as F}from"./index-f5e64579.js";import{C as L}from"./CusNavigation-52f261c8.js";import{s as b}from"./function-call-0875a39e.js";import"./axios-1779699b.js";import"./index-e9453d64.js";import"./index-c1d3cef3.js";import"./use-scope-id-7611483c.js";import"./on-popup-reopen-8ab517b6.js";import"./mount-component-8daea98e.js";import"./index-856231c7.js";const R={style:{display:"flex","flex-direction":"column",height:"100vh"}},S={class:"container",style:{"overflow-y":"auto","flex-grow":"1","background-color":"#F7F8FA"}},W={style:{height:"100%",position:"relative"}},A={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"}},D={style:{padding:"30px 40px"}},T={style:{display:"flex","align-items":"flex-end"}},V={style:{"font-weight":"bold"}},Z={style:{display:"flex","align-items":"flex-end","margin-top":"5px"}},j={style:{"font-weight":"bold"}},E={style:{display:"flex","align-items":"flex-end","margin-top":"5px"}},G={style:{"font-weight":"bold"}},J={style:{display:"flex","align-items":"flex-start","margin-top":"5px"}},q={style:{"font-weight":"bold",width:"0px","flex-grow":"1"}},ae=k({__name:"Location",setup(H){const i=window.BMapGL,a=f(null),g=()=>{a.value||(a.value=new i.Map("map_1"),a.value.centerAndZoom(new i.Point(116.404,39.915),15),a.value.enableScrollWheelZoom(!0))},y=()=>{var l,t,n,d;if(console.log(o.value),a.value.clearOverlays(),(l=o.value)!=null&&l.data.lat&&((t=o.value)!=null&&t.data.lng)){const r=(n=o.value)==null?void 0:n.data.lng.value,p=(d=o.value)==null?void 0:d.data.lat.value;let s=new i.Point(r,p);console.log(r,p);let v=new i.Marker(s),c=new i.Circle(s,500,{strokeColor:"red",strokeWeight:1,strokeOpacity:1,fillOpacity:0});a.value.addOverlay(v),a.value.addOverlay(c),setTimeout(()=>{a.value.setCenter(s)},300)}else console.log("hhhh"),b({message:"暂无定位"})},o=f(),h=async()=>{await F({url:"/device/search",data:{size:200,page:1,sort:"createtime",order:"desc",keyWord:u.value}}).then(l=>{l.data[0]?(o.value=l.data[0],o.value.data=JSON.parse(l.data[0].data),console.log(o.value)):b("设备不存在")})},x=I(),u=f("");return z(()=>x.currentRoute.value.params,async(l,t)=>{console.log("路由参数发生了变化",l,t),l.deviceId&&(u.value=l.deviceId,await h(),g(),y())}),B(async()=>{console.log("deviceDetail onMounted"),u.value=x.currentRoute.value.params.deviceId,await h(),g(),y()}),(l,t)=>{var n,d,r,p,s,v,c,_,w;return N(),C("div",R,[M(O(L),{gobackabled:"",title:"设备位置"}),e("div",S,[e("div",W,[t[4]||(t[4]=e("div",{id:"map_1",style:{height:"100%","background-color":"#aaa"}},null,-1)),e("div",A,[e("div",D,[e("div",T,[t[0]||(t[0]=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"设备编号:")],-1)),e("div",V,[e("span",null,m(u.value),1)])]),e("div",Z,[t[1]||(t[1]=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"坐标(lng):")],-1)),e("div",j,[e("span",null,[e("span",null,m((r=(d=(n=o.value)==null?void 0:n.data)==null?void 0:d.lng)==null?void 0:r.value),1)])])]),e("div",E,[t[2]||(t[2]=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"坐标(lat):")],-1)),e("div",G,[e("span",null,[e("span",null,m((v=(s=(p=o.value)==null?void 0:p.data)==null?void 0:s.lat)==null?void 0:v.value),1)])])]),e("div",J,[t[3]||(t[3]=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"地址:")],-1)),e("div",q,[e("span",null,m((w=(_=(c=o.value)==null?void 0:c.data)==null?void 0:_.address)==null?void 0:w.value),1)])])])])])])])}}});export{ae as default};
|