zhihao-ui 1.3.41 → 1.3.42-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/{Map-4bZtTD6G.js → Map-BNx8cwZB.js} +169 -163
- package/dist/es/index.js +1 -1
- package/dist/types/components/CascaderLoadMore/CascaderLoadMore.vue.d.ts +197 -0
- package/dist/types/components/CascaderLoadMore/index.d.ts +369 -0
- package/dist/types/components/CascaderLoadMore/types.d.ts +7 -0
- package/dist/types/components/Map/components/copyright.vue.d.ts +36 -0
- package/dist/types/components/Map/components/measure.vue.d.ts +23 -0
- package/dist/types/components/Map/components/toolPanel.vue.d.ts +40 -0
- package/dist/types/components/Map/config.d.ts +32 -0
- package/dist/types/components/Map/enum/car.d.ts +5 -0
- package/dist/types/components/Map/enum/device.d.ts +8 -0
- package/dist/types/components/Map/enum/index.d.ts +5 -0
- package/dist/types/components/Map/enum/openLayers.d.ts +10 -0
- package/dist/types/components/Map/enum/ship.d.ts +50 -0
- package/dist/types/components/Map/interface/common/BaseEntity.d.ts +29 -0
- package/dist/types/components/Map/interface/common/page.d.ts +34 -0
- package/dist/types/components/Map/interface/entity/dashboard.d.ts +16 -0
- package/dist/types/components/Map/interface/entity/map.d.ts +36 -0
- package/dist/types/components/Map/interface/entity/point.d.ts +10 -0
- package/dist/types/components/Map/interface/entity/queryLicenseResponse.d.ts +86 -0
- package/dist/types/components/Map/interface/entity/render.d.ts +57 -0
- package/dist/types/components/Map/interface/entity/ship.d.ts +361 -0
- package/dist/types/components/Map/interface/entity/shipInfoVo.d.ts +210 -0
- package/dist/types/components/Map/interface/entity/shipMapData.d.ts +27 -0
- package/dist/types/components/Map/interface/entity/shipMarker.d.ts +8 -0
- package/dist/types/components/Map/interface/entity/shipTrack.d.ts +56 -0
- package/dist/types/components/Map/interface/entity/vehicle.d.ts +345 -0
- package/dist/types/components/Map/interface/vo/vehicleVo.d.ts +20 -0
- package/dist/types/components/Map/render/canvasRender/canvasRender.d.ts +15 -0
- package/dist/types/components/Map/render/canvasRender/geometry.d.ts +22 -0
- package/dist/types/components/Map/render/canvasRender/renderCustomOverlay.d.ts +5 -0
- package/dist/types/components/Map/render/canvasRender/renderPointStyle.d.ts +10 -0
- package/dist/types/components/Map/render/canvasRender/renderShipStyle.d.ts +5 -0
- package/dist/types/components/Map/render/canvasRender/renderTrackStyle.d.ts +12 -0
- package/dist/types/components/Map/render/canvasRender/renderTruckStyle.d.ts +3 -0
- package/dist/types/components/Map/render/drawPolygon.d.ts +10 -0
- package/dist/types/components/Map/render/renderDashboard.d.ts +12 -0
- package/dist/types/components/Map/render/renderMarker.d.ts +7 -0
- package/dist/types/components/Map/render/renderPoint.d.ts +80 -0
- package/dist/types/components/Map/render/renderShip.d.ts +20 -0
- package/dist/types/components/Map/render/renderTrack.d.ts +12 -0
- package/dist/types/components/Map/render/renderTruck.d.ts +10 -0
- package/dist/types/components/Map/utils/common.d.ts +27 -0
- package/dist/types/components/Map/utils/format.d.ts +10 -0
- package/dist/types/components/Map/utils/store.d.ts +32 -0
- package/dist/types/components/Map/utils/transform.d.ts +44 -0
- package/dist/umd/index.umd.cjs +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { transform } from 'ol/proj';
|
|
2
|
+
|
|
3
|
+
declare function gcj02ToWgs84(lnglat: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* 通过圆心和半径计算区域范围 输出为矩形
|
|
6
|
+
* @param center 圆心坐标
|
|
7
|
+
* @param radiusInKilometers 距离 单位:公里
|
|
8
|
+
*/
|
|
9
|
+
declare function calculateCirclePoints(center: [number, number], radiusInKilometers: number): {
|
|
10
|
+
leftTopPoint: {
|
|
11
|
+
lng: number;
|
|
12
|
+
lat: number;
|
|
13
|
+
};
|
|
14
|
+
rightTopPoint: {
|
|
15
|
+
lng: number;
|
|
16
|
+
lat: number;
|
|
17
|
+
};
|
|
18
|
+
rightBottomPoint: {
|
|
19
|
+
lng: number;
|
|
20
|
+
lat: number;
|
|
21
|
+
};
|
|
22
|
+
leftBottomPoint: {
|
|
23
|
+
lng: number;
|
|
24
|
+
lat: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare function lonLatToMercator(center: [number, number]): number[];
|
|
28
|
+
declare function mercatorToLonLat(center: [number, number], type?: string): number[] | {
|
|
29
|
+
lon: number;
|
|
30
|
+
lat: number;
|
|
31
|
+
};
|
|
32
|
+
/** 计算多组点的最大矩形范围
|
|
33
|
+
* @param coordinates
|
|
34
|
+
*/
|
|
35
|
+
declare function calculateBoundingBox(coordinates: [number, number][]): number[];
|
|
36
|
+
declare const _default: {
|
|
37
|
+
gcj02ToWgs84: typeof gcj02ToWgs84;
|
|
38
|
+
calculateCirclePoints: typeof calculateCirclePoints;
|
|
39
|
+
lonLatToMercator: typeof lonLatToMercator;
|
|
40
|
+
mercatorToLonLat: typeof mercatorToLonLat;
|
|
41
|
+
calculateBoundingBox: typeof calculateBoundingBox;
|
|
42
|
+
transform: typeof transform;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
package/dist/umd/index.umd.cjs
CHANGED
|
@@ -201,7 +201,7 @@ fe.version="2.30.1",Z4(Tt),fe.fn=le,fe.min=BV,fe.max=VV,fe.now=$V,fe.utc=mi,fe.u
|
|
|
201
201
|
<path d="M1.99982 46.9998L1.99982 1.99982L46.9998 1.99982L46.9998 46.9998L1.99982 46.9998Z" fill="#FF2424" fill-opacity="0.2"/>
|
|
202
202
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.9998 0.5V3.5L3.49976 3.5V20H0.499756V0.500002L19.9998 0.5ZM45.4998 3.5H28.9998V0.5H48.4998V20H45.4998V3.5ZM48.4998 29L48.4998 48.5H28.9998V45.5H45.4998L45.4998 29H48.4998ZM3.49976 45.5L3.49976 29H0.499756L0.499758 48.5L19.9998 48.5V45.5L3.49976 45.5Z" fill="#FF2424"/>
|
|
203
203
|
</svg>
|
|
204
|
-
`,a=document.createElement("div");return a.className="ship-overlay-selected",a.innerHTML=s,a};function T7(t,e,n,r){if(e){const o=new mo({element:n,positioning:"top-left",id:"label-"+(r==null?void 0:r.id),offset:[20,-20],autoPan:!1,position:e,className:r.blinking?"ship-label-overlay-blinking":"ship-label-overlay"});o.set("class","zh-map-ship-overlay"),t.addOverlay(o)}}const M7=(t,e)=>{const{lon:n,lat:r,blinking:o}=e,s=$2(e);n&&r&&T7(t,rr([n,r]),s,{...e,blinking:o})},$2=t=>{const e=document.createElement("div");e.className="ship-overlay-box",e.style.position="relative";const{lon:n,lat:r,blinking:o,blinkingColors:s,name:a}=t,l=i.createVNode({setup(){return S7({position:[n+.002,r+.002],selected:o,name:a,colors:s||[],existDevice:t==null?void 0:t.existDevice,existMobile:t==null?void 0:t.existMobile,existWaterGauge:t==null?void 0:t.existWaterGauge})}});return i.render(l,e),e},z2=t=>{const e=[];return t.existDevice&&e.push(""),t.existMobile&&e.push(""),t.existWaterGauge&&e.push(""),e};function R7(){const t=["left-top","left-middle","left-bottom","right-top","right-middle","right-bottom"];return t[Math.floor(Math.random()*t.length)]}const D7=window.devicePixelRatio||1,C0=new Map;let Bc=null,E0=null;function P7(t,e,n="left-bottom",r=2){const o=`${t}-${e.join(",")}-${n}-${r}`;if(C0.has(o))return C0.get(o);if(!Bc){Bc=document.createElement("canvas");try{E0=Bc.getContext("2d",{willReadFrequently:!0})}catch{E0=Bc.getContext("2d")}}const s=Bc,a=E0;if(!a)return"";s.width=0,s.height=0;const l=2,c=8,d=16,u=window.devicePixelRatio||1,f="500 12px Arial",p="14px map-iconfont";a.font=f;const h=a.measureText(t).width;a.font=p;const m=e.map(M=>({width:a.measureText(Is(M)).width,height:14})),y=m.reduce((M,R)=>M+R.width,0),_=(e.length-1)*r,w=c+h+y+_+c,E=l+14+l;let b,C,S=0,v=0,x=0,k=0,T=0,I=0;switch(b=d+w,n){case"right-top":C=d+E,S=0,v=d+E,x=d,k=0,T=d,I=0;break;case"right-middle":C=E,S=0,v=E/2,x=d,k=E/2,T=d,I=0;break;case"right-bottom":C=d+E,S=0,v=0,x=d,k=d,T=d,I=d;break;case"left-top":C=d+E,S=w,v=d,x=w+d,k=E+d,T=0,I=0;break;case"left-middle":C=E,S=w,v=E/2,x=w+d,k=E/2,T=0,I=0;break;case"left-bottom":C=d+E,S=w,v=E,x=w+d,k=0,T=0,I=d;break}C=C+l,s.width=Math.round(b*u),s.height=Math.round(C*u),a.scale(u,u),a.clearRect(0,0,b,C),a.beginPath(),a.moveTo(S,v),a.lineTo(x,k),a.strokeStyle="#FFF",a.lineWidth=1,a.stroke(),a.fillStyle="#FFF",a.fillRect(T,I,w,E),a.font=f,a.textBaseline="middle";const P=I+l+E/2;a.strokeStyle="#ffffff",a.lineWidth=1,a.strokeText(t,T+c,P),a.fillStyle="#000000",a.fillText(t,T+c,P),a.font=p,a.fillStyle="#3370ff";let N=T+c+h+r;e.length>0&&e.forEach((M,R)=>{const O=I+l+E/2;a.fillText(Is(M),N,O),N+=m[R].width+r});const F=s.toDataURL("image/png");return C0.set(o,F),F}const Y2=(t,e)=>{const{name:n,rightIcons:r,selected:o}=t.getProperties(),s=e!==1?R7():"right-top",a=P7(n,r,s);let l=[0,0];switch(s){case"right-top":l=[0,1];break;case"right-middle":l=[0,.5];break;case"right-bottom":l=[0,0];break;case"left-top":l=[1,1];break;case"left-middle":l=[1,.5];break;case"left-bottom":l=[1,0];break}return new Ct({image:new ao({src:a,anchor:l,displacement:[0,0],scale:1/D7,anchorXUnits:"fraction",anchorYUnits:"fraction"}),zIndex:o?100:10})},I7=t=>{let e=null,n=null;const r=new ho,o=new E7({source:r,className:"zh-map--ship-layer",renderBuffer:300,zIndex:101,hitTolerance:10}),s=new ho,a=new Go({source:s,className:"zh-map--ship-label-layer",zIndex:102,updateWhileInteracting:!1,updateWhileAnimating:!1,declutter:!0});t==null||t.addLayer(o),t==null||t.addLayer(a);let l=null,c="",d={},u={};const f=P=>{if(!P||!t)return;const N=(n==null?void 0:n.id)||(e==null?void 0:e.get("id"));if(n){const F=P.filter(M=>M.id===N);F.length===0?P.push(n):n=F[0]}y(),I(P),g(),b()},p=P=>{var L;const N=(n==null?void 0:n.id)||(e==null?void 0:e.get("id")),F=rr([P==null?void 0:P.lon,P==null?void 0:P.lat]),M=((L=u[P.id])==null?void 0:L.blinkColors)||[],O=M[M.length-1]||P.fill||"#04C900",A=v7(P),D=new sn({geometry:new an(F),shipData:P,id:P.id,name:P.cnname||P.enname||P.name||P.id||"未命名船舶",selected:P.id===N,rightIcons:z2(P),color:O,direct:A,isHighlight:!1});return D.set("clickGeometry",new Ic(F)),D},g=async()=>{if(!n||!t)return;let N=t.getOverlays().getArray().find(F=>F.get("class")=="ship-overlay-selected");if(N){const F=V2(t,n);await N.setElement(F),await N.setPosition(rr([n.lon,n.lat]))}else N=k7(t,n),N&&t.addOverlay(N);setTimeout(()=>{var F;N&&((F=N.get("element"))!=null&&F.parentElement)&&(N.get("element").parentElement.style.display="block")},20)},h=P=>{if(P==="start"){const N=()=>{r.getFeatures().forEach(F=>{F.setStyle(tl(t,F))}),l=requestAnimationFrame(N)};N()}P==="end"&&l&&(cancelAnimationFrame(l),l=null)},m=()=>{const N=(t==null?void 0:t.getOverlays().getArray()).find(F=>F.get("class")=="ship-overlay-selected");if(N){const F=N.getElement(),M=w0(t,n,"ship"),R=F.querySelector("svg");console.log(R),R&&(R.style.transform=`scale(${M})`)}},y=()=>{t&&r&&(_(),r.clear(),s.clear(),h("end"))},_=P=>{const N=t.getOverlays().getArray().filter(F=>F.get("class")=="zh-map-ship-overlay");if(N&&N.length>0){for(let F=0;F<N.length;F++)if(N[F].get("class")!=="ship-overlay-selected"){const M=N[F];console.log("overlay---",M),M.setPosition(void 0),t.removeOverlay(M),M.dispose()}}},w=(P,N)=>{d=P,u=N;const F=t.getOverlays().getArray(),M=r.getFeatures();for(const R in d){const O=d[R],A=F.find(L=>L.getId()==="label-"+R),D=M.find(L=>R===L.get("id"));if(A&&D){const L=N[R].blinkColors||[],{shipData:B,name:j,color:$}=D.getProperties();D.set("blinking",O),L[(L==null?void 0:L.length)-1]&&$!==L[(L==null?void 0:L.length)-1]&&(D.set("color",L[(L==null?void 0:L.length)-1]||""),D.setStyle(tl(t,D)));const W={...B,blinking:O,blinkingColors:L||[],name:j+"("+N[R].shipState+")"},q=A.getElement(),ne=$2(W);q&&q!==ne&&A.setElement(ne)}}},E=()=>{const P=t.getOverlays().getArray();if(d)for(const N in d){const F=P.find(M=>M.getId()==="label-"+N);if(F){const M=F.getElement();M&&(M.style.opacity=0)}}},b=()=>{const P=t.getOverlays().getArray();if(d)for(const N in d){const F=P.find(M=>M.getId()==="label-"+N);if(F){const M=F.getElement();M&&(M.style.opacity=1)}}},C=P=>{if(!t)return;const N=r.getFeatures(),F=s.getFeatures(),M=e?e.get("id"):"",R=N.filter(L=>L.get("id")!==M),O=F==null?void 0:F.filter(L=>L.get("id")!==M),A=new Map;P.forEach(L=>{A.set(L.id,!0)});const D=t.getOverlays().getArray();R.forEach(L=>{const B=L.get("id");if(!A.has(B))L.setStyle([]);else{const $=L.getStyle();($==null?void 0:$.length)==0&&L.setStyle(tl(t,L))}const j=D.find($=>$.getId()==="label-"+B);j&&j.setPosition(void 0)}),O.forEach(L=>{const B=L.get("id");if(!A.has(B))L.setStyle([]);else{const j=L.getStyle();(j==null?void 0:j.length)==0&&L.setStyle(Y2(L))}})},S=P=>{if(P){console.log("选中",P);const N=r.getFeatures().find(M=>M.get("id")===P.id),F=s.getFeatures().find(M=>M.get("id")===P.id);N&&(e=N),F&&F.set("selected",!0),n=P,g()}else console.log("取消选中"),n=null,e=null,k()},v=Nr((P,N,F)=>{try{if(P){const M=P.get("shipData"),R=P.get("id");if(t.getTargetElement().style.cursor=R?"pointer":"",N==="click"&&(S(M),F&&F(R)),N==="hover"){c&&c!==R&&x(),c=R;const O=r.getFeatures().find(A=>A.get("id")===c);O==null||O.set("isHighlight",!0),O==null||O.setStyle(tl(t,O))}}else t.getTargetElement().style.cursor="",x()}catch(M){console.log("handleShipMapEvent",M)}},10),x=()=>{const P=c?r.getFeatures().find(N=>N.get("id")===c):null;c=null,P==null||P.set("isHighlight",!1),P==null||P.setStyle(tl(t,P))},k=()=>{try{const N=t.getOverlays().getArray().find(F=>F.get("class")=="ship-overlay-selected");N&&N.setPosition(void 0)}catch(P){console.log(P)}},T=(P,N)=>{const F=rr([P==null?void 0:P.lon,P==null?void 0:P.lat]),M=new sn({geometry:new an(F),name:P.cnname||P.enname||P.name||P.id||"未命名船舶",rightIcons:z2(P),selected:(P==null?void 0:P.id)===(n==null?void 0:n.id),shipData:P});M.set("id",P.id);const R=Y2(M,N);return M.setStyle(R),M},I=P=>{const N=t.getView().getZoom();P.forEach(F=>{const M=p(F);if(M.setStyle(tl(t,M)),r.addFeature(M),(n==null?void 0:n.id)==F.id||N>=Mr.shipModelMin)if(d[F.id]){if(F.id&&u[F==null?void 0:F.id]){const R=u[F==null?void 0:F.id]||{},O=(R==null?void 0:R.blinkColors)||[],A=(R==null?void 0:R.shipState)||"",D=(F.cnname||F.enname||F.name||F.id||"未命名船舶")+"("+A+")",L={...F,name:D,blinking:d[F.id],blinkingColors:O||[]};M7(t,L)}}else{const R=T(F,P.length);s.addFeature(R)}})};return{render:f,selected:S,filter:C,blinking:w,clear:y,handleShipMapEvent:v,changeShipScale:h,changeSelectedScale:m,hiddenShipBlink:E,showShipBlink:b}},O7=t=>{const e=()=>t==null?void 0:t.getLayers(),n=i.ref("vector"),r=()=>n.value,o=c=>{n.value=c;const d=e();d&&(d==null||d.getArray().forEach(u=>{(u.className_==="vector"||u.className_==="satellite")&&u.setVisible(u.className_===c)}))},s=i.ref(!1);return{getLayers:e,getGreenTileVisible:()=>s.value,setGreenTileVisible:c=>{if(c!==s.value){if(c){const d=e();if(!d.getArray().find(f=>f.className_==="greenTile")){const f=new qa({source:new el({url:Ps.greenTile}),visible:c,zIndex:2,className:"greenTile"});d.push(f)}}else{const d=e(),u=d.getArray().find(f=>f.className_==="greenTile");u&&d.remove(u)}s.value=c}},getShowLayerType:r,setShowLayerType:o}},N7=()=>{const t=i.ref();return{setProps:r=>{t.value=r},getProps:()=>t.value}},L7=t=>{const e="zh-map-location-layer";let n,r,o=null,s=null;const a=h=>{if(!(!h||h.length===0)){if(r||(r=new ho),r.clear(),s){const m=h.find(y=>y.id===s.id);m?s=m:h.push(s)}h.forEach(m=>{l(m)}),n||(n=new Go({className:e,source:r,zIndex:100}),t==null||t.addLayer(n))}},l=h=>{const m=t==null?void 0:t.getView().getZoom(),[y,_]=h.latLon.split(","),w=new sn({geometry:new an(rr([Number(y),Number(_)]))});w.setStyle(c(h,m,h.id===(s==null?void 0:s.id))),w.set("loactionData",h),r.addFeature(w)},c=(h,m,y)=>{const _={image:new ao({src:y&&h.selectedPath||h.defaultPath,scale:.5*m/10})};return h.name&&(_.text=new so({text:h.name,font:"12px sans-serif",fill:new Jt({color:"#000000"}),backgroundFill:new Jt({color:"#FFFFFF"}),offsetY:30})),new Ct(_)},d=()=>{if(o){const h=o.get("loactionData").id;r.getFeatures().forEach(m=>{m.get("loactionData").id!==h&&r.removeFeature(m)})}else r.clear()},u=()=>{var _;const h=o.get("loactionData"),m=(_=t==null?void 0:t.getView())==null?void 0:_.getZoom();r.getFeatures().forEach(w=>{w.get("loactionData").id===h.id&&(w==null||w.setStyle(c(h,m,!1)))}),s=null,o=null},f=h=>{h?(p(),g(h)):clearSelectedPort()},p=()=>{var h;if(o){const m=o.get("loactionData"),y=(h=t==null?void 0:t.getView())==null?void 0:h.getZoom();o.setStyle(c(m,y,!1))}},g=h=>{const m=r.getFeatures();s=h,o=m.find(y=>y.get("loactionData").id===h.id)};return{render:a,selected:f,clearSelected:u,clear:d}},wf={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class Cf extends bi{constructor(e,n){super(e),this.feature=n}}function A7(t,e){const n=[];for(let r=0;r<e.length;++r){const s=e[r].getGeometry();W2(t,s,n)}return n}function Ef(t,e){return Ji(t[0],t[1],e[0],e[1])}function nl(t,e){const n=t.length;return e<0?t[e+n]:e>=n?t[e-n]:t[e]}function Sf(t,e,n){let r,o;e<n?(r=e,o=n):(r=n,o=e);const s=Math.ceil(r),a=Math.floor(o);if(s>a){const c=rl(t,r),d=rl(t,o);return Ef(c,d)}let l=0;if(r<s){const c=rl(t,r),d=nl(t,s);l+=Ef(c,d)}if(a<o){const c=nl(t,a),d=rl(t,o);l+=Ef(c,d)}for(let c=s;c<a-1;++c){const d=nl(t,c),u=nl(t,c+1);l+=Ef(d,u)}return l}function W2(t,e,n){if(e instanceof An){vf(t,e.getCoordinates(),!1,n);return}if(e instanceof Oc){const r=e.getCoordinates();for(let o=0,s=r.length;o<s;++o)vf(t,r[o],!1,n);return}if(e instanceof to){const r=e.getCoordinates();for(let o=0,s=r.length;o<s;++o)vf(t,r[o],!0,n);return}if(e instanceof Lc){const r=e.getCoordinates();for(let o=0,s=r.length;o<s;++o){const a=r[o];for(let l=0,c=a.length;l<c;++l)vf(t,a[l],!0,n)}return}if(e instanceof uf){const r=e.getGeometries();for(let o=0;o<r.length;++o)W2(t,r[o],n);return}}const S0={index:-1,endIndex:NaN};function F7(t,e,n,r){const o=t[0],s=t[1];let a=1/0,l=-1,c=NaN;for(let f=0;f<e.targets.length;++f){const p=e.targets[f],g=p.coordinates;let h=1/0,m;for(let y=0;y<g.length-1;++y){const _=g[y],w=g[y+1],E=G2(o,s,_,w);E.squaredDistance<h&&(h=E.squaredDistance,m=y+E.along)}h<a&&(a=h,p.ring&&e.targetIndex===f&&(p.endIndex>p.startIndex?m<p.startIndex&&(m+=g.length):p.endIndex<p.startIndex&&m>p.startIndex&&(m-=g.length)),c=m,l=f)}const d=e.targets[l];let u=d.ring;if(e.targetIndex===l&&u){const f=rl(d.coordinates,c),p=n.getPixelFromCoordinate(f);CE(p,e.startPx)>r&&(u=!1)}if(u){const f=d.coordinates,p=f.length,g=d.startIndex,h=c;if(g<h){const m=Sf(f,g,h);Sf(f,g,h-p)<m&&(c-=p)}else{const m=Sf(f,g,h);Sf(f,g,h+p)<m&&(c+=p)}}return S0.index=l,S0.endIndex=c,S0}function vf(t,e,n,r){const o=t[0],s=t[1];for(let a=0,l=e.length-1;a<l;++a){const c=e[a],d=e[a+1],u=G2(o,s,c,d);if(u.squaredDistance===0){const f=a+u.along;r.push({coordinates:e,ring:n,startIndex:f,endIndex:f});return}}}const v0={along:0,squaredDistance:0};function G2(t,e,n,r){const o=n[0],s=n[1],a=r[0],l=r[1],c=a-o,d=l-s;let u=0,f=o,p=s;return(c!==0||d!==0)&&(u=Ot(((t-o)*c+(e-s)*d)/(c*c+d*d),0,1),f+=c*u,p+=d*u),v0.along=u,v0.squaredDistance=Du(Ji(t,e,f,p),10),v0}function rl(t,e){const n=t.length;let r=Math.floor(e);const o=e-r;r>=n?r-=n:r<0&&(r+=n);let s=r+1;s>=n&&(s-=n);const a=t[r],l=a[0],c=a[1],d=t[s],u=d[0]-l,f=d[1]-c;return[l+u*o,c+f*o]}class xf extends Ha{constructor(e){const n=e;n.stopDown||(n.stopDown=Ea),super(n),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=V7(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:Ca,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let r=e.geometryFunction;if(!r){const o=this.mode_;if(o==="Circle")r=(s,a,l)=>{const c=a||new Ic([NaN,NaN]),d=qr(s[0]),u=wE(d,qr(s[s.length-1]));return c.setCenterAndRadius(d,Math.sqrt(u),this.geometryLayout_),c};else{let s;o==="Point"?s=an:o==="LineString"?s=An:o==="Polygon"&&(s=to),r=(a,l,c)=>(l?o==="Polygon"?a[0].length?l.setCoordinates([a[0].concat([a[0][0]])],this.geometryLayout_):l.setCoordinates([],this.geometryLayout_):l.setCoordinates(a,this.geometryLayout_):l=new s(a,this.geometryLayout_),l)}}this.geometryFunction_=r,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new Go({source:new ho({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:B7(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:o0,this.freehandCondition_,e.freehand?this.freehandCondition_=i0:this.freehandCondition_=e.freehandCondition?e.freehandCondition:h2,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Qg.ACTIVE,this.updateState_)}setTrace(e){let n;e?e===!0?n=i0:n=e:n=GW,this.traceCondition_=n}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===Ae.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let n=e.type===yt.POINTERMOVE,r=!0;return!this.freehand_&&this.lastDragTime_&&e.type===yt.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===yt.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===yt.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===yt.POINTERMOVE,r&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===yt.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===yt.DBLCLICK&&(r=!1),super.handleEvent(e)&&r}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new po(yt.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const n=this.getMap(),r=n.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),o=n.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),s=Lm([r,o]),a=this.traceSource_.getFeaturesInExtent(s);if(a.length===0)return;const l=A7(e.coordinate,a);l.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:l,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,n){const r=e.startIndex<=e.endIndex,o=e.startIndex<=n;r===o?r&&n>e.endIndex||!r&&n<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,n):(r&&n<e.endIndex||!r&&n>e.endIndex)&&this.removeTracedCoordinates_(n,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,n))}removeTracedCoordinates_(e,n){if(e===n)return;let r=0;if(e<n){const o=Math.ceil(e);let s=Math.floor(n);s===n&&(s-=1),r=s-o+1}else{const o=Math.floor(e);let s=Math.ceil(n);s===n&&(s+=1),r=o-s+1}r>0&&this.removeLastPoints_(r)}addTracedCoordinates_(e,n,r){if(n===r)return;const o=[];if(n<r){const s=Math.ceil(n);let a=Math.floor(r);a===r&&(a-=1);for(let l=s;l<=a;++l)o.push(nl(e.coordinates,l))}else{const s=Math.floor(n);let a=Math.ceil(r);a===r&&(a+=1);for(let l=s;l>=a;--l)o.push(nl(e.coordinates,l))}o.length&&this.appendCoordinates(o)}updateTrace_(e){const n=this.traceState_;if(!n.active||n.targetIndex===-1&&CE(n.startPx,e.pixel)<this.snapTolerance_)return;const r=F7(e.coordinate,n,this.getMap(),this.snapTolerance_);if(n.targetIndex!==r.index){if(n.targetIndex!==-1){const c=n.targets[n.targetIndex];this.removeTracedCoordinates_(c.startIndex,c.endIndex)}const l=n.targets[r.index];this.addTracedCoordinates_(l,l.startIndex,r.endIndex)}else{const l=n.targets[n.targetIndex];this.addOrRemoveTracedCoordinates_(l,r.endIndex)}n.targetIndex=r.index;const o=n.targets[n.targetIndex];o.endIndex=r.endIndex;const s=rl(o.coordinates,o.endIndex),a=this.getMap().getPixelFromCoordinate(s);e.coordinate=s,e.pixel=[Math.round(a[0]),Math.round(a[1])]}handleUpEvent(e){let n=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);const r=this.traceState_.active;if(this.toggleTraceState_(e),this.shouldHandle_){const o=!this.finishCoordinate_;o&&this.startDrawing_(e.coordinate),!o&&this.freehand_?this.finishDrawing():!this.freehand_&&(!o||this.mode_==="Point")&&(this.atFinish_(e.pixel,r)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),n=!1}else this.freehand_&&this.abortDrawing()}return!n&&this.stopClick_&&e.preventDefault(),n}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const n=this.downPx_,r=e.pixel,o=n[0]-r[0],s=n[1]-r[1],a=o*o+s*s;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,n){let r=!1;if(this.sketchFeature_){let o=!1,s=[this.finishCoordinate_];const a=this.mode_;if(a==="Point")r=!0;else if(a==="Circle")r=this.sketchCoords_.length===2;else if(a==="LineString")o=!n&&this.sketchCoords_.length>this.minPoints_;else if(a==="Polygon"){const l=this.sketchCoords_;o=l[0].length>this.minPoints_,s=[l[0][0],l[0][l[0].length-2]],n?s=[l[0][0]]:s=[l[0][0],l[0][l[0].length-2]]}if(o){const l=this.getMap();for(let c=0,d=s.length;c<d;c++){const u=s[c],f=l.getPixelFromCoordinate(u),p=e[0]-f[0],g=e[1]-f[1],h=this.freehand_?1:this.snapTolerance_;if(r=Math.sqrt(p*p+g*g)<=h,r){this.finishCoordinate_=u;break}}}}return r}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new sn(new an(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new sn);const n=e.getLinearRing(0);let r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(n.getLayout(),n.getFlatCoordinates()),r.changed()):(r=new An(n.getFlatCoordinates(),n.getLayout()),this.sketchLine_.setGeometry(r))}startDrawing_(e){const n=this.getMap().getView().getProjection(),r=uc(this.geometryLayout_);for(;e.length<r;)e.push(0);this.finishCoordinate_=e,this.mode_==="Point"?this.sketchCoords_=e.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new sn(new An(this.sketchLineCoords_)));const o=this.geometryFunction_(this.sketchCoords_,void 0,n);this.sketchFeature_=new sn,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(o),this.updateSketchFeatures_(),this.dispatchEvent(new Cf(wf.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const n=this.getMap(),r=this.sketchFeature_.getGeometry(),o=n.getView().getProjection(),s=uc(this.geometryLayout_);let a,l;for(;e.length<s;)e.push(0);this.mode_==="Point"?l=this.sketchCoords_:this.mode_==="Polygon"?(a=this.sketchCoords_[0],l=a[a.length-1],this.atFinish_(n.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(a=this.sketchCoords_,l=a[a.length-1]),l[0]=e[0],l[1]=e[1],this.geometryFunction_(this.sketchCoords_,r,o),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),r.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(r):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();let o,s;const a=this.mode_;return a==="LineString"||a==="Circle"?(this.finishCoordinate_=e.slice(),s=this.sketchCoords_,s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(e.slice()),this.geometryFunction_(s,n,r)):a==="Polygon"&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(e.slice()),o&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,n,r)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),o?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),o=this.mode_;for(let s=0;s<e;++s){let a;if(o==="LineString"||o==="Circle"){if(a=this.sketchCoords_,a.splice(-2,1),a.length>=2){this.finishCoordinate_=a[a.length-2].slice();const l=this.finishCoordinate_.slice();a[a.length-1]=l,this.createOrUpdateSketchPoint_(l)}this.geometryFunction_(a,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o==="Polygon"){a=this.sketchCoords_[0],a.splice(-2,1);const l=this.sketchLine_.getGeometry();if(a.length>=2){const c=a[a.length-2].slice();a[a.length-1]=c,this.createOrUpdateSketchPoint_(c)}l.setCoordinates(a),this.geometryFunction_(this.sketchCoords_,n,r)}if(a.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let n=this.sketchCoords_;const r=e.getGeometry(),o=this.getMap().getView().getProjection();return this.mode_==="LineString"?(n.pop(),this.geometryFunction_(n,r,o)):this.mode_==="Polygon"&&(n[0].pop(),this.geometryFunction_(n,r,o),n=r.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new Nc([n])):this.type_==="MultiLineString"?e.setGeometry(new Oc([n])):this.type_==="MultiPolygon"&&e.setGeometry(new Lc([n])),this.dispatchEvent(new Cf(wf.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new Cf(wf.DRAWABORT,e))}appendCoordinates(e){const n=this.mode_,r=!this.sketchFeature_;r&&this.startDrawing_(e[0]);let o;if(n==="LineString"||n==="Circle")o=this.sketchCoords_;else if(n==="Polygon")o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;r&&o.shift(),o.pop();for(let a=0;a<e.length;a++)this.addToDrawing_(e[a]);const s=e[e.length-1];this.sketchFeature_=this.addToDrawing_(s),this.modifyDrawing_(s)}extend(e){const r=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=r.getCoordinates();const o=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=o.slice(),this.sketchCoords_.push(o.slice()),this.sketchPoint_=new sn(new an(o)),this.updateSketchFeatures_(),this.dispatchEvent(new Cf(wf.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const n=this.overlay_.getSource();n.clear(!0),n.addFeatures(e)}updateState_(){const e=this.getMap(),n=this.getActive();(!e||!n)&&this.abortDrawing(),this.overlay_.setMap(n?e:null)}}function B7(){const t=G9();return function(e,n){return t[e.getGeometry().getType()]}}function V7(t){switch(t){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+t)}}const $7=t=>{t.getInteractions().forEach(e=>{e instanceof t0&&e.setActive(!1)})},z7=t=>{t.getInteractions().forEach(e=>{e instanceof t0&&e.setActive(!0)})},Vc=(t,e)=>{const n=t.getViewport();n&&(n.style.cursor=e)},Y7=(t,e)=>{const n=i.ref([]),r=i.ref("km"),o=k=>{r.value=k};let s;const a=i.ref(!1),l=()=>{Vc(t,"crosshair"),u(),$7(t),t.on("pointermove",g),t.getViewport().addEventListener("mouseout",()=>{s&&s.classList.add("hidden")}),m(),a.value=!0};let c,d;const u=()=>{c=new ho,d=new Go({source:c,zIndex:1e3,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),t==null||t.addLayer(d)};let f,p;const g=k=>{if(k.dragging)return;let T="点击选择起点";f&&(T="单击继续,双击结束"),s&&(s.innerHTML=T,p.setPosition(k.coordinate),s.classList.remove("hidden"))};let h;const m=()=>{h=new xf({source:c,type:"LineString",style:new Ct({fill:new Jt({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Fn({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new oo({radius:5,stroke:new Fn({color:"rgba(0, 0, 0, 0.7)"}),fill:new Jt({color:"rgba(255, 255, 255, 0.2)"})})}),condition:T=>T.originalEvent.target.tagName!=="DIV"}),t==null||t.addInteraction(h),E(),b();let k;h.on("drawstart",function(T){var P;f=T.feature,f.set("randomId",y());let I;k=(P=f.getGeometry())==null?void 0:P.on("change",function(N){const F=N.target,M=j2(F,r.value);I=F.getLastCoordinate(),_&&M&&(_.innerHTML=M),w.setPosition(I)})}),h.on("drawend",function(){var T,I,P;if(_&&(_.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),_!=null&&_.innerHTML){const N=(f==null?void 0:f.get("randomId"))||y();n.value.push({id:N,value:_==null?void 0:_.innerHTML}),_.innerHTML=`${_.innerHTML}<div class="ol-tooltip-delete-button" data-id="${N}"><i class="map-iconfont icon-delete"></i></div>`}(T=document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button"))==null||T.addEventListener("click",N=>{var M;N.preventDefault(),N.stopPropagation();const F=(M=N.target)==null?void 0:M.getAttribute("data-id");F&&S(F)}),w.setOffset([0,-7]),f=null,_=null,E(),k&&Eu(k),(P=(I=e.getProps())==null?void 0:I.lineDrawEnd)==null||P.call(I,n.value)})},y=()=>Math.random().toString(36).substring(2,9);let _,w;const E=()=>{_!=null&&_.parentNode&&_.parentNode.removeChild(_),_=document.createElement("div"),_.className="ol-tooltip ol-tooltip-measure",w=new mo({element:_,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),t==null||t.addOverlay(w)},b=()=>{s!=null&&s.parentNode&&s.parentNode.removeChild(s),s=document.createElement("div"),s.className="ol-tooltip hidden",p=new mo({element:s,offset:[15,0],positioning:"center-left"}),t==null||t.addOverlay(p)},C=()=>{n.value.forEach((k,T)=>{var N,F;const I=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");I[T]&&((F=(N=I[T])==null?void 0:N.parentNode)==null||F.removeChild(I[T]));const P=c.getFeatures();P[T]&&c.removeFeature(P[T])}),v(),z7(t),a.value=!1,Vc(t,"pointer")},S=k=>{var I,P,N,F;const T=n.value.findIndex(M=>M.id===k);if(T!==-1){n.value.splice(T,1);const M=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");M[T]&&((P=(I=M[T])==null?void 0:I.parentNode)==null||P.removeChild(M[T]));const R=c.getFeatures();R[T]&&c.removeFeature(R[T])}(F=(N=e.getProps())==null?void 0:N.lineDrawEnd)==null||F.call(N,n.value)},v=()=>{if(n.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(k=>{var T;(T=k==null?void 0:k.parentNode)==null||T.removeChild(k)}),c==null||c.clear(),h){const k=t.getInteractions().getArray().find(T=>ct(T)===ct(h));k&&t.removeInteraction(k)}t.removeLayer(d),s!=null&&s.parentNode&&s.parentNode.removeChild(s),_!=null&&_.parentNode&&_.parentNode.removeChild(_)};return{open:l,close:C,deleteLine:S,setUnit:o,getState:()=>a.value}},j2=(t,e)=>{const r=Nu(t);let o="";switch(e){case"m":o=`${Math.round(r*100)/100} m`;break;case"km":o=`${Math.round(r/1e3*100)/100} km`;break;case"nm":o=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return o},W7=(t,e)=>{let n,r;const o=()=>{S(),s(),Vc(t,"crosshair")},s=()=>{c(),_(),b(),g()};let a=null,l=null;const c=()=>{if(a&&l)return;const v=new ho,x=new Go({source:v,style:new Ct({stroke:new Fn({color:"#fbcc33",width:2})}),zIndex:1e3});a=x,l=v,t.on("pointermove",u),t.addLayer(x),t.on(["dblclick"],function(k){f&&(k.stopPropagation(),k.preventDefault())})};let d;const u=v=>{if(v.dragging)return;const x=d?"单击继续,双击结束":"点击选择起点";w&&(w.innerHTML=x,E.setPosition(v.coordinate))};let f,p=!1;const g=()=>{if(n){w!=null&&w.parentNode&&w.parentNode.removeChild(w);const v=n.getGeometry();if(!v)return;const x=h(v,"nm");m&&(m.innerHTML=`
|
|
204
|
+
`,a=document.createElement("div");return a.className="ship-overlay-selected",a.innerHTML=s,a};function T7(t,e,n,r){if(e){const o=new mo({element:n,positioning:"top-left",id:"label-"+(r==null?void 0:r.id),offset:[20,-20],autoPan:!1,position:e,className:r.blinking?"ship-label-overlay-blinking":"ship-label-overlay"});o.set("class","zh-map-ship-overlay"),t.addOverlay(o)}}const M7=(t,e)=>{const{lon:n,lat:r,blinking:o}=e,s=$2(e);n&&r&&T7(t,rr([n,r]),s,{...e,blinking:o})},$2=t=>{const e=document.createElement("div");e.className="ship-overlay-box",e.style.position="relative";const{lon:n,lat:r,blinking:o,blinkingColors:s,name:a}=t,l=i.createVNode({setup(){return S7({position:[n+.002,r+.002],selected:o,name:a,colors:s||[],existDevice:t==null?void 0:t.existDevice,existMobile:t==null?void 0:t.existMobile,existWaterGauge:t==null?void 0:t.existWaterGauge})}});return i.render(l,e),e},z2=t=>{const e=[];return t.existDevice&&e.push(""),t.existMobile&&e.push(""),t.existWaterGauge&&e.push(""),e};function R7(){const t=["left-top","left-middle","left-bottom","right-top","right-middle","right-bottom"];return t[Math.floor(Math.random()*t.length)]}const D7=window.devicePixelRatio||1,C0=new Map;let Bc=null,E0=null;function P7(t,e,n="left-bottom",r=2){const o=`${t}-${e.join(",")}-${n}-${r}`;if(C0.has(o))return C0.get(o);if(!Bc){Bc=document.createElement("canvas");try{E0=Bc.getContext("2d",{willReadFrequently:!0})}catch{E0=Bc.getContext("2d")}}const s=Bc,a=E0;if(!a)return"";s.width=0,s.height=0;const l=2,c=8,d=16,u=window.devicePixelRatio||1,f="500 12px Arial",p="14px map-iconfont";a.font=f;const h=a.measureText(t).width;a.font=p;const m=e.map(M=>({width:a.measureText(Is(M)).width,height:14})),y=m.reduce((M,R)=>M+R.width,0),_=(e.length-1)*r,w=c+h+y+_+c,E=l+14+l;let b,C,S=0,v=0,x=0,k=0,T=0,I=0;switch(b=d+w,n){case"right-top":C=d+E,S=0,v=d+E,x=d,k=0,T=d,I=0;break;case"right-middle":C=E,S=0,v=E/2,x=d,k=E/2,T=d,I=0;break;case"right-bottom":C=d+E,S=0,v=0,x=d,k=d,T=d,I=d;break;case"left-top":C=d+E,S=w,v=d,x=w+d,k=E+d,T=0,I=0;break;case"left-middle":C=E,S=w,v=E/2,x=w+d,k=E/2,T=0,I=0;break;case"left-bottom":C=d+E,S=w,v=E,x=w+d,k=0,T=0,I=d;break}C=C+l,s.width=Math.round(b*u),s.height=Math.round(C*u),a.scale(u,u),a.clearRect(0,0,b,C),a.beginPath(),a.moveTo(S,v),a.lineTo(x,k),a.strokeStyle="#FFF",a.lineWidth=1,a.stroke(),a.fillStyle="#FFF",a.fillRect(T,I,w,E),a.font=f,a.textBaseline="middle";const P=I+l+E/2;a.strokeStyle="#ffffff",a.lineWidth=1,a.strokeText(t,T+c,P),a.fillStyle="#000000",a.fillText(t,T+c,P),a.font=p,a.fillStyle="#3370ff";let N=T+c+h+r;e.length>0&&e.forEach((M,R)=>{const O=I+l+E/2;a.fillText(Is(M),N,O),N+=m[R].width+r});const F=s.toDataURL("image/png");return C0.set(o,F),F}const Y2=(t,e)=>{const{name:n,rightIcons:r,selected:o}=t.getProperties(),s=e!==1?R7():"right-top",a=P7(n,r,s);let l=[0,0];switch(s){case"right-top":l=[0,1];break;case"right-middle":l=[0,.5];break;case"right-bottom":l=[0,0];break;case"left-top":l=[1,1];break;case"left-middle":l=[1,.5];break;case"left-bottom":l=[1,0];break}return new Ct({image:new ao({src:a,anchor:l,displacement:[0,0],scale:1/D7,anchorXUnits:"fraction",anchorYUnits:"fraction"}),zIndex:o?100:10})},I7=t=>{let e=null,n=null;const r=new ho,o=new E7({source:r,className:"zh-map--ship-layer",renderBuffer:300,zIndex:101,hitTolerance:10}),s=new ho,a=new Go({source:s,className:"zh-map--ship-label-layer",zIndex:102,updateWhileInteracting:!1,updateWhileAnimating:!1,declutter:{enabled:!0,group:"ship-label-group"}});t==null||t.addLayer(o),t==null||t.addLayer(a);let l=null,c="",d={},u={};const f=P=>{if(!P||!t)return;const N=(n==null?void 0:n.id)||(e==null?void 0:e.get("id"));if(n){const F=P.filter(M=>M.id===N);F.length===0?P.push(n):n=F[0]}y(),I(P),g(),b()},p=P=>{var L;const N=(n==null?void 0:n.id)||(e==null?void 0:e.get("id")),F=rr([P==null?void 0:P.lon,P==null?void 0:P.lat]),M=((L=u[P.id])==null?void 0:L.blinkColors)||[],O=M[M.length-1]||P.fill||"#04C900",A=v7(P),D=new sn({geometry:new an(F),shipData:P,id:P.id,name:P.cnname||P.enname||P.name||P.id||"未命名船舶",selected:P.id===N,rightIcons:z2(P),color:O,direct:A,isHighlight:!1});return D.set("clickGeometry",new Ic(F)),D},g=async()=>{if(!n||!t)return;let N=t.getOverlays().getArray().find(F=>F.get("class")=="ship-overlay-selected");if(N){const F=V2(t,n);await N.setElement(F),await N.setPosition(rr([n.lon,n.lat]))}else N=k7(t,n),N&&t.addOverlay(N);setTimeout(()=>{var F;N&&((F=N.get("element"))!=null&&F.parentElement)&&(N.get("element").parentElement.style.display="block")},20)},h=P=>{if(P==="start"){const N=()=>{r.getFeatures().forEach(F=>{F.setStyle(tl(t,F))}),l=requestAnimationFrame(N)};N()}P==="end"&&l&&(cancelAnimationFrame(l),l=null)},m=()=>{const N=(t==null?void 0:t.getOverlays().getArray()).find(F=>F.get("class")=="ship-overlay-selected");if(N){const F=N.getElement(),M=w0(t,n,"ship"),R=F.querySelector("svg");console.log(R),R&&(R.style.transform=`scale(${M})`)}},y=()=>{t&&r&&(_(),r.clear(),s.clear(),h("end"))},_=P=>{const N=t.getOverlays().getArray().filter(F=>F.get("class")=="zh-map-ship-overlay");if(N&&N.length>0){for(let F=0;F<N.length;F++)if(N[F].get("class")!=="ship-overlay-selected"){const M=N[F];console.log("overlay---",M),M.setPosition(void 0),t.removeOverlay(M),M.dispose()}}},w=(P,N)=>{d=P,u=N;const F=t.getOverlays().getArray(),M=r.getFeatures();for(const R in d){const O=d[R],A=F.find(L=>L.getId()==="label-"+R),D=M.find(L=>R===L.get("id"));if(A&&D){const L=N[R].blinkColors||[],{shipData:B,name:j,color:$}=D.getProperties();D.set("blinking",O),L[(L==null?void 0:L.length)-1]&&$!==L[(L==null?void 0:L.length)-1]&&(D.set("color",L[(L==null?void 0:L.length)-1]||""),D.setStyle(tl(t,D)));const W={...B,blinking:O,blinkingColors:L||[],name:j+"("+N[R].shipState+")"},q=A.getElement(),ne=$2(W);q&&q!==ne&&A.setElement(ne)}}},E=()=>{const P=t.getOverlays().getArray();if(d)for(const N in d){const F=P.find(M=>M.getId()==="label-"+N);if(F){const M=F.getElement();M&&(M.style.opacity=0)}}},b=()=>{const P=t.getOverlays().getArray();if(d)for(const N in d){const F=P.find(M=>M.getId()==="label-"+N);if(F){const M=F.getElement();M&&(M.style.opacity=1)}}},C=P=>{if(!t)return;const N=r.getFeatures(),F=s.getFeatures(),M=e?e.get("id"):"",R=N.filter(L=>L.get("id")!==M),O=F==null?void 0:F.filter(L=>L.get("id")!==M),A=new Map;P.forEach(L=>{A.set(L.id,!0)});const D=t.getOverlays().getArray();R.forEach(L=>{const B=L.get("id");if(!A.has(B))L.setStyle([]);else{const $=L.getStyle();($==null?void 0:$.length)==0&&L.setStyle(tl(t,L))}const j=D.find($=>$.getId()==="label-"+B);j&&j.setPosition(void 0)}),O.forEach(L=>{const B=L.get("id");if(!A.has(B))L.setStyle([]);else{const j=L.getStyle();(j==null?void 0:j.length)==0&&L.setStyle(Y2(L))}})},S=P=>{if(P){console.log("选中",P);const N=r.getFeatures().find(M=>M.get("id")===P.id),F=s.getFeatures().find(M=>M.get("id")===P.id);N&&(e=N),F&&F.set("selected",!0),n=P,g()}else console.log("取消选中"),n=null,e=null,k()},v=Nr((P,N,F)=>{try{if(P){const M=P.get("shipData"),R=P.get("id");if(t.getTargetElement().style.cursor=R?"pointer":"",N==="click"&&(S(M),F&&F(R)),N==="hover"){c&&c!==R&&x(),c=R;const O=r.getFeatures().find(A=>A.get("id")===c);O==null||O.set("isHighlight",!0),O==null||O.setStyle(tl(t,O))}}else t.getTargetElement().style.cursor="",x()}catch(M){console.log("handleShipMapEvent",M)}},10),x=()=>{const P=c?r.getFeatures().find(N=>N.get("id")===c):null;c=null,P==null||P.set("isHighlight",!1),P==null||P.setStyle(tl(t,P))},k=()=>{try{const N=t.getOverlays().getArray().find(F=>F.get("class")=="ship-overlay-selected");N&&N.setPosition(void 0)}catch(P){console.log(P)}},T=(P,N)=>{const F=rr([P==null?void 0:P.lon,P==null?void 0:P.lat]),M=new sn({geometry:new an(F),name:P.cnname||P.enname||P.name||P.id||"未命名船舶",rightIcons:z2(P),selected:(P==null?void 0:P.id)===(n==null?void 0:n.id),shipData:P});M.set("id",P.id);const R=Y2(M,N);return M.setStyle(R),M},I=P=>{const N=t.getView().getZoom();P.forEach(F=>{const M=p(F);if(M.setStyle(tl(t,M)),r.addFeature(M),(n==null?void 0:n.id)==F.id||N>=Mr.shipModelMin)if(d[F.id]){if(F.id&&u[F==null?void 0:F.id]){const R=u[F==null?void 0:F.id]||{},O=(R==null?void 0:R.blinkColors)||[],A=(R==null?void 0:R.shipState)||"",D=(F.cnname||F.enname||F.name||F.id||"未命名船舶")+"("+A+")",L={...F,name:D,blinking:d[F.id],blinkingColors:O||[]};M7(t,L)}}else{const R=T(F,P.length);s.addFeature(R)}})};return{render:f,selected:S,filter:C,blinking:w,clear:y,handleShipMapEvent:v,changeShipScale:h,changeSelectedScale:m,hiddenShipBlink:E,showShipBlink:b}},O7=t=>{const e=()=>t==null?void 0:t.getLayers(),n=i.ref("vector"),r=()=>n.value,o=c=>{n.value=c;const d=e();d&&(d==null||d.getArray().forEach(u=>{(u.className_==="vector"||u.className_==="satellite")&&u.setVisible(u.className_===c)}))},s=i.ref(!1);return{getLayers:e,getGreenTileVisible:()=>s.value,setGreenTileVisible:c=>{if(c!==s.value){if(c){const d=e();if(!d.getArray().find(f=>f.className_==="greenTile")){const f=new qa({source:new el({url:Ps.greenTile}),visible:c,zIndex:2,className:"greenTile"});d.push(f)}}else{const d=e(),u=d.getArray().find(f=>f.className_==="greenTile");u&&d.remove(u)}s.value=c}},getShowLayerType:r,setShowLayerType:o}},N7=()=>{const t=i.ref();return{setProps:r=>{t.value=r},getProps:()=>t.value}},L7=t=>{const e="zh-map-location-layer";let n,r,o=null,s=null;const a=h=>{if(!(!h||h.length===0)){if(r||(r=new ho),r.clear(),s){const m=h.find(y=>y.id===s.id);m?s=m:h.push(s)}h.forEach(m=>{l(m)}),n||(n=new Go({className:e,source:r,zIndex:100}),t==null||t.addLayer(n))}},l=h=>{const m=t==null?void 0:t.getView().getZoom(),[y,_]=h.latLon.split(","),w=new sn({geometry:new an(rr([Number(y),Number(_)]))});w.setStyle(c(h,m,h.id===(s==null?void 0:s.id))),w.set("loactionData",h),r.addFeature(w)},c=(h,m,y)=>{const _={image:new ao({src:y&&h.selectedPath||h.defaultPath,scale:.5*m/10})};return h.name&&(_.text=new so({text:h.name,font:"12px sans-serif",fill:new Jt({color:"#000000"}),backgroundFill:new Jt({color:"#FFFFFF"}),offsetY:30})),new Ct(_)},d=()=>{if(o){const h=o.get("loactionData").id;r.getFeatures().forEach(m=>{m.get("loactionData").id!==h&&r.removeFeature(m)})}else r.clear()},u=()=>{var _;const h=o.get("loactionData"),m=(_=t==null?void 0:t.getView())==null?void 0:_.getZoom();r.getFeatures().forEach(w=>{w.get("loactionData").id===h.id&&(w==null||w.setStyle(c(h,m,!1)))}),s=null,o=null},f=h=>{h?(p(),g(h)):clearSelectedPort()},p=()=>{var h;if(o){const m=o.get("loactionData"),y=(h=t==null?void 0:t.getView())==null?void 0:h.getZoom();o.setStyle(c(m,y,!1))}},g=h=>{const m=r.getFeatures();s=h,o=m.find(y=>y.get("loactionData").id===h.id)};return{render:a,selected:f,clearSelected:u,clear:d}},wf={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class Cf extends bi{constructor(e,n){super(e),this.feature=n}}function A7(t,e){const n=[];for(let r=0;r<e.length;++r){const s=e[r].getGeometry();W2(t,s,n)}return n}function Ef(t,e){return Ji(t[0],t[1],e[0],e[1])}function nl(t,e){const n=t.length;return e<0?t[e+n]:e>=n?t[e-n]:t[e]}function Sf(t,e,n){let r,o;e<n?(r=e,o=n):(r=n,o=e);const s=Math.ceil(r),a=Math.floor(o);if(s>a){const c=rl(t,r),d=rl(t,o);return Ef(c,d)}let l=0;if(r<s){const c=rl(t,r),d=nl(t,s);l+=Ef(c,d)}if(a<o){const c=nl(t,a),d=rl(t,o);l+=Ef(c,d)}for(let c=s;c<a-1;++c){const d=nl(t,c),u=nl(t,c+1);l+=Ef(d,u)}return l}function W2(t,e,n){if(e instanceof An){vf(t,e.getCoordinates(),!1,n);return}if(e instanceof Oc){const r=e.getCoordinates();for(let o=0,s=r.length;o<s;++o)vf(t,r[o],!1,n);return}if(e instanceof to){const r=e.getCoordinates();for(let o=0,s=r.length;o<s;++o)vf(t,r[o],!0,n);return}if(e instanceof Lc){const r=e.getCoordinates();for(let o=0,s=r.length;o<s;++o){const a=r[o];for(let l=0,c=a.length;l<c;++l)vf(t,a[l],!0,n)}return}if(e instanceof uf){const r=e.getGeometries();for(let o=0;o<r.length;++o)W2(t,r[o],n);return}}const S0={index:-1,endIndex:NaN};function F7(t,e,n,r){const o=t[0],s=t[1];let a=1/0,l=-1,c=NaN;for(let f=0;f<e.targets.length;++f){const p=e.targets[f],g=p.coordinates;let h=1/0,m;for(let y=0;y<g.length-1;++y){const _=g[y],w=g[y+1],E=G2(o,s,_,w);E.squaredDistance<h&&(h=E.squaredDistance,m=y+E.along)}h<a&&(a=h,p.ring&&e.targetIndex===f&&(p.endIndex>p.startIndex?m<p.startIndex&&(m+=g.length):p.endIndex<p.startIndex&&m>p.startIndex&&(m-=g.length)),c=m,l=f)}const d=e.targets[l];let u=d.ring;if(e.targetIndex===l&&u){const f=rl(d.coordinates,c),p=n.getPixelFromCoordinate(f);CE(p,e.startPx)>r&&(u=!1)}if(u){const f=d.coordinates,p=f.length,g=d.startIndex,h=c;if(g<h){const m=Sf(f,g,h);Sf(f,g,h-p)<m&&(c-=p)}else{const m=Sf(f,g,h);Sf(f,g,h+p)<m&&(c+=p)}}return S0.index=l,S0.endIndex=c,S0}function vf(t,e,n,r){const o=t[0],s=t[1];for(let a=0,l=e.length-1;a<l;++a){const c=e[a],d=e[a+1],u=G2(o,s,c,d);if(u.squaredDistance===0){const f=a+u.along;r.push({coordinates:e,ring:n,startIndex:f,endIndex:f});return}}}const v0={along:0,squaredDistance:0};function G2(t,e,n,r){const o=n[0],s=n[1],a=r[0],l=r[1],c=a-o,d=l-s;let u=0,f=o,p=s;return(c!==0||d!==0)&&(u=Ot(((t-o)*c+(e-s)*d)/(c*c+d*d),0,1),f+=c*u,p+=d*u),v0.along=u,v0.squaredDistance=Du(Ji(t,e,f,p),10),v0}function rl(t,e){const n=t.length;let r=Math.floor(e);const o=e-r;r>=n?r-=n:r<0&&(r+=n);let s=r+1;s>=n&&(s-=n);const a=t[r],l=a[0],c=a[1],d=t[s],u=d[0]-l,f=d[1]-c;return[l+u*o,c+f*o]}class xf extends Ha{constructor(e){const n=e;n.stopDown||(n.stopDown=Ea),super(n),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=V7(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:Ca,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let r=e.geometryFunction;if(!r){const o=this.mode_;if(o==="Circle")r=(s,a,l)=>{const c=a||new Ic([NaN,NaN]),d=qr(s[0]),u=wE(d,qr(s[s.length-1]));return c.setCenterAndRadius(d,Math.sqrt(u),this.geometryLayout_),c};else{let s;o==="Point"?s=an:o==="LineString"?s=An:o==="Polygon"&&(s=to),r=(a,l,c)=>(l?o==="Polygon"?a[0].length?l.setCoordinates([a[0].concat([a[0][0]])],this.geometryLayout_):l.setCoordinates([],this.geometryLayout_):l.setCoordinates(a,this.geometryLayout_):l=new s(a,this.geometryLayout_),l)}}this.geometryFunction_=r,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new Go({source:new ho({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:B7(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:o0,this.freehandCondition_,e.freehand?this.freehandCondition_=i0:this.freehandCondition_=e.freehandCondition?e.freehandCondition:h2,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Qg.ACTIVE,this.updateState_)}setTrace(e){let n;e?e===!0?n=i0:n=e:n=GW,this.traceCondition_=n}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===Ae.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let n=e.type===yt.POINTERMOVE,r=!0;return!this.freehand_&&this.lastDragTime_&&e.type===yt.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===yt.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===yt.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===yt.POINTERMOVE,r&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===yt.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===yt.DBLCLICK&&(r=!1),super.handleEvent(e)&&r}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new po(yt.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const n=this.getMap(),r=n.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),o=n.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),s=Lm([r,o]),a=this.traceSource_.getFeaturesInExtent(s);if(a.length===0)return;const l=A7(e.coordinate,a);l.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:l,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,n){const r=e.startIndex<=e.endIndex,o=e.startIndex<=n;r===o?r&&n>e.endIndex||!r&&n<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,n):(r&&n<e.endIndex||!r&&n>e.endIndex)&&this.removeTracedCoordinates_(n,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,n))}removeTracedCoordinates_(e,n){if(e===n)return;let r=0;if(e<n){const o=Math.ceil(e);let s=Math.floor(n);s===n&&(s-=1),r=s-o+1}else{const o=Math.floor(e);let s=Math.ceil(n);s===n&&(s+=1),r=o-s+1}r>0&&this.removeLastPoints_(r)}addTracedCoordinates_(e,n,r){if(n===r)return;const o=[];if(n<r){const s=Math.ceil(n);let a=Math.floor(r);a===r&&(a-=1);for(let l=s;l<=a;++l)o.push(nl(e.coordinates,l))}else{const s=Math.floor(n);let a=Math.ceil(r);a===r&&(a+=1);for(let l=s;l>=a;--l)o.push(nl(e.coordinates,l))}o.length&&this.appendCoordinates(o)}updateTrace_(e){const n=this.traceState_;if(!n.active||n.targetIndex===-1&&CE(n.startPx,e.pixel)<this.snapTolerance_)return;const r=F7(e.coordinate,n,this.getMap(),this.snapTolerance_);if(n.targetIndex!==r.index){if(n.targetIndex!==-1){const c=n.targets[n.targetIndex];this.removeTracedCoordinates_(c.startIndex,c.endIndex)}const l=n.targets[r.index];this.addTracedCoordinates_(l,l.startIndex,r.endIndex)}else{const l=n.targets[n.targetIndex];this.addOrRemoveTracedCoordinates_(l,r.endIndex)}n.targetIndex=r.index;const o=n.targets[n.targetIndex];o.endIndex=r.endIndex;const s=rl(o.coordinates,o.endIndex),a=this.getMap().getPixelFromCoordinate(s);e.coordinate=s,e.pixel=[Math.round(a[0]),Math.round(a[1])]}handleUpEvent(e){let n=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);const r=this.traceState_.active;if(this.toggleTraceState_(e),this.shouldHandle_){const o=!this.finishCoordinate_;o&&this.startDrawing_(e.coordinate),!o&&this.freehand_?this.finishDrawing():!this.freehand_&&(!o||this.mode_==="Point")&&(this.atFinish_(e.pixel,r)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),n=!1}else this.freehand_&&this.abortDrawing()}return!n&&this.stopClick_&&e.preventDefault(),n}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const n=this.downPx_,r=e.pixel,o=n[0]-r[0],s=n[1]-r[1],a=o*o+s*s;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,n){let r=!1;if(this.sketchFeature_){let o=!1,s=[this.finishCoordinate_];const a=this.mode_;if(a==="Point")r=!0;else if(a==="Circle")r=this.sketchCoords_.length===2;else if(a==="LineString")o=!n&&this.sketchCoords_.length>this.minPoints_;else if(a==="Polygon"){const l=this.sketchCoords_;o=l[0].length>this.minPoints_,s=[l[0][0],l[0][l[0].length-2]],n?s=[l[0][0]]:s=[l[0][0],l[0][l[0].length-2]]}if(o){const l=this.getMap();for(let c=0,d=s.length;c<d;c++){const u=s[c],f=l.getPixelFromCoordinate(u),p=e[0]-f[0],g=e[1]-f[1],h=this.freehand_?1:this.snapTolerance_;if(r=Math.sqrt(p*p+g*g)<=h,r){this.finishCoordinate_=u;break}}}}return r}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new sn(new an(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new sn);const n=e.getLinearRing(0);let r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(n.getLayout(),n.getFlatCoordinates()),r.changed()):(r=new An(n.getFlatCoordinates(),n.getLayout()),this.sketchLine_.setGeometry(r))}startDrawing_(e){const n=this.getMap().getView().getProjection(),r=uc(this.geometryLayout_);for(;e.length<r;)e.push(0);this.finishCoordinate_=e,this.mode_==="Point"?this.sketchCoords_=e.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new sn(new An(this.sketchLineCoords_)));const o=this.geometryFunction_(this.sketchCoords_,void 0,n);this.sketchFeature_=new sn,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(o),this.updateSketchFeatures_(),this.dispatchEvent(new Cf(wf.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const n=this.getMap(),r=this.sketchFeature_.getGeometry(),o=n.getView().getProjection(),s=uc(this.geometryLayout_);let a,l;for(;e.length<s;)e.push(0);this.mode_==="Point"?l=this.sketchCoords_:this.mode_==="Polygon"?(a=this.sketchCoords_[0],l=a[a.length-1],this.atFinish_(n.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(a=this.sketchCoords_,l=a[a.length-1]),l[0]=e[0],l[1]=e[1],this.geometryFunction_(this.sketchCoords_,r,o),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),r.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(r):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();let o,s;const a=this.mode_;return a==="LineString"||a==="Circle"?(this.finishCoordinate_=e.slice(),s=this.sketchCoords_,s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(e.slice()),this.geometryFunction_(s,n,r)):a==="Polygon"&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(e.slice()),o&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,n,r)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),o?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),o=this.mode_;for(let s=0;s<e;++s){let a;if(o==="LineString"||o==="Circle"){if(a=this.sketchCoords_,a.splice(-2,1),a.length>=2){this.finishCoordinate_=a[a.length-2].slice();const l=this.finishCoordinate_.slice();a[a.length-1]=l,this.createOrUpdateSketchPoint_(l)}this.geometryFunction_(a,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o==="Polygon"){a=this.sketchCoords_[0],a.splice(-2,1);const l=this.sketchLine_.getGeometry();if(a.length>=2){const c=a[a.length-2].slice();a[a.length-1]=c,this.createOrUpdateSketchPoint_(c)}l.setCoordinates(a),this.geometryFunction_(this.sketchCoords_,n,r)}if(a.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let n=this.sketchCoords_;const r=e.getGeometry(),o=this.getMap().getView().getProjection();return this.mode_==="LineString"?(n.pop(),this.geometryFunction_(n,r,o)):this.mode_==="Polygon"&&(n[0].pop(),this.geometryFunction_(n,r,o),n=r.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new Nc([n])):this.type_==="MultiLineString"?e.setGeometry(new Oc([n])):this.type_==="MultiPolygon"&&e.setGeometry(new Lc([n])),this.dispatchEvent(new Cf(wf.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new Cf(wf.DRAWABORT,e))}appendCoordinates(e){const n=this.mode_,r=!this.sketchFeature_;r&&this.startDrawing_(e[0]);let o;if(n==="LineString"||n==="Circle")o=this.sketchCoords_;else if(n==="Polygon")o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;r&&o.shift(),o.pop();for(let a=0;a<e.length;a++)this.addToDrawing_(e[a]);const s=e[e.length-1];this.sketchFeature_=this.addToDrawing_(s),this.modifyDrawing_(s)}extend(e){const r=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=r.getCoordinates();const o=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=o.slice(),this.sketchCoords_.push(o.slice()),this.sketchPoint_=new sn(new an(o)),this.updateSketchFeatures_(),this.dispatchEvent(new Cf(wf.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const n=this.overlay_.getSource();n.clear(!0),n.addFeatures(e)}updateState_(){const e=this.getMap(),n=this.getActive();(!e||!n)&&this.abortDrawing(),this.overlay_.setMap(n?e:null)}}function B7(){const t=G9();return function(e,n){return t[e.getGeometry().getType()]}}function V7(t){switch(t){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+t)}}const $7=t=>{t.getInteractions().forEach(e=>{e instanceof t0&&e.setActive(!1)})},z7=t=>{t.getInteractions().forEach(e=>{e instanceof t0&&e.setActive(!0)})},Vc=(t,e)=>{const n=t.getViewport();n&&(n.style.cursor=e)},Y7=(t,e)=>{const n=i.ref([]),r=i.ref("km"),o=k=>{r.value=k};let s;const a=i.ref(!1),l=()=>{Vc(t,"crosshair"),u(),$7(t),t.on("pointermove",g),t.getViewport().addEventListener("mouseout",()=>{s&&s.classList.add("hidden")}),m(),a.value=!0};let c,d;const u=()=>{c=new ho,d=new Go({source:c,zIndex:1e3,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),t==null||t.addLayer(d)};let f,p;const g=k=>{if(k.dragging)return;let T="点击选择起点";f&&(T="单击继续,双击结束"),s&&(s.innerHTML=T,p.setPosition(k.coordinate),s.classList.remove("hidden"))};let h;const m=()=>{h=new xf({source:c,type:"LineString",style:new Ct({fill:new Jt({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Fn({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new oo({radius:5,stroke:new Fn({color:"rgba(0, 0, 0, 0.7)"}),fill:new Jt({color:"rgba(255, 255, 255, 0.2)"})})}),condition:T=>T.originalEvent.target.tagName!=="DIV"}),t==null||t.addInteraction(h),E(),b();let k;h.on("drawstart",function(T){var P;f=T.feature,f.set("randomId",y());let I;k=(P=f.getGeometry())==null?void 0:P.on("change",function(N){const F=N.target,M=j2(F,r.value);I=F.getLastCoordinate(),_&&M&&(_.innerHTML=M),w.setPosition(I)})}),h.on("drawend",function(){var T,I,P;if(_&&(_.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),_!=null&&_.innerHTML){const N=(f==null?void 0:f.get("randomId"))||y();n.value.push({id:N,value:_==null?void 0:_.innerHTML}),_.innerHTML=`${_.innerHTML}<div class="ol-tooltip-delete-button" data-id="${N}"><i class="map-iconfont icon-delete"></i></div>`}(T=document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button"))==null||T.addEventListener("click",N=>{var M;N.preventDefault(),N.stopPropagation();const F=(M=N.target)==null?void 0:M.getAttribute("data-id");F&&S(F)}),w.setOffset([0,-7]),f=null,_=null,E(),k&&Eu(k),(P=(I=e.getProps())==null?void 0:I.lineDrawEnd)==null||P.call(I,n.value)})},y=()=>Math.random().toString(36).substring(2,9);let _,w;const E=()=>{_!=null&&_.parentNode&&_.parentNode.removeChild(_),_=document.createElement("div"),_.className="ol-tooltip ol-tooltip-measure",w=new mo({element:_,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),t==null||t.addOverlay(w)},b=()=>{s!=null&&s.parentNode&&s.parentNode.removeChild(s),s=document.createElement("div"),s.className="ol-tooltip hidden",p=new mo({element:s,offset:[15,0],positioning:"center-left"}),t==null||t.addOverlay(p)},C=()=>{n.value.forEach((k,T)=>{var N,F;const I=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");I[T]&&((F=(N=I[T])==null?void 0:N.parentNode)==null||F.removeChild(I[T]));const P=c.getFeatures();P[T]&&c.removeFeature(P[T])}),v(),z7(t),a.value=!1,Vc(t,"pointer")},S=k=>{var I,P,N,F;const T=n.value.findIndex(M=>M.id===k);if(T!==-1){n.value.splice(T,1);const M=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");M[T]&&((P=(I=M[T])==null?void 0:I.parentNode)==null||P.removeChild(M[T]));const R=c.getFeatures();R[T]&&c.removeFeature(R[T])}(F=(N=e.getProps())==null?void 0:N.lineDrawEnd)==null||F.call(N,n.value)},v=()=>{if(n.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(k=>{var T;(T=k==null?void 0:k.parentNode)==null||T.removeChild(k)}),c==null||c.clear(),h){const k=t.getInteractions().getArray().find(T=>ct(T)===ct(h));k&&t.removeInteraction(k)}t.removeLayer(d),s!=null&&s.parentNode&&s.parentNode.removeChild(s),_!=null&&_.parentNode&&_.parentNode.removeChild(_)};return{open:l,close:C,deleteLine:S,setUnit:o,getState:()=>a.value}},j2=(t,e)=>{const r=Nu(t);let o="";switch(e){case"m":o=`${Math.round(r*100)/100} m`;break;case"km":o=`${Math.round(r/1e3*100)/100} km`;break;case"nm":o=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return o},W7=(t,e)=>{let n,r;const o=()=>{S(),s(),Vc(t,"crosshair")},s=()=>{c(),_(),b(),g()};let a=null,l=null;const c=()=>{if(a&&l)return;const v=new ho,x=new Go({source:v,style:new Ct({stroke:new Fn({color:"#fbcc33",width:2})}),zIndex:1e3});a=x,l=v,t.on("pointermove",u),t.addLayer(x),t.on(["dblclick"],function(k){f&&(k.stopPropagation(),k.preventDefault())})};let d;const u=v=>{if(v.dragging)return;const x=d?"单击继续,双击结束":"点击选择起点";w&&(w.innerHTML=x,E.setPosition(v.coordinate))};let f,p=!1;const g=()=>{if(n){w!=null&&w.parentNode&&w.parentNode.removeChild(w);const v=n.getGeometry();if(!v)return;const x=h(v,"nm");m&&(m.innerHTML=`
|
|
205
205
|
<span class="text">面积:${x}${p?'<span class="error pl-12">超出可以绘画的距离</span>':""}</span>
|
|
206
206
|
`),m&&(m.innerHTML+='<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');const k=v.getCoordinates(),T=k[0][k[0].length-2];if(y.setPosition(T),a){const P=a.getSource();P&&n&&(P.clear(),P.addFeature(n))}setTimeout(()=>{var P;(P=document.querySelector(".delete-icon"))==null||P.addEventListener("click",()=>{var N,F;console.log("delete"),C(),(F=(N=e.getProps())==null?void 0:N.areaDrawEnd)==null||F.call(N,[])})},0);const I=Zi(n.getGeometry().getExtent());t==null||t.getView().setCenter(I);return}f=new xf({type:"Polygon",source:l,trace:!0,style:[new Ct({stroke:new Fn({color:"rgba(255, 255, 255, 1)",width:1.5,lineDash:[10,10]}),fill:new Jt({color:"rgba(255, 255, 255, 0.25)"})}),new Ct({image:new oo({radius:5,fill:new Jt({color:"rgb(51,112,255, 1)"})}),geometry:function(v){const x=v.getGeometry().getCoordinates();return new Nc(x)}})]}),t==null||t.addInteraction(f),f.on("drawstart",v=>{var x;d=v.feature,r=(x=d.getGeometry())==null?void 0:x.on("change",k=>{const T=k.target,I=h(T,"nm"),N=T.getCoordinates()[0],F=new An([N[N.length-2],N[N.length-1]]),M=j2(F,"nm");if(p=Number(Nu(F)/1e3)>150,!I)return;const R='<span class="error pl-4">超出可以绘画的距离</span>';m&&(m.innerHTML=`
|
|
207
207
|
<div class="text">
|
|
@@ -231,7 +231,7 @@ fe.version="2.30.1",Z4(Tt),fe.fn=le,fe.min=BV,fe.max=VV,fe.now=$V,fe.utc=mi,fe.u
|
|
|
231
231
|
</clipPath>
|
|
232
232
|
</defs>
|
|
233
233
|
</svg>
|
|
234
|
-
`,E=()=>`data:image/svg+xml;utf8,${encodeURIComponent(w(y?"#FF5733":"#3370FF"))}`,b=t.getView().getZoom(),C=m.get("portData"),S=window.devicePixelRatio||1,v=new Ct({image:new ao({src:E(),scale:.5*b/10}),zIndex:y?110:100}),x=new Ct({image:new ao({src:c(C.shortName,y),anchor:[.5,.5],displacement:[0,-26],scale:1/S,anchorXUnits:"fraction",anchorYUnits:"fraction"}),zIndex:y?110:100});return!_&&!y?v:[v,x]},u=()=>{if(e)if(r){console.log("清除非选中的港口");const m=r.get("portData").id;e.getFeatures().forEach(y=>{y.get("portData").id!==m&&e.removeFeature(y)})}else console.log("清除所有港口",e),e==null||e.clear()},f=m=>{if(e){if(!m)return p();(r==null?void 0:r.get("portData").id)!==m.id&&(p(),g(m))}},p=()=>{var m;if(r){const y=r==null?void 0:r.get("portData"),_=(m=e.getFeatures())==null?void 0:m.find(w=>w.get("portData").id===y.id);_&&(_.set("select",!1),_.setStyle(d(_)),r=null,o=null)}},g=m=>{if(!e)return;const y=e.getFeatures();o=m,r=y.find(_=>_.get("portData").id===m.id),r&&(r.set("select",!0),r.setStyle(d(r)))};return{render:s,clear:u,selected:f,handlePortHover:m=>{const y=t==null?void 0:t.getTargetElement();m&&m.get("portData")&&y&&Vc(t,"pointer")}}},H7=(t,e,n,r,o,s)=>{const a=t.getInstall();a.on("moveend",()=>{var l,c;try{const d=t.getZoom();(c=(l=e.getProps()).mapMoveEnd)==null||c.call(l,d),n.reRenderTrackLine(),r.changeShipScale("end")}catch(d){console.log("moveend---catch",d)}}),a.on("pointermove",l=>{try{const c=a==null?void 0:a.getEventPixel(l.originalEvent);if(!c||!a)return;const d=a==null?void 0:a.forEachFeatureAtPixel(c,u=>u);r==null||r.handleShipMapEvent(d,"hover"),n==null||n.handleTrackMapEvent(d,"hover",l),d&&(o==null||o.handlePortHover(d))}catch(c){console.log("pointermove---catch",c)}}),a.on("movestart",()=>{try{const l=a==null?void 0:a.getView().getZoom();l&&l<=Mr.shipModelMax&&l>=Mr.shipTriggleMin&&r.changeShipScale("start"),r.hiddenShipBlink()}catch(l){console.log("movestart---catch",l)}}),a.on("click",Nr(l=>{var c,d,u;try{if(console.log("1",s.getState()),s.getState())return;const f=a.getEventPixel(l.originalEvent),p=a.forEachFeatureAtPixel(f,g=>{if(g!=null&&g.get("shipData")||g!=null&&g.get("portData"))return g});if(p!=null&&p.get("shipData"))r.handleShipMapEvent(p,"click",(c=e.getProps())==null?void 0:c.selectShip);else if(p!=null&&p.get("portData")){const g=p.get("portData");o.selected(g),(u=(d=e.getProps())==null?void 0:d.selectPort)==null||u.call(d,g)}l.preventDefault(),l.stopPropagation()}catch(f){console.log("click---catch",f)}},150)),a.getView().on("change:resolution",Nr(()=>{const l=a==null?void 0:a.getView().getZoom();l&&l<=Mr.shipModelMax&&l>=Mr.shipTriggleMin&&r.changeSelectedScale("start")},10))},U7=()=>{const t=i.reactive([]);return{createInstance:(r,o)=>{const s=r7();s.initMap(r,o);const a=s.getInstall(),l=O7(a),c=N7();c.setProps(o),l.setShowLayerType(o.layerType),l.setGreenTileVisible(o.showGreenLayer);const d=w7(a),u=l7(a,d),f=I7(a),p=L7(a),g=Y7(a,c),h=W7(a,c),m=j7(a);H7(s,c,d,f,m,g);const y=()=>{const w=a.getView().calculateExtent(s.getSize()),E=Qi([w[0],w[1]],Yn.mercator,Yn.data),b=Qi([w[2],w[3]],Yn.mercator,Yn.data);return[E[0],E[1],b[0],b[1]]},_={id:Symbol("map-instance"),innerMap:null,map:s.getInstall(),destroy:()=>{t.splice(t.indexOf(_),1)},methods:{...s,layer:l,ship:f,track:d,carTrack:u,port:{render:m.render,clear:m.clear,selected:m.selected},position:p,drawLine:g,drawPolygon:h,utils:{getCalculateExtent:y,convertSixHundredThousandToLatLng:b0,calculateCirclePoints:i7}}};return t.push(_),_},destroyInstance:r=>{const o=t.findIndex(s=>s.id===r);o>-1&&(t[o].destroy(),t.splice(o,1))},destroyAll:()=>{t.forEach(r=>r.destroy()),t.splice(0,t.length)},getAllInstances:()=>[...t]}},K7={class:"zh-map-box"},X7=i.defineComponent({__name:"Map",props:{zoom:{default:Mr.default},center:{default:FG},layerType:{default:"vector"},showGreenLayer:{type:Boolean,default:!1},showScale:{type:Boolean,default:!0},scaleLineUnit:{default:"metric"},mapMoveEnd:{type:Function,default:()=>{}},lineDrawEnd:{},areaDrawEnd:{type:Function,default:()=>{}},selectShip:{type:Function,default:()=>{}},selectPort:{type:Function,default:()=>{}}},setup(t,{expose:e}){const n=i.ref(),r=i.ref(),o=U7(),s=i.ref(),a=t,l=i.ref({getInstall(){}});return i.onMounted(()=>{var c;s.value=o.createInstance(n.value,a),l.value=s.value.methods,(c=r.value)==null||c.setScaleLine(s.value.map,a.scaleLineUnit)}),i.onUnmounted(()=>{var c,d;o.destroyInstance((c=s==null?void 0:s.value)==null?void 0:c.id),(d=s.value)==null||d.destroy()}),e({getZoom:()=>{var c;return(c=s.value)==null?void 0:c.methods.getZoom()},setZoom:c=>{var d;return(d=s.value)==null?void 0:d.methods.setZoom(c)},getInstall:()=>{var c;return(c=s.value)==null?void 0:c.methods.getInstall()},getView:()=>{var c;return(c=s.value)==null?void 0:c.methods.getView()},setCenter:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.setCenter(c,d)},getSize:()=>{var c;return(c=s.value)==null?void 0:c.methods.getSize()},getCenter:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.getCenter()},layer:{setGreenTileVisible:c=>{var d;return(d=s.value)==null?void 0:d.methods.layer.setGreenTileVisible(c)},getGreenTileVisible:()=>{var c;return(c=s.value)==null?void 0:c.methods.layer.getGreenTileVisible()},getShowLayerType:()=>{var c;return(c=s.value)==null?void 0:c.methods.layer.getShowLayerType()},setShowLayerType:c=>{var d;return(d=s.value)==null?void 0:d.methods.layer.setShowLayerType(c)}},ship:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.render(...c)},selected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.selected(...c)},filter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.filter(...c)},blinking:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.blinking(...c)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.ship.clear()}},track:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.render(...c)},remove:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.remove(...c)},play:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.play(...c)},setCenter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.setCenter(...c)},close:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.close(...c)},getLength:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.getLength(...c)}},carTrack:{location:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.location(...c)},remove:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.remove(...c)},renderTrack:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.renderTrack(...c)},setCenter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.setCenter(...c)},closeTrack:()=>{var c;return(c=s.value)==null?void 0:c.methods.carTrack.closeTrack()},playTrack:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.playTrack(...c)}},port:{render:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.port.render(c,d)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.port.clear()},selected:c=>{var d;return(d=s.value)==null?void 0:d.methods.port.selected(c)}},position:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.render(...c)},selected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.selected(...c)},clearSelected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.clearSelected(...c)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.position.clear()}},drawLine:{open:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.open()},close:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.close()},deleteLine:c=>{var d;return(d=s.value)==null?void 0:d.methods.drawLine.deleteLine(c)},setUnit:c=>{var d;return(d=s.value)==null?void 0:d.methods.drawLine.setUnit(c)},getState:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.getState()}},drawPolygon:{open:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.open()},close:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.close()},reset:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.reset()}},utils:{getCalculateExtent:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.utils.getCalculateExtent(...c)},convertSixHundredThousandToLatLng:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.utils.convertSixHundredThousandToLatLng(...c)},calculateCirclePoints:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.utils.calculateCirclePoints(c,d)}}}),(c,d)=>(i.openBlock(),i.createElementBlock("div",K7,[i.createElementVNode("div",{id:"map",ref_key:"zhMapRef",ref:n,class:"zh-map"},null,512),i.createVNode(uG,{ref_key:"scaleLineRef",ref:r},null,512),i.createVNode(hG,{ref:"zoomControlRef","map-instance":s.value},null,8,["map-instance"])]))}}),H2=Dt(Ft(X7,[["__scopeId","data-v-1fa3c6fd"]]));var Z7={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
|
|
234
|
+
`,E=()=>`data:image/svg+xml;utf8,${encodeURIComponent(w(y?"#FF5733":"#3370FF"))}`,b=t.getView().getZoom(),C=m.get("portData"),S=window.devicePixelRatio||1,v=new Ct({image:new ao({src:E(),scale:.5*b/10}),zIndex:y?110:100}),x=new Ct({image:new ao({src:c(C.shortName,y),anchor:[.5,.5],displacement:[0,-26],scale:1/S,anchorXUnits:"fraction",anchorYUnits:"fraction"}),zIndex:y?110:100});return!_&&!y?v:[v,x]},u=()=>{if(e)if(r){console.log("清除非选中的港口");const m=r.get("portData").id;e.getFeatures().forEach(y=>{y.get("portData").id!==m&&e.removeFeature(y)})}else console.log("清除所有港口",e),e==null||e.clear()},f=m=>{if(e){if(!m)return p();(r==null?void 0:r.get("portData").id)!==m.id&&(p(),g(m))}},p=()=>{var m;if(r){const y=r==null?void 0:r.get("portData"),_=(m=e.getFeatures())==null?void 0:m.find(w=>w.get("portData").id===y.id);_&&(_.set("select",!1),_.setStyle(d(_)),r=null,o=null)}},g=m=>{if(!e)return;const y=e.getFeatures();o=m,r=y.find(_=>_.get("portData").id===m.id),r&&(r.set("select",!0),r.setStyle(d(r)))};return{render:s,clear:u,selected:f,handlePortHover:m=>{m&&m.get("portData")&&(t!=null&&t.getTargetElement())&&Vc(t,"pointer")}}},H7=(t,e,n,r,o,s)=>{const a=t.getInstall();a.on("moveend",()=>{var l,c;try{const d=t.getZoom();(c=(l=e.getProps()).mapMoveEnd)==null||c.call(l,d),n.reRenderTrackLine(),r.changeShipScale("end")}catch(d){console.log("moveend---catch",d)}}),a.on("pointermove",l=>{try{const c=a==null?void 0:a.getEventPixel(l.originalEvent);if(!c||!a)return;const d=a.getSize();if(c[0]<0||c[0]>d[0]||c[1]<0||c[1]>d[1])return;const u=a==null?void 0:a.forEachFeatureAtPixel(c,f=>f);n==null||n.handleTrackMapEvent(u,"hover",l),r==null||r.handleShipMapEvent(u,"hover"),u&&(o==null||o.handlePortHover(u))}catch(c){console.log("pointermove---catch",c)}}),a.on("movestart",()=>{try{const l=a==null?void 0:a.getView().getZoom();l&&l<=Mr.shipModelMax&&l>=Mr.shipTriggleMin&&r.changeShipScale("start"),r.hiddenShipBlink()}catch(l){console.log("movestart---catch",l)}}),a.on("click",Nr(l=>{var c,d,u;try{if(console.log("1",s.getState()),s.getState())return;const f=a.getEventPixel(l.originalEvent),p=a.forEachFeatureAtPixel(f,g=>{if(g!=null&&g.get("shipData")||g!=null&&g.get("portData"))return g});if(p!=null&&p.get("shipData"))r.handleShipMapEvent(p,"click",(c=e.getProps())==null?void 0:c.selectShip);else if(p!=null&&p.get("portData")){const g=p.get("portData");o.selected(g),(u=(d=e.getProps())==null?void 0:d.selectPort)==null||u.call(d,g)}l.preventDefault(),l.stopPropagation()}catch(f){console.log("click---catch",f)}},150)),a.getView().on("change:resolution",Nr(()=>{const l=a==null?void 0:a.getView().getZoom();l&&l<=Mr.shipModelMax&&l>=Mr.shipTriggleMin&&r.changeSelectedScale("start")},10))},U7=()=>{const t=i.reactive([]);return{createInstance:(r,o)=>{const s=r7();s.initMap(r,o);const a=s.getInstall(),l=O7(a),c=N7();c.setProps(o),l.setShowLayerType(o.layerType),l.setGreenTileVisible(o.showGreenLayer);const d=w7(a),u=l7(a,d),f=I7(a),p=L7(a),g=Y7(a,c),h=W7(a,c),m=j7(a);H7(s,c,d,f,m,g);const y=()=>{const w=a.getView().calculateExtent(s.getSize()),E=Qi([w[0],w[1]],Yn.mercator,Yn.data),b=Qi([w[2],w[3]],Yn.mercator,Yn.data);return[E[0],E[1],b[0],b[1]]},_={id:Symbol("map-instance"),innerMap:null,map:s.getInstall(),destroy:()=>{t.splice(t.indexOf(_),1)},methods:{...s,layer:l,ship:f,track:d,carTrack:u,port:{render:m.render,clear:m.clear,selected:m.selected},position:p,drawLine:g,drawPolygon:h,utils:{getCalculateExtent:y,convertSixHundredThousandToLatLng:b0,calculateCirclePoints:i7}}};return t.push(_),_},destroyInstance:r=>{const o=t.findIndex(s=>s.id===r);o>-1&&(t[o].destroy(),t.splice(o,1))},destroyAll:()=>{t.forEach(r=>r.destroy()),t.splice(0,t.length)},getAllInstances:()=>[...t]}},K7={class:"zh-map-box"},X7=i.defineComponent({__name:"Map",props:{zoom:{default:Mr.default},center:{default:FG},layerType:{default:"vector"},showGreenLayer:{type:Boolean,default:!1},showScale:{type:Boolean,default:!0},scaleLineUnit:{default:"metric"},mapMoveEnd:{type:Function,default:()=>{}},lineDrawEnd:{},areaDrawEnd:{type:Function,default:()=>{}},selectShip:{type:Function,default:()=>{}},selectPort:{type:Function,default:()=>{}}},setup(t,{expose:e}){const n=i.ref(),r=i.ref(),o=U7(),s=i.ref(),a=t,l=i.ref({getInstall(){}});return i.onMounted(()=>{var c;s.value=o.createInstance(n.value,a),l.value=s.value.methods,(c=r.value)==null||c.setScaleLine(s.value.map,a.scaleLineUnit)}),i.onUnmounted(()=>{var c,d;o.destroyInstance((c=s==null?void 0:s.value)==null?void 0:c.id),(d=s.value)==null||d.destroy()}),e({getZoom:()=>{var c;return(c=s.value)==null?void 0:c.methods.getZoom()},setZoom:c=>{var d;return(d=s.value)==null?void 0:d.methods.setZoom(c)},getInstall:()=>{var c;return(c=s.value)==null?void 0:c.methods.getInstall()},getView:()=>{var c;return(c=s.value)==null?void 0:c.methods.getView()},setCenter:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.setCenter(c,d)},getSize:()=>{var c;return(c=s.value)==null?void 0:c.methods.getSize()},getCenter:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.getCenter()},layer:{setGreenTileVisible:c=>{var d;return(d=s.value)==null?void 0:d.methods.layer.setGreenTileVisible(c)},getGreenTileVisible:()=>{var c;return(c=s.value)==null?void 0:c.methods.layer.getGreenTileVisible()},getShowLayerType:()=>{var c;return(c=s.value)==null?void 0:c.methods.layer.getShowLayerType()},setShowLayerType:c=>{var d;return(d=s.value)==null?void 0:d.methods.layer.setShowLayerType(c)}},ship:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.render(...c)},selected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.selected(...c)},filter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.filter(...c)},blinking:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.blinking(...c)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.ship.clear()}},track:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.render(...c)},remove:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.remove(...c)},play:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.play(...c)},setCenter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.setCenter(...c)},close:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.close(...c)},getLength:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.getLength(...c)}},carTrack:{location:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.location(...c)},remove:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.remove(...c)},renderTrack:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.renderTrack(...c)},setCenter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.setCenter(...c)},closeTrack:()=>{var c;return(c=s.value)==null?void 0:c.methods.carTrack.closeTrack()},playTrack:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.playTrack(...c)}},port:{render:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.port.render(c,d)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.port.clear()},selected:c=>{var d;return(d=s.value)==null?void 0:d.methods.port.selected(c)}},position:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.render(...c)},selected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.selected(...c)},clearSelected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.clearSelected(...c)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.position.clear()}},drawLine:{open:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.open()},close:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.close()},deleteLine:c=>{var d;return(d=s.value)==null?void 0:d.methods.drawLine.deleteLine(c)},setUnit:c=>{var d;return(d=s.value)==null?void 0:d.methods.drawLine.setUnit(c)},getState:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.getState()}},drawPolygon:{open:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.open()},close:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.close()},reset:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.reset()}},utils:{getCalculateExtent:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.utils.getCalculateExtent(...c)},convertSixHundredThousandToLatLng:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.utils.convertSixHundredThousandToLatLng(...c)},calculateCirclePoints:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.utils.calculateCirclePoints(c,d)}}}),(c,d)=>(i.openBlock(),i.createElementBlock("div",K7,[i.createElementVNode("div",{id:"map",ref_key:"zhMapRef",ref:n,class:"zh-map"},null,512),i.createVNode(uG,{ref_key:"scaleLineRef",ref:r},null,512),i.createVNode(hG,{ref:"zoomControlRef","map-instance":s.value},null,8,["map-instance"])]))}}),H2=Dt(Ft(X7,[["__scopeId","data-v-1fa3c6fd"]]));var Z7={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
|
|
235
235
|
* Sortable 1.15.6
|
|
236
236
|
* @author RubaXa <trash@rubaxa.org>
|
|
237
237
|
* @author owenm <owen23355@gmail.com>
|