zhihao-ui 1.2.40 → 1.2.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/DiyDataTable-BerDffOX.js +325 -0
- package/dist/es/{Map-C5b6b8Iq.js → Map-DcXPse85.js} +45 -43
- package/dist/es/index.js +4 -4
- package/dist/index.css +1 -1
- package/dist/types/components/DiyDataTable/DiyDataTable.vue.d.ts +38 -0
- package/dist/types/components/DiyDataTable/index.d.ts +66 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.umd.cjs +2 -2
- package/package.json +1 -1
- package/dist/es/DiyDataTable-B8z44XT3.js +0 -317
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { defineComponent as Z, useModel as P, ref as R, openBlock as i, createBlock as h, unref as s, withCtx as p, createVNode as c, mergeProps as z, createElementBlock as m, Fragment as _, renderList as X, normalizeClass as T, toDisplayString as v, renderSlot as V, createTextVNode as x, createCommentVNode as w, createElementVNode as k, mergeModels as j } from "vue";
|
|
2
|
+
import { D as $ } from "./BaseItem-D1xoWSGo.js";
|
|
3
|
+
import { g as b, i as F, j as K, k as G, l as E, m as M, n as J, o as L, b as S } from "./vendor-DaYdW1_n.js";
|
|
4
|
+
import { _ as Q } from "./Button-CNEQmoqP.js";
|
|
5
|
+
import { w as Y } from "./utils-BSQSj8Ii.js";
|
|
6
|
+
var g = /* @__PURE__ */ ((u) => (u.AUTOCOMPLETE = "autocomplete", u.FORMAT = "format", u.TEXT = "text", u))(g || {});
|
|
7
|
+
const ee = { key: 0 }, te = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "col-edit-header"
|
|
10
|
+
}, ae = ["onClick"], re = { key: 0 }, oe = { class: "header-operation-container" }, le = { class: "operation-container" }, de = ["onClick"], U = "$ZH_DIV$", ie = /* @__PURE__ */ Z({
|
|
11
|
+
name: "zh-diy-data-table",
|
|
12
|
+
__name: "DiyDataTable",
|
|
13
|
+
props: /* @__PURE__ */ j({
|
|
14
|
+
isEdit: { type: Boolean, default: !1 },
|
|
15
|
+
maxRowLength: { default: 50 },
|
|
16
|
+
maxColLength: { default: 10 },
|
|
17
|
+
defaultMinWidth: { default: 120 },
|
|
18
|
+
beforeAddRow: {},
|
|
19
|
+
addRowText: { default: "增行" },
|
|
20
|
+
addColumnText: { default: "增列" },
|
|
21
|
+
customAddRow: { type: Boolean, default: !0 },
|
|
22
|
+
customAddColumn: { type: Boolean, default: !0 }
|
|
23
|
+
}, {
|
|
24
|
+
rawData: { required: !0 },
|
|
25
|
+
rawDataModifiers: {}
|
|
26
|
+
}),
|
|
27
|
+
emits: ["update:rawData"],
|
|
28
|
+
setup(u, { expose: I }) {
|
|
29
|
+
const f = u, n = P(u, "rawData"), l = R([]), C = () => {
|
|
30
|
+
if (n.value.length === f.maxRowLength) {
|
|
31
|
+
b({
|
|
32
|
+
message: `最多添加${f.maxRowLength}行`,
|
|
33
|
+
type: "warning"
|
|
34
|
+
});
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
let t = {};
|
|
38
|
+
f.beforeAddRow && (t = f.beforeAddRow(n.value)), n.value.push(t);
|
|
39
|
+
}, D = () => {
|
|
40
|
+
if (l.value.filter((e) => e.isAdd).length >= f.maxColLength) {
|
|
41
|
+
b({
|
|
42
|
+
message: `最多添加${f.maxColLength}列`,
|
|
43
|
+
type: "warning"
|
|
44
|
+
});
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const a = String(Date.now());
|
|
48
|
+
l.value.push({
|
|
49
|
+
prop: a,
|
|
50
|
+
label: "",
|
|
51
|
+
isEditHeader: !0,
|
|
52
|
+
isAdd: !0,
|
|
53
|
+
maxlength: 15,
|
|
54
|
+
minWidth: 150,
|
|
55
|
+
headerMaxlength: 15
|
|
56
|
+
});
|
|
57
|
+
}, O = (t, a) => {
|
|
58
|
+
l.value.splice(t, 1), n.value.forEach((e) => {
|
|
59
|
+
delete e[a.prop];
|
|
60
|
+
});
|
|
61
|
+
}, B = (t) => {
|
|
62
|
+
t === 0 && l.value.forEach((a) => {
|
|
63
|
+
a.isSameData && (n.value[1][a.prop] = n.value[0][a.prop]);
|
|
64
|
+
}), n.value.splice(t, 1);
|
|
65
|
+
}, q = (t, a, e) => {
|
|
66
|
+
a(
|
|
67
|
+
e.completeList.filter((o) => o.includes(t)).map((o) => ({ value: o }))
|
|
68
|
+
);
|
|
69
|
+
}, H = (t) => [
|
|
70
|
+
{
|
|
71
|
+
validator: (a, e, o) => {
|
|
72
|
+
if (!l.value[t].label) {
|
|
73
|
+
o(new Error("请输入表头"));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
o();
|
|
77
|
+
},
|
|
78
|
+
message: "请输入表头",
|
|
79
|
+
trigger: ["blur", "change"]
|
|
80
|
+
}
|
|
81
|
+
], N = (t) => {
|
|
82
|
+
const a = [];
|
|
83
|
+
return t.required && a.push({
|
|
84
|
+
required: !0,
|
|
85
|
+
message: "请输入" + t.label,
|
|
86
|
+
trigger: t.slot ? void 0 : "blur"
|
|
87
|
+
}), t.varidate && a.push({
|
|
88
|
+
validator: (e, o, r) => {
|
|
89
|
+
const d = t.varidate(o);
|
|
90
|
+
d !== !0 ? r(new Error(d)) : r();
|
|
91
|
+
},
|
|
92
|
+
trigger: t.slot ? void 0 : "blur"
|
|
93
|
+
}), a;
|
|
94
|
+
}, W = (t, a) => {
|
|
95
|
+
let e = t;
|
|
96
|
+
return a.isSameData && (e = n.value[0] || $), a.formatter ? a.showFormatter ? a.type === g.FORMAT ? a.showFormatter(a.formatter(e)) : a.showFormatter(e[a.prop]) : a.formatter(e[a.prop]) : e[a.prop] || $;
|
|
97
|
+
}, A = R();
|
|
98
|
+
return I({
|
|
99
|
+
/** 初始化数据 */
|
|
100
|
+
initData: (t, a) => {
|
|
101
|
+
console.log("initData", t, a), t = F(t) || [], t.length === 0 && t.push({}), a = [...a];
|
|
102
|
+
for (const e in t[0])
|
|
103
|
+
if (!a.some(
|
|
104
|
+
(o) => o.prop === e
|
|
105
|
+
)) {
|
|
106
|
+
const o = Date.now() + e, r = e.split(U);
|
|
107
|
+
if (r.length !== 2) {
|
|
108
|
+
console.log("keySplit 失败", e);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const d = Number(r[1]);
|
|
112
|
+
a[d] = {
|
|
113
|
+
prop: e,
|
|
114
|
+
isEditHeader: !0,
|
|
115
|
+
label: r[0],
|
|
116
|
+
key: o,
|
|
117
|
+
isAdd: !0,
|
|
118
|
+
maxlength: 15,
|
|
119
|
+
headerMaxlength: 15
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
n.value = t, l.value = a;
|
|
123
|
+
},
|
|
124
|
+
/** 获取数据 */
|
|
125
|
+
getData: async () => {
|
|
126
|
+
await A.value.validate();
|
|
127
|
+
for (const a in l.value) {
|
|
128
|
+
const e = l.value[a];
|
|
129
|
+
for (const o of l.value)
|
|
130
|
+
if (e.prop !== o.prop && e.label === o.label) {
|
|
131
|
+
b({
|
|
132
|
+
message: "所有列的表头不可重复",
|
|
133
|
+
type: "warning"
|
|
134
|
+
});
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const t = F(n.value);
|
|
139
|
+
for (const a in t) {
|
|
140
|
+
const e = t[a];
|
|
141
|
+
for (const o in l.value) {
|
|
142
|
+
const r = l.value[o];
|
|
143
|
+
if (r.isSameData && a !== "0" && (e[r.prop] = t[0][r.prop]), r.varidate && !r.varidate(e[r.prop]))
|
|
144
|
+
return;
|
|
145
|
+
if (r.isAdd) {
|
|
146
|
+
const d = e[r.prop];
|
|
147
|
+
delete e[r.prop];
|
|
148
|
+
const y = r.label + U + o;
|
|
149
|
+
e[y] = d;
|
|
150
|
+
}
|
|
151
|
+
r.formatter && r.type === g.FORMAT && (e[r.prop] = r.formatter(e));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return console.log("DiyDataTable 获取数据", t, l.value), {
|
|
155
|
+
data: t,
|
|
156
|
+
columns: l.value
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
/** 更新列配置数据 */
|
|
160
|
+
updateColumn: (t, a) => {
|
|
161
|
+
const e = l.value[t].prop;
|
|
162
|
+
if (l.value[t] = a, e !== a.prop)
|
|
163
|
+
for (const o of n.value)
|
|
164
|
+
o[a.prop] = o[e], delete o[e];
|
|
165
|
+
},
|
|
166
|
+
/** 重置默认列配置数据 */
|
|
167
|
+
resetColumns: (t) => {
|
|
168
|
+
const e = l.value.filter((r) => !r.isAdd).reduce((r, d) => (t.some((y) => y.prop === d.prop) || r.push(d.prop), r), []);
|
|
169
|
+
n.value.forEach((r) => {
|
|
170
|
+
e.forEach((d) => {
|
|
171
|
+
delete r[d];
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
const o = t.filter((r) => r.isAdd);
|
|
175
|
+
l.value = [...t, ...o];
|
|
176
|
+
},
|
|
177
|
+
onAddRow: C,
|
|
178
|
+
onAddColumn: D
|
|
179
|
+
}), (t, a) => (i(), h(s(K), {
|
|
180
|
+
class: "diy-data-table",
|
|
181
|
+
model: u.rawData,
|
|
182
|
+
ref_key: "formRef",
|
|
183
|
+
ref: A
|
|
184
|
+
}, {
|
|
185
|
+
default: p(() => [
|
|
186
|
+
c(s(G), z({ data: n.value }, t.$attrs), {
|
|
187
|
+
default: p(() => [
|
|
188
|
+
c(s(E), {
|
|
189
|
+
type: "index",
|
|
190
|
+
label: "序号",
|
|
191
|
+
width: "132",
|
|
192
|
+
fixed: "left"
|
|
193
|
+
}),
|
|
194
|
+
(i(!0), m(_, null, X(l.value, (e, o) => (i(), h(s(E), {
|
|
195
|
+
key: e.key || o,
|
|
196
|
+
prop: e.prop,
|
|
197
|
+
label: e.label,
|
|
198
|
+
width: e.width,
|
|
199
|
+
"min-width": e.minWidth || t.defaultMinWidth,
|
|
200
|
+
fixed: e.fixed
|
|
201
|
+
}, {
|
|
202
|
+
header: p(() => [
|
|
203
|
+
t.isEdit ? e.isEditHeader ? (i(), m("div", te, [
|
|
204
|
+
c(s(M), {
|
|
205
|
+
prop: `columns.${o}`,
|
|
206
|
+
rules: H(o)
|
|
207
|
+
}, {
|
|
208
|
+
default: p(() => [
|
|
209
|
+
c(s(L), {
|
|
210
|
+
modelValue: e.label,
|
|
211
|
+
"onUpdate:modelValue": (r) => e.label = r,
|
|
212
|
+
maxlength: e.headerMaxlength || 20,
|
|
213
|
+
placeholder: "请输入表头"
|
|
214
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "maxlength"])
|
|
215
|
+
]),
|
|
216
|
+
_: 2
|
|
217
|
+
}, 1032, ["prop", "rules"]),
|
|
218
|
+
e.isAdd ? (i(), m("i", {
|
|
219
|
+
key: 0,
|
|
220
|
+
class: "iconfont icon-close",
|
|
221
|
+
onClick: (r) => O(o, e)
|
|
222
|
+
}, null, 8, ae)) : w("", !0)
|
|
223
|
+
])) : (i(), m("div", {
|
|
224
|
+
key: 2,
|
|
225
|
+
class: T({ "is-required-label": e.required })
|
|
226
|
+
}, v(e.label), 3)) : (i(), m("div", ee, v(e.label), 1))
|
|
227
|
+
]),
|
|
228
|
+
default: p((r) => [
|
|
229
|
+
f.isEdit && (!e.isSameData || r.$index === 0) && e.type !== s(g).TEXT ? (i(), h(s(M), {
|
|
230
|
+
key: 0,
|
|
231
|
+
prop: `${r.$index}.${e.prop}`,
|
|
232
|
+
rules: N(e),
|
|
233
|
+
class: T(["col-edit-container", { "close-padding": e.isAdd }])
|
|
234
|
+
}, {
|
|
235
|
+
default: p(() => [
|
|
236
|
+
e.type === s(g).FORMAT && e.formatter ? (i(), m("div", re, v(e.showFormatter ? e.showFormatter(
|
|
237
|
+
e.formatter(r.row)
|
|
238
|
+
) : e.formatter(r.row)), 1)) : e.type === s(g).AUTOCOMPLETE ? (i(), h(s(J), {
|
|
239
|
+
key: 1,
|
|
240
|
+
modelValue: r.row[e.prop],
|
|
241
|
+
"onUpdate:modelValue": (d) => r.row[e.prop] = d,
|
|
242
|
+
placeholder: e.placeholder || "请输入",
|
|
243
|
+
"fetch-suggestions": (d, y) => q(d, y, e),
|
|
244
|
+
maxlength: e.maxlength || 20
|
|
245
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "fetch-suggestions", "maxlength"])) : e.slot ? V(t.$slots, e.slot, {
|
|
246
|
+
key: 2,
|
|
247
|
+
row: r.row,
|
|
248
|
+
$index: r.$index
|
|
249
|
+
}, void 0, !0) : (i(), h(s(L), {
|
|
250
|
+
key: 3,
|
|
251
|
+
modelValue: r.row[e.prop],
|
|
252
|
+
"onUpdate:modelValue": (d) => r.row[e.prop] = d,
|
|
253
|
+
placeholder: e.placeholder || "请输入",
|
|
254
|
+
formatter: e.formatter,
|
|
255
|
+
parser: e.parser,
|
|
256
|
+
maxlength: e.maxlength || 20
|
|
257
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "formatter", "parser", "maxlength"]))
|
|
258
|
+
]),
|
|
259
|
+
_: 2
|
|
260
|
+
}, 1032, ["prop", "rules", "class"])) : e.slot ? V(t.$slots, e.slot, {
|
|
261
|
+
key: 1,
|
|
262
|
+
row: r.row,
|
|
263
|
+
$index: r.$index
|
|
264
|
+
}, void 0, !0) : (i(), m(_, { key: 2 }, [
|
|
265
|
+
x(v(W(r.row, e)), 1)
|
|
266
|
+
], 64))
|
|
267
|
+
]),
|
|
268
|
+
_: 2
|
|
269
|
+
}, 1032, ["prop", "label", "width", "min-width", "fixed"]))), 128)),
|
|
270
|
+
f.isEdit ? (i(), h(s(E), {
|
|
271
|
+
key: 0,
|
|
272
|
+
width: "150",
|
|
273
|
+
fixed: "right"
|
|
274
|
+
}, {
|
|
275
|
+
header: p(() => [
|
|
276
|
+
k("div", oe, [
|
|
277
|
+
t.customAddRow ? (i(), h(s(S), {
|
|
278
|
+
key: 0,
|
|
279
|
+
type: "primary",
|
|
280
|
+
link: "",
|
|
281
|
+
onClick: C
|
|
282
|
+
}, {
|
|
283
|
+
default: p(() => [
|
|
284
|
+
a[0] || (a[0] = k("i", { class: "iconfont icon-Frame1" }, null, -1)),
|
|
285
|
+
x(v(t.addRowText), 1)
|
|
286
|
+
]),
|
|
287
|
+
_: 1
|
|
288
|
+
})) : w("", !0),
|
|
289
|
+
t.customAddColumn ? (i(), h(s(S), {
|
|
290
|
+
key: 1,
|
|
291
|
+
type: "primary",
|
|
292
|
+
link: "",
|
|
293
|
+
onClick: D
|
|
294
|
+
}, {
|
|
295
|
+
default: p(() => [
|
|
296
|
+
a[1] || (a[1] = k("i", { class: "iconfont icon-Frame-11" }, null, -1)),
|
|
297
|
+
x(v(t.addColumnText), 1)
|
|
298
|
+
]),
|
|
299
|
+
_: 1
|
|
300
|
+
})) : w("", !0)
|
|
301
|
+
])
|
|
302
|
+
]),
|
|
303
|
+
default: p(({ $index: e }) => [
|
|
304
|
+
k("div", le, [
|
|
305
|
+
n.value.length > 1 ? (i(), m("i", {
|
|
306
|
+
key: 0,
|
|
307
|
+
class: "iconfont icon-close",
|
|
308
|
+
onClick: (o) => B(e)
|
|
309
|
+
}, null, 8, de)) : w("", !0)
|
|
310
|
+
])
|
|
311
|
+
]),
|
|
312
|
+
_: 1
|
|
313
|
+
})) : w("", !0)
|
|
314
|
+
]),
|
|
315
|
+
_: 3
|
|
316
|
+
}, 16, ["data"])
|
|
317
|
+
]),
|
|
318
|
+
_: 3
|
|
319
|
+
}, 8, ["model"]));
|
|
320
|
+
}
|
|
321
|
+
}), se = /* @__PURE__ */ Q(ie, [["__scopeId", "data-v-f5baec5d"]]), me = Y(se);
|
|
322
|
+
export {
|
|
323
|
+
g as D,
|
|
324
|
+
me as Z
|
|
325
|
+
};
|
|
@@ -8,7 +8,7 @@ import { g as getForegroundColor } from "./DatePicker-Dh8sksac.js";
|
|
|
8
8
|
import { w as withInstall } from "./utils-BSQSj8Ii.js";
|
|
9
9
|
var BaseMapType = /* @__PURE__ */ ((e) => (e[e.vector = 0] = "vector", e[e.satellite = 1] = "satellite", e))(BaseMapType || {}), SEARCH_TYPE = /* @__PURE__ */ ((e) => (e[e.SEARCH_SHIP = 0] = "SEARCH_SHIP", e[e.SEARCH_PORT = 1] = "SEARCH_PORT", e[e.SEARCH_CUSTOM = 2] = "SEARCH_CUSTOM", e))(SEARCH_TYPE || {}), COPY_RIGHT_TYPE = /* @__PURE__ */ ((e) => (e[e.HORIZONTAL = 0] = "HORIZONTAL", e[e.VERTICAL = 1] = "VERTICAL", e))(COPY_RIGHT_TYPE || {}), 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 || {}), SWITCH_BTN = /* @__PURE__ */ ((e) => (e.Camera = "camera", e.Mobile = "mobile", e.WaterGauge = "waterGauge", e))(SWITCH_BTN || {}), SHIP_SAIL_STATUS = /* @__PURE__ */ ((e) => (e[e.发动机使用中 = 0] = "发动机使用中", e[e.锚泊 = 1] = "锚泊", e[e.未操作 = 2] = "未操作", e[e.操纵能力受限 = 3] = "操纵能力受限", e[e.吃水受限 = 4] = "吃水受限", e[e.系泊 = 5] = "系泊", e[e.搁浅 = 6] = "搁浅", e[e.从事捕捞 = 7] = "从事捕捞", e[e.航行中 = 8] = "航行中", e[e.留作将来修正导航状态 = 9] = "留作将来修正导航状态", e[e.高速船留用 = 10] = "高速船留用", e[e.机动船尾推作业 = 11] = "机动船尾推作业", e[e.机动船顶推或侧推作业 = 12] = "机动船顶推或侧推作业", e[e.飞翼船留用 = 13] = "飞翼船留用", e[e.现行的 = 14] = "现行的", e[e.未定义 = 15] = "未定义", e))(SHIP_SAIL_STATUS || {});
|
|
10
10
|
class ShipMapData {
|
|
11
|
-
constructor(t, n, o, i, r, l, c, s, m, d, u, f, p, y, h, g, k, T, I,
|
|
11
|
+
constructor(t, n, o, i, r, l, c, s, m, d, u, f, p, y, h, g, k, T, I, F, V, P, v, L) {
|
|
12
12
|
b(this, "id");
|
|
13
13
|
// mmsi
|
|
14
14
|
b(this, "mmsi");
|
|
@@ -50,7 +50,7 @@ class ShipMapData {
|
|
|
50
50
|
b(this, "existWaterGauge");
|
|
51
51
|
b(this, "selected");
|
|
52
52
|
b(this, "blinkColors");
|
|
53
|
-
this.id = t, this.mmsi = n, this.fill = o, this.shipType = i, this.name = r, this.length = l, this.breadth = c, this.lon = s, this.lat = m, this.createdAt = d, this.speed = u, this.from = f, this.sailStatus = p, this.hdg = y, this.cog = h, this.posType = g, this.type = k, this.angle = T, this.leftIconColor = I, this.existDevice =
|
|
53
|
+
this.id = t, this.mmsi = n, this.fill = o, this.shipType = i, this.name = r, this.length = l, this.breadth = c, this.lon = s, this.lat = m, this.createdAt = d, this.speed = u, this.from = f, this.sailStatus = p, this.hdg = y, this.cog = h, this.posType = g, this.type = k, this.angle = T, this.leftIconColor = I, this.existDevice = F, this.existMobile = V, this.existWaterGauge = P, this.selected = v, this.blinkColors = L;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
const formatLength = function(e, t) {
|
|
@@ -173,7 +173,7 @@ const formatLength = function(e, t) {
|
|
|
173
173
|
})
|
|
174
174
|
})
|
|
175
175
|
});
|
|
176
|
-
function
|
|
176
|
+
function F() {
|
|
177
177
|
var S, M;
|
|
178
178
|
if (o != null && o.value) {
|
|
179
179
|
if (c.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((C) => {
|
|
@@ -186,9 +186,9 @@ const formatLength = function(e, t) {
|
|
|
186
186
|
(M = o.value) == null || M.removeLayer(h), u != null && u.parentNode && u.parentNode.removeChild(u), p != null && p.parentNode && p.parentNode.removeChild(p);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function V() {
|
|
190
190
|
var M, C;
|
|
191
|
-
|
|
191
|
+
F(), (M = o == null ? void 0 : o.value) == null || M.addLayer(h), T = new Draw({
|
|
192
192
|
source: m,
|
|
193
193
|
type: "LineString",
|
|
194
194
|
style: function() {
|
|
@@ -203,15 +203,15 @@ const formatLength = function(e, t) {
|
|
|
203
203
|
T.on("drawstart", function(E) {
|
|
204
204
|
var N;
|
|
205
205
|
d = E.feature;
|
|
206
|
-
let
|
|
206
|
+
let x;
|
|
207
207
|
S = (N = d.getGeometry()) == null ? void 0 : N.on("change", function(A) {
|
|
208
208
|
const $ = A.target;
|
|
209
209
|
let R = formatUtils.formatLength($, Number(l.value));
|
|
210
|
-
|
|
210
|
+
x = $.getLastCoordinate(), p && R && (p.innerHTML = R), y.setPosition(x);
|
|
211
211
|
});
|
|
212
212
|
}), T.on("drawend", function() {
|
|
213
|
-
var E,
|
|
214
|
-
p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML && (c.value.push(p == null ? void 0 : p.innerHTML), p.innerHTML = `${p.innerHTML}<div class="ol-tooltip-delete-button" data-index="${((E = c.value) == null ? void 0 : E.length) - 1}"><i class="map-iconfont icon-delete"></i></div>`), (
|
|
213
|
+
var E, x;
|
|
214
|
+
p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML && (c.value.push(p == null ? void 0 : p.innerHTML), p.innerHTML = `${p.innerHTML}<div class="ol-tooltip-delete-button" data-index="${((E = c.value) == null ? void 0 : E.length) - 1}"><i class="map-iconfont icon-delete"></i></div>`), (x = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || x.addEventListener("click", (N) => {
|
|
215
215
|
var $;
|
|
216
216
|
N.preventDefault(), N.stopPropagation();
|
|
217
217
|
const A = ($ = N.target) == null ? void 0 : $.getAttribute("data-index");
|
|
@@ -238,20 +238,20 @@ const formatLength = function(e, t) {
|
|
|
238
238
|
}), (S = o == null ? void 0 : o.value) == null || S.addOverlay(y);
|
|
239
239
|
}
|
|
240
240
|
const L = (S) => {
|
|
241
|
-
var E,
|
|
241
|
+
var E, x;
|
|
242
242
|
c.value[S] && c.value.splice(S, 1);
|
|
243
243
|
const M = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
244
|
-
M[S] && ((
|
|
244
|
+
M[S] && ((x = (E = M[S]) == null ? void 0 : E.parentNode) == null || x.removeChild(M[S]));
|
|
245
245
|
const C = m.getFeatures();
|
|
246
246
|
C[S] && m.removeFeature(C[S]);
|
|
247
247
|
}, w = () => {
|
|
248
248
|
i("close");
|
|
249
249
|
};
|
|
250
250
|
return watch(() => r, () => {
|
|
251
|
-
r.value && !s.value && (k(),
|
|
251
|
+
r.value && !s.value && (k(), V());
|
|
252
252
|
}, { deep: !0, immediate: !0 }), t({
|
|
253
|
-
addInteraction:
|
|
254
|
-
removeInteraction:
|
|
253
|
+
addInteraction: V,
|
|
254
|
+
removeInteraction: F
|
|
255
255
|
}), (S, M) => r.value && S.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
256
256
|
createElementVNode("div", { class: "header" }, [
|
|
257
257
|
M[1] || (M[1] = createElementVNode("div", { class: "title" }, "测量", -1)),
|
|
@@ -296,7 +296,7 @@ const formatLength = function(e, t) {
|
|
|
296
296
|
]),
|
|
297
297
|
createElementVNode("div", {
|
|
298
298
|
class: "delete-button",
|
|
299
|
-
onClick: (
|
|
299
|
+
onClick: (x) => L(E)
|
|
300
300
|
}, M[4] || (M[4] = [
|
|
301
301
|
createElementVNode("i", { class: "map-iconfont icon-delete" }, null, -1)
|
|
302
302
|
]), 8, _hoisted_7)
|
|
@@ -454,8 +454,8 @@ const multiplyPixelRatio = (e) => {
|
|
|
454
454
|
return function(P, v) {
|
|
455
455
|
return (l(v, P) + 180) % 360;
|
|
456
456
|
}(u, f);
|
|
457
|
-
const y = r(u), h = r(f), g = i(y[0]), k = i(h[0]), T = i(y[1]), I = i(h[1]),
|
|
458
|
-
return o(Math.atan2(
|
|
457
|
+
const y = r(u), h = r(f), g = i(y[0]), k = i(h[0]), T = i(y[1]), I = i(h[1]), F = Math.sin(k - g) * Math.cos(I), V = Math.cos(T) * Math.sin(I) - Math.sin(T) * Math.cos(I) * Math.cos(k - g);
|
|
458
|
+
return o(Math.atan2(F, V));
|
|
459
459
|
}
|
|
460
460
|
function c(u) {
|
|
461
461
|
return !isNaN(u) && u !== null && !Array.isArray(u);
|
|
@@ -545,7 +545,9 @@ const multiplyPixelRatio = (e) => {
|
|
|
545
545
|
o.feature.get("index") === 0 && (shipLabels.value = []);
|
|
546
546
|
try {
|
|
547
547
|
const c = drawShipBody(i, r, n, t);
|
|
548
|
-
c && (drawHeading(i, r, c, t), r.selected = e, e &&
|
|
548
|
+
c && (drawHeading(i, r, c, t), r.selected = e, e && setTimeout(() => {
|
|
549
|
+
drawSelectBounds(i, c);
|
|
550
|
+
}, 1)), drawShipLabel(i, r, n);
|
|
549
551
|
} catch {
|
|
550
552
|
return !1;
|
|
551
553
|
}
|
|
@@ -965,13 +967,13 @@ function drawLabelBody(e, t, n) {
|
|
|
965
967
|
p = calculateBounds(l, k, f, g, d);
|
|
966
968
|
let T = !1;
|
|
967
969
|
for (let I = 0; I < t.length; ++I) {
|
|
968
|
-
let
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
970
|
+
let F = t[I].bounds, V = [
|
|
971
|
+
F[0] - y,
|
|
972
|
+
F[1] - y,
|
|
973
|
+
F[2] + y,
|
|
974
|
+
F[3] + y
|
|
973
975
|
];
|
|
974
|
-
if (p && isOverlapping(p,
|
|
976
|
+
if (p && isOverlapping(p, V)) {
|
|
975
977
|
T = !0;
|
|
976
978
|
break;
|
|
977
979
|
}
|
|
@@ -1050,9 +1052,9 @@ const drawText = (e, t) => {
|
|
|
1050
1052
|
(u = t.blinkColors) != null && u.length && t.fill && (c = t.fill, l = getForegroundColor(t.fill));
|
|
1051
1053
|
const I = drawLabelBody(e, n, T);
|
|
1052
1054
|
if (I) {
|
|
1053
|
-
const { x, bounds:
|
|
1055
|
+
const { x: F, bounds: V, l: P } = I, v = [getTopLeftPoint(V), getBottomLeftPoint(V), getBottomRightPoint(V), getTopRighttPoint(V)];
|
|
1054
1056
|
n.find((E) => E.name === i) || n.push(I), drawPolygon(e, {
|
|
1055
|
-
points: [o,
|
|
1057
|
+
points: [o, F],
|
|
1056
1058
|
strokeColor: r,
|
|
1057
1059
|
fillColor: "#000",
|
|
1058
1060
|
shouldClosePath: !0,
|
|
@@ -1061,8 +1063,8 @@ const drawText = (e, t) => {
|
|
|
1061
1063
|
rotationCenter: void 0,
|
|
1062
1064
|
scale: void 0,
|
|
1063
1065
|
globalAlpha: labelAlpha
|
|
1064
|
-
}), m != null && m.length && m.forEach((
|
|
1065
|
-
v[1][0] +=
|
|
1066
|
+
}), m != null && m.length && m.forEach(() => {
|
|
1067
|
+
v[1][0] += pixelRatio === 1 ? 18 : 36, v[2][0] += pixelRatio === 1 ? 18 : 36;
|
|
1066
1068
|
});
|
|
1067
1069
|
const w = {
|
|
1068
1070
|
points: v,
|
|
@@ -1078,7 +1080,7 @@ const drawText = (e, t) => {
|
|
|
1078
1080
|
blinkColors: t.blinkColors
|
|
1079
1081
|
};
|
|
1080
1082
|
if (drawPolygon(e, w), drawText(e, C), t != null && t.blinkColors && t.blinkColors.length > 0) {
|
|
1081
|
-
let E = Date.now(),
|
|
1083
|
+
let E = Date.now(), x = 0;
|
|
1082
1084
|
const N = t.blinkColors;
|
|
1083
1085
|
!!!((y = (p = (f = selectShipsLayer.value) == null ? void 0 : f.getSource()) == null ? void 0 : p.getFeatures()) != null && y.find(($) => {
|
|
1084
1086
|
var R;
|
|
@@ -1089,7 +1091,7 @@ const drawText = (e, t) => {
|
|
|
1089
1091
|
})) || hiddenOrther.value ? (clearInterval(intervalIds[t.id]), deleteLabelFromArray(n, i)) : (intervalIds[t.id] && clearInterval(intervalIds[t.id]), intervalIds[t.id] = window.setInterval(() => {
|
|
1090
1092
|
var D, G, _;
|
|
1091
1093
|
const $ = Date.now();
|
|
1092
|
-
$ - E >= 500 && (
|
|
1094
|
+
$ - E >= 500 && (x = (x + 1) % N.length, E = $, w.fillColor = N[x], drawPolygon(e, w), C.textColor = getForegroundColor(w.fillColor), drawText(e, C));
|
|
1093
1095
|
const R = shipsMarkerList == null ? void 0 : shipsMarkerList.some((O) => {
|
|
1094
1096
|
var B;
|
|
1095
1097
|
return ((B = O.ship) == null ? void 0 : B.id) === t.id;
|
|
@@ -1100,7 +1102,7 @@ const drawText = (e, t) => {
|
|
|
1100
1102
|
!R && !Z && (clearInterval(intervalIds[t.id]), deleteLabelFromArray(n, i));
|
|
1101
1103
|
}, 10));
|
|
1102
1104
|
} else
|
|
1103
|
-
shipLabels.value.find((
|
|
1105
|
+
shipLabels.value.find((x) => x.name === i) && (clearInterval(intervalIds[t.id]), drawPolygon(e, w), drawText(e, C));
|
|
1104
1106
|
}
|
|
1105
1107
|
}
|
|
1106
1108
|
return null;
|
|
@@ -1456,8 +1458,8 @@ const moveFeature = (e, t) => {
|
|
|
1456
1458
|
}), document.addEventListener("mousemove", function(k) {
|
|
1457
1459
|
var T;
|
|
1458
1460
|
if (f) {
|
|
1459
|
-
const I = (T = mapInstance$4.value) == null ? void 0 : T.getCoordinateFromPixel([k.clientX - y[0], k.clientY - y[1]]),
|
|
1460
|
-
l.setPosition([p[0] +
|
|
1461
|
+
const I = (T = mapInstance$4.value) == null ? void 0 : T.getCoordinateFromPixel([k.clientX - y[0], k.clientY - y[1]]), F = I[0] - p[0], V = I[1] - p[1];
|
|
1462
|
+
l.setPosition([p[0] + F, p[1] + V]);
|
|
1461
1463
|
}
|
|
1462
1464
|
}), document.addEventListener("mouseup", function() {
|
|
1463
1465
|
f = !1;
|
|
@@ -1799,14 +1801,14 @@ const setTruckStyle = (e, t, n, o) => new Style({
|
|
|
1799
1801
|
n === CAR_COLOR.YELLOW ? (h = 176, k = "#FFC81E", T = "rgba(0,0,0,0.88)") : n === CAR_COLOR.Y_GREEN && (f = 200, h = 196, k = "#8FED7C", T = "rgba(0,0,0,0.88)"), o != null && o.length && (f += o.length * 56), fillRectRadius(l, d, u, f, p, y), fillRectRadius(l, d + 2, u + 2, h, g, k), n === CAR_COLOR.Y_GREEN && fillRectRadius(l, d + 2, u + 2, 68, g, "#FFC81E"), l.save(), l.restore(), l.fillStyle = T, l.font = "bold 28px Arial", l.textAlign = "left", l.textBaseline = "middle";
|
|
1800
1802
|
const I = `${t.slice(0, 2) + " · " + t.slice(2)}`;
|
|
1801
1803
|
if (l.fillText(I, d + 12, u + 32), l.save(), l.restore(), o != null && o.length) {
|
|
1802
|
-
const
|
|
1804
|
+
const V = l.measureText(I).width + 12;
|
|
1803
1805
|
let P = 0;
|
|
1804
1806
|
o.forEach((v) => {
|
|
1805
|
-
v === DEVICE_TYPE.CAMERA && (l.drawImage(cameraImage, s - 54 +
|
|
1807
|
+
v === DEVICE_TYPE.CAMERA && (l.drawImage(cameraImage, s - 54 + V + P * 56, m - 64, 50, 50), ++P), v === DEVICE_TYPE.LOAD && (l.drawImage(loadImage, s - 54 + V + P * 56, m - 64, 50, 50), ++P);
|
|
1806
1808
|
});
|
|
1807
1809
|
}
|
|
1808
|
-
const
|
|
1809
|
-
l.drawImage(
|
|
1810
|
+
const F = dotImage$1;
|
|
1811
|
+
l.drawImage(F, s + f / 2 - 90, m, 50 / c, 50 / c), l.restore();
|
|
1810
1812
|
}
|
|
1811
1813
|
}), mapInstance$2 = ref(), renderDashboardSetInstance = (e) => mapInstance$2.value = e;
|
|
1812
1814
|
ref([]);
|
|
@@ -2253,15 +2255,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2253
2255
|
});
|
|
2254
2256
|
}, I = () => {
|
|
2255
2257
|
const v = o.value.getView(), L = v.getZoom();
|
|
2256
|
-
L &&
|
|
2258
|
+
L && F(L);
|
|
2257
2259
|
const w = v.calculateExtent(o.value.getSize());
|
|
2258
|
-
w && L &&
|
|
2259
|
-
},
|
|
2260
|
-
var S, M, C, E,
|
|
2260
|
+
w && L && V(w, L);
|
|
2261
|
+
}, F = (v) => {
|
|
2262
|
+
var S, M, C, E, x;
|
|
2261
2263
|
m.value = v, g(v < mapZoom.shipGreenDotMax);
|
|
2262
2264
|
const L = (S = o.value) == null ? void 0 : S.getLayers(), w = s.vehicleMode === "ship" ? L == null ? void 0 : L.getArray().find((N) => getUid(N) === getUid(p.greenMark)) : void 0;
|
|
2263
|
-
showTrackLayer.value ? (f.value = !1, w == null || w.setVisible(!1), (M = shipsLayer.value) == null || M.setVisible(!1), (C = largeAmountShipsLayer.value) == null || C.setVisible(!1)) : !d.value && u.value && v <= mapZoom.shipGreenDotMax ? (f.value = !0, w == null || w.setVisible(!0), (E = shipsLayer.value) == null || E.setVisible(!1), (
|
|
2264
|
-
},
|
|
2265
|
+
showTrackLayer.value ? (f.value = !1, w == null || w.setVisible(!1), (M = shipsLayer.value) == null || M.setVisible(!1), (C = largeAmountShipsLayer.value) == null || C.setVisible(!1)) : !d.value && u.value && v <= mapZoom.shipGreenDotMax ? (f.value = !0, w == null || w.setVisible(!0), (E = shipsLayer.value) == null || E.setVisible(!1), (x = largeAmountShipsLayer.value) == null || x.setVisible(!1)) : (f.value = !1, w == null || w.setVisible(!1)), c("zoomChanged", v);
|
|
2266
|
+
}, V = (v, L) => {
|
|
2265
2267
|
const w = transform([v[0], v[1]], projection.mercator, projection.data), S = transform([v[2], v[3]], projection.mercator, projection.data);
|
|
2266
2268
|
c("extentChanged", { extent: [w, S], zoom: L });
|
|
2267
2269
|
};
|
package/dist/es/index.js
CHANGED
|
@@ -15,10 +15,10 @@ import { Z as b } from "./PageHeadPanel-C5A4n2ie.js";
|
|
|
15
15
|
import { Z as _ } from "./ToolTips-6ETyGI4m.js";
|
|
16
16
|
import { Z as A } from "./BaseInfo-VzgiaCKn.js";
|
|
17
17
|
import { Z as E } from "./DetailHeader-CSC9DAQc.js";
|
|
18
|
-
import { Z as c } from "./DiyDataTable-
|
|
19
|
-
import { D as Q } from "./DiyDataTable-
|
|
20
|
-
import { Z as B } from "./Map-
|
|
21
|
-
import { B as $, C as aa, c as oa, D as ra, L as ma, S as sa, b as ta, a as Za, m as ea, p as ia, r as pa, t as fa, z as ha } from "./Map-
|
|
18
|
+
import { Z as c } from "./DiyDataTable-BerDffOX.js";
|
|
19
|
+
import { D as Q } from "./DiyDataTable-BerDffOX.js";
|
|
20
|
+
import { Z as B } from "./Map-DcXPse85.js";
|
|
21
|
+
import { B as $, C as aa, c as oa, D as ra, L as ma, S as sa, b as ta, a as Za, m as ea, p as ia, r as pa, t as fa, z as ha } from "./Map-DcXPse85.js";
|
|
22
22
|
import { Z as L } from "./Table-BoMGydAp.js";
|
|
23
23
|
import { Z as la } from "./BaseItem-D1xoWSGo.js";
|
|
24
24
|
const M = [
|