zhihao-ui 1.2.9 → 1.2.11

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.
@@ -1,9 +1,9 @@
1
- import { defineComponent as B, useModel as H, ref as E, openBlock as s, createBlock as c, unref as o, withCtx as p, createVNode as g, createElementBlock as f, Fragment as N, renderList as Z, normalizeClass as D, toDisplayString as m, createCommentVNode as x, createElementVNode as v, createTextVNode as w, mergeModels as z } from "vue";
1
+ import { defineComponent as B, useModel as H, ref as E, openBlock as s, createBlock as c, unref as o, withCtx as p, createVNode as g, createElementBlock as f, Fragment as N, renderList as Z, normalizeClass as D, toDisplayString as v, createCommentVNode as x, createElementVNode as y, createTextVNode as w, mergeModels as z } from "vue";
2
2
  import { D as X } from "./DatePicker-CWQoV03Q.js";
3
3
  import { d as _, e as V, f as j, g as K, i as k, j as C, k as P, l as T, E as L } from "./vendor-BY-fHNA3.js";
4
4
  import { _ as G } from "./Button-DBbUF88w.js";
5
5
  import { w as J } from "./utils-DZ8-2Fg2.js";
6
- var y = /* @__PURE__ */ ((u) => (u.AUTOCOMPLETE = "autocomplete", u.FORMAT = "format", u.TEXT = "text", u))(y || {});
6
+ var m = /* @__PURE__ */ ((u) => (u.AUTOCOMPLETE = "autocomplete", u.FORMAT = "format", u.TEXT = "text", u))(m || {});
7
7
  const Q = { key: 0 }, W = {
8
8
  key: 1,
9
9
  class: "col-edit-header"
@@ -29,7 +29,7 @@ const Q = { key: 0 }, W = {
29
29
  return;
30
30
  }
31
31
  n.value.push({});
32
- }, U = () => {
32
+ }, A = () => {
33
33
  if (i.value.filter((e) => e.isAdd).length >= h.maxColLength) {
34
34
  _({
35
35
  message: `最多添加${h.maxColLength}列`,
@@ -46,20 +46,20 @@ const Q = { key: 0 }, W = {
46
46
  maxlength: 15,
47
47
  headerMaxlength: 15
48
48
  });
49
- }, A = (t, l) => {
50
- i.value.splice(t, 1), n.value.forEach((e) => {
49
+ }, U = (a, l) => {
50
+ i.value.splice(a, 1), n.value.forEach((e) => {
51
51
  delete e[l.prop];
52
52
  });
53
- }, F = (t) => {
54
- n.value.splice(t, 1);
55
- }, S = (t, l, e) => {
53
+ }, F = (a) => {
54
+ n.value.splice(a, 1);
55
+ }, S = (a, l, e) => {
56
56
  l(
57
- e.completeList.filter((r) => r.includes(t)).map((r) => ({ value: r }))
57
+ e.completeList.filter((r) => r.includes(a)).map((r) => ({ value: r }))
58
58
  );
59
- }, q = (t) => [
59
+ }, O = (a) => [
60
60
  {
61
61
  validator: (l, e, r) => {
62
- if (!i.value[t].label) {
62
+ if (!i.value[a].label) {
63
63
  r(new Error("请输入表头"));
64
64
  return;
65
65
  }
@@ -68,45 +68,45 @@ const Q = { key: 0 }, W = {
68
68
  message: "请输入表头",
69
69
  trigger: ["blur", "change"]
70
70
  }
71
- ], I = (t) => {
71
+ ], q = (a) => {
72
72
  const l = [];
73
- return t.required && l.push({
73
+ return a.required && l.push({
74
74
  required: !0,
75
- message: "请输入" + t.label,
75
+ message: "请输入" + a.label,
76
76
  trigger: "blur"
77
- }), t.varidate && l.push({
78
- validator: (e, r, a) => {
79
- const d = t.varidate(r);
80
- d !== !0 ? a(new Error(d)) : a();
77
+ }), a.varidate && l.push({
78
+ validator: (e, r, t) => {
79
+ const d = a.varidate(r);
80
+ d !== !0 ? t(new Error(d)) : t();
81
81
  },
82
82
  trigger: "blur"
83
83
  }), l;
84
84
  }, b = E();
85
85
  return R({
86
86
  /** 初始化数据 */
87
- initData: (t, l) => {
88
- console.log("initData", t, l), t = V(t) || [], t.length === 0 && t.push({}), l = [...l];
89
- for (const e in t[0])
87
+ initData: (a, l) => {
88
+ console.log("initData", a, l), a = V(a) || [], a.length === 0 && a.push({}), l = [...l];
89
+ for (const e in a[0])
90
90
  if (!l.some(
91
91
  (r) => r.prop === e
92
92
  )) {
93
- const r = Date.now() + e, a = e.split(M);
94
- if (a.length !== 2) {
93
+ const r = Date.now() + e, t = e.split(M);
94
+ if (t.length !== 2) {
95
95
  console.log("keySplit 失败", e);
96
96
  continue;
97
97
  }
98
- const d = Number(a[1]);
98
+ const d = Number(t[1]);
99
99
  l[d] = {
100
100
  prop: e,
101
101
  isEditHeader: !0,
102
- label: a[0],
102
+ label: t[0],
103
103
  key: r,
104
104
  isAdd: !0,
105
105
  maxlength: 15,
106
106
  headerMaxlength: 15
107
107
  };
108
108
  }
109
- n.value = t, i.value = l;
109
+ n.value = a, i.value = l;
110
110
  },
111
111
  /** 获取数据 */
112
112
  getData: async () => {
@@ -122,33 +122,33 @@ const Q = { key: 0 }, W = {
122
122
  return;
123
123
  }
124
124
  }
125
- const t = V(n.value);
126
- for (const l in t) {
127
- const e = t[l];
125
+ const a = V(n.value);
126
+ for (const l in a) {
127
+ const e = a[l];
128
128
  for (const r in i.value) {
129
- const a = i.value[r];
130
- if (a.isSameData && l !== "0" && (e[a.prop] = t[0][a.prop]), a.varidate && !a.varidate(e[a.prop]))
129
+ const t = i.value[r];
130
+ if (t.isSameData && l !== "0" && (e[t.prop] = a[0][t.prop]), t.varidate && !t.varidate(e[t.prop]))
131
131
  return;
132
- if (a.isAdd) {
133
- const d = a.label + M + r;
134
- e[d] = e[a.prop], delete e[a.prop];
132
+ if (t.isAdd) {
133
+ const d = t.label + M + r;
134
+ e[d] = e[t.prop], delete e[t.prop];
135
135
  }
136
- a.formatter && (e[a.prop] = a.formatter(e));
136
+ t.formatter && t.type === m.FORMAT && (e[t.prop] = t.formatter(e));
137
137
  }
138
138
  }
139
- return console.log("DiyDataTable 获取数据", t, i.value), {
140
- data: t,
139
+ return console.log("DiyDataTable 获取数据", a, i.value), {
140
+ data: a,
141
141
  columns: i.value
142
142
  };
143
143
  },
144
144
  /** 更新列配置数据 */
145
- updateColumn: (t, l) => {
146
- const e = i.value[t].prop;
147
- if (i.value[t] = l, e !== l.prop)
145
+ updateColumn: (a, l) => {
146
+ const e = i.value[a].prop;
147
+ if (i.value[a] = l, e !== l.prop)
148
148
  for (const r of n.value)
149
149
  r[l.prop] = r[e], delete r[e];
150
150
  }
151
- }), (t, l) => (s(), c(o(j), {
151
+ }), (a, l) => (s(), c(o(j), {
152
152
  class: "diy-data-table",
153
153
  model: u.rawData,
154
154
  ref_key: "formRef",
@@ -171,15 +171,15 @@ const Q = { key: 0 }, W = {
171
171
  fixed: e.fixed
172
172
  }, {
173
173
  header: p(() => [
174
- t.isEdit ? e.isEditHeader ? (s(), f("div", W, [
174
+ a.isEdit ? e.isEditHeader ? (s(), f("div", W, [
175
175
  g(o(C), {
176
176
  prop: `columns.${r}`,
177
- rules: q(r)
177
+ rules: O(r)
178
178
  }, {
179
179
  default: p(() => [
180
180
  g(o(T), {
181
181
  modelValue: e.label,
182
- "onUpdate:modelValue": (a) => e.label = a,
182
+ "onUpdate:modelValue": (t) => e.label = t,
183
183
  maxlength: e.headerMaxlength || 20,
184
184
  placeholder: "请输入表头"
185
185
  }, null, 8, ["modelValue", "onUpdate:modelValue", "maxlength"])
@@ -189,32 +189,32 @@ const Q = { key: 0 }, W = {
189
189
  e.isAdd ? (s(), f("i", {
190
190
  key: 0,
191
191
  class: "iconfont icon-close",
192
- onClick: (a) => A(r, e)
192
+ onClick: (t) => U(r, e)
193
193
  }, null, 8, Y)) : x("", !0)
194
194
  ])) : (s(), f("div", {
195
195
  key: 2,
196
196
  class: D({ "is-required-label": e.required })
197
- }, m(e.label), 3)) : (s(), f("div", Q, m(e.label), 1))
197
+ }, v(e.label), 3)) : (s(), f("div", Q, v(e.label), 1))
198
198
  ]),
199
- default: p((a) => [
200
- h.isEdit && (!e.isSameData || a.$index === 0) && e.type !== o(y).TEXT ? (s(), c(o(C), {
199
+ default: p((t) => [
200
+ h.isEdit && (!e.isSameData || t.$index === 0) && e.type !== o(m).TEXT ? (s(), c(o(C), {
201
201
  key: 0,
202
- prop: `${a.$index}.${e.prop}`,
203
- rules: I(e),
202
+ prop: `${t.$index}.${e.prop}`,
203
+ rules: q(e),
204
204
  class: D(["col-edit-container", { "close-padding": e.isAdd }])
205
205
  }, {
206
206
  default: p(() => [
207
- e.type === o(y).FORMAT && e.formatter ? (s(), f("div", ee, m(e.formatter(a.row)), 1)) : e.type === o(y).AUTOCOMPLETE ? (s(), c(o(P), {
207
+ e.type === o(m).FORMAT && e.formatter ? (s(), f("div", ee, v(e.formatter(t.row)), 1)) : e.type === o(m).AUTOCOMPLETE ? (s(), c(o(P), {
208
208
  key: 1,
209
- modelValue: a.row[e.prop],
210
- "onUpdate:modelValue": (d) => a.row[e.prop] = d,
209
+ modelValue: t.row[e.prop],
210
+ "onUpdate:modelValue": (d) => t.row[e.prop] = d,
211
211
  placeholder: e.placeholder || "请输入",
212
- "fetch-suggestions": (d, O) => S(d, O, e),
212
+ "fetch-suggestions": (d, I) => S(d, I, e),
213
213
  maxlength: e.maxlength || 20
214
214
  }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "fetch-suggestions", "maxlength"])) : (s(), c(o(T), {
215
215
  key: 2,
216
- modelValue: a.row[e.prop],
217
- "onUpdate:modelValue": (d) => a.row[e.prop] = d,
216
+ modelValue: t.row[e.prop],
217
+ "onUpdate:modelValue": (d) => t.row[e.prop] = d,
218
218
  placeholder: e.placeholder || "请输入",
219
219
  formatter: e.formatter,
220
220
  parser: e.parser,
@@ -222,7 +222,7 @@ const Q = { key: 0 }, W = {
222
222
  }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "formatter", "parser", "maxlength"]))
223
223
  ]),
224
224
  _: 2
225
- }, 1032, ["prop", "rules", "class"])) : (s(), f("div", te, m((e.isSameData ? n.value[0][e.prop] : a.row[e.prop]) || o(X)), 1))
225
+ }, 1032, ["prop", "rules", "class"])) : (s(), f("div", te, v((e.isSameData ? n.value[0][e.prop] : t.row[e.prop]) || o(X)), 1))
226
226
  ]),
227
227
  _: 2
228
228
  }, 1032, ["prop", "label", "width", "fixed"]))), 128)),
@@ -232,14 +232,14 @@ const Q = { key: 0 }, W = {
232
232
  fixed: "right"
233
233
  }, {
234
234
  header: p(() => [
235
- v("div", ae, [
235
+ y("div", ae, [
236
236
  g(o(L), {
237
237
  type: "primary",
238
238
  link: "",
239
239
  onClick: $
240
240
  }, {
241
241
  default: p(() => l[0] || (l[0] = [
242
- v("i", { class: "iconfont icon-Frame1" }, null, -1),
242
+ y("i", { class: "iconfont icon-Frame1" }, null, -1),
243
243
  w("增行")
244
244
  ])),
245
245
  _: 1
@@ -247,10 +247,10 @@ const Q = { key: 0 }, W = {
247
247
  g(o(L), {
248
248
  type: "primary",
249
249
  link: "",
250
- onClick: U
250
+ onClick: A
251
251
  }, {
252
252
  default: p(() => l[1] || (l[1] = [
253
- v("i", { class: "iconfont icon-Frame-11" }, null, -1),
253
+ y("i", { class: "iconfont icon-Frame-11" }, null, -1),
254
254
  w("增列")
255
255
  ])),
256
256
  _: 1
@@ -258,7 +258,7 @@ const Q = { key: 0 }, W = {
258
258
  ])
259
259
  ]),
260
260
  default: p(({ $index: e }) => [
261
- v("div", le, [
261
+ y("div", le, [
262
262
  n.value.length > 1 ? (s(), f("i", {
263
263
  key: 0,
264
264
  class: "iconfont icon-close",
@@ -275,8 +275,8 @@ const Q = { key: 0 }, W = {
275
275
  _: 1
276
276
  }, 8, ["model"]));
277
277
  }
278
- }), ie = /* @__PURE__ */ G(oe, [["__scopeId", "data-v-345db26b"]]), fe = J(ie);
278
+ }), ie = /* @__PURE__ */ G(oe, [["__scopeId", "data-v-bf341535"]]), fe = J(ie);
279
279
  export {
280
- y as D,
280
+ m as D,
281
281
  fe as Z
282
282
  };
@@ -16,7 +16,7 @@ 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, s, i, d, u, p, c, f, g, y, k, L, E, m, v, h, I) {
19
+ constructor(t, o, n, a, r, l, s, i, d, u, p, c, f, v, y, k, L, E, m, g, h, I) {
20
20
  T(this, "id");
21
21
  // mmsi
22
22
  T(this, "mmsi");
@@ -56,7 +56,7 @@ class ShipMapData {
56
56
  T(this, "existDevice");
57
57
  T(this, "existMobile");
58
58
  T(this, "existWaterGauge");
59
- this.id = t, this.mmsi = o, this.fill = n, this.shipType = a, this.name = r, this.length = l, this.breadth = s, this.lon = i, this.lat = d, this.createdAt = u, this.speed = p, this.from = c, this.sailStatus = f, this.hdg = g, this.cog = y, this.posType = k, this.type = L, this.angle = E, this.leftIconColor = m, this.existDevice = v, this.existMobile = h, this.existWaterGauge = I;
59
+ this.id = t, this.mmsi = o, this.fill = n, this.shipType = a, this.name = r, this.length = l, this.breadth = s, this.lon = i, this.lat = d, this.createdAt = u, this.speed = p, this.from = c, this.sailStatus = f, this.hdg = v, this.cog = y, this.posType = k, this.type = L, this.angle = E, this.leftIconColor = m, this.existDevice = g, this.existMobile = h, this.existWaterGauge = I;
60
60
  }
61
61
  }
62
62
  const formatLength = function(e, t) {
@@ -135,7 +135,7 @@ const labels = ref([]), _hoisted_1$4 = {
135
135
  setup(e, { expose: t, emit: o }) {
136
136
  const n = o, a = useModel(e, "visible"), r = ref(LENGTH_UNIT.NM), l = ref([]), s = ref(!1), i = new VectorSource();
137
137
  let d, u, p, c, f;
138
- const g = new VectorLayer({
138
+ const v = new VectorLayer({
139
139
  source: i,
140
140
  style: {
141
141
  "fill-color": "rgba(255, 255, 255, 0.2)",
@@ -180,11 +180,11 @@ const labels = ref([]), _hoisted_1$4 = {
180
180
  l.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((_) => {
181
181
  var M;
182
182
  (M = _ == null ? void 0 : _.parentNode) == null || M.removeChild(_);
183
- }), i.clear(), (S = mapInstance.value) == null || S.removeInteraction(L), (w = mapInstance.value) == null || w.removeLayer(g), u != null && u.parentNode && u.parentNode.removeChild(u);
183
+ }), i.clear(), (S = mapInstance.value) == null || S.removeInteraction(L), (w = mapInstance.value) == null || w.removeLayer(v), u != null && u.parentNode && u.parentNode.removeChild(u);
184
184
  }
185
- function v() {
185
+ function g() {
186
186
  var w, _;
187
- m(), (w = mapInstance.value) == null || w.addLayer(g), L = new Draw({
187
+ m(), (w = mapInstance.value) == null || w.addLayer(v), L = new Draw({
188
188
  source: i,
189
189
  type: "LineString",
190
190
  style: function() {
@@ -234,9 +234,9 @@ const labels = ref([]), _hoisted_1$4 = {
234
234
  n("close");
235
235
  };
236
236
  return watch(() => a, () => {
237
- a && !s.value && (k(), v());
237
+ a && !s.value && (k(), g());
238
238
  }, { deep: !0, immediate: !0 }), t({
239
- addInteraction: v,
239
+ addInteraction: g,
240
240
  removeInteraction: m
241
241
  }), (S, w) => {
242
242
  const _ = resolveComponent("el-select");
@@ -613,12 +613,12 @@ function drawLabelBody(e, t, o) {
613
613
  e.save(), n && (e.font = n);
614
614
  let p = e.measureText(s).width + 2 * a;
615
615
  (i || d) && (p += r + 4 * a), e.restore();
616
- let c, f = -1, g = r + 3 * a;
617
- if (f = 0, c = calculateBounds(l, f, p, g, u), c && f > -1) {
616
+ let c, f = -1, v = r + 3 * a;
617
+ if (f = 0, c = calculateBounds(l, f, p, v, u), c && f > -1) {
618
618
  let y = getBottomLeftPoint(c), k = getTopRighttPoint(c);
619
619
  return {
620
620
  center: l,
621
- x: calculateAnchorPoint(l, f, p, g, u),
621
+ x: calculateAnchorPoint(l, f, p, v, u),
622
622
  l: k,
623
623
  r: y,
624
624
  bounds: c,
@@ -641,8 +641,8 @@ const drawText = (e, t) => {
641
641
  e.font = "12px map-iconfont", e.fillStyle = "#3370ff";
642
642
  let u = e.measureText(n).width + 6;
643
643
  l.forEach((p, c) => {
644
- let f = getIconFont(p), g = 20 * c;
645
- e.fillText(f, i + u + g, d);
644
+ let f = getIconFont(p), v = 20 * c;
645
+ e.fillText(f, i + u + v, d);
646
646
  });
647
647
  }
648
648
  e.font = s || labelFont, e.fillStyle = a, e.fillText(n, i, d), e.restore();
@@ -677,7 +677,7 @@ const drawText = (e, t) => {
677
677
  }, u = drawLabelBody(e, labels.value, d);
678
678
  if (u) {
679
679
  const { x: p, bounds: c, l: f } = u;
680
- let g = [getTopLeftPoint(c), getBottomLeftPoint(c), getBottomRightPoint(c), getTopRighttPoint(c)];
680
+ let v = [getTopLeftPoint(c), getBottomLeftPoint(c), getBottomRightPoint(c), getTopRighttPoint(c)];
681
681
  labels.value.push(u), drawPolygon(e, {
682
682
  points: [o, p],
683
683
  strokeColor: a,
@@ -689,9 +689,9 @@ const drawText = (e, t) => {
689
689
  scale: void 0,
690
690
  globalAlpha: labelAlpha
691
691
  }), i != null && i.length && i.forEach(() => {
692
- g[1][0] += 20, g[2][0] += 20;
692
+ v[1][0] += 20, v[2][0] += 20;
693
693
  }), drawPolygon(e, {
694
- points: g,
694
+ points: v,
695
695
  strokeColor: a,
696
696
  fillColor: l,
697
697
  shouldClosePath: !0
@@ -729,11 +729,11 @@ const setTruckStyle = (e, t, o, n) => new Style({
729
729
  i = i / s - 20, d = d / s;
730
730
  const u = i - 70, p = d - 68;
731
731
  let c = 180;
732
- const f = 56, g = "#FFFFFF";
732
+ const f = 56, v = "#FFFFFF";
733
733
  let y = 176;
734
734
  const k = 52;
735
735
  let L = "#164AFF", E = "#FFFFFF";
736
- o === CAR_COLOR.YELLOW ? (y = 176, L = "#FFC81E", E = "rgba(0,0,0,0.88)") : o === CAR_COLOR.Y_GREEN && (c = 200, y = 196, L = "#8FED7C", E = "rgba(0,0,0,0.88)"), n != null && n.length && (c += n.length * 56), fillRectRadius(l, u, p, c, f, g), fillRectRadius(l, u + 2, p + 2, y, k, L), o === CAR_COLOR.Y_GREEN && fillRectRadius(l, u + 2, p + 2, 68, k, "#FFC81E"), l.save(), l.restore(), l.fillStyle = E, l.font = "bold 28px Arial", l.textAlign = "left", l.textBaseline = "middle";
736
+ o === CAR_COLOR.YELLOW ? (y = 176, L = "#FFC81E", E = "rgba(0,0,0,0.88)") : o === CAR_COLOR.Y_GREEN && (c = 200, y = 196, L = "#8FED7C", E = "rgba(0,0,0,0.88)"), n != null && n.length && (c += n.length * 56), fillRectRadius(l, u, p, c, f, v), fillRectRadius(l, u + 2, p + 2, y, k, L), o === CAR_COLOR.Y_GREEN && fillRectRadius(l, u + 2, p + 2, 68, k, "#FFC81E"), l.save(), l.restore(), l.fillStyle = E, l.font = "bold 28px Arial", l.textAlign = "left", l.textBaseline = "middle";
737
737
  const m = `${t.slice(0, 2) + " · " + t.slice(2)}`;
738
738
  if (l.fillText(m, u + 12, p + 32), l.save(), l.restore(), n != null && n.length) {
739
739
  const h = l.measureText(m).width + 12;
@@ -742,8 +742,8 @@ const setTruckStyle = (e, t, o, n) => new Style({
742
742
  C === DEVICE_TYPE.CAMERA && (l.drawImage(cameraImage, i - 54 + h + I * 56, d - 64, 50, 50), ++I), C === DEVICE_TYPE.LOAD && (l.drawImage(loadImage, i - 54 + h + I * 56, d - 64, 50, 50), ++I);
743
743
  });
744
744
  }
745
- const v = dotImage;
746
- l.drawImage(v, i + c / 2 - 90, d, 50 / s, 50 / s), l.restore();
745
+ const g = dotImage;
746
+ l.drawImage(g, i + c / 2 - 90, d, 50 / s, 50 / s), l.restore();
747
747
  }
748
748
  });
749
749
  ref([]);
@@ -1150,8 +1150,8 @@ const renderShips = (e) => {
1150
1150
  offsetY: -10
1151
1151
  }),
1152
1152
  zIndex: 99
1153
- }), g = [];
1154
- s.state === "0" ? ((u = f.getText()) == null || u.setFill(new Fill({ color: stopColor })), g.push(r)) : ((p = f.getText()) == null || p.setFill(new Fill({ color: slowColor })), g.push(l)), g.push(f), c.setStyle(g), trackLineVectorSource.value.addFeature(c);
1153
+ }), v = [];
1154
+ s.state === "0" ? ((u = f.getText()) == null || u.setFill(new Fill({ color: stopColor })), v.push(r)) : ((p = f.getText()) == null || p.setFill(new Fill({ color: slowColor })), v.push(l)), v.push(f), c.setStyle(v), trackLineVectorSource.value.addFeature(c);
1155
1155
  }
1156
1156
  }), renderArrow(n, e), renderIconPoint();
1157
1157
  }, renderArrow = (e, t) => {
@@ -1268,17 +1268,17 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship")
1268
1268
  // 设置不阻拦事件
1269
1269
  });
1270
1270
  if (a) {
1271
- let c = !1, f = [0, 0], g = [0, 0];
1271
+ let c = !1, f = [0, 0], v = [0, 0];
1272
1272
  r.addEventListener("mousedown", function(y) {
1273
1273
  var k;
1274
- c = !0, y.clientX, y.clientY, f = (k = mapInstance.value) == null ? void 0 : k.getCoordinateFromPixel([y.clientX - 200, y.clientY - 200]), g = [
1274
+ c = !0, y.clientX, y.clientY, f = (k = mapInstance.value) == null ? void 0 : k.getCoordinateFromPixel([y.clientX - 200, y.clientY - 200]), v = [
1275
1275
  y.clientX - r.getBoundingClientRect().left + 160,
1276
1276
  y.clientY - r.getBoundingClientRect().top + 84
1277
1277
  ], y.preventDefault();
1278
1278
  }), document.addEventListener("mousemove", function(y) {
1279
1279
  var k;
1280
1280
  if (c) {
1281
- let L = (k = mapInstance.value) == null ? void 0 : k.getCoordinateFromPixel([y.clientX - g[0], y.clientY - g[1]]), E = L[0] - f[0], m = L[1] - f[1];
1281
+ let L = (k = mapInstance.value) == null ? void 0 : k.getCoordinateFromPixel([y.clientX - v[0], y.clientY - v[1]]), E = L[0] - f[0], m = L[1] - f[1];
1282
1282
  l.setPosition([f[0] + E, f[1] + m]);
1283
1283
  }
1284
1284
  }), document.addEventListener("mouseup", function() {
@@ -1372,8 +1372,8 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship")
1372
1372
  });
1373
1373
  p.on("translating", function(c) {
1374
1374
  var y;
1375
- const f = c.features.item(0).getGeometry().getCoordinates(), g = toLonLat(f);
1376
- markerPosition.value = `${g[0].toFixed(6)}, ${g[1].toFixed(6)}`, (y = marker.value) == null || y.setStyle(createIconStyle(markerPosition.value));
1375
+ const f = c.features.item(0).getGeometry().getCoordinates(), v = toLonLat(f);
1376
+ markerPosition.value = `${v[0].toFixed(6)}, ${v[1].toFixed(6)}`, (y = marker.value) == null || y.setStyle(createIconStyle(markerPosition.value));
1377
1377
  }), mapInstance.value.addInteraction(p);
1378
1378
  }
1379
1379
  const d = new Point([n, a]);
@@ -1400,18 +1400,8 @@ const circleStyle = {
1400
1400
  const t = e.getGeometry().getCoordinates();
1401
1401
  return new MultiPoint(t);
1402
1402
  }
1403
- }, drawVector = new VectorLayer({
1404
- source,
1405
- style: [
1406
- {
1407
- "stroke-color": "rgba(255, 255, 255, 1)",
1408
- "stroke-width": 2,
1409
- "fill-color": "rgba(255, 255, 255, 0.3)"
1410
- },
1411
- new Style(circleStyle)
1412
- ]
1413
- });
1414
- let draw;
1403
+ };
1404
+ let drawVector, draw;
1415
1405
  function createMeasureTooltip() {
1416
1406
  var e;
1417
1407
  measureTooltipElement != null && measureTooltipElement.parentNode && measureTooltipElement.parentNode.removeChild(measureTooltipElement), measureTooltipElement = document.createElement("div"), measureTooltipElement.className = "ol-tooltip ol-tooltip-draw-polygon", measureTooltip = new Overlay({
@@ -1443,7 +1433,7 @@ const validateSquareLimit = (e) => {
1443
1433
  let storeFeature;
1444
1434
  function addInteraction(e) {
1445
1435
  var o, n;
1446
- mapInstance.value || init(), drawnState = "undrawn", layerState = "drawn", (o = mapInstance.value) == null || o.addLayer(drawVector), draw = new Draw({
1436
+ drawVector || init(), drawnState = "undrawn", layerState = "drawn", (o = mapInstance.value) == null || o.addLayer(drawVector), draw = new Draw({
1447
1437
  type: "Polygon",
1448
1438
  // source: drawVector.getSource(),
1449
1439
  source,
@@ -1530,7 +1520,17 @@ const endFn = (e) => {
1530
1520
  let t = "点击选择起点";
1531
1521
  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");
1532
1522
  }, init = () => {
1533
- mapInstance.value && (mapInstance.value.on("pointermove", pointerMoveHandler), mapInstance.value.getViewport().addEventListener("mouseout", function() {
1523
+ mapInstance.value && (drawVector = new VectorLayer({
1524
+ source,
1525
+ style: [
1526
+ {
1527
+ "stroke-color": "rgba(255, 255, 255, 1)",
1528
+ "stroke-width": 2,
1529
+ "fill-color": "rgba(255, 255, 255, 0.3)"
1530
+ },
1531
+ new Style(circleStyle)
1532
+ ]
1533
+ }), mapInstance.value.on("pointermove", pointerMoveHandler), mapInstance.value.getViewport().addEventListener("mouseout", function() {
1534
1534
  var e;
1535
1535
  (e = helpTooltipElement == null ? void 0 : helpTooltipElement.classList) == null || e.add("hidden");
1536
1536
  }), mapInstance.value.on("dblclick", function(e) {
@@ -1558,7 +1558,7 @@ const endFn = (e) => {
1558
1558
  m[m.tiandituTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTile }) })] = "tiandituTile", m[m.tiandituTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTileMark }) })] = "tiandituTileMark", m[m.tiandituImgTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTile }), visible: !1 })] = "tiandituImgTile", m[m.tiandituImgTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTileMark }), visible: !1 })] = "tiandituImgTileMark", m[m.greenMark = new TileLayer({ source: new XYZ({ url: baseMap.greenTile }) })] = "greenMark";
1559
1559
  })(c || (c = {}));
1560
1560
  const f = () => {
1561
- var v, h;
1561
+ var g, h;
1562
1562
  const m = {
1563
1563
  projection: projection.mercator,
1564
1564
  // 地图投影坐标系
@@ -1585,34 +1585,34 @@ const endFn = (e) => {
1585
1585
  c.greenMark
1586
1586
  ],
1587
1587
  view: new View(m)
1588
- }), (v = a.value) == null || v.setScaleLine(), (h = mapInstance.value) == null || h.on("moveend", k), g(s.vehicleMode === "ship"), y(s.vehicleMode === "ship" ? BaseMapType.satellite : BaseMapType.vector);
1588
+ }), (g = a.value) == null || g.setScaleLine(), (h = mapInstance.value) == null || h.on("moveend", k), v(s.vehicleMode === "ship"), y(s.vehicleMode === "ship" ? BaseMapType.satellite : BaseMapType.vector);
1589
1589
  };
1590
1590
  onMounted(() => {
1591
1591
  f();
1592
1592
  });
1593
- const g = (m) => {
1594
- var v;
1595
- (v = mapInstance.value) == null || v.getLayers().forEach((h) => {
1593
+ const v = (m) => {
1594
+ var g;
1595
+ (g = mapInstance.value) == null || g.getLayers().forEach((h) => {
1596
1596
  h.ol_uid === c.greenMark.ol_uid && (h.setVisible(m), u.value = m);
1597
1597
  });
1598
1598
  }, y = (m) => {
1599
- var v;
1600
- console.log("mode", m), (v = mapInstance.value) == null || v.getLayers().forEach((h) => {
1599
+ var g;
1600
+ console.log("mode", m), (g = mapInstance.value) == null || g.getLayers().forEach((h) => {
1601
1601
  (h.ol_uid === c.tiandituTile.ol_uid || h.ol_uid === c.tiandituTileMark.ol_uid || h.ol_uid === c.tiandituImgTile.ol_uid || h.ol_uid === c.tiandituImgTileMark.ol_uid) && h.setVisible(!1), (m === BaseMapType.vector && h.ol_uid === c.tiandituTile.ol_uid || h.ol_uid === c.tiandituTileMark.ol_uid || m === BaseMapType.satellite && h.ol_uid === c.tiandituImgTile.ol_uid || h.ol_uid === c.tiandituImgTileMark.ol_uid) && (console.log(m, h.ol_uid), h.setVisible(!0));
1602
1602
  });
1603
1603
  }, k = () => {
1604
- const m = mapInstance.value.getView(), v = m.getZoom();
1605
- v && L(v);
1604
+ const m = mapInstance.value.getView(), g = m.getZoom();
1605
+ g && L(g);
1606
1606
  const h = m.calculateExtent(mapInstance.value.getSize());
1607
- h && v && E(h, v);
1607
+ h && g && E(h, g);
1608
1608
  }, L = (m) => {
1609
1609
  var I, C, V, S;
1610
1610
  i.value = m;
1611
- const v = (I = mapInstance.value) == null ? void 0 : I.getLayers(), h = s.vehicleMode === "ship" ? v == null ? void 0 : v.getArray().find((w) => w.ol_uid === c.greenMark.ol_uid) : void 0;
1611
+ const g = (I = mapInstance.value) == null ? void 0 : I.getLayers(), h = s.vehicleMode === "ship" ? g == null ? void 0 : g.getArray().find((w) => w.ol_uid === c.greenMark.ol_uid) : void 0;
1612
1612
  !d.value && u.value && m < mapZoom.shipGreenDotMax ? (p.value = !0, h == null || h.setVisible(!0), (C = shipsLayer.value) == null || C.setVisible(!1), (V = largeAmountShipsLayer.value) == null || V.setVisible(!1)) : (p.value = !1, h == null || h.setVisible(!1), (S = largeAmountShipsLayer.value) == null || S.setVisible(!0)), l("zoomChanged", m);
1613
- }, E = (m, v) => {
1613
+ }, E = (m, g) => {
1614
1614
  const h = transform([m[0], m[1]], projection.mercator, projection.data), I = transform([m[2], m[3]], projection.mercator, projection.data);
1615
- l("extentChanged", { extent: [h, I], zoom: v });
1615
+ l("extentChanged", { extent: [h, I], zoom: g });
1616
1616
  };
1617
1617
  return t({
1618
1618
  mapInstance,
@@ -1633,34 +1633,34 @@ const endFn = (e) => {
1633
1633
  },
1634
1634
  clearSelectFeature,
1635
1635
  findShip,
1636
- focusShip: (m, v) => {
1636
+ focusShip: (m, g) => {
1637
1637
  var h, I;
1638
- (h = shipsLayer.value) == null || h.setVisible(!1), (I = largeAmountShipsLayer.value) == null || I.setVisible(!1), findShip(m, v);
1638
+ (h = shipsLayer.value) == null || h.setVisible(!1), (I = largeAmountShipsLayer.value) == null || I.setVisible(!1), findShip(m, g);
1639
1639
  },
1640
1640
  showTracks,
1641
1641
  removeAllTrackLayer,
1642
1642
  switchFilterItem,
1643
1643
  rerenderShip,
1644
- switchGreenDot: () => g(!1),
1644
+ switchGreenDot: () => v(!1),
1645
1645
  zoomTruckIcon,
1646
- renderTruckTrack: (m, v, h) => {
1647
- renderTrack(m, v, h, LENGTH_UNIT.KM, "truck");
1646
+ renderTruckTrack: (m, g, h) => {
1647
+ renderTrack(m, g, h, LENGTH_UNIT.KM, "truck");
1648
1648
  },
1649
1649
  renderMarker,
1650
1650
  setMarkerPosition,
1651
1651
  drawPolygonTool
1652
- }), (m, v) => (openBlock(), createElementBlock("div", {
1652
+ }), (m, g) => (openBlock(), createElementBlock("div", {
1653
1653
  class: "map-page map-container",
1654
1654
  ref_key: "pageRef",
1655
1655
  ref: n
1656
1656
  }, [
1657
- v[0] || (v[0] = createElementVNode("div", {
1657
+ g[0] || (g[0] = createElementVNode("div", {
1658
1658
  id: "map",
1659
1659
  class: "map"
1660
1660
  }, null, -1)),
1661
1661
  createVNode(ToolPanel, {
1662
1662
  "vehicle-mode": m.vehicleMode,
1663
- onSwitchGreenDot: g,
1663
+ onSwitchGreenDot: v,
1664
1664
  onSwitchMapTile: y
1665
1665
  }, null, 8, ["vehicle-mode"]),
1666
1666
  createVNode(ScaleLine, {
package/dist/es/index.js CHANGED
@@ -16,9 +16,9 @@ import { Z as u } from "./PageHeadPanel-_mKu2rMQ.js";
16
16
  import { Z as D } from "./ToolTips-BTCP0N--.js";
17
17
  import { Z as I } from "./BaseInfo-Dv-eon6t.js";
18
18
  import { Z as d } from "./DetailHeader-C_mAB8-2.js";
19
- import { Z as P } from "./DiyDataTable-KOY6vjPs.js";
20
- import { D as J } from "./DiyDataTable-KOY6vjPs.js";
21
- import { Z as T } from "./Map-CMiThYaG.js";
19
+ import { Z as P } from "./DiyDataTable-CpkKeWkY.js";
20
+ import { D as J } from "./DiyDataTable-CpkKeWkY.js";
21
+ import { Z as T } from "./Map-B8_d8utt.js";
22
22
  const b = [
23
23
  I,
24
24
  r,