import{u as Ne,r as $,an as ge,a8 as Pe,P as Be,L as Ue,g as P,o as k,h as fe,m as u,i as S,w as G,t as R,k as p,j as ne,U as Ye,Z as Xe,_ as We,N as U,$ as dt,M as ut,z as ct,B as ht,l as Ee}from"./vendor.5f04cee5.js";import{e as gt,l as He,g as me,h as Z,i as re,m as ft,j as mt,k as pt,n as Ze,o as yt,p as vt,q as Ct,r as De,C as _t,t as wt,u as At,G as St,v as Ft,w as Pt,E as Et,x as xt,y as Rt,z as Gt,A as Mt,B as Ot,D as It,H as bt,J as Lt,K as Tt,L as kt,P as Y,N as Vt,O as jt,Q as Qt,R as Nt,U as Bt,W as Ut,Y as Yt,Z as qe,_ as Xt,$ as Wt,a0 as Ht,a1 as Zt,a2 as xe,a3 as Dt,a4 as qt,a5 as X,a6 as zt,a7 as E,F as D,a8 as Kt,a9 as Jt,S as q,aa as Re,ab as $t,d as oe,f as ee,b as ae,a as le,I as pe,c as ze,T as ye,X as ve,M as Ke,V as Je,s as es}from"./ship_tblr.e53cacd7.js";import{_ as $e,q as ts,v as ss,s as is,b as ns,c as rs}from"./index.93e79fa9.js";function et(n,e,t,s,i,r,o){let a,l;const g=(t-e)/s;if(g===1)a=e;else if(g===2)a=e,l=i;else if(g!==0){let h=n[e],w=n[e+1],y=0;const _=[0];for(let b=e+s;b1?o:2,r=r||new Array(o);for(let h=0;h>1;i(Xe("data-v-4020d383"),n=n(),We(),n),Ts=V(()=>u("div",{id:"mapHis",style:{height:"calc(100vh - 84px)",width:"100%"}},null,-1)),ks={style:{position:"absolute",left:"0.5em",top:"0.5em"}},Vs={slot:"header",class:"clearfix bg-blue padding-sm"},js={class:"padding-sm"},Qs={class:"item flex align-center"},Ns={style:{width:"60px","font-size":"28px"}},Bs={style:{width:"calc(100% - 60px)"}},Us={class:"item flex align-center margin-tb-sm"},Ys=V(()=>u("div",{style:{width:"60px"}},"\u901F\u5EA6\uFF1A",-1)),Xs={style:{width:"calc(100% - 60px)"}},Ws={class:"item flex align-center"},Hs=V(()=>u("div",{style:{width:"50px"}},"\u5F00\u59CB\uFF1A",-1)),Zs={class:"item flex align-center margin-tb-sm"},Ds=V(()=>u("div",{style:{width:"50px"}},"\u7ED3\u675F\uFF1A",-1)),qs={class:"item",style:{"padding-left":"50px"}},zs=U("\u67E5\u8BE2"),Ks={id:"mapOpen",class:"mapOpen"},Js={class:"mapTitle"},$s={id:"mapCont",class:"mapCont"},ei=V(()=>u("div",null,"\u7ECF\u5EA6\uFF1A",-1)),ti=V(()=>u("div",null,"\u7ECF\u5EA6\uFF1A",-1)),si=V(()=>u("div",null,"\u822A\u901F\uFF1A",-1)),ii=V(()=>u("div",null,"\u8239\u824F\u5411\uFF1A",-1)),ni=V(()=>u("div",null,"\u822A\u8FF9\u5411\uFF1A",-1)),ri={props:{oneShip:{type:Object,default:{}}},setup(n){const e=n;Ne();const{proxy:t}=dt(),s=$(!1);let i=0,r,o=["---","---","---","---","---","---","---","---"],a=$(null);var l=null,g=null,h=null,w=null,y=null,_=null,f=null,F={route:new q({stroke:new Re({width:6,color:[237,212,0,0]})}),geoMarker:new q({image:new $t({radius:7,fill:new oe({color:"black"}),stroke:new Re({color:"red",width:2})})})};const b=ge({center:ee([118.26718,22.45402]),zoom:14,minZoom:2,maxZoom:18}),{oneShip:M}=Pe(e);Be(M,v=>{c(),i=0,ue()},{deep:!0});const W=ge({queryParams:{key:"7b581bc63821b05b2870456fbb6f47df",mmsi:"",start:"",end:""},selectedDays:[t.parseTime(new Date,"{y}-{m}-{d}")+" 00:00:00",t.parseTime(new Date,"{y}-{m}-{d}")+" 23:59:59"],lengSli:0,speedSli:4,nowHis:["---","---","---","---","---","---","---","---"]}),{queryParams:L,selectedDays:j,lengSli:Q,speedSli:z,nowHis:A}=Pe(W),de=function(){const v=new ye({visible:!0,source:new ve({url:"https://t1.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=317e52a409b6b382957e09003ee7e235"}),isGroup:!0,name:"\u5929\u5730\u56FE\u8DEF\u7F51"}),C=new ye({visible:!0,source:new ve({url:"https://t3.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=317e52a409b6b382957e09003ee7e235"}),isGroup:!0,name:"\u5929\u5730\u56FE\u6587\u5B57\u6807\u6CE8"});a.value=new Ke({layers:[v,C],view:new Je(b),target:"mapHis"})},ue=function(){M.value.mmsi!=""&&(L.value.mmsi=M.value.mmsi,L.value.start=new Date(j.value[0]).getTime(),L.value.end=new Date(j.value[1]).getTime(),ts(L.value).then(v=>{let C=[],O=ss(v.data)[L.value.mmsi];O=O.reverse(),O.forEach((m,x)=>{let K=ee([m.lon,m.lat],"EPSG:4326");m.glng=K[0],m.glat=K[1],C.push([m.glng,m.glat,t.parseTime(new Date(parseInt(m.createdAt)),"{y}-{m}-{d} {h}:{m}:{s}"),m.speed==""?0:m.speed,m.hdg==""?0:m.hdg,m.cog==""?0:m.cog,m.lon,m.lat])}),A.value=C[0],o=C[C.length-1];const N={type:"Feature",properties:{},geometry:{type:"LineString",coordinates:C}};_=new Os().readFeature(N,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}).getGeometry();const I=new D({type:"route",geometry:_});f=new Y(_.getFirstCoordinate()),y=new D({type:"geoMarker",geometry:f}),ce(),l=new ae({source:new le({features:[I]}),style:se,zIndex:2}),g=new ae({source:new le({features:[I,y]}),style:function(m){return F[m.get("type")]},zIndex:100}),h=B(_.getFirstCoordinate(),Is),w=B(_.getLastCoordinate(),bs),a.value.addLayer(h),a.value.addLayer(w),a.value.addLayer(g),a.value.addLayer(l),a.value.getView().animate({center:_.getFirstCoordinate(),duration:1e3});function T(m){return new q({image:new pe({src:m,anchor:[.5,.5],scale:1.1})})}function B(m,x){return new ae({style:T(x),source:new le({features:[new D({geometryName:"centerMark",geometry:new Y(m)})]})})}function se(m,x){for(var K=m.getGeometry(),nt=K.getLength(),rt=100*x/nt,Le=1e4,Te=[new q({stroke:new Re({color:"red",width:2})})],Fe=0;Fe<=1;Fe+=rt){var ie=K.getCoordinateAt(Fe);K.forEachSegment(function(J,H){if(!(J[0]==H[0]||J[1]==H[1])){var ke=H[0]-ie[0],Ve=H[1]-ie[1],je=ie[0]-J[0],Qe=ie[1]-J[1];if(ke!=je&&Ve!=Qe&&Math.abs(Le*ke*Qe-Le*je*Ve)<.001){var ot=H[0]-J[0],at=H[1]-J[1],lt=Math.atan2(at,ot);Te.push(new q({geometry:new Y(ie),image:new pe({scale:.1,src:Ls,anchor:[.5,.5],rotation:-lt+Math.PI*3/2}),text:new ze({text:H[2],textAlign:"center",textBaseline:"middle",font:"normal 10px \u5FAE\u8F6F\u96C5\u9ED1",offsetX:0,offsetY:16,fill:new oe({color:"#000"}),backgroundFill:new oe({color:"rgba(255, 255, 255, 0.8)"}),padding:[2,4,2,4]})}))}}})}return Te}}))},ce=function(){l!=null&&(i=0,Q.value=0,l.getSource().clear(),g.getSource().clear(),h.getSource().clear(),w.getSource().clear())};function he(v){const C=Number(z.value),O=v.frameState.time,N=O-r;if(i=(i+C*10*N/1e6)%2,r=O,i>1){c(),i=0,A.value=o;return}Q.value=i;const I=_.getCoordinateAt(i);f.setCoordinates(I);const T=as(v);T.setStyle(F.geoMarker),T.drawGeometry(f),A.value=I,a.value.render()}function d(){s.value=!0,r=Date.now(),g.on("postrender",he),y.setGeometry(null)}function c(){s.value=!1,y.setGeometry(f),g.un("postrender",he)}return Ue(()=>{de()}),(v,C)=>{const O=P("videoPlay"),N=P("el-icon"),I=P("videoPause"),T=P("el-slider"),B=P("el-date-picker"),se=P("el-button"),m=P("el-card");return k(),fe("div",null,[Ts,u("div",ks,[S(m,{class:"box-card","body-style":{width:"300px",padding:"0px !important"}},{default:G(()=>[u("div",Vs,[u("span",null,R(p(M).name),1)]),u("div",js,[u("div",Qs,[u("div",Ns,[s.value?(k(),ne(N,{key:1,onClick:c},{default:G(()=>[S(I)]),_:1})):(k(),ne(N,{key:0,onClick:d},{default:G(()=>[S(O)]),_:1}))]),u("div",Bs,[S(T,{modelValue:p(Q),"onUpdate:modelValue":C[0]||(C[0]=x=>Ye(Q)?Q.value=x:null),max:1,min:0},null,8,["modelValue"])])]),u("div",Us,[Ys,u("div",Xs,[S(T,{modelValue:p(z),"onUpdate:modelValue":C[1]||(C[1]=x=>Ye(z)?z.value=x:null),max:10,min:0},null,8,["modelValue"])])]),u("div",Ws,[Hs,S(B,{modelValue:p(j)[0],"onUpdate:modelValue":C[2]||(C[2]=x=>p(j)[0]=x),type:"datetime",placeholder:"\u9009\u62E9\u65E5\u671F\u65F6\u95F4"},null,8,["modelValue"])]),u("div",Zs,[Ds,S(B,{modelValue:p(j)[1],"onUpdate:modelValue":C[3]||(C[3]=x=>p(j)[1]=x),type:"datetime",placeholder:"\u9009\u62E9\u65E5\u671F\u65F6\u95F4"},null,8,["modelValue"])]),u("div",qs,[S(se,{style:{width:"100%"},type:"primary",onClick:ue},{default:G(()=>[zs]),_:1})])])]),_:1})]),u("div",Ks,[u("div",Js,R(p(A)[2].split("NaN")[0]),1),u("div",$s,[u("div",null,[ei,u("div",null,R(p(A)[6]=="---"?"---":parseFloat(p(A)[6])),1)]),u("div",null,[ti,u("div",null,R(p(A)[7]=="---"?"---":parseFloat(p(A)[7])),1)]),u("div",null,[si,u("div",null,R(p(A)[3]=="---"?"---":parseFloat(p(A)[3]).toFixed(1))+" km/h",1)]),u("div",null,[ii,u("div",null,R(p(A)[4]=="---"?"---":parseFloat(p(A)[4]).toFixed(1))+" \xB0",1)]),u("div",null,[ni,u("div",null,R(p(A)[5]=="---"?"---":parseFloat(p(A)[5]).toFixed(1))+" \xB0",1)])])])])}}};var oi=$e(ri,[["__scopeId","data-v-4020d383"]]);const te=n=>(Xe("data-v-27630e4c"),n=n(),We(),n),ai={class:"padding-lr-sm"},li={class:"head-container"},di={class:"head-container",style:{height:"calc(100vh - 126px)","overflow-y":"auto"}},ui=te(()=>u("div",{id:"map",style:{height:"calc(100vh - 84px)",width:"100%"}},null,-1)),ci={style:{position:"absolute",left:"0.5em",top:"0.5em"}},hi={slot:"header",class:"clearfix bg-blue padding-sm"},gi={style:{padding:"10px 20px"}},fi={class:"text item"},mi=te(()=>u("span",{class:"text-blue"},"\u7ECF\u5EA6\uFF1A",-1)),pi={class:"text item",style:{padding:"5px 0"}},yi=te(()=>u("span",{class:"text-blue"},"\u7EAC\u5EA6\uFF1A",-1)),vi={class:"text item"},Ci=te(()=>u("span",{class:"text-blue"},"\u822A\u901F\uFF1A",-1)),_i={class:"text item"},wi=te(()=>u("span",{class:"text-blue"},"\u5403\u6C34\uFF1A",-1)),Ai={class:"text item",style:{padding:"5px 0"}},Si=te(()=>u("span",{class:"text-blue"},"\u8239\u824F\u5411\uFF1A",-1)),Fi={style:{position:"absolute",right:"0.5em",top:"0.5em","z-index":"2005"}},Pi=U("\u5386\u53F2\u8F68\u8FF9"),Ei=U("\u5B9E\u65F6\u4F4D\u7F6E"),xi={key:0,style:{position:"absolute",right:"0",top:"0",width:"100%","z-index":"2000","background-color":"#000"}},Ri={setup(n){const e=Ne();let t=$(null),s=$(null);const i=ge({center:ee([118.26718,22.45402]),zoom:14,minZoom:2,maxZoom:18});let r=rs(),o=null,a=[],l=!1,g={},h=null;const w=$(""),y=$([]),_=ge({nowShip:{mmsi:"",name:"-----",lon:"-----",lat:"-----",hdg:"-----",sog:"-----"},hisShip:{},showHis:!1}),{nowShip:f,showHis:F,hisShip:b}=Pe(_),M=function(d){L(d)},W=function(d){if(d=="")y.value=a;else{let c=[];a.forEach(v=>{JSON.stringify(v).indexOf(d)!=-1&&c.push(v)}),y.value=c}},L=function(d){if(f.value.mmsi!=d){let c=y.value;for(let v=0;v{if(d.data!=null){let c="";d.data!=null?(c=d.data,localStorage.setItem("Histroy-List",c)):localStorage.getItem("Histroy-List")!=null&&localStorage.getItem("Histroy-List")!=null?c=localStorage.getItem("Histroy-List"):c="";let v=ns(c);f.value=v[0],ue(v)}})},ue=function(d){d.forEach(c=>{g[c.mmsi]!=null&&(g[c.mmsi].getSource().clear(),t.value.removeLayer(g[c.mmsi])),z(c)}),e.state.data.shipList=d,e.state.data.curShipMMsi==null&&(e.state.data.curShipMMsi="413859981"),f.value=d.filter(c=>c.mmsi==e.state.data.curShipMMsi)[0],e.state.data.curShipMMsi=f.value.mmsi,e.state.data.curShipSn=f.value.sn,e.state.data.curShipDevice=f.value.device,y.value=d,a=d,l||(l=!0,ce(f.value))},ce=function(d){s.value.clear();var c=new D({geometry:new Y(ee(d.ol)),cog:d.hdg,anchor:d.anchor});c.setStyle(Q(c)),s.value.addFeature(c),t.value.getView().animate({center:ee(f.value.ol),duration:1e3}),b.value=f.value,e.state.data.curShipMMsi=f.value.mmsi,e.state.data.curShipSn=f.value.sn,e.state.data.curShipDevice=f.value.device},he=function(){t.value&&t.value.on("click",function(d){if(!!t.value){var c=t.value.forEachFeatureAtPixel(d.pixel,function(v,C){return v});c!=null&&L(c.values_.key)}})};return Be([()=>e.state.data.curShipMMsi],([d])=>{L(d)}),Ue(()=>{j(),l=!1,setTimeout(()=>{de(),o=setInterval(()=>{de()},30*1e3),he()},100)}),ut(()=>{clearInterval(o)}),(d,c)=>{const v=P("el-input"),C=P("svg-icon"),O=P("el-menu-item"),N=P("el-menu"),I=P("el-col"),T=P("el-card"),B=P("el-button"),se=P("el-row");return k(),fe("div",ai,[S(se,{gutter:20},{default:G(()=>[S(I,{span:3,xs:24},{default:G(()=>[u("div",li,[S(v,{placeholder:"\u8BF7\u8F93\u5165\u8239\u8236\u540D\u79F0",clearable:"","prefix-icon":"Search",style:{"margin-top":"10px"},onInput:W,modelValue:w.value,"onUpdate:modelValue":c[0]||(c[0]=m=>w.value=m)},null,8,["modelValue"])]),u("div",di,[S(N,{"default-active":""+p(f).mmsi,onSelect:M},{default:G(()=>[(k(!0),fe(ct,null,ht(y.value,(m,x)=>(k(),ne(O,{index:""+m.mmsi,key:x},{title:G(()=>[S(C,{"icon-class":"ship",class:"text-blue"}),u("span",null,R(m.name),1)]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"])])]),_:1}),S(I,{span:21,xs:24,style:{position:"relative",padding:"0"}},{default:G(()=>[ui,u("div",ci,[S(T,{class:"box-card","body-style":{width:"200px",padding:"0px !important"}},{default:G(()=>[u("div",hi,[u("span",null,R(p(f).name),1)]),u("div",gi,[u("div",fi,[mi,U(R(p(f).lon),1)]),u("div",pi,[yi,U(R(p(f).lat),1)]),u("div",vi,[Ci,U(R(p(f).sog)+" \u8282",1)]),u("div",_i,[wi,U(R(p(f).draught)+" m",1)]),u("div",Ai,[Si,U(R(p(f).hdg)+" \xB0",1)])])]),_:1})]),u("div",Fi,[p(F)?Ee("",!0):(k(),ne(B,{key:0,type:"primary",onClick:c[1]||(c[1]=m=>F.value=!0)},{default:G(()=>[Pi]),_:1})),p(F)?(k(),ne(B,{key:1,type:"primary",onClick:c[2]||(c[2]=m=>F.value=!1)},{default:G(()=>[Ei]),_:1})):Ee("",!0)]),p(F)?(k(),fe("div",xi,[S(p(oi),{oneShip:p(b)},null,8,["oneShip"])])):Ee("",!0)]),_:1})]),_:1})])}}};var Ii=$e(Ri,[["__scopeId","data-v-27630e4c"]]);export{Ii as default};