zhihao-ui 1.2.15 → 1.2.17

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.
Files changed (39) hide show
  1. package/dist/es/{BaseInfo-uUbvvsrZ.js → BaseInfo-Dr298ctb.js} +1 -1
  2. package/dist/es/{Button-8WUVSVx0.js → Button-OpzeoolK.js} +2 -2
  3. package/dist/es/{DatePicker-BumwuulN.js → DatePicker-vGQGWrmB.js} +2 -2
  4. package/dist/es/{DetailHeader-CMSTYZ3n.js → DetailHeader-Dy_GLl1j.js} +3 -3
  5. package/dist/es/{DetailSubTitle-Ck4-kTS6.js → DetailSubTitle-Cgs5HrKC.js} +2 -2
  6. package/dist/es/{Dialog-mXMk_A1l.js → Dialog-DsjDYguS.js} +3 -3
  7. package/dist/es/{DiyDataTable-B_mIRxiG.js → DiyDataTable-BzYgTozd.js} +126 -112
  8. package/dist/es/{EditInfoPair-re7I2_Hd.js → EditInfoPair-D5IdY32c.js} +3 -3
  9. package/dist/es/{FileWrapper-Bd67K2uz.js → FileWrapper-BWTQDfI0.js} +4 -4
  10. package/dist/es/{Grid-CeGoopKP.js → Grid-CIMCXeIw.js} +1 -1
  11. package/dist/es/{InfoPair-Zi5AQw4v.js → InfoPair-BCfbK9Vi.js} +3 -3
  12. package/dist/es/{Input-BpSs19mA.js → Input-Stgzni-P.js} +3 -3
  13. package/dist/es/{Loading-Vg9jMM-v.js → Loading-CV65SoyW.js} +2 -2
  14. package/dist/es/{Map-lPiX2Ato.js → Map-f7AQFEm9.js} +395 -388
  15. package/dist/es/{MessageBox-BU-x0a_N.js → MessageBox-7G0T_aYK.js} +2 -2
  16. package/dist/es/{MoneyInput-BpkcRnUd.js → MoneyInput-CILa4-8Q.js} +5 -5
  17. package/dist/es/{PageHeadPanel-BCJ2dIzS.js → PageHeadPanel-CAVlNQj7.js} +2 -2
  18. package/dist/es/Table-B786GVKD.js +1132 -0
  19. package/dist/es/{ToolTips-D1gBKbDi.js → ToolTips-B1YUKWTm.js} +3 -3
  20. package/dist/es/index.js +21 -21
  21. package/dist/es/{utils-DQpHM4si.js → utils-CbI5IWJJ.js} +1 -1
  22. package/dist/es/{vendor-HCJEPiOI.js → vendor-AIl6iHcE.js} +12 -11
  23. package/dist/index.css +1 -1
  24. package/dist/types/components/DiyDataTable/DiyDataTable.vue.d.ts +12 -0
  25. package/dist/types/components/DiyDataTable/index.d.ts +21 -0
  26. package/dist/types/components/DiyDataTable/type.d.ts +2 -0
  27. package/dist/types/components/Map/Map.vue.d.ts +22 -4
  28. package/dist/types/components/Map/components/measure.vue.d.ts +8 -0
  29. package/dist/types/components/Map/index.d.ts +44 -7
  30. package/dist/types/components/Map/render/canvasRender/renderShipStyle.d.ts +1 -0
  31. package/dist/types/components/Map/render/canvasRender/renderTrackStyle.d.ts +1 -0
  32. package/dist/types/components/Map/render/drawPolygon.d.ts +2 -5
  33. package/dist/types/components/Map/render/renderShip.d.ts +1 -0
  34. package/dist/types/components/Map/utils/common.d.ts +13 -6
  35. package/dist/types/components/Map/utils/store.d.ts +3 -2
  36. package/dist/umd/index.css +1 -1
  37. package/dist/umd/index.umd.cjs +19 -19
  38. package/package.json +1 -1
  39. package/dist/es/Table-r8e67LNt.js +0 -1133
@@ -1,10 +1,10 @@
1
- var A = Object.defineProperty;
2
- var B = (e, t, o) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var k = (e, t, o) => B(e, typeof t != "symbol" ? t + "" : t, o);
4
- import { ref, defineComponent, useModel, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, Fragment, renderList, unref, createBlock, toDisplayString, createCommentVNode, mergeModels, nextTick, normalizeClass, renderSlot, onMounted } from "vue";
5
- import { n as getArea, o as getLength, V as VectorSource, p as VectorLayer, S as Style, C as CircleStyle, F as Fill, q as Stroke, D as Draw, O as Overlay, u as unByKey, r as ElOption, T as Text, h as hooks, L as LineString, s as Feature, P as Point, t as fromLonLat, e as cloneDeep, G as GeoJSON, W as WebGLPointsLayer, v as transform, w as ScaleLine$1, I as Icon, x as Translate, y as toLonLat, M as MultiPoint, z as getCenter, A as TileLayer, X as XYZ, B as Map$1, H as View } from "./vendor-HCJEPiOI.js";
6
- import { _ as _export_sfc } from "./Button-8WUVSVx0.js";
7
- import { w as withInstall } from "./utils-DQpHM4si.js";
1
+ var B = Object.defineProperty;
2
+ var A = (e, t, o) => t in e ? B(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var L = (e, t, o) => A(e, typeof t != "symbol" ? t + "" : t, o);
4
+ import { ref, defineComponent, useModel, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, Fragment, renderList, unref, createBlock, toDisplayString, createCommentVNode, mergeModels, nextTick, onMounted, normalizeClass, renderSlot } from "vue";
5
+ import { n as getArea, o as getLength, V as VectorSource, p as VectorLayer, S as Style, C as CircleStyle, F as Fill, q as Stroke, D as Draw, O as Overlay, u as unByKey, r as ElOption, T as Text, h as hooks, L as LineString, s as Feature, P as Point, t as fromLonLat, e as cloneDeep, G as GeoJSON, W as WebGLPointsLayer, v as transform, w as ScaleLine$1, I as Icon, x as Translate, y as toLonLat, M as MultiPoint, z as getCenter, A as TileLayer, X as XYZ, B as Map$1, H as View } from "./vendor-AIl6iHcE.js";
6
+ import { _ as _export_sfc } from "./Button-OpzeoolK.js";
7
+ import { w as withInstall } from "./utils-CbI5IWJJ.js";
8
8
  var BaseMapType = /* @__PURE__ */ ((e) => (e[e.vector = 0] = "vector", e[e.satellite = 1] = "satellite", e))(BaseMapType || {}), CAR_COLOR = /* @__PURE__ */ ((e) => (e[e.BLUE = 1] = "BLUE", e[e.YELLOW = 2] = "YELLOW", e[e.Y_GREEN = 3] = "Y_GREEN", e))(CAR_COLOR || {}), DEVICE_TYPE = /* @__PURE__ */ ((e) => (e[e.HOST = 1] = "HOST", e[e.TALK = 2] = "TALK", e[e.STORAGE = 3] = "STORAGE", e[e.INTERNET = 4] = "INTERNET", e[e.CAMERA = 5] = "CAMERA", e[e.LOAD = 6] = "LOAD", e))(DEVICE_TYPE || {}), LENGTH_UNIT = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(LENGTH_UNIT || {});
9
9
  const LENGTH_UNIT_LABEL = {
10
10
  1: "M",
@@ -16,47 +16,47 @@ const LENGTH_UNIT_LABEL = {
16
16
  };
17
17
  var SWITCH_BTN = /* @__PURE__ */ ((e) => (e.Camera = "camera", e.Mobile = "mobile", e.WaterGauge = "waterGauge", e))(SWITCH_BTN || {});
18
18
  class ShipMapData {
19
- constructor(t, o, n, a, r, l, i, s, u, c, m, d, f, g, p, T, L, E, b, h, y, v) {
20
- k(this, "id");
19
+ constructor(t, o, n, a, r, l, i, s, u, c, m, d, f, w, v, h, T, E, C, p, S, g) {
20
+ L(this, "id");
21
21
  // mmsi
22
- k(this, "mmsi");
22
+ L(this, "mmsi");
23
23
  // 船舶三角形填充色
24
- k(this, "fill");
24
+ L(this, "fill");
25
25
  // 船类型 "7": "货船",
26
- k(this, "shipType");
26
+ L(this, "shipType");
27
27
  // 船名
28
- k(this, "name");
28
+ L(this, "name");
29
29
  // 长度
30
- k(this, "length");
30
+ L(this, "length");
31
31
  // 宽度
32
- k(this, "breadth");
32
+ L(this, "breadth");
33
33
  // 经度
34
- k(this, "lon");
34
+ L(this, "lon");
35
35
  // 纬度
36
- k(this, "lat");
36
+ L(this, "lat");
37
37
  // 时间
38
- k(this, "createdAt");
38
+ L(this, "createdAt");
39
39
  // 速度
40
- k(this, "speed");
40
+ L(this, "speed");
41
41
  // 来源
42
- k(this, "from");
42
+ L(this, "from");
43
43
  // 船状态 "stop":"静止","sail":"航行","work":"作业","danger":"危险","other":"其他"
44
- k(this, "sailStatus");
44
+ L(this, "sailStatus");
45
45
  // 船艏向
46
- k(this, "hdg");
46
+ L(this, "hdg");
47
47
  // 航迹向
48
- k(this, "cog");
48
+ L(this, "cog");
49
49
  // 设备定位类型
50
- k(this, "posType");
51
- k(this, "type");
50
+ L(this, "posType");
51
+ L(this, "type");
52
52
  // 航向角度
53
- k(this, "angle");
53
+ L(this, "angle");
54
54
  // 左侧是否显示色块
55
- k(this, "leftIconColor");
56
- k(this, "existDevice");
57
- k(this, "existMobile");
58
- k(this, "existWaterGauge");
59
- this.id = t, this.mmsi = o, this.fill = n, this.shipType = a, this.name = r, this.length = l, this.breadth = i, this.lon = s, this.lat = u, this.createdAt = c, this.speed = m, this.from = d, this.sailStatus = f, this.hdg = g, this.cog = p, this.posType = T, this.type = L, this.angle = E, this.leftIconColor = b, this.existDevice = h, this.existMobile = y, this.existWaterGauge = v;
55
+ L(this, "leftIconColor");
56
+ L(this, "existDevice");
57
+ L(this, "existMobile");
58
+ L(this, "existWaterGauge");
59
+ this.id = t, this.mmsi = o, this.fill = n, this.shipType = a, this.name = r, this.length = l, this.breadth = i, this.lon = s, this.lat = u, this.createdAt = c, this.speed = m, this.from = d, this.sailStatus = f, this.hdg = w, this.cog = v, this.posType = h, this.type = T, this.angle = E, this.leftIconColor = C, this.existDevice = p, this.existMobile = S, this.existWaterGauge = g;
60
60
  }
61
61
  }
62
62
  const formatLength = function(e, t) {
@@ -97,7 +97,7 @@ const formatLength = function(e, t) {
97
97
  // 船舶三角形填充色
98
98
  o.fill || "#04C900",
99
99
  "70",
100
- o.cnname || o.name,
100
+ o.name || o.cnname || o.enname,
101
101
  o.len,
102
102
  o.wid,
103
103
  o.lon,
@@ -117,7 +117,7 @@ const formatLength = function(e, t) {
117
117
  o.existWaterGauge
118
118
  );
119
119
  return Array.isArray(e) ? e.map((o) => t(o)) : t(e);
120
- }, mapInstance = ref(), shipsLayer = ref(), selectShipsLayer = ref(), allShips = ref([]), largeAmountShipsLayer = ref();
120
+ }, mapInstance = ref(), shipsLayer = ref(), largeAmountShipsLayer = ref(), selectShipsLayer = ref(), allShips = ref([]), selectSingleShipData = ref();
121
121
  ref();
122
122
  const trucksLayer = ref(), shipTrackLineFeatures = ref([]), trackLineVectorSource = ref(), shipTrackVectorLayer = ref();
123
123
  ref();
@@ -125,17 +125,19 @@ ref();
125
125
  const labels = ref([]), _hoisted_1$4 = {
126
126
  key: 0,
127
127
  class: "measure-panel"
128
- }, _hoisted_2$2 = { class: "d-flex justify-content-between align-content-start w-100" }, _hoisted_3$2 = { class: "measure-history-list" }, _hoisted_4$1 = { class: "left-panel" }, _hoisted_5 = { class: "text index" }, _hoisted_6 = { class: "text" }, _hoisted_7 = ["onClick"], _sfc_main$6 = /* @__PURE__ */ defineComponent({
128
+ }, _hoisted_2$2 = { class: "d-flex justify-content-between align-content-start w-100" }, _hoisted_3$2 = { class: "measure-history-list" }, _hoisted_4 = { class: "left-panel" }, _hoisted_5 = { class: "text index" }, _hoisted_6 = { class: "text" }, _hoisted_7 = ["onClick"], _sfc_main$5 = /* @__PURE__ */ defineComponent({
129
129
  __name: "measure",
130
- props: {
130
+ props: /* @__PURE__ */ mergeModels({
131
+ viewMode: {}
132
+ }, {
131
133
  visible: { type: Boolean },
132
134
  visibleModifiers: {}
133
- },
135
+ }),
134
136
  emits: /* @__PURE__ */ mergeModels(["close"], ["update:visible"]),
135
137
  setup(e, { expose: t, emit: o }) {
136
- const n = o, a = useModel(e, "visible"), r = ref(LENGTH_UNIT.NM), l = ref([]), i = ref(!1), s = new VectorSource();
138
+ const n = o, a = useModel(e, "visible"), r = ref(String(LENGTH_UNIT.NM)), l = ref([]), i = ref(!1), s = new VectorSource();
137
139
  let u, c, m, d, f;
138
- const g = new VectorLayer({
140
+ const w = new VectorLayer({
139
141
  source: s,
140
142
  style: {
141
143
  "fill-color": "rgba(255, 255, 255, 0.2)",
@@ -144,18 +146,18 @@ const labels = ref([]), _hoisted_1$4 = {
144
146
  "circle-radius": 7,
145
147
  "circle-fill-color": "#ffcc33"
146
148
  }
147
- }), p = function(w) {
148
- if (w.dragging)
149
+ }), v = function(y) {
150
+ if (y.dragging)
149
151
  return;
150
- let S = "点击选择起点";
151
- u && (S = "单击继续,双击结束"), c && (c.innerHTML = S, m.setPosition(w.coordinate), c.classList.remove("hidden"));
152
- }, T = () => {
153
- mapInstance.value && (mapInstance.value.on("pointermove", p), mapInstance.value.getViewport().addEventListener("mouseout", function() {
154
- var w;
155
- (w = c == null ? void 0 : c.classList) == null || w.add("hidden");
152
+ let k = "点击选择起点";
153
+ u && (k = "单击继续,双击结束"), c && (c.innerHTML = k, m.setPosition(y.coordinate), c.classList.remove("hidden"));
154
+ }, h = () => {
155
+ mapInstance.value && (mapInstance.value.on("pointermove", v), mapInstance.value.getViewport().addEventListener("mouseout", function() {
156
+ var y;
157
+ (y = c == null ? void 0 : c.classList) == null || y.add("hidden");
156
158
  }), i.value = !0);
157
159
  };
158
- let L;
160
+ let T;
159
161
  const E = new Style({
160
162
  fill: new Fill({
161
163
  color: "rgba(255, 255, 255, 0.2)"
@@ -175,118 +177,124 @@ const labels = ref([]), _hoisted_1$4 = {
175
177
  })
176
178
  })
177
179
  });
178
- function b() {
179
- var w, S;
180
- l.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((M) => {
181
- var I;
182
- (I = M == null ? void 0 : M.parentNode) == null || I.removeChild(M);
183
- }), s.clear(), (w = mapInstance.value) == null || w.removeInteraction(L), (S = mapInstance.value) == null || S.removeLayer(g), c != null && c.parentNode && c.parentNode.removeChild(c);
180
+ function C() {
181
+ var y, k;
182
+ if (mapInstance.value) {
183
+ if (l.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((b) => {
184
+ var M;
185
+ (M = b == null ? void 0 : b.parentNode) == null || M.removeChild(b);
186
+ }), s.clear(), T) {
187
+ const b = mapInstance.value.getInteractions().getArray().find((M) => M.ol_uid === T.ol_uid);
188
+ b && ((y = mapInstance.value) == null || y.removeInteraction(b));
189
+ }
190
+ (k = mapInstance.value) == null || k.removeLayer(w), c != null && c.parentNode && c.parentNode.removeChild(c);
191
+ }
184
192
  }
185
- function h() {
186
- var S, M;
187
- b(), (S = mapInstance.value) == null || S.addLayer(g), L = new Draw({
193
+ function p() {
194
+ var k, b;
195
+ C(), (k = mapInstance.value) == null || k.addLayer(w), T = new Draw({
188
196
  source: s,
189
197
  type: "LineString",
190
198
  style: function() {
191
199
  return E;
192
200
  }
193
- }), (M = mapInstance.value) == null || M.addInteraction(L), v(), y();
194
- let w;
195
- L.on("drawstart", function(I) {
201
+ }), (b = mapInstance.value) == null || b.addInteraction(T), g(), S();
202
+ let y;
203
+ T.on("drawstart", function(M) {
196
204
  var N;
197
- u = I.feature;
198
- let _;
199
- w = (N = u.getGeometry()) == null ? void 0 : N.on("change", function(P) {
200
- const F = P.target;
201
- let x = formatLength(F, r.value);
202
- _ = F.getLastCoordinate(), d && x && (d.innerHTML = x), f.setPosition(_);
205
+ u = M.feature;
206
+ let F;
207
+ y = (N = u.getGeometry()) == null ? void 0 : N.on("change", function(P) {
208
+ const _ = P.target;
209
+ let x = formatLength(_, Number(r.value));
210
+ F = _.getLastCoordinate(), d && x && (d.innerHTML = x), f.setPosition(F);
203
211
  });
204
- }), L.on("drawend", function() {
205
- d && (d.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), d != null && d.innerHTML && l.value.push(d == null ? void 0 : d.innerHTML), f.setOffset([0, -7]), u = null, d = null, v(), w && unByKey(w);
212
+ }), T.on("drawend", function() {
213
+ d && (d.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), d != null && d.innerHTML && l.value.push(d == null ? void 0 : d.innerHTML), f.setOffset([0, -7]), u = null, d = null, g(), y && unByKey(y);
206
214
  });
207
215
  }
208
- function y() {
209
- var w;
216
+ function S() {
217
+ var y;
210
218
  c != null && c.parentNode && c.parentNode.removeChild(c), c = document.createElement("div"), c.className = "ol-tooltip hidden", m = new Overlay({
211
219
  element: c,
212
220
  offset: [15, 0],
213
221
  positioning: "center-left"
214
- }), (w = mapInstance.value) == null || w.addOverlay(m);
222
+ }), (y = mapInstance.value) == null || y.addOverlay(m);
215
223
  }
216
- function v() {
217
- var w;
224
+ function g() {
225
+ var y;
218
226
  d != null && d.parentNode && d.parentNode.removeChild(d), d = document.createElement("div"), d.className = "ol-tooltip ol-tooltip-measure", f = new Overlay({
219
227
  element: d,
220
228
  offset: [0, -15],
221
229
  positioning: "bottom-center",
222
230
  stopEvent: !1,
223
231
  insertFirst: !1
224
- }), (w = mapInstance.value) == null || w.addOverlay(f);
232
+ }), (y = mapInstance.value) == null || y.addOverlay(f);
225
233
  }
226
- const C = (w) => {
227
- var I, _;
228
- l.value[w] && l.value.splice(w, 1);
229
- const S = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
230
- S[w] && ((_ = (I = S[w]) == null ? void 0 : I.parentNode) == null || _.removeChild(S[w]));
231
- const M = s.getFeatures();
232
- M[w] && s.removeFeature(M[w]);
234
+ const I = (y) => {
235
+ var M, F;
236
+ l.value[y] && l.value.splice(y, 1);
237
+ const k = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
238
+ k[y] && ((F = (M = k[y]) == null ? void 0 : M.parentNode) == null || F.removeChild(k[y]));
239
+ const b = s.getFeatures();
240
+ b[y] && s.removeFeature(b[y]);
233
241
  }, V = () => {
234
242
  n("close");
235
243
  };
236
244
  return watch(() => a, () => {
237
- a && !i.value && (T(), h());
245
+ a && !i.value && (h(), p());
238
246
  }, { deep: !0, immediate: !0 }), t({
239
- addInteraction: h,
240
- removeInteraction: b
241
- }), (w, S) => {
242
- const M = resolveComponent("el-select");
243
- return a.value ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
247
+ addInteraction: p,
248
+ removeInteraction: C
249
+ }), (y, k) => {
250
+ const b = resolveComponent("el-select");
251
+ return a.value && y.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
244
252
  createElementVNode("div", { class: "header" }, [
245
- S[1] || (S[1] = createElementVNode("div", { class: "title" }, "测量", -1)),
253
+ k[1] || (k[1] = createElementVNode("div", { class: "title" }, "测量", -1)),
246
254
  createElementVNode("i", {
247
255
  onClick: V,
248
256
  class: "map-iconfont icon-close"
249
257
  })
250
258
  ]),
251
259
  createElementVNode("div", _hoisted_2$2, [
252
- S[2] || (S[2] = createElementVNode("div", { class: "tips" }, "在地图上点击多个点测量距离,距离单位", -1)),
253
- createVNode(M, {
260
+ k[2] || (k[2] = createElementVNode("div", { class: "tips" }, "在地图上点击多个点测量距离,距离单位", -1)),
261
+ createVNode(b, {
254
262
  class: "select-length-unit",
255
263
  modelValue: r.value,
256
- "onUpdate:modelValue": S[0] || (S[0] = (I) => r.value = I)
264
+ "onUpdate:modelValue": k[0] || (k[0] = (M) => r.value = M)
257
265
  }, {
258
266
  default: withCtx(() => [
259
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(LENGTH_UNIT_LABEL), (I) => (openBlock(), createBlock(unref(ElOption), {
260
- key: unref(LENGTH_UNIT)[I],
261
- label: I,
262
- value: unref(LENGTH_UNIT)[I]
267
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Object.keys(unref(LENGTH_UNIT_LABEL)), (M) => (openBlock(), createBlock(unref(ElOption), {
268
+ key: M,
269
+ label: String(unref(LENGTH_UNIT_LABEL)[M]),
270
+ value: String(M)
263
271
  }, null, 8, ["label", "value"]))), 128))
264
272
  ]),
265
273
  _: 1
266
274
  }, 8, ["modelValue"])
267
275
  ]),
268
276
  createElementVNode("div", _hoisted_3$2, [
269
- (openBlock(!0), createElementBlock(Fragment, null, renderList(l.value, (I, _) => (openBlock(), createElementBlock("div", {
277
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(l.value, (M, F) => (openBlock(), createElementBlock("div", {
270
278
  class: "measure-history-item",
271
- key: _
279
+ key: F
272
280
  }, [
273
- createElementVNode("div", _hoisted_4$1, [
274
- S[3] || (S[3] = createElementVNode("i", { class: "map-iconfont icon-a-Frame-11" }, null, -1)),
275
- createElementVNode("span", _hoisted_5, "线段" + toDisplayString(_ + 1), 1),
276
- createElementVNode("span", _hoisted_6, toDisplayString(I), 1)
281
+ createElementVNode("div", _hoisted_4, [
282
+ k[3] || (k[3] = createElementVNode("i", { class: "map-iconfont icon-line" }, null, -1)),
283
+ createElementVNode("span", _hoisted_5, "线段" + toDisplayString(F + 1), 1),
284
+ createElementVNode("span", _hoisted_6, toDisplayString(M), 1)
277
285
  ]),
278
286
  createElementVNode("div", {
279
287
  class: "delete-button",
280
- onClick: (N) => C(_)
281
- }, S[4] || (S[4] = [
282
- createElementVNode("i", { class: "map-iconfont icon-a-delete1" }, null, -1)
288
+ onClick: (N) => I(F)
289
+ }, k[4] || (k[4] = [
290
+ createElementVNode("i", { class: "map-iconfont icon-delete" }, null, -1)
283
291
  ]), 8, _hoisted_7)
284
292
  ]))), 128))
285
293
  ])
286
294
  ])) : createCommentVNode("", !0);
287
295
  };
288
296
  }
289
- }), Measure = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-650abf6f"]]), CDN_URL = "https://static.zhihaoscm.cn/", tiandituKey = "a6e8f78974f2581f2ca00485b40c948f", baseMap = {
297
+ }), Measure = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-007c38c9"]]), CDN_URL = "https://static.zhihaoscm.cn/", tiandituKey = "a6e8f78974f2581f2ca00485b40c948f", baseMap = {
290
298
  // 矢量底图
291
299
  tiandituTile: `http://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,
292
300
  // 矢量注记
@@ -329,6 +337,10 @@ function lonLatToMercator(e) {
329
337
  let o = Math.log(Math.tan((90 + e[1]) * Math.PI / 360)) / (Math.PI / 180);
330
338
  return o = o * equatorialCircumference / 180, [t, o];
331
339
  }
340
+ function mercatorToLonLat(e) {
341
+ let t = { lon: 0, lat: 0 }, o = e[0] / equatorialCircumference * 180, n = e[1] / equatorialCircumference * 180;
342
+ return n = 180 / Math.PI * (2 * Math.atan(Math.exp(n * Math.PI / 180)) - Math.PI / 2), t.lon = o, t.lat = n, t;
343
+ }
332
344
  function getIconFont(unicode = "") {
333
345
  return unicode.indexOf("&") !== -1 && (unicode = unicode.replace("&", "&")), unicode.indexOf("&amp") !== -1 && (unicode = unicode.replace("&amp", "&")), eval('("' + unicode.replace("&#x", "\\u").replace(";", "") + '")');
334
346
  }
@@ -343,40 +355,7 @@ const multiplyPixelRatio = (e) => {
343
355
  offsetY: -14
344
356
  }),
345
357
  zIndex: 100
346
- });
347
- function convertToRadians(e) {
348
- if (!e)
349
- throw new Error("coord is required");
350
- if (!Array.isArray(e)) {
351
- if (e.type === "Feature" && e.geometry !== null && e.geometry.type === "Point")
352
- return e.geometry.coordinates;
353
- if (e.type === "Point")
354
- return e.coordinates;
355
- }
356
- if (Array.isArray(e) && e.length >= 2 && !Array.isArray(e[0]) && !Array.isArray(e[1]))
357
- return e;
358
- throw new Error("coord must be GeoJSON Point or an Array of numbers");
359
- }
360
- function createFeature(e, t, o = {}) {
361
- const n = {
362
- type: "Feature"
363
- };
364
- return o.id !== void 0 && (n.id = o.id), o.bbox && (n.bbox = o.bbox), n.properties = {}, n.geometry = e, n;
365
- }
366
- function createPoint(e, t, o) {
367
- return createFeature({
368
- type: "Point",
369
- coordinates: e
370
- }, t, o);
371
- }
372
- function calculateAngle(e, t, o) {
373
- const n = convertToRadians(e), a = convertToRadians(t), r = n[0] % 360 * (Math.PI / 180), l = a[0] % 360 * (Math.PI / 180), i = n[1] % 360 * (Math.PI / 180), s = a[1] % 360 * (Math.PI / 180), u = Math.sin(l - r) * Math.cos(s), c = Math.cos(i) * Math.sin(s) - Math.sin(i) * Math.cos(s) * Math.cos(l - r);
374
- return 180 * Math.atan2(u, c) % (2 * Math.PI) / Math.PI;
375
- }
376
- const getAngle = (e, t) => {
377
- let o = calculateAngle(createPoint(e), createPoint(t));
378
- return o = o < 0 ? 360 + o : o, o % 360 * Math.PI / 180;
379
- }, labelAlpha = 0.8, labelFont = "500 12px Arial", labelOutSize = 2, labelHeight = 10, fillRectRadius = (e, t, o, n, a, r, l = 4) => {
358
+ }), labelAlpha = 0.8, labelFont = "500 12px Arial", labelOutSize = 2, labelHeight = 10, fillRectRadius = (e, t, o, n, a, r, l = 4) => {
380
359
  e.beginPath(), e.moveTo(t + l, o), e.arcTo(t + n, o, t + n, o + l, l), e.arcTo(t + n, o + a, t + n - l, o + a, l), e.arcTo(t, o + a, t, o + a - l, l), e.arcTo(t, o, t + l, o, l), e.closePath(), e.fillStyle = r, e.fill();
381
360
  }, getPixelFromCoordinate = (e) => {
382
361
  if (!e || e.length === 0)
@@ -479,14 +458,14 @@ function drawLabelBody(e, t, o) {
479
458
  e.save(), n && (e.font = n);
480
459
  let m = e.measureText(i).width + 2 * a;
481
460
  (s || u) && (m += r + 4 * a), e.restore();
482
- let d, f = -1, g = r + 3 * a;
483
- if (f = 0, d = calculateBounds(l, f, m, g, c), d && f > -1) {
484
- let p = getBottomLeftPoint(d), T = getTopRighttPoint(d);
461
+ let d, f = -1, w = r + 3 * a;
462
+ if (f = 0, d = calculateBounds(l, f, m, w, c), d && f > -1) {
463
+ let v = getBottomLeftPoint(d), h = getTopRighttPoint(d);
485
464
  return {
486
465
  center: l,
487
- x: calculateAnchorPoint(l, f, m, g, c),
488
- l: T,
489
- r: p,
466
+ x: calculateAnchorPoint(l, f, m, w, c),
467
+ l: h,
468
+ r: v,
490
469
  bounds: d,
491
470
  position: f
492
471
  };
@@ -507,8 +486,8 @@ const drawText = (e, t) => {
507
486
  e.font = "12px map-iconfont", e.fillStyle = "#3370ff";
508
487
  let c = e.measureText(n).width + 6;
509
488
  l.forEach((m, d) => {
510
- let f = getIconFont(m), g = 20 * d;
511
- e.fillText(f, s + c + g, u);
489
+ let f = getIconFont(m), w = 20 * d;
490
+ e.fillText(f, s + c + w, u);
512
491
  });
513
492
  }
514
493
  e.font = i || labelFont, e.fillStyle = a, e.fillText(n, s, u), e.restore();
@@ -543,7 +522,7 @@ const drawText = (e, t) => {
543
522
  }, c = drawLabelBody(e, labels.value, u);
544
523
  if (c) {
545
524
  const { x: m, bounds: d, l: f } = c;
546
- let g = [getTopLeftPoint(d), getBottomLeftPoint(d), getBottomRightPoint(d), getTopRighttPoint(d)];
525
+ let w = [getTopLeftPoint(d), getBottomLeftPoint(d), getBottomRightPoint(d), getTopRighttPoint(d)];
547
526
  labels.value.push(c), drawPolygon(e, {
548
527
  points: [o, m],
549
528
  strokeColor: a,
@@ -555,53 +534,53 @@ const drawText = (e, t) => {
555
534
  scale: void 0,
556
535
  globalAlpha: labelAlpha
557
536
  }), s != null && s.length && s.forEach(() => {
558
- g[1][0] += 20, g[2][0] += 20;
537
+ w[1][0] += 20, w[2][0] += 20;
559
538
  }), drawPolygon(e, {
560
- points: g,
539
+ points: w,
561
540
  strokeColor: a,
562
541
  fillColor: l,
563
542
  shouldClosePath: !0
564
543
  });
565
- const [L, E] = f, b = {
566
- center: [L, E + labelOutSize + labelHeight + 1],
544
+ const [T, E] = f, C = {
545
+ center: [T, E + labelOutSize + labelHeight + 1],
567
546
  text: n,
568
547
  textColor: r,
569
548
  leftIcon: i,
570
549
  rightIcons: s
571
550
  };
572
- drawText(e, b);
551
+ drawText(e, C);
573
552
  }
574
553
  }
575
554
  return null;
576
555
  }, stopIcon = "&#xe6e2;", stopColor = "#E31818", slowIcon = "&#xe703;", slowColor = "#1890FF", dropletsIcon = "&#xe6d2", trackList$1 = ref([]);
577
556
  let animationFeature, animationId;
578
557
  const renderTrackLine = (e, t, o) => {
579
- var r, l;
558
+ var r, l, i;
580
559
  const n = e[t];
581
560
  if (!n) return;
582
- (r = trackLineVectorSource.value) == null || r.clear(), trackList$1.value = [], trackList$1.value = n.reverse().map((i, s) => (i.center = [i.lon, i.lat], i.centerPoint = lonLatToMercator(i.center), i.id = t, i.index = s, i.time = hooks(i.createdAt).format("YYYY-MM-DD HH:mm:ss"), i));
583
- let a = trackList$1.value.map((i) => i.centerPoint);
561
+ trackList$1.value = [], trackList$1.value = n.reverse().map((s, u) => (s.center = [s.lon, s.lat], s.centerPoint = lonLatToMercator(s.center), s.id = t, s.index = u, s.time = hooks(s.createdAt).format("YYYY-MM-DD HH:mm:ss"), s));
562
+ let a = trackList$1.value.map((s) => s.centerPoint);
584
563
  if (a.length >= 2) {
585
- let i = new LineString(a);
586
- const s = new Feature({ geometry: i });
587
- s.setStyle(
564
+ let s = new LineString(a);
565
+ const u = new Feature({ geometry: s });
566
+ u.setStyle(
588
567
  new Style({
589
568
  stroke: new Stroke({
590
569
  color: o,
591
570
  width: 2
592
571
  })
593
572
  })
594
- ), s.setId(t), s.set("type", "line");
595
- const u = shipTrackLineFeatures.value.findIndex((m) => m.getId() === t);
596
- u >= 0 ? shipTrackLineFeatures.value[u] = s : shipTrackLineFeatures.value.push(s);
597
- const c = createAnimatedIconFeature(o, a);
573
+ ), u.setId(t), u.set("type", "line"), (l = (r = shipTrackVectorLayer.value) == null ? void 0 : r.getSource()) == null || l.clear(), shipTrackLineFeatures.value = [];
574
+ const c = shipTrackLineFeatures.value.findIndex((d) => d.getId() === t);
575
+ c >= 0 ? shipTrackLineFeatures.value[c] = u : shipTrackLineFeatures.value.push(u);
576
+ const m = createAnimatedIconFeature(o, a);
598
577
  trackLineVectorSource.value = new VectorSource({
599
- features: [...shipTrackLineFeatures.value, c]
600
- }), animationFeature = c, shipTrackVectorLayer.value = new VectorLayer({
578
+ features: [...shipTrackLineFeatures.value, m]
579
+ }), animationFeature = m, shipTrackVectorLayer.value = new VectorLayer({
601
580
  source: trackLineVectorSource.value
602
581
  }), setTimeout(() => {
603
582
  renderPoint(o);
604
- }, 500), (l = mapInstance.value) == null || l.addLayer(shipTrackVectorLayer.value);
583
+ }, 500), (i = mapInstance.value) == null || i.addLayer(shipTrackVectorLayer.value);
605
584
  }
606
585
  }, handlePlay = (e) => {
607
586
  const t = trackLineVectorSource.value.getFeatures().filter((o) => {
@@ -609,6 +588,10 @@ const renderTrackLine = (e, t, o) => {
609
588
  return !!((n = o.get("data")) != null && n.lon);
610
589
  }).map((o) => lonLatToMercator([o.get("data").lon, o.get("data").lat]));
611
590
  startAnimation(t);
591
+ }, removeShipTrackLineFeatureByIndex = (e) => {
592
+ e >= 0 && e < shipTrackLineFeatures.value.length && shipTrackLineFeatures.value.splice(e, 1), trackLineVectorSource.value = new VectorSource({
593
+ features: [...shipTrackLineFeatures.value]
594
+ }), shipTrackVectorLayer.value && shipTrackVectorLayer.value.setSource(trackLineVectorSource.value);
612
595
  }, createAnimatedIconFeature = (e, t) => {
613
596
  const o = new Feature({
614
597
  geometry: new Point(fromLonLat([t[0][0], t[0][1]]))
@@ -693,8 +676,8 @@ const renderTrackLine = (e, t, o) => {
693
676
  offsetY: -10
694
677
  }),
695
678
  zIndex: 99
696
- }), g = [];
697
- i.state === "0" ? ((c = f.getText()) == null || c.setFill(new Fill({ color: stopColor })), g.push(r)) : ((m = f.getText()) == null || m.setFill(new Fill({ color: slowColor })), g.push(l)), g.push(f), d.setStyle(g), trackLineVectorSource.value.addFeature(d);
679
+ }), w = [];
680
+ i.state === "0" ? ((c = f.getText()) == null || c.setFill(new Fill({ color: stopColor })), w.push(r)) : ((m = f.getText()) == null || m.setFill(new Fill({ color: slowColor })), w.push(l)), w.push(f), d.setStyle(w), trackLineVectorSource.value.addFeature(d);
698
681
  }
699
682
  }), renderArrow(n, e), renderIconPoint();
700
683
  }, renderArrow = (e, t) => {
@@ -721,10 +704,11 @@ const renderTrackLine = (e, t, o) => {
721
704
  font: "700 14px map-iconfont",
722
705
  text: getIconFont("&#xe6bc;"),
723
706
  fill: new Fill({ color: t }),
724
- rotation: getAngle(
725
- e[n].center,
726
- e[n + 1].center
727
- )
707
+ rotation: 1
708
+ // getRotation(
709
+ // pointList[index].center,
710
+ // pointList[index + 1].center
711
+ // ),
728
712
  })
729
713
  })
730
714
  ), trackLineVectorSource.value.addFeature(i);
@@ -824,7 +808,11 @@ const renderTrackLine = (e, t, o) => {
824
808
  [0, -24]
825
809
  ]
826
810
  }
827
- }, speedCondition = [[1, 10], [10, 20], [20, 1 / 0]], drawShipModelByZoom = { 16: [200, 30], 17: [50, 5], 18: [1, 1] }, setShipStyle = (e) => new Style({
811
+ }, speedCondition = [[1, 10], [10, 20], [20, 1 / 0]], drawShipModelByZoom = { 16: [200, 30], 17: [50, 5], 18: [1, 1] }, setBlankStyle = () => new Style({
812
+ image: new CircleStyle({
813
+ radius: 0
814
+ })
815
+ }), setShipStyle = (e) => new Style({
828
816
  renderer: (t, o) => {
829
817
  const n = o.context, a = o.feature.get("data");
830
818
  try {
@@ -921,13 +909,14 @@ let shipsMarkerList = [], shipsVectorSource, largeAmountShipsSource;
921
909
  const selectedShipData = ref(null);
922
910
  let selectShipsVectorSource;
923
911
  const renderShips = (e) => {
912
+ var o, n, a, r;
924
913
  if (!mapInstance.value) return;
925
914
  const t = mapInstance.value.getView().getZoom();
926
915
  if (selectedShipData.value && nextTick(() => {
927
916
  selectSingleShipMarker(selectedShipData.value);
928
- }).then((o) => {
917
+ }).then((l) => {
929
918
  }), !(!t || t < mapZoom.shipGreenDotMax))
930
- return allShips.value = e, t > mapZoom.shipGreenDotMax && t < mapZoom.shipModelMin || e.length > 500 ? (deleteAllShipMarkers(), renderLargeAmountShips(e)) : (largeAmountShipsSource == null || largeAmountShipsSource.clear(), renderShipsMarker(e));
919
+ return allShips.value = e, t > mapZoom.shipGreenDotMax && t < mapZoom.shipModelMin ? ((o = shipsLayer.value) == null || o.setVisible(!1), (n = largeAmountShipsLayer.value) == null || n.setVisible(!0), renderLargeAmountShips(e)) : ((a = largeAmountShipsLayer.value) == null || a.setVisible(!1), (r = shipsLayer.value) == null || r.setVisible(!0), renderShipsMarker(e));
931
920
  }, renderLargeAmountShips = (e) => {
932
921
  if (!mapInstance.value) return;
933
922
  const t = e.map((o) => ({
@@ -951,15 +940,20 @@ const renderShips = (e) => {
951
940
  "shape-points": 3,
952
941
  "shape-radius": 9,
953
942
  "shape-fill-color": "#04C900",
943
+ // 'shape-fill-color': ['get', 'data.fill'],
954
944
  "shape-rotate-with-view": !1,
955
945
  "shape-rotation": [
956
- "get",
957
- "cog",
946
+ "+",
947
+ ["get", "cog"],
958
948
  // 获取 'cog' 属性值
959
- 0
960
- // 如果 'cog' 属性不存在,使用默认值 0
949
+ 180
950
+ // 将值旋转 180
961
951
  ],
962
- "shape-scale": [0.8, 1.2]
952
+ "shape-scale": [0.8, 1.2],
953
+ "shape-stroke-color": "#000000",
954
+ // 边框颜色为黑色
955
+ "shape-stroke-width": 0.5
956
+ // 边框宽度为0.5px
963
957
  }
964
958
  }), mapInstance.value.addLayer(largeAmountShipsLayer.value), largeAmountShipsLayer.value;
965
959
  }, renderShipsMarker = (e) => {
@@ -1000,20 +994,26 @@ const renderShips = (e) => {
1000
994
  }), shipsMarkerList = [];
1001
995
  }, selectSingleShipMarker = (e) => {
1002
996
  if (!mapInstance.value) return;
1003
- const t = convertShipMapData(e), o = [t.lon, t.lat], n = new Feature({
1004
- geometry: new Point(fromLonLat(o))
997
+ selectSingleShipData.value = convertShipMapData(e);
998
+ const t = [selectSingleShipData.value.lon, selectSingleShipData.value.lat], o = new Feature({
999
+ geometry: new Point(fromLonLat(t))
1005
1000
  });
1006
- return n.set("data", t), n.setStyle(
1007
- setShipStyle(!0, t.id)
1001
+ return o.set("data", selectSingleShipData.value), o.setStyle(
1002
+ setShipStyle(!0, selectSingleShipData.value.id)
1008
1003
  ), shipsMarkerList.push({
1009
- ship: t,
1010
- lonlat: o,
1011
- feature: n
1004
+ ship: selectSingleShipData.value,
1005
+ lonlat: t,
1006
+ feature: o
1012
1007
  }), selectShipsVectorSource == null || selectShipsVectorSource.clear(), selectShipsVectorSource = new VectorSource({
1013
- features: [n]
1008
+ features: [o]
1014
1009
  }), selectShipsLayer.value = new VectorLayer({
1015
1010
  source: selectShipsVectorSource
1016
- }), mapInstance.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!0), selectShipsLayer.value;
1011
+ }), setVisibleFeatureById(selectSingleShipData.value.id, !0), mapInstance.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!0), selectShipsLayer.value;
1012
+ }, setVisibleFeatureById = (e, t) => {
1013
+ shipsVectorSource && shipsVectorSource.forEachFeature((o) => {
1014
+ const n = o.get("data");
1015
+ n && n.id === e && o.setStyle(t ? setShipStyle(!1, n.id) : setBlankStyle());
1016
+ });
1017
1017
  }, findShip = (e, t, o = !0) => {
1018
1018
  var a, r, l, i, s;
1019
1019
  if (!e || !mapInstance.value) return;
@@ -1021,11 +1021,7 @@ const renderShips = (e) => {
1021
1021
  var c;
1022
1022
  return ((c = u.get("data")) == null ? void 0 : c.id) === e;
1023
1023
  });
1024
- if (n)
1025
- selectedShipData.value = n;
1026
- else if (t)
1027
- selectedShipData.value = t;
1028
- else {
1024
+ if (n ? selectedShipData.value = n : t && (selectedShipData.value = t), !t) {
1029
1025
  console.error("找不到船舶");
1030
1026
  return;
1031
1027
  }
@@ -1037,7 +1033,8 @@ const renderShips = (e) => {
1037
1033
  }
1038
1034
  return n;
1039
1035
  }, clearSelectFeature = () => {
1040
- selectedShipData.value = null, mapInstance.value && (selectShipsVectorSource == null || selectShipsVectorSource.clear(), selectShipsLayer.value = new VectorLayer({
1036
+ var e;
1037
+ selectedShipData.value && setVisibleFeatureById((e = selectedShipData.value) == null ? void 0 : e.id, !1), selectedShipData.value = null, mapInstance.value && (selectShipsVectorSource == null || selectShipsVectorSource.clear(), selectShipsLayer.value = new VectorLayer({
1041
1038
  source: selectShipsVectorSource
1042
1039
  }), mapInstance.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!1));
1043
1040
  }, hiddenAllShips = () => {
@@ -1094,10 +1091,10 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship")
1094
1091
  } catch (r) {
1095
1092
  console.log(r);
1096
1093
  }
1097
- }, _hoisted_1$3 = { class: "tool-panel" }, _hoisted_2$1 = {
1094
+ }, _hoisted_1$3 = {
1098
1095
  key: 0,
1099
1096
  class: "more-tool-panel"
1100
- }, _hoisted_3$1 = { class: "switch-buttons" }, _hoisted_4 = { class: "tool-components" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
1097
+ }, _hoisted_2$1 = { class: "switch-buttons" }, _hoisted_3$1 = { class: "tool-components" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
1101
1098
  __name: "toolPanel",
1102
1099
  props: {
1103
1100
  vehicleMode: {},
@@ -1107,112 +1104,124 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship")
1107
1104
  },
1108
1105
  emits: ["switchGreenDot", "switchMapTile"],
1109
1106
  setup(e, { emit: t }) {
1110
- var d, f;
1111
- const o = t, n = ref(((f = (d = mapInstance.value) == null ? void 0 : d.getView()) == null ? void 0 : f.getZoom()) || mapZoom.default), a = ref(!1), r = ref(null), l = ref(!0), i = () => {
1112
- l.value = !l.value, o("switchGreenDot", l.value);
1113
- }, s = ref(BaseMapType.vector), u = () => {
1114
- s.value = s.value === BaseMapType.vector ? BaseMapType.satellite : BaseMapType.vector, o("switchMapTile", s.value);
1115
- }, c = () => {
1116
- var g, p;
1117
- a.value ? (g = r.value) == null || g.removeInteraction() : (p = r.value) == null || p.addInteraction(), a.value = !a.value;
1107
+ var f, w;
1108
+ const o = e, n = t, a = ref(((w = (f = mapInstance.value) == null ? void 0 : f.getView()) == null ? void 0 : w.getZoom()) || mapZoom.default), r = ref(!1), l = ref(null), i = ref(!0), s = () => {
1109
+ o.disableGreenDot || a.value >= mapZoom.shipGreenDotMax || (i.value = !i.value, n("switchGreenDot", i.value));
1110
+ }, u = ref(BaseMapType.vector), c = () => {
1111
+ u.value = u.value === BaseMapType.vector ? BaseMapType.satellite : BaseMapType.vector, n("switchMapTile", u.value);
1118
1112
  }, m = () => {
1119
- var g;
1120
- (g = r.value) == null || g.removeInteraction(), a.value = !1;
1113
+ var v, h;
1114
+ r.value ? (v = l.value) == null || v.removeInteraction() : (h = l.value) == null || h.addInteraction(), r.value = !r.value;
1115
+ }, d = () => {
1116
+ var v;
1117
+ (v = l.value) == null || v.removeInteraction(), r.value = !1;
1121
1118
  };
1122
- return (g, p) => (openBlock(), createElementBlock(Fragment, null, [
1123
- createElementVNode("div", _hoisted_1$3, [
1124
- g.viewMode === "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
1125
- createElementVNode("div", _hoisted_3$1, [
1126
- g.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1119
+ return onMounted(() => {
1120
+ nextTick(() => {
1121
+ var v;
1122
+ (v = mapInstance.value) == null || v.on("moveend", () => {
1123
+ var T, E;
1124
+ const h = (E = (T = mapInstance.value) == null ? void 0 : T.getView()) == null ? void 0 : E.getZoom();
1125
+ h && (a.value = h);
1126
+ });
1127
+ });
1128
+ }), (v, h) => (openBlock(), createElementBlock(Fragment, null, [
1129
+ createElementVNode("div", {
1130
+ class: normalizeClass(`tool-panel ${v.viewMode}`)
1131
+ }, [
1132
+ v.viewMode === "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
1133
+ createElementVNode("div", _hoisted_2$1, [
1134
+ v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1127
1135
  key: 0,
1128
- class: normalizeClass(["switch-btn", `${a.value && "active"}`]),
1129
- onClick: c
1130
- }, p[5] || (p[5] = [
1136
+ class: normalizeClass(["switch-btn", `${r.value && "active"}`]),
1137
+ onClick: m
1138
+ }, h[5] || (h[5] = [
1131
1139
  createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
1132
1140
  createElementVNode("div", { class: "button-text" }, "测距", -1)
1133
1141
  ]), 2)) : createCommentVNode("", !0),
1134
- g.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1142
+ v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1135
1143
  key: 1,
1136
- "<div": "",
1137
- class: normalizeClass(`switch-btn ${l.value && "active"} ${(g.disableGreenDot || n.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
1138
- onClick: i
1139
- }, p[6] || (p[6] = [
1144
+ class: normalizeClass(`switch-btn ${i.value && "active"} ${(v.disableGreenDot || a.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
1145
+ onClick: s
1146
+ }, h[6] || (h[6] = [
1140
1147
  createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
1141
1148
  createElementVNode("div", { class: "button-text" }, "绿点", -1)
1142
1149
  ]), 2)) : createCommentVNode("", !0),
1143
- g.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1150
+ v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1144
1151
  key: 2,
1145
- class: normalizeClass(`switch-btn ${s.value === unref(BaseMapType).vector && "active"}`),
1146
- onClick: p[0] || (p[0] = (T) => u())
1147
- }, p[7] || (p[7] = [
1152
+ class: normalizeClass(`switch-btn ${u.value === unref(BaseMapType).vector && "active"}`),
1153
+ onClick: h[0] || (h[0] = (T) => c())
1154
+ }, h[7] || (h[7] = [
1148
1155
  createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
1149
1156
  createElementVNode("div", { class: "button-text" }, "图层", -1)
1150
1157
  ]), 2)) : createCommentVNode("", !0),
1151
- g.vehicleMode === "truck" ? (openBlock(), createElementBlock("div", {
1158
+ v.vehicleMode === "truck" ? (openBlock(), createElementBlock("div", {
1152
1159
  key: 3,
1153
- class: normalizeClass(`switch-btn ${s.value === unref(BaseMapType).satellite && "active"}`),
1154
- onClick: p[1] || (p[1] = (T) => u())
1155
- }, p[8] || (p[8] = [
1160
+ class: normalizeClass(`switch-btn ${u.value === unref(BaseMapType).satellite && "active"}`),
1161
+ onClick: h[1] || (h[1] = (T) => c())
1162
+ }, h[8] || (h[8] = [
1156
1163
  createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
1157
1164
  createElementVNode("div", { class: "button-text" }, "卫星", -1)
1158
1165
  ]), 2)) : createCommentVNode("", !0),
1159
- g.showTrackLayer ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1166
+ v.showTrackLayer ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1160
1167
  createElementVNode("div", {
1161
1168
  class: "switch-btn multiple",
1162
- onClick: p[2] || (p[2] = (T) => unref(playTrack)(0, 1))
1163
- }, p[9] || (p[9] = [
1164
- createElementVNode("i", { class: "iconfont icon-play" }, null, -1),
1169
+ onClick: h[2] || (h[2] = (T) => unref(playTrack)(0, 1))
1170
+ }, h[9] || (h[9] = [
1171
+ createElementVNode("i", { class: "map-iconfont icon-play" }, null, -1),
1165
1172
  createElementVNode("div", { class: "button-text" }, "播放轨迹", -1)
1166
1173
  ])),
1167
1174
  createElementVNode("div", {
1168
1175
  class: "switch-btn multiple",
1169
- onClick: p[3] || (p[3] = (T) => unref(resetTrackView)())
1170
- }, p[10] || (p[10] = [
1171
- createElementVNode("i", { class: "iconfont icon-center" }, null, -1),
1176
+ onClick: h[3] || (h[3] = (T) => unref(resetTrackView)())
1177
+ }, h[10] || (h[10] = [
1178
+ createElementVNode("i", { class: "map-iconfont icon-center" }, null, -1),
1172
1179
  createElementVNode("div", { class: "button-text" }, "轨迹居中", -1)
1173
1180
  ]))
1174
1181
  ], 64)) : createCommentVNode("", !0),
1175
- renderSlot(g.$slots, "toolPanel", {}, void 0, !0)
1182
+ renderSlot(v.$slots, "toolPanel", {}, void 0, !0)
1176
1183
  ])
1177
1184
  ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1178
- g.vehicleMode === "ship" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1185
+ v.vehicleMode === "ship" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1179
1186
  createElementVNode("div", {
1180
- class: normalizeClass(["switch-btn", `${a.value && "active"}`]),
1181
- onClick: c
1182
- }, p[11] || (p[11] = [
1187
+ class: normalizeClass(["switch-btn", `${r.value && "active"}`]),
1188
+ onClick: m
1189
+ }, h[11] || (h[11] = [
1183
1190
  createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
1184
1191
  createElementVNode("div", { class: "button-text" }, "测距", -1)
1185
1192
  ]), 2),
1186
- createElementVNode("div", {
1187
- class: normalizeClass(["switch-btn", { active: l.value }]),
1188
- onClick: i
1189
- }, p[12] || (p[12] = [
1193
+ v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1194
+ key: 0,
1195
+ class: normalizeClass(`switch-btn ${i.value && "active"} ${(v.disableGreenDot || a.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
1196
+ onClick: s
1197
+ }, h[12] || (h[12] = [
1190
1198
  createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
1191
1199
  createElementVNode("div", { class: "button-text" }, "绿点", -1)
1192
- ]), 2)
1200
+ ]), 2)) : createCommentVNode("", !0)
1193
1201
  ], 64)) : createCommentVNode("", !0),
1194
1202
  createElementVNode("div", {
1195
- class: normalizeClass(["switch-btn", { active: s.value === unref(BaseMapType).satellite }]),
1196
- onClick: u
1197
- }, p[13] || (p[13] = [
1203
+ class: normalizeClass(["switch-btn", { active: u.value === unref(BaseMapType).satellite }]),
1204
+ onClick: c
1205
+ }, h[13] || (h[13] = [
1198
1206
  createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
1199
1207
  createElementVNode("div", { class: "button-text" }, "卫星", -1)
1200
1208
  ]), 2)
1201
1209
  ], 64))
1202
- ]),
1203
- createElementVNode("div", _hoisted_4, [
1204
- a.value ? (openBlock(), createBlock(Measure, {
1210
+ ], 2),
1211
+ createElementVNode("div", _hoisted_3$1, [
1212
+ r.value ? (openBlock(), createBlock(Measure, {
1205
1213
  key: 0,
1206
1214
  ref_key: "measureRef",
1207
- ref: r,
1208
- visible: a.value,
1209
- "onUpdate:visible": p[4] || (p[4] = (T) => a.value = T),
1210
- onClose: m
1211
- }, null, 8, ["visible"])) : createCommentVNode("", !0)
1215
+ ref: l,
1216
+ visible: r.value,
1217
+ "onUpdate:visible": h[4] || (h[4] = (T) => r.value = T),
1218
+ onClose: d,
1219
+ "view-mode": v.viewMode
1220
+ }, null, 8, ["visible", "view-mode"])) : createCommentVNode("", !0)
1212
1221
  ])
1213
1222
  ], 64));
1214
1223
  }
1215
- }), ToolPanel = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-ddfa6649"]]), _hoisted_1$2 = { id: "scale-line-container" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
1224
+ }), ToolPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-1b8ea4b1"]]), _hoisted_1$2 = { id: "scale-line-container" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
1216
1225
  __name: "scaleLine",
1217
1226
  setup(e, { expose: t }) {
1218
1227
  const o = new ScaleLine$1({
@@ -1224,7 +1233,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship")
1224
1233
  }
1225
1234
  }), (a, r) => (openBlock(), createElementBlock("div", _hoisted_1$2));
1226
1235
  }
1227
- }), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-e51b19b1"]]), _hoisted_1$1 = { class: "zoom" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
1236
+ }), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-e51b19b1"]]), _hoisted_1$1 = { class: "zoom" }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
1228
1237
  __name: "zoomControl",
1229
1238
  props: {
1230
1239
  map: {
@@ -1252,7 +1261,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship")
1252
1261
  }, "-")
1253
1262
  ]));
1254
1263
  }
1255
- }), ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f2b62b21"]]), _hoisted_1 = { class: "copyright" }, _hoisted_2 = { class: "tdt-control-copyright tdt-control" }, _hoisted_3 = ["src"], _sfc_main$2 = /* @__PURE__ */ defineComponent({
1264
+ }), ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-f2b62b21"]]), _hoisted_1 = { class: "copyright" }, _hoisted_2 = { class: "tdt-control-copyright tdt-control" }, _hoisted_3 = ["src"], _sfc_main$1 = /* @__PURE__ */ defineComponent({
1256
1265
  __name: "copyright",
1257
1266
  setup(e) {
1258
1267
  return (t, o) => (openBlock(), createElementBlock("div", _hoisted_1, [
@@ -1272,29 +1281,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship")
1272
1281
  }, "数据来源:自然资源部 & NavInfo", -1))
1273
1282
  ]));
1274
1283
  }
1275
- }), Copyright = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-9c5c2f7b"]]), _sfc_main$1 = /* @__PURE__ */ defineComponent({
1276
- __name: "fullscreen",
1277
- props: {
1278
- pageRef: {
1279
- type: Object,
1280
- default: () => ({})
1281
- }
1282
- },
1283
- setup(e) {
1284
- const t = e, o = ref(!1), n = () => {
1285
- var a;
1286
- o.value ? document.exitFullscreen() : (console.log(t.pageRef), (a = t.pageRef) == null || a.requestFullscreen()), o.value = !o.value;
1287
- };
1288
- return (a, r) => (openBlock(), createElementBlock("div", {
1289
- class: "fullscreen-btn",
1290
- onClick: n
1291
- }, [
1292
- createElementVNode("i", {
1293
- class: normalizeClass(`map-iconfont ${o.value ? "icon-quxiaoquanping" : "icon-quanping"} `)
1294
- }, null, 2)
1295
- ]));
1296
- }
1297
- }), Fullscreen = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ed59d7cb"]]), dotImage = new Image();
1284
+ }), Copyright = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-9c5c2f7b"]]), dotImage = new Image();
1298
1285
  dotImage.src = `${CDN_URL}/map/truck-dot.svg`;
1299
1286
  dotImage.crossOrigin = "anonymous";
1300
1287
  const dotActiveImage = new Image();
@@ -1316,21 +1303,21 @@ const setTruckStyle = (e, t, o, n) => new Style({
1316
1303
  s = s / i - 20, u = u / i;
1317
1304
  const c = s - 70, m = u - 68;
1318
1305
  let d = 180;
1319
- const f = 56, g = "#FFFFFF";
1320
- let p = 176;
1321
- const T = 52;
1322
- let L = "#164AFF", E = "#FFFFFF";
1323
- o === CAR_COLOR.YELLOW ? (p = 176, L = "#FFC81E", E = "rgba(0,0,0,0.88)") : o === CAR_COLOR.Y_GREEN && (d = 200, p = 196, L = "#8FED7C", E = "rgba(0,0,0,0.88)"), n != null && n.length && (d += n.length * 56), fillRectRadius(l, c, m, d, f, g), fillRectRadius(l, c + 2, m + 2, p, T, L), o === CAR_COLOR.Y_GREEN && fillRectRadius(l, c + 2, m + 2, 68, T, "#FFC81E"), l.save(), l.restore(), l.fillStyle = E, l.font = "bold 28px Arial", l.textAlign = "left", l.textBaseline = "middle";
1324
- const b = `${t.slice(0, 2) + " · " + t.slice(2)}`;
1325
- if (l.fillText(b, c + 12, m + 32), l.save(), l.restore(), n != null && n.length) {
1326
- const y = l.measureText(b).width + 12;
1327
- let v = 0;
1328
- n.forEach((C) => {
1329
- C === DEVICE_TYPE.CAMERA && (l.drawImage(cameraImage, s - 54 + y + v * 56, u - 64, 50, 50), ++v), C === DEVICE_TYPE.LOAD && (l.drawImage(loadImage, s - 54 + y + v * 56, u - 64, 50, 50), ++v);
1306
+ const f = 56, w = "#FFFFFF";
1307
+ let v = 176;
1308
+ const h = 52;
1309
+ let T = "#164AFF", E = "#FFFFFF";
1310
+ o === CAR_COLOR.YELLOW ? (v = 176, T = "#FFC81E", E = "rgba(0,0,0,0.88)") : o === CAR_COLOR.Y_GREEN && (d = 200, v = 196, T = "#8FED7C", E = "rgba(0,0,0,0.88)"), n != null && n.length && (d += n.length * 56), fillRectRadius(l, c, m, d, f, w), fillRectRadius(l, c + 2, m + 2, v, h, T), o === CAR_COLOR.Y_GREEN && fillRectRadius(l, c + 2, m + 2, 68, h, "#FFC81E"), l.save(), l.restore(), l.fillStyle = E, l.font = "bold 28px Arial", l.textAlign = "left", l.textBaseline = "middle";
1311
+ const C = `${t.slice(0, 2) + " · " + t.slice(2)}`;
1312
+ if (l.fillText(C, c + 12, m + 32), l.save(), l.restore(), n != null && n.length) {
1313
+ const S = l.measureText(C).width + 12;
1314
+ let g = 0;
1315
+ n.forEach((I) => {
1316
+ I === DEVICE_TYPE.CAMERA && (l.drawImage(cameraImage, s - 54 + S + g * 56, u - 64, 50, 50), ++g), I === DEVICE_TYPE.LOAD && (l.drawImage(loadImage, s - 54 + S + g * 56, u - 64, 50, 50), ++g);
1330
1317
  });
1331
1318
  }
1332
- const h = dotImage;
1333
- l.drawImage(h, s + d / 2 - 90, u, 50 / i, 50 / i), l.restore();
1319
+ const p = dotImage;
1320
+ l.drawImage(p, s + d / 2 - 90, u, 50 / i, 50 / i), l.restore();
1334
1321
  }
1335
1322
  });
1336
1323
  ref([]);
@@ -1372,18 +1359,18 @@ const renderTrucksMarker = (e) => {
1372
1359
  // 设置不阻拦事件
1373
1360
  });
1374
1361
  if (a) {
1375
- let d = !1, f = [0, 0], g = [0, 0];
1376
- r.addEventListener("mousedown", function(p) {
1377
- var T;
1378
- d = !0, p.clientX, p.clientY, f = (T = mapInstance.value) == null ? void 0 : T.getCoordinateFromPixel([p.clientX - 200, p.clientY - 200]), g = [
1379
- p.clientX - r.getBoundingClientRect().left + 160,
1380
- p.clientY - r.getBoundingClientRect().top + 84
1381
- ], p.preventDefault();
1382
- }), document.addEventListener("mousemove", function(p) {
1383
- var T;
1362
+ let d = !1, f = [0, 0], w = [0, 0];
1363
+ r.addEventListener("mousedown", function(v) {
1364
+ var h;
1365
+ d = !0, v.clientX, v.clientY, f = (h = mapInstance.value) == null ? void 0 : h.getCoordinateFromPixel([v.clientX - 200, v.clientY - 200]), w = [
1366
+ v.clientX - r.getBoundingClientRect().left + 160,
1367
+ v.clientY - r.getBoundingClientRect().top + 84
1368
+ ], v.preventDefault();
1369
+ }), document.addEventListener("mousemove", function(v) {
1370
+ var h;
1384
1371
  if (d) {
1385
- let L = (T = mapInstance.value) == null ? void 0 : T.getCoordinateFromPixel([p.clientX - g[0], p.clientY - g[1]]), E = L[0] - f[0], b = L[1] - f[1];
1386
- l.setPosition([f[0] + E, f[1] + b]);
1372
+ let T = (h = mapInstance.value) == null ? void 0 : h.getCoordinateFromPixel([v.clientX - w[0], v.clientY - w[1]]), E = T[0] - f[0], C = T[1] - f[1];
1373
+ l.setPosition([f[0] + E, f[1] + C]);
1387
1374
  }
1388
1375
  }), document.addEventListener("mouseup", function() {
1389
1376
  d = !1;
@@ -1475,9 +1462,9 @@ const renderTrucksMarker = (e) => {
1475
1462
  layers: [i]
1476
1463
  });
1477
1464
  m.on("translating", function(d) {
1478
- var p;
1479
- const f = d.features.item(0).getGeometry().getCoordinates(), g = toLonLat(f);
1480
- markerPosition.value = `${g[0].toFixed(6)}, ${g[1].toFixed(6)}`, (p = marker.value) == null || p.setStyle(createIconStyle(markerPosition.value));
1465
+ var v;
1466
+ const f = d.features.item(0).getGeometry().getCoordinates(), w = toLonLat(f);
1467
+ markerPosition.value = `${w[0].toFixed(6)}, ${w[1].toFixed(6)}`, (v = marker.value) == null || v.setStyle(createIconStyle(markerPosition.value));
1481
1468
  }), mapInstance.value.addInteraction(m);
1482
1469
  }
1483
1470
  const u = new Point([n, a]);
@@ -1492,20 +1479,7 @@ const renderTrucksMarker = (e) => {
1492
1479
  };
1493
1480
  let layerState = "drawn", drawnState = "undrawn";
1494
1481
  const source = new VectorSource();
1495
- let sketch, helpTooltipElement, helpTooltip, measureTooltipElement, measureTooltip;
1496
- const circleStyle = {
1497
- image: new CircleStyle({
1498
- radius: 5,
1499
- fill: new Fill({
1500
- color: "rgb(51,112,255, 1)"
1501
- })
1502
- }),
1503
- geometry: function(e) {
1504
- const t = e.getGeometry().getCoordinates();
1505
- return new MultiPoint(t);
1506
- }
1507
- };
1508
- let drawVector, draw;
1482
+ let sketch, helpTooltipElement, helpTooltip, measureTooltipElement, measureTooltip, circleStyle, drawVector, draw;
1509
1483
  function createMeasureTooltip() {
1510
1484
  var e;
1511
1485
  measureTooltipElement != null && measureTooltipElement.parentNode && measureTooltipElement.parentNode.removeChild(measureTooltipElement), measureTooltipElement = document.createElement("div"), measureTooltipElement.className = "ol-tooltip ol-tooltip-draw-polygon", measureTooltip = new Overlay({
@@ -1535,7 +1509,7 @@ const validateSquareLimit = (e) => {
1535
1509
  squareLimitError = l > 150 || i > 150;
1536
1510
  };
1537
1511
  let storeFeature;
1538
- function addInteraction(e) {
1512
+ const addInteraction = (e) => {
1539
1513
  var o, n;
1540
1514
  drawVector || init(), drawnState = "undrawn", layerState = "drawn", (o = mapInstance.value) == null || o.addLayer(drawVector), draw = new Draw({
1541
1515
  type: "Polygon",
@@ -1581,15 +1555,19 @@ function addInteraction(e) {
1581
1555
  }
1582
1556
  sketch = null, measureTooltipElement = null, createMeasureTooltip(), t && unByKey(t), drawnState = "drawend";
1583
1557
  });
1584
- }
1585
- function removeInteraction() {
1558
+ }, removeInteraction = () => {
1586
1559
  var e, t, o;
1587
- mapInstance.value && (document.querySelectorAll(".ol-tooltip.ol-tooltip-draw-polygon").forEach((n) => {
1588
- var a;
1589
- (a = n == null ? void 0 : n.parentNode) == null || a.removeChild(n);
1590
- }), source.clear(), (e = mapInstance.value) == null || e.removeInteraction(draw), (t = mapInstance.value) == null || t.removeLayer(drawVector), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement), ((o = mapInstance.value) == null ? void 0 : o.getTargetElement()).style.cursor = "", document.querySelector("#map").style.cursor = "", drawnState = "undrawn", layerState = "destroyed");
1591
- }
1592
- const endFn = (e) => {
1560
+ if (mapInstance.value) {
1561
+ if (document.querySelectorAll(".ol-tooltip.ol-tooltip-draw-polygon").forEach((n) => {
1562
+ var a;
1563
+ (a = n == null ? void 0 : n.parentNode) == null || a.removeChild(n);
1564
+ }), source.clear(), (e = mapInstance.value) == null || e.removeLayer(drawVector), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement), ((t = mapInstance.value) == null ? void 0 : t.getTargetElement()).style.cursor = "", document.querySelector("#map").style.cursor = "", draw) {
1565
+ const n = mapInstance.value.getInteractions().getArray().find((a) => a.ol_uid === draw.ol_uid);
1566
+ n && ((o = mapInstance.value) == null || o.removeInteraction(n));
1567
+ }
1568
+ drawnState = "undrawn", layerState = "destroyed";
1569
+ }
1570
+ }, endFn = (e) => {
1593
1571
  var t, o, n;
1594
1572
  if (e.getGeometry()) {
1595
1573
  const a = [], l = e.getGeometry().getCoordinates();
@@ -1597,7 +1575,7 @@ const endFn = (e) => {
1597
1575
  a.push(transform(s, projection.mercator, projection.data));
1598
1576
  });
1599
1577
  const i = l[0][l[0].length - 2];
1600
- if (i && measureTooltip.setPosition(i), measureTooltip.setOffset([10, 0]), measureTooltipElement && (measureTooltipElement.innerHTML += '<span class="delete-icon"><i class="iconfont icon-delete" /></div>'), (o = document.querySelector(".delete-icon")) == null || o.addEventListener("click", () => {
1578
+ if (i && measureTooltip.setPosition(i), measureTooltip.setOffset([10, 0]), measureTooltipElement && (measureTooltipElement.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), (o = document.querySelector(".delete-icon")) == null || o.addEventListener("click", () => {
1601
1579
  reset();
1602
1580
  }), !lineLimitError && !squareLimitError)
1603
1581
  return a;
@@ -1624,7 +1602,18 @@ const endFn = (e) => {
1624
1602
  let t = "点击选择起点";
1625
1603
  sketch && (t = "单击继续,双击结束"), helpTooltipElement && (helpTooltipElement.innerHTML = t, helpTooltip.setPosition(e.coordinate), helpTooltipElement.classList.remove("hidden")), layerState === "drawn" && (((o = mapInstance.value) == null ? void 0 : o.getTargetElement()).style.cursor = "crosshair");
1626
1604
  }, init = () => {
1627
- mapInstance.value && (drawVector = new VectorLayer({
1605
+ mapInstance.value && (circleStyle = {
1606
+ image: new CircleStyle({
1607
+ radius: 5,
1608
+ fill: new Fill({
1609
+ color: "rgb(51,112,255, 1)"
1610
+ })
1611
+ }),
1612
+ geometry: function(e) {
1613
+ const t = e.getGeometry().getCoordinates();
1614
+ return new MultiPoint(t);
1615
+ }
1616
+ }, drawVector = new VectorLayer({
1628
1617
  source,
1629
1618
  style: new Style({
1630
1619
  stroke: new Stroke({
@@ -1654,18 +1643,20 @@ const endFn = (e) => {
1654
1643
  zoom: {},
1655
1644
  center: {},
1656
1645
  vehicleMode: {},
1657
- viewMode: {}
1646
+ viewMode: {},
1647
+ mmsi: {},
1648
+ shipData: {}
1658
1649
  },
1659
1650
  emits: ["zoomChanged", "extentChanged"],
1660
1651
  setup(e, { expose: t, emit: o }) {
1661
1652
  const n = ref(null), a = ref(null), r = ref(null), l = o, i = e, s = ref(i.zoom || mapZoom.default), u = ref(!1), c = ref(!0), m = ref(!0), d = ref(!1);
1662
1653
  let f;
1663
- ((h) => {
1664
- h[h.tiandituTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTile }) })] = "tiandituTile", h[h.tiandituTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTileMark }) })] = "tiandituTileMark", h[h.tiandituImgTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTile }), visible: !1 })] = "tiandituImgTile", h[h.tiandituImgTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTileMark }), visible: !1 })] = "tiandituImgTileMark", h[h.greenMark = new TileLayer({ source: new XYZ({ url: baseMap.greenTile }) })] = "greenMark";
1654
+ ((p) => {
1655
+ p[p.tiandituTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTile }) })] = "tiandituTile", p[p.tiandituTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTileMark }) })] = "tiandituTileMark", p[p.tiandituImgTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTile }), visible: !1 })] = "tiandituImgTile", p[p.tiandituImgTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTileMark }), visible: !1 })] = "tiandituImgTileMark", p[p.greenMark = new TileLayer({ source: new XYZ({ url: baseMap.greenTile }) })] = "greenMark";
1665
1656
  })(f || (f = {}));
1666
- const g = () => {
1667
- var y, v;
1668
- const h = {
1657
+ const w = () => {
1658
+ var S, g;
1659
+ const p = {
1669
1660
  projection: projection.mercator,
1670
1661
  // 地图投影坐标系
1671
1662
  zoom: i.zoom || (i.vehicleMode === "ship" ? mapZoom.default : mapZoom.truckDefault),
@@ -1676,7 +1667,8 @@ const endFn = (e) => {
1676
1667
  // 地图缩放最大级别
1677
1668
  center: lonLatToMercator(i.center || mapDefaultCenter),
1678
1669
  // 深圳坐标
1679
- constrainResolution: !0,
1670
+ constrainResolution: !1,
1671
+ // 禁用旋转
1680
1672
  multiWorld: !0
1681
1673
  };
1682
1674
  mapInstance.value = new Map$1({
@@ -1690,93 +1682,109 @@ const endFn = (e) => {
1690
1682
  f.tiandituImgTileMark,
1691
1683
  f.greenMark
1692
1684
  ],
1693
- view: new View(h)
1694
- }), (y = a.value) == null || y.setScaleLine(), (v = mapInstance.value) == null || v.on("moveend", L), p(i.vehicleMode === "ship"), T(i.vehicleMode === "ship" ? BaseMapType.satellite : BaseMapType.vector);
1685
+ view: new View(p)
1686
+ }), (S = a.value) == null || S.setScaleLine(), (g = mapInstance.value) == null || g.on("moveend", T), v(i.vehicleMode === "ship"), h(i.vehicleMode === "ship" ? BaseMapType.satellite : BaseMapType.vector), i.viewMode === "findShip" && i.mmsi && i.shipData && nextTick(() => {
1687
+ findShip(String(i.mmsi), i.shipData);
1688
+ });
1695
1689
  };
1696
1690
  onMounted(() => {
1697
- g();
1691
+ w();
1698
1692
  });
1699
- const p = (h) => {
1700
- var y;
1701
- (y = mapInstance.value) == null || y.getLayers().forEach((v) => {
1702
- v.ol_uid === f.greenMark.ol_uid && (v.setVisible(h), c.value = h);
1693
+ const v = (p) => {
1694
+ var S;
1695
+ (S = mapInstance.value) == null || S.getLayers().forEach((g) => {
1696
+ g.ol_uid === f.greenMark.ol_uid && (g.setVisible(p), c.value = p);
1703
1697
  });
1704
- }, T = (h) => {
1705
- var y;
1706
- console.log("mode", h), (y = mapInstance.value) == null || y.getLayers().forEach((v) => {
1707
- (v.ol_uid === f.tiandituTile.ol_uid || v.ol_uid === f.tiandituTileMark.ol_uid || v.ol_uid === f.tiandituImgTile.ol_uid || v.ol_uid === f.tiandituImgTileMark.ol_uid) && v.setVisible(!1), (h === BaseMapType.vector && v.ol_uid === f.tiandituTile.ol_uid || v.ol_uid === f.tiandituTileMark.ol_uid || h === BaseMapType.satellite && v.ol_uid === f.tiandituImgTile.ol_uid || v.ol_uid === f.tiandituImgTileMark.ol_uid) && (console.log(h, v.ol_uid), v.setVisible(!0));
1698
+ }, h = (p) => {
1699
+ var S;
1700
+ console.log("mode", p), (S = mapInstance.value) == null || S.getLayers().forEach((g) => {
1701
+ (g.ol_uid === f.tiandituTile.ol_uid || g.ol_uid === f.tiandituTileMark.ol_uid || g.ol_uid === f.tiandituImgTile.ol_uid || g.ol_uid === f.tiandituImgTileMark.ol_uid) && g.setVisible(!1), (p === BaseMapType.vector && (g.ol_uid === f.tiandituTile.ol_uid || g.ol_uid === f.tiandituTileMark.ol_uid) || p === BaseMapType.satellite && (g.ol_uid === f.tiandituImgTile.ol_uid || g.ol_uid === f.tiandituImgTileMark.ol_uid)) && (console.log(p, g.ol_uid), g.setVisible(!0));
1708
1702
  });
1709
- }, L = () => {
1710
- const h = mapInstance.value.getView(), y = h.getZoom();
1711
- y && E(y);
1712
- const v = h.calculateExtent(mapInstance.value.getSize());
1713
- v && y && b(v, y);
1714
- }, E = (h) => {
1715
- var C, V, w, S;
1716
- s.value = h;
1717
- const y = (C = mapInstance.value) == null ? void 0 : C.getLayers(), v = i.vehicleMode === "ship" ? y == null ? void 0 : y.getArray().find((M) => M.ol_uid === f.greenMark.ol_uid) : void 0;
1718
- !u.value && c.value && h < mapZoom.shipGreenDotMax ? (m.value = !0, v == null || v.setVisible(!0), (V = shipsLayer.value) == null || V.setVisible(!1), (w = largeAmountShipsLayer.value) == null || w.setVisible(!1)) : (m.value = !1, v == null || v.setVisible(!1), (S = largeAmountShipsLayer.value) == null || S.setVisible(!0)), l("zoomChanged", h);
1719
- }, b = (h, y) => {
1720
- const v = transform([h[0], h[1]], projection.mercator, projection.data), C = transform([h[2], h[3]], projection.mercator, projection.data);
1721
- l("extentChanged", { extent: [v, C], zoom: y });
1703
+ }, T = () => {
1704
+ const p = mapInstance.value.getView(), S = p.getZoom();
1705
+ S && E(S);
1706
+ const g = p.calculateExtent(mapInstance.value.getSize());
1707
+ g && S && C(g, S);
1708
+ }, E = (p) => {
1709
+ var I, V, y;
1710
+ s.value = p;
1711
+ const S = (I = mapInstance.value) == null ? void 0 : I.getLayers(), g = i.vehicleMode === "ship" ? S == null ? void 0 : S.getArray().find((k) => k.ol_uid === f.greenMark.ol_uid) : void 0;
1712
+ !u.value && c.value && p < mapZoom.shipGreenDotMax ? (m.value = !0, g == null || g.setVisible(!0), (V = shipsLayer.value) == null || V.setVisible(!1), (y = largeAmountShipsLayer.value) == null || y.setVisible(!1)) : (m.value = !1, g == null || g.setVisible(!1)), l("zoomChanged", p);
1713
+ }, C = (p, S) => {
1714
+ const g = transform([p[0], p[1]], projection.mercator, projection.data), I = transform([p[2], p[3]], projection.mercator, projection.data);
1715
+ l("extentChanged", { extent: [g, I], zoom: S });
1722
1716
  };
1723
1717
  return t({
1724
1718
  mapInstance,
1725
- initMap: g,
1719
+ initMap: w,
1726
1720
  renderTrucksMarker,
1727
1721
  renderShip: renderShips,
1728
- renderTrack: (h, y, v) => {
1729
- d.value = !0, u.value = !0, renderTrack(h, y, v, LENGTH_UNIT.NM);
1722
+ renderTrack: (p, S, g) => {
1723
+ var I, V;
1724
+ d.value = !0, u.value = !0, hiddenAllShips(), (V = (I = largeAmountShipsLayer.value) == null ? void 0 : I.getSource()) == null || V.clear(), renderTrack(p, S, g, LENGTH_UNIT.NM);
1730
1725
  },
1731
1726
  findTruck,
1732
1727
  removeTruckIcon,
1733
1728
  clearAllTruck,
1734
1729
  closeTrack: () => {
1735
- var h;
1736
- d.value = !1, (h = shipTrackVectorLayer.value) == null || h.setVisible(!1);
1730
+ var p, S;
1731
+ d.value = !1, (p = shipTrackVectorLayer.value) == null || p.setVisible(!1), (S = selectShipsLayer.value) == null || S.setVisible(!0), selectSingleShipData.value && setVisibleFeatureById(selectSingleShipData.value.id, !0);
1737
1732
  },
1738
1733
  closeTruckTrack: () => {
1739
- var h;
1740
- d.value = !1, (h = shipTrackVectorLayer.value) == null || h.setVisible(!1);
1734
+ var p, S;
1735
+ d.value = !1, (p = shipTrackVectorLayer.value) == null || p.setVisible(!1), (S = selectShipsLayer.value) == null || S.setVisible(!0);
1741
1736
  },
1742
1737
  resetTrackView,
1743
1738
  playTrack,
1744
1739
  clearSelectFeature,
1745
1740
  findShip,
1746
- focusShip: (h, y) => {
1747
- var v, C;
1748
- (v = shipsLayer.value) == null || v.setVisible(!1), (C = largeAmountShipsLayer.value) == null || C.setVisible(!1), findShip(h, y);
1741
+ focusShip: (p, S, g = !0) => {
1742
+ var I, V;
1743
+ (I = shipsLayer.value) == null || I.setVisible(g), (V = largeAmountShipsLayer.value) == null || V.setVisible(!1), findShip(p, S);
1749
1744
  },
1750
1745
  showTracks,
1751
1746
  removeAllTrackLayer,
1752
1747
  switchFilterItem,
1753
1748
  rerenderShip,
1754
- switchGreenDot: () => p(!1),
1749
+ switchGreenDot: () => v(!1),
1755
1750
  zoomTruckIcon,
1756
- renderTruckTrack: (h, y, v) => {
1757
- d.value = !0, renderTrack(h, y, v, LENGTH_UNIT.KM, "truck");
1751
+ renderTruckTrack: (p, S, g) => {
1752
+ d.value = !0, renderTrack(p, S, g, LENGTH_UNIT.KM, "truck");
1758
1753
  },
1754
+ removerLayer: removeShipTrackLineFeatureByIndex,
1759
1755
  renderMarker,
1760
1756
  setMarkerPosition,
1757
+ getZoomAndCenter: () => {
1758
+ var V;
1759
+ const p = (V = mapInstance.value) == null ? void 0 : V.getView();
1760
+ if (!p) return null;
1761
+ const S = parseInt(String(p.getZoom())), { lon: g, lat: I } = mercatorToLonLat(p.getCenter());
1762
+ return { zoom: S, center: [g, I] };
1763
+ },
1761
1764
  drawPolygonTool
1762
- }), (h, y) => (openBlock(), createElementBlock("div", {
1765
+ }), (p, S) => (openBlock(), createElementBlock("div", {
1763
1766
  class: "map-page map-container",
1764
1767
  ref_key: "pageRef",
1765
1768
  ref: n
1766
1769
  }, [
1767
- y[0] || (y[0] = createElementVNode("div", {
1770
+ S[0] || (S[0] = createElementVNode("div", {
1768
1771
  id: "map",
1769
1772
  class: "map"
1770
1773
  }, null, -1)),
1771
1774
  createVNode(ToolPanel, {
1772
- "vehicle-mode": h.vehicleMode,
1773
- "view-mode": h.viewMode,
1775
+ "vehicle-mode": p.vehicleMode,
1776
+ "view-mode": p.viewMode,
1774
1777
  "disable-green-dot": u.value,
1775
1778
  "show-track-layer": d.value,
1776
- onSwitchGreenDot: p,
1777
- onSwitchMapTile: T
1778
- }, null, 8, ["vehicle-mode", "view-mode", "disable-green-dot", "show-track-layer"]),
1779
- h.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1779
+ onSwitchGreenDot: v,
1780
+ onSwitchMapTile: h
1781
+ }, {
1782
+ toolPanel: withCtx(() => [
1783
+ renderSlot(p.$slots, "toolPanel", {}, void 0, !0)
1784
+ ]),
1785
+ _: 3
1786
+ }, 8, ["vehicle-mode", "view-mode", "disable-green-dot", "show-track-layer"]),
1787
+ p.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1780
1788
  createVNode(ScaleLine, {
1781
1789
  ref_key: "scaleLineControl",
1782
1790
  ref: a
@@ -1784,13 +1792,12 @@ const endFn = (e) => {
1784
1792
  createVNode(ZoomControl, {
1785
1793
  ref_key: "zoomControl",
1786
1794
  ref: r
1787
- }, null, 512),
1788
- createVNode(Fullscreen, { page: n.value }, null, 8, ["page"])
1795
+ }, null, 512)
1789
1796
  ], 64)) : createCommentVNode("", !0),
1790
1797
  createVNode(Copyright)
1791
1798
  ], 512));
1792
1799
  }
1793
- }), Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-51c9ddf4"]]), ZhMap = withInstall(Map);
1800
+ }), Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bfb8b74c"]]), ZhMap = withInstall(Map);
1794
1801
  export {
1795
1802
  ZhMap as Z
1796
1803
  };