zhihao-ui 1.3.42-alpha.6 → 1.3.42-alpha.7

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.
@@ -10,8 +10,8 @@ const Kt = { id: "scale-line-container" }, _t = /* @__PURE__ */ je({
10
10
  i || (i = "metric");
11
11
  const o = new Rt({
12
12
  units: i
13
- }), f = document.getElementById("scale-line-container");
14
- f && (o.setTarget(f), l.addControl(o));
13
+ }), g = document.getElementById("scale-line-container");
14
+ g && (o.setTarget(g), l.addControl(o));
15
15
  }
16
16
  }), (l, i) => (Qe(), Je("div", Kt));
17
17
  }
@@ -28,13 +28,13 @@ const Kt = { id: "scale-line-container" }, _t = /* @__PURE__ */ je({
28
28
  console.log("props", n);
29
29
  const s = () => {
30
30
  console.log("props");
31
- const { setZoom: i, getZoom: o, getInstall: f } = n.mapInstance.methods;
32
- if (!f()) return;
31
+ const { setZoom: i, getZoom: o, getInstall: g } = n.mapInstance.methods;
32
+ if (!g()) return;
33
33
  const t = o();
34
34
  t && i(t + 1);
35
35
  }, l = () => {
36
- const { setZoom: i, getZoom: o, getInstall: f } = n.mapInstance.methods;
37
- if (!f()) return;
36
+ const { setZoom: i, getZoom: o, getInstall: g } = n.mapInstance.methods;
37
+ if (!g()) return;
38
38
  const t = o();
39
39
  t && i(t - 1);
40
40
  };
@@ -81,7 +81,7 @@ function ro() {
81
81
  }, o = (p, T) => {
82
82
  var z;
83
83
  (z = s()) == null || z.setCenter(ee([p, T]));
84
- }, f = () => {
84
+ }, g = () => {
85
85
  var T;
86
86
  const p = (T = s()) == null ? void 0 : T.getCenter();
87
87
  return At(p);
@@ -89,7 +89,7 @@ function ro() {
89
89
  var p;
90
90
  return (p = n()) == null ? void 0 : p.getSize();
91
91
  }, t = new rt(), r = (p, T) => {
92
- g(T);
92
+ f(T);
93
93
  const z = {
94
94
  zoom: T.zoom,
95
95
  center: ee(T.center),
@@ -114,7 +114,7 @@ function ro() {
114
114
  };
115
115
  const x = new rt(M);
116
116
  e.value = x;
117
- }, g = (p) => {
117
+ }, f = (p) => {
118
118
  t.set("vectorTile", new we({
119
119
  source: new xe({ url: fe.vectorTile }),
120
120
  visible: p.layerType === "vector",
@@ -152,10 +152,10 @@ function ro() {
152
152
  getZoom: l,
153
153
  setZoom: i,
154
154
  setCenter: o,
155
- getCenter: f,
155
+ getCenter: g,
156
156
  getSize: w,
157
157
  initMap: r,
158
- setBaseLayerMap: g
158
+ setBaseLayerMap: f
159
159
  };
160
160
  }
161
161
  const Ue = function(e, n) {
@@ -223,13 +223,13 @@ const st = (e) => {
223
223
  return l !== 0 && (o = `${String(l).padStart(2, "0")}时${o}`), s !== 0 && (o = `${String(s).padStart(2, "0")}天${o}`), o;
224
224
  }, co = (e, n) => {
225
225
  let s = null;
226
- const l = async (g) => {
227
- if (!e || (console.log("vehicleInfo", g), !(g != null && g.lon && (g != null && g.lat)))) return;
228
- const p = Math.abs(Number(g.lon)) > 180 ? Ue(g.lon, g.lat) : [g.lon, g.lat];
229
- i(g, ee(p));
226
+ const l = async (f) => {
227
+ if (!e || (console.log("vehicleInfo", f), !(f != null && f.lon && (f != null && f.lat)))) return;
228
+ const p = Math.abs(Number(f.lon)) > 180 ? Ue(f.lon, f.lat) : [f.lon, f.lat];
229
+ i(f, ee(p));
230
230
  const T = e == null ? void 0 : e.getView(), z = new ce(p);
231
231
  T.setCenter(Me(z.getCoordinates(), _.data, _.mercator));
232
- }, i = (g, p) => {
232
+ }, i = (f, p) => {
233
233
  const T = `${gt}map/car-icon.gif`;
234
234
  s || (s = new de({
235
235
  element: document.createElement("div"),
@@ -239,26 +239,26 @@ const st = (e) => {
239
239
  }), e.addOverlay(s));
240
240
  const z = s.getElement();
241
241
  z.style.backgroundImage = `url(${T})`, z.style.width = "80px", z.style.height = "80px";
242
- const M = (g == null ? void 0 : g.drc) || "";
242
+ const M = (f == null ? void 0 : f.drc) || "";
243
243
  z.style.transform = `rotate(${M}deg)`, z.style.backgroundSize = "cover", s == null || s.setPosition(p);
244
244
  };
245
245
  return {
246
246
  location: l,
247
247
  remove: () => {
248
- const g = s == null ? void 0 : s.getElement();
249
- g && (g.innerHTML = "");
248
+ const f = s == null ? void 0 : s.getElement();
249
+ f && (f.innerHTML = "");
250
250
  },
251
- renderTrack: (g, p, T) => {
252
- n.render(g, p, T, "truck", 1e3);
251
+ renderTrack: (f, p, T) => {
252
+ n.render(f, p, T, "truck", 1e3);
253
253
  },
254
- setCenter: (g) => {
255
- n.setCenter(g);
254
+ setCenter: (f) => {
255
+ n.setCenter(f);
256
256
  },
257
257
  closeTrack: () => {
258
258
  n.close();
259
259
  },
260
- playTrack: (g, p) => {
261
- n.play(g, p);
260
+ playTrack: (f, p) => {
261
+ n.play(f, p);
262
262
  }
263
263
  };
264
264
  };
@@ -268,12 +268,12 @@ const ao = (e) => {
268
268
  let l = null;
269
269
  const i = "--";
270
270
  let o = null;
271
- const f = document.createElement("div"), w = new de({
272
- element: f,
271
+ const g = document.createElement("div"), w = new de({
272
+ element: g,
273
273
  positioning: "top-left",
274
274
  className: "track-label-popup"
275
275
  });
276
- let t, r, g, p, T, z = !1, M = Date.now(), x, y = 0, b = null, E = 20;
276
+ let t, r, f, p, T, z = !1, M = Date.now(), x, y = 0, b = null, E = 20;
277
277
  const L = 8, D = [], W = (c) => {
278
278
  var d;
279
279
  for (D.unshift(c); D.length > L; ) {
@@ -353,7 +353,7 @@ const ao = (e) => {
353
353
  if (console.log("trackId-data", k), c && k && d === "hover") {
354
354
  e.getTargetElement().style.cursor = k ? "pointer" : "";
355
355
  const P = G(k), S = h == null ? void 0 : h.coordinate;
356
- S && (f.querySelector(".popup-content"), f.innerHTML = P, w == null || w.setPosition(S));
356
+ S && (g.querySelector(".popup-content"), g.innerHTML = P, w == null || w.setPosition(S));
357
357
  } else
358
358
  w && w.setPosition(void 0);
359
359
  } catch (k) {
@@ -665,7 +665,7 @@ const ao = (e) => {
665
665
  U.setStyle(Ge), U.drawGeometry(p), e == null || e.render();
666
666
  }, Et = () => {
667
667
  var c;
668
- z = !0, M = Date.now(), y = 0, p = ((c = g.getGeometry()) == null ? void 0 : c.clone()) || new ce([0, 0]), o && (x == null || x.on("postrender", o)), T == null || T.setGeometry(void 0);
668
+ z = !0, M = Date.now(), y = 0, p = ((c = f.getGeometry()) == null ? void 0 : c.clone()) || new ce([0, 0]), o && (x == null || x.on("postrender", o)), T == null || T.setGeometry(void 0);
669
669
  }, Fe = () => {
670
670
  z && (z = !1, T == null || T.setGeometry(void 0), o && x && x.un("postrender", o), x && (e == null || e.removeLayer(x)), x = null, T = null);
671
671
  }, Tt = (c, d) => {
@@ -676,11 +676,11 @@ const ao = (e) => {
676
676
  }).readGeometry(t, {
677
677
  dataProjection: _.data,
678
678
  featureProjection: _.mercator
679
- }), g = new ae({
679
+ }), f = new ae({
680
680
  type: "icon",
681
681
  geometry: new ce(r.getFirstCoordinate())
682
682
  });
683
- const h = g.getGeometry();
683
+ const h = f.getGeometry();
684
684
  p = h ? h.clone() : new ce([0, 0]), T = new ae({
685
685
  type: "geoMarker",
686
686
  style: Ge,
@@ -760,7 +760,7 @@ function uo(e) {
760
760
  position: "relative",
761
761
  "pointer-events": "none"
762
762
  })), l = $e(() => {
763
- var f;
763
+ var g;
764
764
  return {
765
765
  position: "relative",
766
766
  "border-radius": "1px",
@@ -777,7 +777,7 @@ function uo(e) {
777
777
  "z-index": "1",
778
778
  display: "flex",
779
779
  "align-items": "center",
780
- animation: e.selected ? e.colors && ((f = e.colors) == null ? void 0 : f.length) >= 2 ? "blink-dual 2s ease-in-out infinite" : "blink-single 1.5s ease-in-out infinite" : "none"
780
+ animation: e.selected ? e.colors && ((g = e.colors) == null ? void 0 : g.length) >= 2 ? "blink-dual 2s ease-in-out infinite" : "blink-single 1.5s ease-in-out infinite" : "none"
781
781
  // "animation": props.selected ? 'blink 1.5s ease-in-out infinite' : 'none', // 动画开关
782
782
  };
783
783
  }), i = $e(() => ({
@@ -875,12 +875,12 @@ const go = (e) => {
875
875
  return n <= re.shipModelMax && n >= re.shipTriggleMin ? "ship" : "triangle";
876
876
  }, Ie = (e, n, s) => {
877
877
  if (s === "ship") {
878
- const { len: l, wid: i } = n, o = 97, f = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()), r = l * t / o, g = i * t / f, p = Math.min(r, g);
878
+ const { len: l, wid: i } = n, o = 97, g = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()), r = l * t / o, f = i * t / g, p = Math.min(r, f);
879
879
  return p < 0.2 ? 0.2 : p > 2 ? 2 : p;
880
880
  }
881
881
  return re.scaleNum;
882
882
  }, fo = (e, n, s) => {
883
- const { color: l, direct: i, isHighlight: o, shipData: f } = e.getProperties(), w = ((f == null ? void 0 : f.cog) - 90 + 360) % 360;
883
+ const { color: l, direct: i, isHighlight: o, shipData: g } = e.getProperties(), w = ((g == null ? void 0 : g.cog) - 90 + 360) % 360;
884
884
  return new Q({
885
885
  image: new Ce({
886
886
  src: t(),
@@ -921,7 +921,7 @@ const go = (e) => {
921
921
  }
922
922
  }
923
923
  }, ho = (e, n) => {
924
- const s = vt(e, n), l = n.id, { lon: i, lat: o } = n, f = new de({
924
+ const s = vt(e, n), l = n.id, { lon: i, lat: o } = n, g = new de({
925
925
  element: s,
926
926
  position: ee([i, o]),
927
927
  id: "selected-" + l,
@@ -929,15 +929,15 @@ const go = (e) => {
929
929
  offset: [0, 5],
930
930
  className: "ship-selected-overlay"
931
931
  });
932
- return f.set("class", "ship-overlay-selected"), f;
932
+ return g.set("class", "ship-overlay-selected"), g;
933
933
  }, vt = (e, n) => {
934
934
  const s = ht(e), l = Ie(e, n, s), i = s === "ship" ? 109 : 49, o = `
935
935
  <svg style="transform:scale(${l});" xmlns="http://www.w3.org/2000/svg" width="${i}" height="${i}" viewBox="0 0 49 49" fill="none">
936
936
  <path d="M1.99982 46.9998L1.99982 1.99982L46.9998 1.99982L46.9998 46.9998L1.99982 46.9998Z" fill="#FF2424" fill-opacity="0.2"/>
937
937
  <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"/>
938
938
  </svg>
939
- `, f = document.createElement("div");
940
- return f.className = "ship-overlay-selected", f.innerHTML = o, f;
939
+ `, g = document.createElement("div");
940
+ return g.className = "ship-overlay-selected", g.innerHTML = o, g;
941
941
  };
942
942
  function vo(e, n, s, l) {
943
943
  if (n) {
@@ -959,12 +959,12 @@ const yo = (e, n) => {
959
959
  }, yt = (e) => {
960
960
  const n = document.createElement("div");
961
961
  n.className = "ship-overlay-box", n.style.position = "relative";
962
- const { lon: s, lat: l, blinking: i, blinkingColors: o, name: f } = e, w = He({
962
+ const { lon: s, lat: l, blinking: i, blinkingColors: o, name: g } = e, w = He({
963
963
  setup() {
964
964
  return uo({
965
965
  position: [s + 2e-3, l + 2e-3],
966
966
  selected: i,
967
- name: f,
967
+ name: g,
968
968
  colors: o || [],
969
969
  existDevice: e == null ? void 0 : e.existDevice,
970
970
  existMobile: e == null ? void 0 : e.existMobile,
@@ -1004,14 +1004,14 @@ function xo(e, n, s = "left-bottom", l = 2) {
1004
1004
  Be = pe.getContext("2d");
1005
1005
  }
1006
1006
  }
1007
- const o = pe, f = Be;
1008
- if (!f) return "";
1007
+ const o = pe, g = Be;
1008
+ if (!g) return "";
1009
1009
  o.width = 0, o.height = 0;
1010
- const w = 2, t = 8, r = 16, g = window.devicePixelRatio || 1, p = "500 12px Arial", T = "14px map-iconfont";
1011
- f.font = p;
1012
- const M = f.measureText(e).width;
1013
- f.font = T;
1014
- const x = n.map((m) => ({ width: f.measureText(he(m)).width, height: 14 })), y = x.reduce((m, V) => m + V.width, 0), b = (n.length - 1) * l, E = t + M + y + b + t, L = w + 14 + w;
1010
+ const w = 2, t = 8, r = 16, f = window.devicePixelRatio || 1, p = "500 12px Arial", T = "14px map-iconfont";
1011
+ g.font = p;
1012
+ const M = g.measureText(e).width;
1013
+ g.font = T;
1014
+ const x = n.map((m) => ({ width: g.measureText(he(m)).width, height: 14 })), y = x.reduce((m, V) => m + V.width, 0), b = (n.length - 1) * l, E = t + M + y + b + t, L = w + 14 + w;
1015
1015
  let D, W, A = 0, H = 0, j = 0, F = 0, C = 0, $ = 0;
1016
1016
  switch (D = r + E, s) {
1017
1017
  case "right-top":
@@ -1033,19 +1033,19 @@ function xo(e, n, s = "left-bottom", l = 2) {
1033
1033
  W = r + L, A = E, H = L, j = E + r, F = 0, C = 0, $ = r;
1034
1034
  break;
1035
1035
  }
1036
- W = W + w, o.width = Math.round(D * g), o.height = Math.round(W * g), f.scale(g, g), f.clearRect(0, 0, D, W), f.beginPath(), f.moveTo(A, H), f.lineTo(j, F), f.strokeStyle = "#FFF", f.lineWidth = 1, f.stroke(), f.fillStyle = "#FFF", f.fillRect(C, $, E, L), f.font = p, f.textBaseline = "middle";
1036
+ W = W + w, o.width = Math.round(D * f), o.height = Math.round(W * f), g.scale(f, f), g.clearRect(0, 0, D, W), g.beginPath(), g.moveTo(A, H), g.lineTo(j, F), g.strokeStyle = "#FFF", g.lineWidth = 1, g.stroke(), g.fillStyle = "#FFF", g.fillRect(C, $, E, L), g.font = p, g.textBaseline = "middle";
1037
1037
  const a = $ + w + L / 2;
1038
- f.strokeStyle = "#ffffff", f.lineWidth = 1, f.strokeText(e, C + t, a), f.fillStyle = "#000000", f.fillText(e, C + t, a), f.font = T, f.fillStyle = "#3370ff";
1038
+ g.strokeStyle = "#ffffff", g.lineWidth = 1, g.strokeText(e, C + t, a), g.fillStyle = "#000000", g.fillText(e, C + t, a), g.font = T, g.fillStyle = "#3370ff";
1039
1039
  let v = C + t + M + l;
1040
1040
  n.length > 0 && n.forEach((m, V) => {
1041
1041
  const G = $ + w + L / 2;
1042
- f.fillText(he(m), v, G), v += x[V].width + l;
1042
+ g.fillText(he(m), v, G), v += x[V].width + l;
1043
1043
  });
1044
1044
  const u = o.toDataURL("image/png");
1045
1045
  return Ye.set(i, u), u;
1046
1046
  }
1047
1047
  const at = (e, n) => {
1048
- const { name: s, rightIcons: l, selected: i } = e.getProperties(), o = n !== 1 ? mo() : "right-top", f = xo(s, l, o);
1048
+ const { name: s, rightIcons: l, selected: i } = e.getProperties(), o = n !== 1 ? mo() : "right-top", g = xo(s, l, o);
1049
1049
  let w = [0, 0];
1050
1050
  switch (o) {
1051
1051
  case "right-top":
@@ -1069,7 +1069,7 @@ const at = (e, n) => {
1069
1069
  }
1070
1070
  return new Q({
1071
1071
  image: new Ce({
1072
- src: f,
1072
+ src: g,
1073
1073
  anchor: w,
1074
1074
  displacement: [0, 0],
1075
1075
  scale: 1 / wo,
@@ -1086,7 +1086,7 @@ const at = (e, n) => {
1086
1086
  renderBuffer: 300,
1087
1087
  zIndex: 101,
1088
1088
  hitTolerance: 10
1089
- }), o = new ge(), f = new ye({
1089
+ }), o = new ge(), g = new ye({
1090
1090
  source: o,
1091
1091
  className: "zh-map--ship-label-layer",
1092
1092
  zIndex: 102,
@@ -1098,8 +1098,8 @@ const at = (e, n) => {
1098
1098
  // 自定义分组名称
1099
1099
  }
1100
1100
  });
1101
- e == null || e.addLayer(i), e == null || e.addLayer(f);
1102
- let w = null, t = "", r = {}, g = {};
1101
+ e == null || e.addLayer(i), e == null || e.addLayer(g);
1102
+ let w = null, t = "", r = {}, f = {};
1103
1103
  const p = (a) => {
1104
1104
  if (!a || !e) return;
1105
1105
  const v = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id"));
@@ -1110,7 +1110,7 @@ const at = (e, n) => {
1110
1110
  y(), $(a), z(), D();
1111
1111
  }, T = (a) => {
1112
1112
  var R;
1113
- const v = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id")), u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), m = ((R = g[a.id]) == null ? void 0 : R.blinkColors) || [], G = m[m.length - 1] || a.fill || "#04C900", B = go(a), J = new ae({
1113
+ const v = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id")), u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), m = ((R = f[a.id]) == null ? void 0 : R.blinkColors) || [], G = m[m.length - 1] || a.fill || "#04C900", B = go(a), J = new ae({
1114
1114
  geometry: new ce(u),
1115
1115
  // 船舶数据
1116
1116
  shipData: a,
@@ -1167,7 +1167,7 @@ const at = (e, n) => {
1167
1167
  }
1168
1168
  }
1169
1169
  }, E = (a, v) => {
1170
- r = a, g = v;
1170
+ r = a, f = v;
1171
1171
  const u = e.getOverlays().getArray(), m = l.getFeatures();
1172
1172
  for (const V in r) {
1173
1173
  const G = r[V], B = u.find((R) => R.getId() === "label-" + V), J = m.find((R) => V === R.get("id"));
@@ -1278,8 +1278,8 @@ const at = (e, n) => {
1278
1278
  const m = T(u);
1279
1279
  if (m.setStyle(me(e, m)), l.addFeature(m), (s == null ? void 0 : s.id) == u.id || v >= re.shipModelMin)
1280
1280
  if (r[u.id]) {
1281
- if (u.id && g[u == null ? void 0 : u.id]) {
1282
- const V = g[u == null ? void 0 : u.id] || {}, G = (V == null ? void 0 : V.blinkColors) || [], B = (V == null ? void 0 : V.shipState) || "", J = (u.cnname || u.enname || u.name || u.id || "未命名船舶") + "(" + B + ")", R = {
1281
+ if (u.id && f[u == null ? void 0 : u.id]) {
1282
+ const V = f[u == null ? void 0 : u.id] || {}, G = (V == null ? void 0 : V.blinkColors) || [], B = (V == null ? void 0 : V.shipState) || "", J = (u.cnname || u.enname || u.name || u.id || "未命名船舶") + "(" + B + ")", R = {
1283
1283
  ...u,
1284
1284
  name: J,
1285
1285
  blinking: r[u.id],
@@ -1309,8 +1309,8 @@ const at = (e, n) => {
1309
1309
  const n = () => e == null ? void 0 : e.getLayers(), s = oe("vector"), l = () => s.value, i = (t) => {
1310
1310
  s.value = t;
1311
1311
  const r = n();
1312
- r && (r == null || r.getArray().forEach((g) => {
1313
- (g.className_ === "vector" || g.className_ === "satellite") && g.setVisible(g.className_ === t);
1312
+ r && (r == null || r.getArray().forEach((f) => {
1313
+ (f.className_ === "vector" || f.className_ === "satellite") && f.setVisible(f.className_ === t);
1314
1314
  }));
1315
1315
  }, o = oe(!1);
1316
1316
  return {
@@ -1330,8 +1330,8 @@ const at = (e, n) => {
1330
1330
  r.push(p);
1331
1331
  }
1332
1332
  } else {
1333
- const r = n(), g = r.getArray().find((p) => p.className_ === "greenTile");
1334
- g && r.remove(g);
1333
+ const r = n(), f = r.getArray().find((p) => p.className_ === "greenTile");
1334
+ f && r.remove(f);
1335
1335
  }
1336
1336
  o.value = t;
1337
1337
  }
@@ -1350,7 +1350,7 @@ const at = (e, n) => {
1350
1350
  }, Mo = (e) => {
1351
1351
  const n = "zh-map-location-layer";
1352
1352
  let s, l, i = null, o = null;
1353
- const f = (M) => {
1353
+ const g = (M) => {
1354
1354
  if (!(!M || M.length === 0)) {
1355
1355
  if (l || (l = new ge()), l.clear(), o) {
1356
1356
  const x = M.find((y) => y.id === o.id);
@@ -1395,7 +1395,7 @@ const at = (e, n) => {
1395
1395
  });
1396
1396
  } else
1397
1397
  l.clear();
1398
- }, g = () => {
1398
+ }, f = () => {
1399
1399
  var b;
1400
1400
  const M = i.get("loactionData"), x = (b = e == null ? void 0 : e.getView()) == null ? void 0 : b.getZoom();
1401
1401
  l.getFeatures().forEach((E) => {
@@ -1414,9 +1414,9 @@ const at = (e, n) => {
1414
1414
  o = M, i = x.find((y) => y.get("loactionData").id === M.id);
1415
1415
  };
1416
1416
  return {
1417
- render: f,
1417
+ render: g,
1418
1418
  selected: p,
1419
- clearSelected: g,
1419
+ clearSelected: f,
1420
1420
  clear: r
1421
1421
  };
1422
1422
  }, Co = (e) => {
@@ -1435,13 +1435,13 @@ const at = (e, n) => {
1435
1435
  l.value = F;
1436
1436
  };
1437
1437
  let o;
1438
- const f = oe(!1), w = () => {
1439
- Le(e, "crosshair"), g(), Co(e), e.on("pointermove", z), e.getViewport().addEventListener("mouseout", () => {
1438
+ const g = oe(!1), w = () => {
1439
+ Le(e, "crosshair"), f(), Co(e), e.on("pointermove", z), e.getViewport().addEventListener("mouseout", () => {
1440
1440
  o && o.classList.add("hidden");
1441
- }), x(), f.value = !0;
1441
+ }), x(), g.value = !0;
1442
1442
  };
1443
1443
  let t, r;
1444
- const g = () => {
1444
+ const f = () => {
1445
1445
  t = new ge(), r = new ye({
1446
1446
  source: t,
1447
1447
  zIndex: 1e3,
@@ -1533,7 +1533,7 @@ const at = (e, n) => {
1533
1533
  $[C] && ((u = (v = $[C]) == null ? void 0 : v.parentNode) == null || u.removeChild($[C]));
1534
1534
  const a = t.getFeatures();
1535
1535
  a[C] && t.removeFeature(a[C]);
1536
- }), H(), Lo(e), f.value = !1, Le(e, "pointer");
1536
+ }), H(), Lo(e), g.value = !1, Le(e, "pointer");
1537
1537
  }, A = (F) => {
1538
1538
  var $, a, v, u;
1539
1539
  const C = s.value.findIndex((m) => m.id === F);
@@ -1560,7 +1560,7 @@ const at = (e, n) => {
1560
1560
  close: W,
1561
1561
  deleteLine: A,
1562
1562
  setUnit: i,
1563
- getState: () => f.value
1563
+ getState: () => g.value
1564
1564
  };
1565
1565
  }, mt = (e, n) => {
1566
1566
  const l = Ke(e);
@@ -1580,8 +1580,8 @@ const at = (e, n) => {
1580
1580
  }, To = (e, n) => {
1581
1581
  let s, l, i = "close";
1582
1582
  const o = () => {
1583
- H(), i = "open", f(), Le(e, "crosshair");
1584
- }, f = () => {
1583
+ H(), i = "open", g(), Le(e, "crosshair");
1584
+ }, g = () => {
1585
1585
  r(), E(), W(), M();
1586
1586
  };
1587
1587
  let w = null, t = null;
@@ -1601,10 +1601,10 @@ const at = (e, n) => {
1601
1601
  T && ($.stopPropagation(), $.preventDefault());
1602
1602
  });
1603
1603
  };
1604
- let g;
1604
+ let f;
1605
1605
  const p = (F) => {
1606
1606
  if (F.dragging) return;
1607
- const C = g ? "单击继续,双击结束" : "点击选择起点";
1607
+ const C = f ? "单击继续,双击结束" : "点击选择起点";
1608
1608
  L && (L.innerHTML = C, D.setPosition(F.coordinate));
1609
1609
  };
1610
1610
  let T, z = !1;
@@ -1660,7 +1660,7 @@ const at = (e, n) => {
1660
1660
  })]
1661
1661
  }), e == null || e.addInteraction(T), T.on("drawstart", (F) => {
1662
1662
  var C;
1663
- g = F.feature, l = (C = g.getGeometry()) == null ? void 0 : C.on("change", ($) => {
1663
+ f = F.feature, l = (C = f.getGeometry()) == null ? void 0 : C.on("change", ($) => {
1664
1664
  const a = $.target, v = x(a, "nm"), m = a.getCoordinates()[0], V = new ze([m[m.length - 2], m[m.length - 1]]), G = mt(V, "nm");
1665
1665
  if (z = Number(Ke(V) / 1e3) > 150, !v) return;
1666
1666
  const B = '<span class="error pl-4">超出可以绘画的距离</span>';
@@ -1728,7 +1728,7 @@ const at = (e, n) => {
1728
1728
  }, A = () => {
1729
1729
  s = null, o();
1730
1730
  }, H = () => {
1731
- i = "close", e.un("pointermove", p), g = null, T && (T.abortDrawing(), console.log("abortDrawing"), T.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((C) => {
1731
+ i = "close", e.un("pointermove", p), f = null, T && (T.abortDrawing(), console.log("abortDrawing"), T.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((C) => {
1732
1732
  C instanceof Oe && (C.setActive(!1), e == null || e.removeInteraction(C));
1733
1733
  }), T = null), l && Xe(l), l = void 0, t == null || t.clear(), t = null, w && e.getAllLayers().includes(w) && (e.removeLayer(w), w = null), L != null && L.parentElement && (L.innerHTML = "", L.parentElement.removeChild(L), L = null), y != null && y.parentElement && (y.innerHTML = "", y.parentElement.removeChild(y), y = null), D && e.removeOverlay(D), b && e.removeOverlay(b), Le(e, "pointer");
1734
1734
  };
@@ -1766,12 +1766,12 @@ const at = (e, n) => {
1766
1766
  W.setStyle(A), b.push(W);
1767
1767
  }), n.addFeatures(b);
1768
1768
  };
1769
- let f = null, w = null;
1769
+ let g = null, w = null;
1770
1770
  const t = (x, y) => {
1771
- f || (f = document.createElement("canvas"), w = f.getContext("2d", {
1771
+ g || (g = document.createElement("canvas"), w = g.getContext("2d", {
1772
1772
  willReadFrequently: !0
1773
1773
  }));
1774
- const b = f, E = w;
1774
+ const b = g, E = w;
1775
1775
  if (!E) return "";
1776
1776
  b.width = 0, b.height = 0;
1777
1777
  const L = 2, D = 8, W = window.devicePixelRatio || 1, A = "12px sans-serif";
@@ -1821,7 +1821,7 @@ const at = (e, n) => {
1821
1821
  // }),
1822
1822
  });
1823
1823
  return !b && !y ? H : [H, j];
1824
- }, g = () => {
1824
+ }, f = () => {
1825
1825
  if (n)
1826
1826
  if (l) {
1827
1827
  console.log("清除非选中的港口");
@@ -1850,38 +1850,38 @@ const at = (e, n) => {
1850
1850
  };
1851
1851
  return {
1852
1852
  render: o,
1853
- clear: g,
1853
+ clear: f,
1854
1854
  selected: p,
1855
1855
  handlePortHover: (x) => {
1856
1856
  x && x.get("portData") && (e != null && e.getTargetElement()) && Le(e, "pointer");
1857
1857
  }
1858
1858
  };
1859
- }, So = (e, n, s, l, i, o, f) => {
1859
+ }, So = (e, n, s, l, i, o, g) => {
1860
1860
  const w = e.getInstall();
1861
1861
  w.on("moveend", () => {
1862
1862
  var t, r;
1863
1863
  try {
1864
- const g = e.getZoom();
1865
- (r = (t = n.getProps()).mapMoveEnd) == null || r.call(t, g), s.reRenderTrackLine(), l.changeShipScale("end");
1866
- } catch (g) {
1867
- console.log("moveend---catch", g);
1864
+ const f = e.getZoom();
1865
+ (r = (t = n.getProps()).mapMoveEnd) == null || r.call(t, f), s.reRenderTrackLine(), l.changeShipScale("end");
1866
+ } catch (f) {
1867
+ console.log("moveend---catch", f);
1868
1868
  }
1869
1869
  }), w.on("pointermove", (t) => {
1870
1870
  if (t.dragging || !w) return;
1871
1871
  const r = w.forEachFeatureAtPixel(
1872
1872
  t.pixel,
1873
- function(g) {
1874
- return g;
1873
+ function(f) {
1874
+ return f;
1875
1875
  },
1876
1876
  {
1877
- hitTolerance: 3,
1877
+ hitTolerance: 3
1878
1878
  // 3像素的容差范围
1879
- layerFilter: function(g) {
1880
- return g.get("interactive") === !0;
1881
- }
1879
+ // layerFilter: function (layer) {
1880
+ // return layer.get('interactive') === true; // 只检查可交互的图层
1881
+ // }
1882
1882
  }
1883
1883
  );
1884
- s == null || s.handleTrackMapEvent(r, "hover", t), l == null || l.handleShipMapEvent(r, "hover"), r && (i == null || i.handlePortHover(r));
1884
+ console.log("feature", r), s == null || s.handleTrackMapEvent(r, "hover", t), l == null || l.handleShipMapEvent(r, "hover"), r && (i == null || i.handlePortHover(r));
1885
1885
  }), w.on("movestart", () => {
1886
1886
  try {
1887
1887
  const t = w == null ? void 0 : w.getView().getZoom();
@@ -1890,8 +1890,8 @@ const at = (e, n) => {
1890
1890
  console.log("movestart---catch", t);
1891
1891
  }
1892
1892
  }), w.on("click", Re((t) => {
1893
- var r, g, p;
1894
- if (f.getState() !== "open")
1893
+ var r, f, p;
1894
+ if (g.getState() !== "open")
1895
1895
  try {
1896
1896
  if (console.log("1", o.getState()), o.getState()) return;
1897
1897
  const T = w.getEventPixel(t.originalEvent), z = w.forEachFeatureAtPixel(
@@ -1905,7 +1905,7 @@ const at = (e, n) => {
1905
1905
  l.handleShipMapEvent(z, "click", (r = n.getProps()) == null ? void 0 : r.selectShip);
1906
1906
  else if (z != null && z.get("portData")) {
1907
1907
  const M = z.get("portData");
1908
- i.selected(M), (p = (g = n.getProps()) == null ? void 0 : g.selectPort) == null || p.call(g, M);
1908
+ i.selected(M), (p = (f = n.getProps()) == null ? void 0 : f.selectPort) == null || p.call(f, M);
1909
1909
  }
1910
1910
  t.preventDefault(), t.stopPropagation();
1911
1911
  } catch (T) {
@@ -1921,12 +1921,12 @@ const at = (e, n) => {
1921
1921
  createInstance: (l, i) => {
1922
1922
  const o = ro();
1923
1923
  o.initMap(l, i);
1924
- const f = o.getInstall(), w = ko(f), t = po();
1924
+ const g = o.getInstall(), w = ko(g), t = po();
1925
1925
  t.setProps(i), w.setShowLayerType(i.layerType), w.setGreenTileVisible(i.showGreenLayer);
1926
- const r = ao(f), g = co(f, r), p = bo(f), T = Mo(f), z = Eo(f, t), M = To(f, t), x = Po(f);
1926
+ const r = ao(g), f = co(g, r), p = bo(g), T = Mo(g), z = Eo(g, t), M = To(g, t), x = Po(g);
1927
1927
  So(o, t, r, p, x, z, M);
1928
1928
  const y = () => {
1929
- const E = f.getView().calculateExtent(o.getSize()), L = Me([E[0], E[1]], _.mercator, _.data), D = Me([E[2], E[3]], _.mercator, _.data);
1929
+ const E = g.getView().calculateExtent(o.getSize()), L = Me([E[0], E[1]], _.mercator, _.data), D = Me([E[2], E[3]], _.mercator, _.data);
1930
1930
  return [L[0], L[1], D[0], D[1]];
1931
1931
  }, b = {
1932
1932
  id: Symbol("map-instance"),
@@ -1940,7 +1940,7 @@ const at = (e, n) => {
1940
1940
  layer: w,
1941
1941
  ship: p,
1942
1942
  track: r,
1943
- carTrack: g,
1943
+ carTrack: f,
1944
1944
  port: {
1945
1945
  render: x.render,
1946
1946
  clear: x.clear,
@@ -1988,13 +1988,13 @@ const at = (e, n) => {
1988
1988
  } }
1989
1989
  },
1990
1990
  setup(e, { expose: n }) {
1991
- const s = oe(), l = oe(), i = No(), o = oe(), f = e, w = oe({
1991
+ const s = oe(), l = oe(), i = No(), o = oe(), g = e, w = oe({
1992
1992
  getInstall() {
1993
1993
  }
1994
1994
  });
1995
1995
  return zt(() => {
1996
1996
  var t;
1997
- o.value = i.createInstance(s.value, f), w.value = o.value.methods, (t = l.value) == null || t.setScaleLine(o.value.map, f.scaleLineUnit);
1997
+ o.value = i.createInstance(s.value, g), w.value = o.value.methods, (t = l.value) == null || t.setScaleLine(o.value.map, g.scaleLineUnit);
1998
1998
  }), Ot(() => {
1999
1999
  var t, r;
2000
2000
  i.destroyInstance((t = o == null ? void 0 : o.value) == null ? void 0 : t.id), (r = o.value) == null || r.destroy();
@@ -2016,16 +2016,16 @@ const at = (e, n) => {
2016
2016
  return (t = o.value) == null ? void 0 : t.methods.getView();
2017
2017
  },
2018
2018
  setCenter: (t, r) => {
2019
- var g;
2020
- return (g = o.value) == null ? void 0 : g.methods.setCenter(t, r);
2019
+ var f;
2020
+ return (f = o.value) == null ? void 0 : f.methods.setCenter(t, r);
2021
2021
  },
2022
2022
  getSize: () => {
2023
2023
  var t;
2024
2024
  return (t = o.value) == null ? void 0 : t.methods.getSize();
2025
2025
  },
2026
2026
  getCenter: (t, r) => {
2027
- var g;
2028
- return (g = o.value) == null ? void 0 : g.methods.getCenter();
2027
+ var f;
2028
+ return (f = o.value) == null ? void 0 : f.methods.getCenter();
2029
2029
  },
2030
2030
  layer: {
2031
2031
  setGreenTileVisible: (t) => {
@@ -2121,8 +2121,8 @@ const at = (e, n) => {
2121
2121
  },
2122
2122
  port: {
2123
2123
  render: (t, r) => {
2124
- var g;
2125
- return (g = o.value) == null ? void 0 : g.methods.port.render(t, r);
2124
+ var f;
2125
+ return (f = o.value) == null ? void 0 : f.methods.port.render(t, r);
2126
2126
  },
2127
2127
  clear: () => {
2128
2128
  var t;
@@ -2198,8 +2198,8 @@ const at = (e, n) => {
2198
2198
  return (r = o.value) == null ? void 0 : r.methods.utils.convertSixHundredThousandToLatLng(...t);
2199
2199
  },
2200
2200
  calculateCirclePoints: (t, r) => {
2201
- var g;
2202
- return (g = o.value) == null ? void 0 : g.methods.utils.calculateCirclePoints(t, r);
2201
+ var f;
2202
+ return (f = o.value) == null ? void 0 : f.methods.utils.calculateCirclePoints(t, r);
2203
2203
  }
2204
2204
  }
2205
2205
  }), (t, r) => (Qe(), Je("div", $o, [
package/dist/es/index.js CHANGED
@@ -17,7 +17,7 @@ import { Z as B } from "./BaseInfo-BhnEjLKF.js";
17
17
  import { Z as g } from "./DetailHeader-DaabNj_4.js";
18
18
  import { Z as x } from "./DiyDataTable-D-UZVciZ.js";
19
19
  import { D as V } from "./DiyDataTable-D-UZVciZ.js";
20
- import { Z as G } from "./Map-myp8PNlU.js";
20
+ import { Z as G } from "./Map-BtQEJVq-.js";
21
21
  import { Z as M } from "./Table-B_3YA1mb.js";
22
22
  import { Z as $ } from "./BaseItem-C4NJy1i4.js";
23
23
  const A = [
@@ -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
- `,C=()=>`data:image/svg+xml;utf8,${encodeURIComponent(w(y?"#FF5733":"#3370FF"))}`,b=t.getView().getZoom(),E=m.get("portData"),S=window.devicePixelRatio||1,v=new Ct({image:new ao({src:C(),scale:.5*b/10}),zIndex:y?110:100}),k=new Ct({image:new ao({src:c(E.shortName,y),anchor:[.5,.5],displacement:[0,-26],scale:1/S,anchorXUnits:"fraction",anchorYUnits:"fraction"}),zIndex:y?110:100});return!_&&!y?v:[v,k]},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,a)=>{const l=t.getInstall();l.on("moveend",()=>{var c,d;try{const u=t.getZoom();(d=(c=e.getProps()).mapMoveEnd)==null||d.call(c,u),n.reRenderTrackLine(),r.changeShipScale("end")}catch(u){console.log("moveend---catch",u)}}),l.on("pointermove",c=>{if(c.dragging||!l)return;const d=l.forEachFeatureAtPixel(c.pixel,function(u){return u},{hitTolerance:3,layerFilter:function(u){return u.get("interactive")===!0}});n==null||n.handleTrackMapEvent(d,"hover",c),r==null||r.handleShipMapEvent(d,"hover"),d&&(o==null||o.handlePortHover(d))}),l.on("movestart",()=>{try{const c=l==null?void 0:l.getView().getZoom();c&&c<=Mr.shipModelMax&&c>=Mr.shipTriggleMin&&r.changeShipScale("start"),r.hiddenShipBlink()}catch(c){console.log("movestart---catch",c)}}),l.on("click",Nr(c=>{var d,u,f;if(a.getState()!=="open")try{if(console.log("1",s.getState()),s.getState())return;const p=l.getEventPixel(c.originalEvent),g=l.forEachFeatureAtPixel(p,h=>{if(h!=null&&h.get("shipData")||h!=null&&h.get("portData"))return h});if(g!=null&&g.get("shipData"))r.handleShipMapEvent(g,"click",(d=e.getProps())==null?void 0:d.selectShip);else if(g!=null&&g.get("portData")){const h=g.get("portData");o.selected(h),(f=(u=e.getProps())==null?void 0:u.selectPort)==null||f.call(u,h)}c.preventDefault(),c.stopPropagation()}catch(p){console.log("click---catch",p)}},150)),l.getView().on("change:resolution",Nr(()=>{const c=l==null?void 0:l.getView().getZoom();c&&c<=Mr.shipModelMax&&c>=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,h);const y=()=>{const w=a.getView().calculateExtent(s.getSize()),C=Qi([w[0],w[1]],Yn.mercator,Yn.data),b=Qi([w[2],w[3]],Yn.mercator,Yn.data);return[C[0],C[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
+ `,C=()=>`data:image/svg+xml;utf8,${encodeURIComponent(w(y?"#FF5733":"#3370FF"))}`,b=t.getView().getZoom(),E=m.get("portData"),S=window.devicePixelRatio||1,v=new Ct({image:new ao({src:C(),scale:.5*b/10}),zIndex:y?110:100}),k=new Ct({image:new ao({src:c(E.shortName,y),anchor:[.5,.5],displacement:[0,-26],scale:1/S,anchorXUnits:"fraction",anchorYUnits:"fraction"}),zIndex:y?110:100});return!_&&!y?v:[v,k]},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,a)=>{const l=t.getInstall();l.on("moveend",()=>{var c,d;try{const u=t.getZoom();(d=(c=e.getProps()).mapMoveEnd)==null||d.call(c,u),n.reRenderTrackLine(),r.changeShipScale("end")}catch(u){console.log("moveend---catch",u)}}),l.on("pointermove",c=>{if(c.dragging||!l)return;const d=l.forEachFeatureAtPixel(c.pixel,function(u){return u},{hitTolerance:3});console.log("feature",d),n==null||n.handleTrackMapEvent(d,"hover",c),r==null||r.handleShipMapEvent(d,"hover"),d&&(o==null||o.handlePortHover(d))}),l.on("movestart",()=>{try{const c=l==null?void 0:l.getView().getZoom();c&&c<=Mr.shipModelMax&&c>=Mr.shipTriggleMin&&r.changeShipScale("start"),r.hiddenShipBlink()}catch(c){console.log("movestart---catch",c)}}),l.on("click",Nr(c=>{var d,u,f;if(a.getState()!=="open")try{if(console.log("1",s.getState()),s.getState())return;const p=l.getEventPixel(c.originalEvent),g=l.forEachFeatureAtPixel(p,h=>{if(h!=null&&h.get("shipData")||h!=null&&h.get("portData"))return h});if(g!=null&&g.get("shipData"))r.handleShipMapEvent(g,"click",(d=e.getProps())==null?void 0:d.selectShip);else if(g!=null&&g.get("portData")){const h=g.get("portData");o.selected(h),(f=(u=e.getProps())==null?void 0:u.selectPort)==null||f.call(u,h)}c.preventDefault(),c.stopPropagation()}catch(p){console.log("click---catch",p)}},150)),l.getView().on("change:resolution",Nr(()=>{const c=l==null?void 0:l.getView().getZoom();c&&c<=Mr.shipModelMax&&c>=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,h);const y=()=>{const w=a.getView().calculateExtent(s.getSize()),C=Qi([w[0],w[1]],Yn.mercator,Yn.data),b=Qi([w[2],w[3]],Yn.mercator,Yn.data);return[C[0],C[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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zhihao-ui",
3
- "version": "1.3.42-alpha.6",
3
+ "version": "1.3.42-alpha.7",
4
4
  "description": "components",
5
5
  "type": "module",
6
6
  "main": "./dist/umd/index.umd.cjs",