| 1 |
- import{d as b,r as h,o as k,b as z,e as M,f as e,c as B,L as O,t as u,u as C}from"./index-3383364a.js";import{p as L}from"./index-cc4d5747.js";import{_ as F}from"./CusNavigation-0f5ab82a.js";import{s as g}from"./function-call-40112d3e.js";import"./axios-9cbf0d09.js";import"./index-ff835fad.js";import"./index-9645362a.js";import"./index-62b3a6c4.js";import"./use-expose-0933a92c.js";import"./on-popup-reopen-c4f039c8.js";import"./index-924210d5.js";const N={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"}},j=e("div",{style:{width:"80px",color:"#969799","font-size":"0.9rem"}},[e("span",null,"坐标(lat):")],-1),q={style:{"font-weight":"bold"}},H={style:{display:"flex","align-items":"flex-start","margin-top":"5px"}},K=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"}},de=b({__name:"Location",setup(U){const s=window.BMapGL,o=h(null),y=()=>{var l,v,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),(l=t.value)!=null&&l.data.lat&&((v=t.value)!=null&&v.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 a=new s.Point(d,r);console.log(d,r);let c=new s.Marker(a),p=new s.Circle(a,500,{strokeColor:"red",strokeWeight:1,strokeOpacity:1,fillOpacity:0});o.value.addOverlay(c),o.value.addOverlay(p),setTimeout(()=>{o.value.setCenter(a)},300)}else console.log("hhhh"),g({message:"暂无定位"})},t=h(),x=async()=>{await L({url:"/device/search",data:{size:200,page:1,sort:"createtime",order:"desc",keyWord:_.value}}).then(l=>{l.data[0]?(t.value=l.data[0],t.value.data=JSON.parse(l.data[0].data),console.log(t.value)):g("设备不存在")}),console.log("init_map"),y()},w=C(),_=h("");return k(()=>{console.log("deviceDetail onMounted"),_.value=w.currentRoute.value.params.deviceId,x()}),(l,v)=>{var i,n,d,r,a,c,p,m,f;return z(),M("div",N,[e("div",S,[B(O(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(_.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,[j,e("div",q,[e("span",null,[e("span",null,u((c=(a=(r=t.value)==null?void 0:r.data)==null?void 0:a.lat)==null?void 0:c.value),1)])])]),e("div",H,[K,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{de as default};
|