web3dlink 2.1.16 → 2.1.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.
- package/dist/createGameSession-Ce1m5HFi.js +4132 -0
- package/dist/createGameSession-Ce1m5HFi.js.map +1 -0
- package/dist/linkFlowLarkSR-fa6gb2wM.js +105 -0
- package/dist/linkFlowLarkSR-fa6gb2wM.js.map +1 -0
- package/dist/linkFlowzsStream-BzZf51cL.js +195 -0
- package/dist/linkFlowzsStream-BzZf51cL.js.map +1 -0
- package/dist/web3dlink-larksr.js +3 -0
- package/dist/web3dlink-zs.js +3 -0
- package/dist/web3dlink.d.ts +91 -0
- package/dist/web3dlink.js +4 -24742
- package/package.json +25 -2
- package/dist/web3dlink.js.map +0 -1
|
@@ -0,0 +1,4132 @@
|
|
|
1
|
+
//#endregion
|
|
2
|
+
//#region version.js
|
|
3
|
+
var e = {
|
|
4
|
+
name: "web3dlink",
|
|
5
|
+
version: "2.1.17",
|
|
6
|
+
description: "LarkSR / ZS 推流 GameAPI SDK",
|
|
7
|
+
type: "module",
|
|
8
|
+
main: "./dist/web3dlink.js",
|
|
9
|
+
module: "./dist/web3dlink.js",
|
|
10
|
+
types: "./dist/web3dlink.d.ts",
|
|
11
|
+
exports: {
|
|
12
|
+
".": {
|
|
13
|
+
types: "./dist/web3dlink.d.ts",
|
|
14
|
+
import: "./dist/web3dlink.js",
|
|
15
|
+
default: "./dist/web3dlink.js"
|
|
16
|
+
},
|
|
17
|
+
"./larksr": {
|
|
18
|
+
types: "./dist/web3dlink.d.ts",
|
|
19
|
+
import: "./dist/web3dlink-larksr.js",
|
|
20
|
+
default: "./dist/web3dlink-larksr.js"
|
|
21
|
+
},
|
|
22
|
+
"./zs": {
|
|
23
|
+
types: "./dist/web3dlink.d.ts",
|
|
24
|
+
import: "./dist/web3dlink-zs.js",
|
|
25
|
+
default: "./dist/web3dlink-zs.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
files: ["dist"],
|
|
29
|
+
scripts: {
|
|
30
|
+
build: "node ./scripts/build.mjs",
|
|
31
|
+
"sync:dts": "node ./scripts/sync-dts.mjs",
|
|
32
|
+
prepublishOnly: "npm run build"
|
|
33
|
+
},
|
|
34
|
+
keywords: [
|
|
35
|
+
"larksr",
|
|
36
|
+
"zs-stream",
|
|
37
|
+
"game-api",
|
|
38
|
+
"streaming",
|
|
39
|
+
"web3dlink"
|
|
40
|
+
],
|
|
41
|
+
license: "MIT",
|
|
42
|
+
peerDependencies: { larksr_websdk: "^3.3.119" },
|
|
43
|
+
peerDependenciesMeta: { larksr_websdk: { optional: !0 } },
|
|
44
|
+
sideEffects: [
|
|
45
|
+
"./dist/web3dlink.js",
|
|
46
|
+
"./dist/web3dlink-larksr.js",
|
|
47
|
+
"./dist/web3dlink-zs.js",
|
|
48
|
+
"./zs-stream-parent.js",
|
|
49
|
+
"./version.js"
|
|
50
|
+
]
|
|
51
|
+
}.version, t = "background: #22c55e; color: #fff; padding: 2px 6px; border-radius: 4px; font-weight: 600;";
|
|
52
|
+
function n() {
|
|
53
|
+
if (typeof globalThis < "u" && globalThis.WEB3DLINK_SILENT) return !1;
|
|
54
|
+
try {
|
|
55
|
+
if (typeof location < "u" && new URLSearchParams(location.search).get("web3dlink_silent") === "1") return !1;
|
|
56
|
+
} catch {}
|
|
57
|
+
return !0;
|
|
58
|
+
}
|
|
59
|
+
n() && (console.log(`%c [web3dlink] version: ${e} `, t), console.log("%c [larksr_websdk] peer: ^3.3.119 ", t));
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region api/createNamespaceApi.js
|
|
62
|
+
function r(e, t = {}, n = {}) {
|
|
63
|
+
class r {
|
|
64
|
+
constructor(e) {
|
|
65
|
+
this.commandManager = e;
|
|
66
|
+
}
|
|
67
|
+
_handleSend(r, i = {}) {
|
|
68
|
+
let a = `${e}.${r}`, o = t[r], s = o ? o(i) : {
|
|
69
|
+
errors: [],
|
|
70
|
+
normalized: i
|
|
71
|
+
}, c = n.getOptions?.(r, i) || {};
|
|
72
|
+
return this.commandManager.sendWithDefault(s, a, c);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return r;
|
|
76
|
+
}
|
|
77
|
+
var i = {
|
|
78
|
+
lightpink: "#FFB6C1",
|
|
79
|
+
pink: "#FFC0CB",
|
|
80
|
+
crimson: "#DC143C",
|
|
81
|
+
lavenderblush: "#FFF0F5",
|
|
82
|
+
palevioletred: "#DB7093",
|
|
83
|
+
hotpink: "#FF69B4",
|
|
84
|
+
deeppink: "#FF1493",
|
|
85
|
+
mediumvioletred: "#C71585",
|
|
86
|
+
orchid: "#DA70D6",
|
|
87
|
+
thistle: "#D8BFD8",
|
|
88
|
+
plum: "#DDA0DD",
|
|
89
|
+
violet: "#EE82EE",
|
|
90
|
+
magenta: "#FF00FF",
|
|
91
|
+
fuchsia: "#FF00FF",
|
|
92
|
+
darkmagenta: "#8B008B",
|
|
93
|
+
purple: "#800080",
|
|
94
|
+
mediumorchid: "#BA55D3",
|
|
95
|
+
darkvoilet: "#9400D3",
|
|
96
|
+
darkorchid: "#9932CC",
|
|
97
|
+
indigo: "#4B0082",
|
|
98
|
+
blueviolet: "#8A2BE2",
|
|
99
|
+
mediumpurple: "#9370DB",
|
|
100
|
+
mediumslateblue: "#7B68EE",
|
|
101
|
+
slateblue: "#6A5ACD",
|
|
102
|
+
darkslateblue: "#483D8B",
|
|
103
|
+
lavender: "#E6E6FA",
|
|
104
|
+
ghostwhite: "#F8F8FF",
|
|
105
|
+
blue: "#0000FF",
|
|
106
|
+
mediumblue: "#0000CD",
|
|
107
|
+
midnightblue: "#191970",
|
|
108
|
+
darkblue: "#00008B",
|
|
109
|
+
navy: "#000080",
|
|
110
|
+
royalblue: "#4169E1",
|
|
111
|
+
cornflowerblue: "#6495ED",
|
|
112
|
+
lightsteelblue: "#B0C4DE",
|
|
113
|
+
lightslategray: "#778899",
|
|
114
|
+
slategray: "#708090",
|
|
115
|
+
doderblue: "#1E90FF",
|
|
116
|
+
aliceblue: "#F0F8FF",
|
|
117
|
+
steelblue: "#4682B4",
|
|
118
|
+
lightskyblue: "#87CEFA",
|
|
119
|
+
skyblue: "#87CEEB",
|
|
120
|
+
deepskyblue: "#00BFFF",
|
|
121
|
+
lightblue: "#ADD8E6",
|
|
122
|
+
powderblue: "#B0E0E6",
|
|
123
|
+
cadetblue: "#5F9EA0",
|
|
124
|
+
azure: "#F0FFFF",
|
|
125
|
+
lightcyan: "#E1FFFF",
|
|
126
|
+
paleturquoise: "#AFEEEE",
|
|
127
|
+
cyan: "#00FFFF",
|
|
128
|
+
aqua: "#D4F2E7",
|
|
129
|
+
darkturquoise: "#00CED1",
|
|
130
|
+
darkslategray: "#2F4F4F",
|
|
131
|
+
darkcyan: "#008B8B",
|
|
132
|
+
teal: "#008080",
|
|
133
|
+
mediumturquoise: "#48D1CC",
|
|
134
|
+
lightseagreen: "#20B2AA",
|
|
135
|
+
turquoise: "#40E0D0",
|
|
136
|
+
auqamarin: "#7FFFAA",
|
|
137
|
+
mediumaquamarine: "#00FA9A",
|
|
138
|
+
mediumspringgreen: "#00FF7F",
|
|
139
|
+
mintcream: "#F5FFFA",
|
|
140
|
+
springgreen: "#3CB371",
|
|
141
|
+
seagreen: "#2E8B57",
|
|
142
|
+
honeydew: "#F0FFF0",
|
|
143
|
+
lightgreen: "#90EE90",
|
|
144
|
+
palegreen: "#98FB98",
|
|
145
|
+
darkseagreen: "#8FBC8F",
|
|
146
|
+
limegreen: "#32CD32",
|
|
147
|
+
lime: "#00FF00",
|
|
148
|
+
forestgreen: "#228B22",
|
|
149
|
+
green: "#008000",
|
|
150
|
+
darkgreen: "#006400",
|
|
151
|
+
chartreuse: "#7FFF00",
|
|
152
|
+
lawngreen: "#7CFC00",
|
|
153
|
+
greenyellow: "#ADFF2F",
|
|
154
|
+
olivedrab: "#556B2F",
|
|
155
|
+
beige: "#F5F5DC",
|
|
156
|
+
lightgoldenrodyellow: "#FAFAD2",
|
|
157
|
+
ivory: "#FFFFF0",
|
|
158
|
+
lightyellow: "#FFFFE0",
|
|
159
|
+
yellow: "#FFFF00",
|
|
160
|
+
olive: "#808000",
|
|
161
|
+
darkkhaki: "#BDB76B",
|
|
162
|
+
lemonchiffon: "#FFFACD",
|
|
163
|
+
palegodenrod: "#EEE8AA",
|
|
164
|
+
khaki: "#F0E68C",
|
|
165
|
+
gold: "#FFD700",
|
|
166
|
+
cornislk: "#FFF8DC",
|
|
167
|
+
goldenrod: "#DAA520",
|
|
168
|
+
floralwhite: "#FFFAF0",
|
|
169
|
+
oldlace: "#FDF5E6",
|
|
170
|
+
wheat: "#F5DEB3",
|
|
171
|
+
moccasin: "#FFE4B5",
|
|
172
|
+
orange: "#FFA500",
|
|
173
|
+
papayawhip: "#FFEFD5",
|
|
174
|
+
blanchedalmond: "#FFEBCD",
|
|
175
|
+
navajowhite: "#FFDEAD",
|
|
176
|
+
antiquewhite: "#FAEBD7",
|
|
177
|
+
tan: "#D2B48C",
|
|
178
|
+
brulywood: "#DEB887",
|
|
179
|
+
bisque: "#FFE4C4",
|
|
180
|
+
darkorange: "#FF8C00",
|
|
181
|
+
linen: "#FAF0E6",
|
|
182
|
+
peru: "#CD853F",
|
|
183
|
+
peachpuff: "#FFDAB9",
|
|
184
|
+
sandybrown: "#F4A460",
|
|
185
|
+
chocolate: "#D2691E",
|
|
186
|
+
saddlebrown: "#8B4513",
|
|
187
|
+
seashell: "#FFF5EE",
|
|
188
|
+
sienna: "#A0522D",
|
|
189
|
+
lightsalmon: "#FFA07A",
|
|
190
|
+
coral: "#FF7F50",
|
|
191
|
+
orangered: "#FF4500",
|
|
192
|
+
darksalmon: "#E9967A",
|
|
193
|
+
tomato: "#FF6347",
|
|
194
|
+
mistyrose: "#FFE4E1",
|
|
195
|
+
salmon: "#FA8072",
|
|
196
|
+
snow: "#FFFAFA",
|
|
197
|
+
lightcoral: "#F08080",
|
|
198
|
+
rosybrown: "#BC8F8F",
|
|
199
|
+
indianred: "#CD5C5C",
|
|
200
|
+
red: "#FF0000",
|
|
201
|
+
brown: "#A52A2A",
|
|
202
|
+
firebrick: "#B22222",
|
|
203
|
+
darkred: "#8B0000",
|
|
204
|
+
maroon: "#800000",
|
|
205
|
+
white: "#FFFFFF",
|
|
206
|
+
whitesmoke: "#F5F5F5",
|
|
207
|
+
gainsboro: "#DCDCDC",
|
|
208
|
+
lightgrey: "#D3D3D3",
|
|
209
|
+
silver: "#C0C0C0",
|
|
210
|
+
darkgray: "#A9A9A9",
|
|
211
|
+
gray: "#808080",
|
|
212
|
+
dimgray: "#696969",
|
|
213
|
+
black: "#000000"
|
|
214
|
+
};
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region baseConfig/color/color.js
|
|
217
|
+
function a(e) {
|
|
218
|
+
if (!e || typeof e != "string") return !1;
|
|
219
|
+
let t = e.trim().toLowerCase(), n = /^#?([0-9A-Fa-f]{3})$/, r = /^#?([0-9A-Fa-f]{6})$/, a = /^#?([0-9A-Fa-f]{8})$/, l = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/, u = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0\.\d+)\s*\)$/, d = /^(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)$/;
|
|
220
|
+
if (a.test(t)) return `#${t.replace("#", "").toUpperCase()}`;
|
|
221
|
+
if (r.test(t)) return `#${t.replace("#", "").toUpperCase()}FF`;
|
|
222
|
+
if (n.test(t)) return `#${t.replace("#", "").split("").map((e) => e + e).join("").toUpperCase()}FF`;
|
|
223
|
+
if (i[t]) {
|
|
224
|
+
let e = i[t].replace("#", "").toUpperCase();
|
|
225
|
+
if (e.length === 8) return `#${e}`;
|
|
226
|
+
if (e.length === 6) return `#${e}FF`;
|
|
227
|
+
}
|
|
228
|
+
return l.test(t) ? o(t.match(l)) : u.test(t) ? s(t.match(u)) : d.test(t) ? c(t.match(d)) : !1;
|
|
229
|
+
}
|
|
230
|
+
function o(e) {
|
|
231
|
+
if (!e || e.length < 4) return !1;
|
|
232
|
+
let [, t, n, r] = e, i = parseInt(t), a = parseInt(n), o = parseInt(r);
|
|
233
|
+
return i < 0 || i > 255 || a < 0 || a > 255 || o < 0 || o > 255 ? !1 : `#${(i << 16 | a << 8 | o).toString(16).padStart(6, "0").toUpperCase()}FF`;
|
|
234
|
+
}
|
|
235
|
+
function s(e) {
|
|
236
|
+
if (!e || e.length < 5) return !1;
|
|
237
|
+
let [, t, n, r, i] = e, a = parseInt(t), o = parseInt(n), s = parseInt(r), c = parseFloat(i);
|
|
238
|
+
return a < 0 || a > 255 || o < 0 || o > 255 || s < 0 || s > 255 || c < 0 || c > 1 ? !1 : `#${(a << 16 | o << 8 | s).toString(16).padStart(6, "0").toUpperCase()}${Math.round(c * 255).toString(16).padStart(2, "0").toUpperCase()}`;
|
|
239
|
+
}
|
|
240
|
+
function c(e) {
|
|
241
|
+
if (!e || e.length < 5) return !1;
|
|
242
|
+
let [, t, n, r, i] = e, a = parseFloat(t), o = parseFloat(n), s = parseFloat(r), c = parseFloat(i), l = a <= 1 && o <= 1 && s <= 1, u, d, f;
|
|
243
|
+
if (l) {
|
|
244
|
+
if (a < 0 || a > 1 || o < 0 || o > 1 || s < 0 || s > 1) return !1;
|
|
245
|
+
u = Math.round(a * 255), d = Math.round(o * 255), f = Math.round(s * 255);
|
|
246
|
+
} else {
|
|
247
|
+
if (a < 0 || a > 255 || o < 0 || o > 255 || s < 0 || s > 255) return !1;
|
|
248
|
+
u = Math.round(a), d = Math.round(o), f = Math.round(s);
|
|
249
|
+
}
|
|
250
|
+
return c < 0 || c > 1 ? !1 : `#${(u << 16 | d << 8 | f).toString(16).padStart(6, "0").toUpperCase()}${Math.round(c * 255).toString(16).padStart(2, "0").toUpperCase()}`;
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region baseConfig/validateHelpers.js
|
|
254
|
+
function l(e, t, n) {
|
|
255
|
+
if (!e || typeof e != "object") return;
|
|
256
|
+
let r = t.split("."), i = r.pop(), a = e;
|
|
257
|
+
for (let e of r) (!(e in a) || typeof a[e] != "object" || a[e] === null) && (a[e] = {}), a = a[e];
|
|
258
|
+
a[i] = n;
|
|
259
|
+
}
|
|
260
|
+
function u(e, t) {
|
|
261
|
+
let { normalized: n, field: r, assign: i } = e || {};
|
|
262
|
+
n && r ? r.includes(".") ? l(n, r, t) : n[r] = t : typeof i == "function" && i(t);
|
|
263
|
+
}
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region baseConfig/validators.js
|
|
266
|
+
function d(e, t = null, n = null) {
|
|
267
|
+
return !(e == null || typeof e != "number" || isNaN(e) || t !== null && e < t || n !== null && e > n);
|
|
268
|
+
}
|
|
269
|
+
function f(e) {
|
|
270
|
+
let t = [];
|
|
271
|
+
if (!e || !Array.isArray(e)) t.push("[coordinates] 为必填项,且必须是数组类型");
|
|
272
|
+
else if (e.length < 3) t.push("[coordinates]包含:[经度, 纬度, 高程]");
|
|
273
|
+
else {
|
|
274
|
+
let [n, r, i] = e;
|
|
275
|
+
d(n, -180, 180) || t.push("[coordinates[0]]经度取值范围:-180~180"), d(r, -90, 90) || t.push("[coordinates[1]]纬度取值范围:-90~90"), d(i) || t.push("[coordinates[2]]高度必须是数字类型");
|
|
276
|
+
}
|
|
277
|
+
return t;
|
|
278
|
+
}
|
|
279
|
+
function p(...e) {
|
|
280
|
+
let t;
|
|
281
|
+
if (e.length === 1 && typeof e[0] == "object" && !Array.isArray(e[0])) t = e[0] || {};
|
|
282
|
+
else {
|
|
283
|
+
let [n, r, i, a, o] = e;
|
|
284
|
+
t = i && typeof i == "object" && !Array.isArray(i) ? {
|
|
285
|
+
value: n,
|
|
286
|
+
field: r,
|
|
287
|
+
...i
|
|
288
|
+
} : {
|
|
289
|
+
value: n,
|
|
290
|
+
field: r,
|
|
291
|
+
min: i,
|
|
292
|
+
max: a,
|
|
293
|
+
normalized: o
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
let { value: n, field: r, label: i, required: a = !0, min: o = null, max: s = null, normalized: c, defaultValue: l, assign: f } = t, p = r || i || "field", m = i || p, h = [], g = !(n == null || n === ""), _ = (e) => {
|
|
297
|
+
u({
|
|
298
|
+
normalized: c,
|
|
299
|
+
field: p,
|
|
300
|
+
assign: f
|
|
301
|
+
}, e);
|
|
302
|
+
};
|
|
303
|
+
if (!g) {
|
|
304
|
+
if (a) h.push(`[${m}]为必填项`);
|
|
305
|
+
else if (l != null) {
|
|
306
|
+
let e = typeof l == "number" ? l : Number(l);
|
|
307
|
+
Number.isNaN(e) || _(e);
|
|
308
|
+
}
|
|
309
|
+
return h;
|
|
310
|
+
}
|
|
311
|
+
return n === null ? (h.push(`[${m}]不能为null`), h) : (d(n, o, s) ? _(n) : o !== null && s !== null ? h.push(`[${m}]取值范围:${o}~${s}`) : o === null ? s === null ? h.push(`[${m}]必须是数字类型`) : h.push(`[${m}]必须≤${s}`) : h.push(`[${m}]必须≥${o}`), h);
|
|
312
|
+
}
|
|
313
|
+
function m(...e) {
|
|
314
|
+
let t;
|
|
315
|
+
if (e.length === 1 && typeof e[0] == "object" && !Array.isArray(e[0])) t = e[0] || {};
|
|
316
|
+
else {
|
|
317
|
+
let [n, r, i = null, a = null] = e;
|
|
318
|
+
t = {
|
|
319
|
+
value: n,
|
|
320
|
+
field: r,
|
|
321
|
+
min: i,
|
|
322
|
+
max: a
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
let { value: n, field: r, label: i, min: a = null, max: o = null, normalized: s, defaultValue: c, assign: l } = t, f = r || i || "field", p = i || f, m = [], h = !(n == null || n === ""), g = (e) => {
|
|
326
|
+
u({
|
|
327
|
+
normalized: s,
|
|
328
|
+
field: f,
|
|
329
|
+
assign: l
|
|
330
|
+
}, e);
|
|
331
|
+
};
|
|
332
|
+
if (!h) {
|
|
333
|
+
if (c != null) {
|
|
334
|
+
let e = typeof c == "number" ? c : Number(c);
|
|
335
|
+
Number.isNaN(e) || (s[f] = Array.isArray(c) ? [...c] : c && typeof c == "object" ? { ...c } : c);
|
|
336
|
+
}
|
|
337
|
+
return m;
|
|
338
|
+
}
|
|
339
|
+
return d(n, a, o) ? g(n) : a !== null && o !== null ? m.push(`[${p}]取值范围:${a}~${o}`) : a === null ? o === null ? m.push(`[${p}]必须是数字类型`) : m.push(`[${p}]必须≤${o}`) : m.push(`[${p}]必须≥${a}`), m;
|
|
340
|
+
}
|
|
341
|
+
function h(...e) {
|
|
342
|
+
let t;
|
|
343
|
+
if (e.length === 1 && typeof e[0] == "object" && !Array.isArray(e[0])) t = e[0] || {};
|
|
344
|
+
else {
|
|
345
|
+
let [n, r] = e;
|
|
346
|
+
t = {
|
|
347
|
+
field: n,
|
|
348
|
+
value: r
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
let { field: n, label: r, value: i, normalized: a, defaultValue: o, assign: s } = t, c = n || r || "field", l = r || c, d = [], f = !(i == null || i === ""), p = (e) => {
|
|
352
|
+
u({
|
|
353
|
+
normalized: a,
|
|
354
|
+
field: c,
|
|
355
|
+
assign: s
|
|
356
|
+
}, e);
|
|
357
|
+
};
|
|
358
|
+
return f ? (typeof i == "string" ? i.trim() === "" ? d.push(`[${l}]不能为空字符串`) : p(i) : d.push(`[${l}]必须是字符串类型`), d) : (d.push(`[${l}]为必填项`), o != null && typeof o == "string" && p(o), d);
|
|
359
|
+
}
|
|
360
|
+
function g(...e) {
|
|
361
|
+
let t;
|
|
362
|
+
if (e.length === 1 && typeof e[0] == "object" && !Array.isArray(e[0])) t = e[0] || {};
|
|
363
|
+
else {
|
|
364
|
+
let [n, r] = e;
|
|
365
|
+
t = {
|
|
366
|
+
field: n,
|
|
367
|
+
value: r
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
let { field: n, label: r, value: i, normalized: a, defaultValue: o, assign: s } = t, c = n || r || "field", l = r || c, d = [], f = !(i == null || i === ""), p = (e) => {
|
|
371
|
+
u({
|
|
372
|
+
normalized: a,
|
|
373
|
+
field: c,
|
|
374
|
+
assign: s
|
|
375
|
+
}, e);
|
|
376
|
+
};
|
|
377
|
+
return f ? (typeof i == "string" ? i.trim() === "" ? d.push(`[${l}]不能为空字符串`) : p(i) : d.push(`[${l}]必须是字符串类型`), d) : (o != null && typeof o == "string" && p(o), d);
|
|
378
|
+
}
|
|
379
|
+
function _(...e) {
|
|
380
|
+
let t;
|
|
381
|
+
if (e.length === 1 && typeof e[0] == "object" && !Array.isArray(e[0])) t = e[0] || {};
|
|
382
|
+
else {
|
|
383
|
+
let [n, r, i, a] = e;
|
|
384
|
+
t = i && typeof i == "object" && !Array.isArray(i) ? {
|
|
385
|
+
label: n,
|
|
386
|
+
value: r,
|
|
387
|
+
...i
|
|
388
|
+
} : {
|
|
389
|
+
label: n,
|
|
390
|
+
value: r,
|
|
391
|
+
length: i,
|
|
392
|
+
minLength: a
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
let { label: n, field: r, value: i, required: a = !1, normalized: o, defaultValue: s, assign: c, length: l, minLength: d, maxLength: f } = t, p = r || n || "field", m = n || p, h = [], g = i != null, _ = (e) => {
|
|
396
|
+
let t = Array.isArray(e) ? [...e] : e;
|
|
397
|
+
u({
|
|
398
|
+
normalized: o,
|
|
399
|
+
field: p,
|
|
400
|
+
assign: c
|
|
401
|
+
}, t);
|
|
402
|
+
};
|
|
403
|
+
if (!g) return a ? h.push(`[${m}]为必填项`) : s !== void 0 && (Array.isArray(s) ? _(s) : h.push(`[${m}] 默认值必须是数组类型`)), h;
|
|
404
|
+
if (!Array.isArray(i)) return h.push(`[${m}]必须是数组类型`), h;
|
|
405
|
+
let v = typeof l == "number" ? l : void 0;
|
|
406
|
+
return v !== void 0 && i.length !== v && h.push(`[${m}]必须是长度为${v}的数组`), typeof d == "number" && i.length < d && h.push(`[${m}]长度至少为${d}`), typeof f == "number" && i.length > f && h.push(`[${m}]长度不能超过${f}`), h.length === 0 && _(i), h;
|
|
407
|
+
}
|
|
408
|
+
function v(...e) {
|
|
409
|
+
let t;
|
|
410
|
+
if (e.length === 1 && typeof e[0] == "object" && !Array.isArray(e[0])) t = e[0] || {};
|
|
411
|
+
else {
|
|
412
|
+
let [n, r, i] = e;
|
|
413
|
+
t = {
|
|
414
|
+
field: n,
|
|
415
|
+
value: r,
|
|
416
|
+
defaultValue: i
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
let { field: n, label: r, value: i, normalized: a, defaultValue: o = [
|
|
420
|
+
0,
|
|
421
|
+
0,
|
|
422
|
+
0
|
|
423
|
+
], assign: s } = t, c = n || r || "field", l = r || c, d = [], f = !(i == null || i === ""), p = (e) => {
|
|
424
|
+
let t = [...e];
|
|
425
|
+
u({
|
|
426
|
+
normalized: a,
|
|
427
|
+
field: c,
|
|
428
|
+
assign: s
|
|
429
|
+
}, t);
|
|
430
|
+
};
|
|
431
|
+
if (!f) return Array.isArray(o) ? p(o.slice(0, 3).map(Number)) : d.push(`[${l}] 默认值必须是数组类型`), d;
|
|
432
|
+
if (!Array.isArray(i)) return d.push(`[${l}]必须是数组类型`), d;
|
|
433
|
+
if (i.length < 3) return d.push(`[${l}]必须包含3个元素 [x, y, z]`), d;
|
|
434
|
+
let m = i.slice(0, 3).map(Number);
|
|
435
|
+
return m.every((e) => Number.isFinite(e)) ? (p(m), d) : (d.push(`[${l}]数组元素必须是数字`), d);
|
|
436
|
+
}
|
|
437
|
+
function y(...e) {
|
|
438
|
+
let t;
|
|
439
|
+
if (e.length === 1 && typeof e[0] == "object" && !Array.isArray(e[0])) t = e[0] || {};
|
|
440
|
+
else {
|
|
441
|
+
let [n, r, i = {}] = e;
|
|
442
|
+
t = {
|
|
443
|
+
label: n,
|
|
444
|
+
value: r,
|
|
445
|
+
...i
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
let { label: n, field: r, value: i, required: o = !1, normalized: s, defaultValue: c, assign: l } = t, d = r || n || "field", f = n || d, p = [], m = !(i == null || i === ""), h = (e) => {
|
|
449
|
+
u({
|
|
450
|
+
normalized: s,
|
|
451
|
+
field: d,
|
|
452
|
+
assign: l
|
|
453
|
+
}, e);
|
|
454
|
+
};
|
|
455
|
+
if (!m) {
|
|
456
|
+
if (o) p.push(`[${f}]为必填项`);
|
|
457
|
+
else if (c != null && c !== "") {
|
|
458
|
+
if (typeof c != "string") return p.push(`[${f}] 默认值必须是字符串类型`), p;
|
|
459
|
+
let e = a(c);
|
|
460
|
+
e ? h(e) : p.push(`${f} 默认值颜色格式不正确`);
|
|
461
|
+
}
|
|
462
|
+
return p;
|
|
463
|
+
}
|
|
464
|
+
if (typeof i != "string") return p.push(`[${f}] 必须是字符串类型`), p;
|
|
465
|
+
let g = a(i);
|
|
466
|
+
return g ? (h(g), p) : (p.push(`${f} 颜色格式不正确`), p);
|
|
467
|
+
}
|
|
468
|
+
function b(e) {
|
|
469
|
+
let { normalized: t, field: n, value: r, defaultValue: i, type: a = "string", list: o = [] } = e, s = [], c = n || "field";
|
|
470
|
+
return r == null || r === "" ? (i != null && t && typeof t == "object" && t && (t[c] = i), s) : a === "string" && typeof r != "string" ? (s.push(`[${c}] 必须是字符串类型`), s) : a === "number" && typeof r != "number" ? (s.push(`[${c}] 必须是数字类型`), s) : !Array.isArray(o) || o.length === 0 ? (s.push(`[${c}] 枚举列表配置错误`), s) : o.includes(r) ? (t && typeof t == "object" && t && (t[c] = r), s) : (s.push(`[${c}] 必须是有效的值: ${o.join(", ")}`), s);
|
|
471
|
+
}
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region api/camera/flyTo.js
|
|
474
|
+
function ee(e) {
|
|
475
|
+
let t = [], n = { ...e };
|
|
476
|
+
return t.push(...f(e.coordinates)), t.push(...m({
|
|
477
|
+
normalized: n,
|
|
478
|
+
field: "pitch",
|
|
479
|
+
value: e.pitch,
|
|
480
|
+
defaultValue: 0,
|
|
481
|
+
min: -90,
|
|
482
|
+
max: 90
|
|
483
|
+
})), t.push(...m({
|
|
484
|
+
normalized: n,
|
|
485
|
+
field: "yaw",
|
|
486
|
+
value: e.yaw,
|
|
487
|
+
defaultValue: 0,
|
|
488
|
+
min: -180,
|
|
489
|
+
max: 180
|
|
490
|
+
})), t.push(...m({
|
|
491
|
+
normalized: n,
|
|
492
|
+
field: "duration",
|
|
493
|
+
value: e.duration,
|
|
494
|
+
defaultValue: 2,
|
|
495
|
+
min: 0,
|
|
496
|
+
max: null
|
|
497
|
+
})), {
|
|
498
|
+
errors: t,
|
|
499
|
+
normalized: n
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region api/camera/focusToID.js
|
|
504
|
+
function te(e) {
|
|
505
|
+
let t = [], n = { ...e };
|
|
506
|
+
return t.push(...h({
|
|
507
|
+
normalized: n,
|
|
508
|
+
field: "id",
|
|
509
|
+
value: e.id
|
|
510
|
+
})), t.push(...m({
|
|
511
|
+
normalized: n,
|
|
512
|
+
field: "pitch",
|
|
513
|
+
value: e.pitch,
|
|
514
|
+
min: -90,
|
|
515
|
+
max: 90
|
|
516
|
+
})), t.push(...m({
|
|
517
|
+
normalized: n,
|
|
518
|
+
field: "yaw",
|
|
519
|
+
value: e.yaw,
|
|
520
|
+
min: -180,
|
|
521
|
+
max: 180
|
|
522
|
+
})), t.push(...m({
|
|
523
|
+
normalized: n,
|
|
524
|
+
field: "duration",
|
|
525
|
+
value: e.duration,
|
|
526
|
+
defaultValue: 2,
|
|
527
|
+
min: 0,
|
|
528
|
+
max: null
|
|
529
|
+
})), t.push(...m({
|
|
530
|
+
normalized: n,
|
|
531
|
+
field: "screenPercent",
|
|
532
|
+
value: e.screenPercent,
|
|
533
|
+
defaultValue: 30,
|
|
534
|
+
min: 0,
|
|
535
|
+
max: 100
|
|
536
|
+
})), {
|
|
537
|
+
errors: t,
|
|
538
|
+
normalized: n
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region api/camera/focusToPoint.js
|
|
543
|
+
function ne(e) {
|
|
544
|
+
let t = [], n = { ...e };
|
|
545
|
+
return t.push(...f(e.coordinates)), t.push(...m({
|
|
546
|
+
normalized: n,
|
|
547
|
+
field: "pitch",
|
|
548
|
+
value: e.pitch,
|
|
549
|
+
defaultValue: 0,
|
|
550
|
+
min: -90,
|
|
551
|
+
max: 90
|
|
552
|
+
})), t.push(...m({
|
|
553
|
+
normalized: n,
|
|
554
|
+
field: "yaw",
|
|
555
|
+
value: e.yaw,
|
|
556
|
+
defaultValue: 0,
|
|
557
|
+
min: -180,
|
|
558
|
+
max: 180
|
|
559
|
+
})), t.push(...m({
|
|
560
|
+
normalized: n,
|
|
561
|
+
field: "duration",
|
|
562
|
+
value: e.duration,
|
|
563
|
+
defaultValue: 2,
|
|
564
|
+
min: 0
|
|
565
|
+
})), t.push(...m({
|
|
566
|
+
normalized: n,
|
|
567
|
+
field: "distance",
|
|
568
|
+
value: e.distance,
|
|
569
|
+
defaultValue: 10,
|
|
570
|
+
min: 0
|
|
571
|
+
})), {
|
|
572
|
+
errors: t,
|
|
573
|
+
normalized: n
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
//#endregion
|
|
577
|
+
//#region api/camera/lookAtID.js
|
|
578
|
+
function re(e) {
|
|
579
|
+
let t = [], n = { ...e };
|
|
580
|
+
return t.push(...h({
|
|
581
|
+
normalized: n,
|
|
582
|
+
field: "id",
|
|
583
|
+
value: e.id
|
|
584
|
+
})), t.push(...m({
|
|
585
|
+
normalized: n,
|
|
586
|
+
field: "duration",
|
|
587
|
+
value: e.duration,
|
|
588
|
+
defaultValue: 2,
|
|
589
|
+
min: 0
|
|
590
|
+
})), {
|
|
591
|
+
errors: t,
|
|
592
|
+
normalized: n
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
//#endregion
|
|
596
|
+
//#region api/camera/lookAtPoint.js
|
|
597
|
+
function ie(e) {
|
|
598
|
+
let t = [], n = { ...e };
|
|
599
|
+
return t.push(...f(e.coordinates)), t.push(...m({
|
|
600
|
+
normalized: n,
|
|
601
|
+
field: "duration",
|
|
602
|
+
value: e.duration,
|
|
603
|
+
defaultValue: 2,
|
|
604
|
+
min: 0
|
|
605
|
+
})), {
|
|
606
|
+
errors: t,
|
|
607
|
+
normalized: n
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region api/camera/config.js
|
|
612
|
+
function ae(e) {
|
|
613
|
+
let t = [], n = { ...e };
|
|
614
|
+
return e.isUseDragLerp !== void 0 && typeof e.isUseDragLerp != "boolean" ? t.push("[isUseDragLerp]必须是布尔类型") : e.isUseDragLerp === void 0 && (n.isUseDragLerp = !0), t.push(...m({
|
|
615
|
+
normalized: n,
|
|
616
|
+
field: "dragLerpSpeed",
|
|
617
|
+
value: e.dragLerpSpeed,
|
|
618
|
+
defaultValue: 9,
|
|
619
|
+
min: 0
|
|
620
|
+
})), t.push(...m({
|
|
621
|
+
normalized: n,
|
|
622
|
+
field: "dragSpeed",
|
|
623
|
+
value: e.dragSpeed,
|
|
624
|
+
defaultValue: 5,
|
|
625
|
+
min: 0
|
|
626
|
+
})), t.push(...m({
|
|
627
|
+
normalized: n,
|
|
628
|
+
field: "pitchAngleOnSwitchDragMode",
|
|
629
|
+
value: e.pitchAngleOnSwitchDragMode,
|
|
630
|
+
defaultValue: 3,
|
|
631
|
+
min: 0
|
|
632
|
+
})), t.push(...m({
|
|
633
|
+
normalized: n,
|
|
634
|
+
field: "scaleSpeed",
|
|
635
|
+
value: e.scaleSpeed,
|
|
636
|
+
defaultValue: 2,
|
|
637
|
+
min: 0
|
|
638
|
+
})), e.isUseMiddleAround !== void 0 && typeof e.isUseMiddleAround != "boolean" ? t.push("[isUseMiddleAround]必须是布尔类型") : e.isUseMiddleAround === void 0 && (n.isUseMiddleAround = !1), e.isUseMousePosOnAround !== void 0 && typeof e.isUseMousePosOnAround != "boolean" ? t.push("[isUseMousePosOnAround]必须是布尔类型") : e.isUseMousePosOnAround === void 0 && (n.isUseMousePosOnAround = !1), t.push(...m({
|
|
639
|
+
normalized: n,
|
|
640
|
+
field: "x_AroundSpeed",
|
|
641
|
+
value: e.x_AroundSpeed,
|
|
642
|
+
defaultValue: 3,
|
|
643
|
+
min: 0
|
|
644
|
+
})), t.push(...m({
|
|
645
|
+
normalized: n,
|
|
646
|
+
field: "y_AroundSpeed",
|
|
647
|
+
value: e.y_AroundSpeed,
|
|
648
|
+
defaultValue: 3,
|
|
649
|
+
min: 0
|
|
650
|
+
})), t.push(...m({
|
|
651
|
+
normalized: n,
|
|
652
|
+
field: "fov",
|
|
653
|
+
value: e.fov,
|
|
654
|
+
defaultValue: 90,
|
|
655
|
+
min: 1,
|
|
656
|
+
max: 180
|
|
657
|
+
})), {
|
|
658
|
+
errors: t,
|
|
659
|
+
normalized: n
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
//#endregion
|
|
663
|
+
//#region api/camera/helpers.js
|
|
664
|
+
function x(e, t, n, r, i) {
|
|
665
|
+
if (n == null || n === "") {
|
|
666
|
+
e[t] = i;
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
if (typeof n != "boolean") {
|
|
670
|
+
r.push(`[${t}]必须是布尔类型`);
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
e[t] = n;
|
|
674
|
+
}
|
|
675
|
+
//#endregion
|
|
676
|
+
//#region api/camera/aroundMode.js
|
|
677
|
+
function oe(e = {}) {
|
|
678
|
+
let t = [], n = { ...e }, r = !(e.id === void 0 || e.id === null || e.id === ""), i = !(e.coordinates === void 0 || e.coordinates === null || e.coordinates === "");
|
|
679
|
+
return r && i ? t.push("[id]与[coordinates]只能二选一,不能同时提供") : !r && !i ? t.push("[id]与[coordinates]必须二选一,至少提供一个") : r ? (t.push(...h({
|
|
680
|
+
normalized: n,
|
|
681
|
+
field: "id",
|
|
682
|
+
value: e.id
|
|
683
|
+
})), delete n.coordinates) : (t.push(...f(e.coordinates)), delete n.id), t.push(...m({
|
|
684
|
+
normalized: n,
|
|
685
|
+
field: "distance",
|
|
686
|
+
value: e.distance,
|
|
687
|
+
defaultValue: 1e4,
|
|
688
|
+
min: 0
|
|
689
|
+
})), t.push(...m({
|
|
690
|
+
normalized: n,
|
|
691
|
+
field: "pitch",
|
|
692
|
+
value: e.pitch,
|
|
693
|
+
defaultValue: 0,
|
|
694
|
+
min: -90,
|
|
695
|
+
max: 90
|
|
696
|
+
})), t.push(...m({
|
|
697
|
+
normalized: n,
|
|
698
|
+
field: "yaw",
|
|
699
|
+
value: e.yaw,
|
|
700
|
+
defaultValue: 0,
|
|
701
|
+
min: -180,
|
|
702
|
+
max: 180
|
|
703
|
+
})), t.push(...m({
|
|
704
|
+
normalized: n,
|
|
705
|
+
field: "duration",
|
|
706
|
+
value: e.duration,
|
|
707
|
+
defaultValue: 2,
|
|
708
|
+
min: 0
|
|
709
|
+
})), t.push(...m({
|
|
710
|
+
normalized: n,
|
|
711
|
+
field: "minDistanceToTarget",
|
|
712
|
+
value: e.minDistanceToTarget,
|
|
713
|
+
defaultValue: 100,
|
|
714
|
+
min: 0
|
|
715
|
+
})), t.push(...m({
|
|
716
|
+
normalized: n,
|
|
717
|
+
field: "maxDistanceToTarget",
|
|
718
|
+
value: e.maxDistanceToTarget,
|
|
719
|
+
defaultValue: 5e4,
|
|
720
|
+
min: 0
|
|
721
|
+
})), t.push(...m({
|
|
722
|
+
normalized: n,
|
|
723
|
+
field: "scaleSpeed",
|
|
724
|
+
value: e.scaleSpeed,
|
|
725
|
+
defaultValue: 30,
|
|
726
|
+
min: 0
|
|
727
|
+
})), t.push(...m({
|
|
728
|
+
normalized: n,
|
|
729
|
+
field: "x_AroundSpeed",
|
|
730
|
+
value: e.x_AroundSpeed,
|
|
731
|
+
defaultValue: 20,
|
|
732
|
+
min: 0
|
|
733
|
+
})), t.push(...m({
|
|
734
|
+
normalized: n,
|
|
735
|
+
field: "y_AroundSpeed",
|
|
736
|
+
value: e.y_AroundSpeed,
|
|
737
|
+
defaultValue: 20,
|
|
738
|
+
min: 0
|
|
739
|
+
})), t.push(...m({
|
|
740
|
+
normalized: n,
|
|
741
|
+
field: "x_AnimSpeed",
|
|
742
|
+
value: e.x_AnimSpeed,
|
|
743
|
+
defaultValue: 5,
|
|
744
|
+
min: 0
|
|
745
|
+
})), t.push(...m({
|
|
746
|
+
normalized: n,
|
|
747
|
+
field: "y_AnimSpeed",
|
|
748
|
+
value: e.y_AnimSpeed,
|
|
749
|
+
defaultValue: 5,
|
|
750
|
+
min: 0
|
|
751
|
+
})), x(n, "isCheckCollision", e.isCheckCollision, t, !1), x(n, "isIgnoreAttachedActors", e.isIgnoreAttachedActors, t, !0), t.push(...m({
|
|
752
|
+
normalized: n,
|
|
753
|
+
field: "collisionOffset",
|
|
754
|
+
value: e.collisionOffset,
|
|
755
|
+
defaultValue: 100,
|
|
756
|
+
min: 0
|
|
757
|
+
})), {
|
|
758
|
+
errors: t,
|
|
759
|
+
normalized: n
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
//#endregion
|
|
763
|
+
//#region api/camera/dragMode.js
|
|
764
|
+
function se(e = {}) {
|
|
765
|
+
return {
|
|
766
|
+
errors: [],
|
|
767
|
+
normalized: { ...e }
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
//#endregion
|
|
771
|
+
//#region api/camera/firstPersonMode.js
|
|
772
|
+
function ce(e = {}) {
|
|
773
|
+
let t = [], n = { ...e };
|
|
774
|
+
return t.push(...f(e.coordinates)), t.push(...m({
|
|
775
|
+
normalized: n,
|
|
776
|
+
field: "pitch",
|
|
777
|
+
value: e.pitch,
|
|
778
|
+
defaultValue: 0,
|
|
779
|
+
min: -90,
|
|
780
|
+
max: 90
|
|
781
|
+
})), t.push(...m({
|
|
782
|
+
normalized: n,
|
|
783
|
+
field: "yaw",
|
|
784
|
+
value: e.yaw,
|
|
785
|
+
defaultValue: 0,
|
|
786
|
+
min: -180,
|
|
787
|
+
max: 180
|
|
788
|
+
})), t.push(...m({
|
|
789
|
+
normalized: n,
|
|
790
|
+
field: "duration",
|
|
791
|
+
value: e.duration,
|
|
792
|
+
defaultValue: 2,
|
|
793
|
+
min: 0
|
|
794
|
+
})), t.push(...m({
|
|
795
|
+
normalized: n,
|
|
796
|
+
field: "speed",
|
|
797
|
+
value: e.speed,
|
|
798
|
+
defaultValue: 2,
|
|
799
|
+
min: 0
|
|
800
|
+
})), x(n, "collision", e.collision, t, !0), {
|
|
801
|
+
errors: t,
|
|
802
|
+
normalized: n
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
//#endregion
|
|
806
|
+
//#region api/camera/viewLock.js
|
|
807
|
+
function le(e = {}) {
|
|
808
|
+
let t = [], n = { ...e };
|
|
809
|
+
return x(n, "state", e.state, t, !1), {
|
|
810
|
+
errors: t,
|
|
811
|
+
normalized: n
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
//#endregion
|
|
815
|
+
//#region api/camera/cameraApi.js
|
|
816
|
+
var ue = r("camera", {
|
|
817
|
+
flyTo: ee,
|
|
818
|
+
focusToID: te,
|
|
819
|
+
focusToPoint: ne,
|
|
820
|
+
lookAtID: re,
|
|
821
|
+
lookAtPoint: ie,
|
|
822
|
+
config: ae,
|
|
823
|
+
aroundMode: oe,
|
|
824
|
+
dragMode: se,
|
|
825
|
+
firstPersonMode: ce,
|
|
826
|
+
viewLock: le
|
|
827
|
+
});
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region api/cesium/helpers.js
|
|
830
|
+
function S(e, t = {}) {
|
|
831
|
+
let { minLength: n = 2, exactLength: r = null, field: i = "points" } = t, a = [], o = [];
|
|
832
|
+
return !e || !Array.isArray(e) ? (a.push(`[${i}] 为必填项,且必须是数组类型`), {
|
|
833
|
+
errors: a,
|
|
834
|
+
validPoints: o
|
|
835
|
+
}) : (r !== null && e.length !== r ? a.push(`[${i}] 长度必须为 ${r}`) : r === null && e.length < n && a.push(`[${i}] 至少需要 ${n} 个坐标点`), e.forEach((e, t) => {
|
|
836
|
+
if (!Array.isArray(e) || e.length < 3) {
|
|
837
|
+
a.push(`[${i}[${t}]] 坐标点格式错误,应为 [经度, 纬度, 高度]`);
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
let [n, r, s] = e;
|
|
841
|
+
d(n, -180, 180) || a.push(`[${i}[${t}][0]] 经度取值范围:-180~180`), d(r, -90, 90) || a.push(`[${i}[${t}][1]] 纬度取值范围:-90~90`), d(s) || a.push(`[${i}[${t}][2]] 高度必须是数字类型`), d(n, -180, 180) && d(r, -90, 90) && d(s) && o.push([
|
|
842
|
+
n,
|
|
843
|
+
r,
|
|
844
|
+
s
|
|
845
|
+
]);
|
|
846
|
+
}), {
|
|
847
|
+
errors: a,
|
|
848
|
+
validPoints: o
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
function C(e, t, n) {
|
|
852
|
+
(n.exactLength != null && t.length === n.exactLength || n.exactLength == null && t.length >= (n.minLength || 0)) && (e.points = t);
|
|
853
|
+
}
|
|
854
|
+
//#endregion
|
|
855
|
+
//#region api/cesium/addMultiLine.js
|
|
856
|
+
function de(e = {}) {
|
|
857
|
+
let t = [], n = { ...e };
|
|
858
|
+
t.push(...h({
|
|
859
|
+
normalized: n,
|
|
860
|
+
field: "name",
|
|
861
|
+
value: e.name
|
|
862
|
+
}));
|
|
863
|
+
let r = {
|
|
864
|
+
minLength: 2,
|
|
865
|
+
field: "points"
|
|
866
|
+
}, { errors: i, validPoints: a } = S(e.points, r);
|
|
867
|
+
return t.push(...i), C(n, a, r), t.push(...y({
|
|
868
|
+
normalized: n,
|
|
869
|
+
field: "color",
|
|
870
|
+
value: e.color,
|
|
871
|
+
defaultValue: "#FF0000CC"
|
|
872
|
+
})), t.push(...m({
|
|
873
|
+
normalized: n,
|
|
874
|
+
field: "lineWidth",
|
|
875
|
+
value: e.lineWidth,
|
|
876
|
+
defaultValue: 1,
|
|
877
|
+
min: 0
|
|
878
|
+
})), {
|
|
879
|
+
errors: t,
|
|
880
|
+
normalized: n
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
//#endregion
|
|
884
|
+
//#region api/cesium/addMultiPolygon.js
|
|
885
|
+
function fe(e = {}) {
|
|
886
|
+
let t = [], n = { ...e };
|
|
887
|
+
t.push(...h({
|
|
888
|
+
normalized: n,
|
|
889
|
+
field: "name",
|
|
890
|
+
value: e.name
|
|
891
|
+
})), t.push(...b({
|
|
892
|
+
normalized: n,
|
|
893
|
+
field: "polygonType",
|
|
894
|
+
value: e.polygonType,
|
|
895
|
+
defaultValue: "rectangle",
|
|
896
|
+
type: "string",
|
|
897
|
+
list: [
|
|
898
|
+
"rectangle",
|
|
899
|
+
"circle",
|
|
900
|
+
"polygon"
|
|
901
|
+
]
|
|
902
|
+
}));
|
|
903
|
+
let r = n.polygonType, i = {
|
|
904
|
+
minLength: 2,
|
|
905
|
+
field: "points"
|
|
906
|
+
};
|
|
907
|
+
r === "rectangle" || r === "circle" ? i = {
|
|
908
|
+
exactLength: 2,
|
|
909
|
+
field: "points"
|
|
910
|
+
} : r === "polygon" && (i = {
|
|
911
|
+
minLength: 3,
|
|
912
|
+
field: "points"
|
|
913
|
+
});
|
|
914
|
+
let { errors: a, validPoints: o } = S(e.points, i);
|
|
915
|
+
return t.push(...a), C(n, o, i), t.push(...y({
|
|
916
|
+
normalized: n,
|
|
917
|
+
field: "color",
|
|
918
|
+
value: e.color,
|
|
919
|
+
defaultValue: "#0099FF99"
|
|
920
|
+
})), {
|
|
921
|
+
errors: t,
|
|
922
|
+
normalized: n
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
//#endregion
|
|
926
|
+
//#region api/cesium/removeDrawn.js
|
|
927
|
+
function pe(e = {}) {
|
|
928
|
+
let t = [], n = { ...e };
|
|
929
|
+
return t.push(...h({
|
|
930
|
+
normalized: n,
|
|
931
|
+
field: "name",
|
|
932
|
+
value: e.name
|
|
933
|
+
})), {
|
|
934
|
+
errors: t,
|
|
935
|
+
normalized: n
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
//#endregion
|
|
939
|
+
//#region api/cesium/removeAllDrawn.js
|
|
940
|
+
function me(e = {}) {
|
|
941
|
+
return {
|
|
942
|
+
errors: [],
|
|
943
|
+
normalized: { ...e }
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
//#endregion
|
|
947
|
+
//#region api/cesium/addTexturedQuad.js
|
|
948
|
+
function he(e = {}) {
|
|
949
|
+
let t = [], n = { ...e };
|
|
950
|
+
t.push(...h({
|
|
951
|
+
normalized: n,
|
|
952
|
+
field: "name",
|
|
953
|
+
value: e.name
|
|
954
|
+
}));
|
|
955
|
+
let r = {
|
|
956
|
+
exactLength: 4,
|
|
957
|
+
field: "points"
|
|
958
|
+
}, { errors: i, validPoints: a } = S(e.points, r);
|
|
959
|
+
return t.push(...i), C(n, a, r), t.push(...h({
|
|
960
|
+
normalized: n,
|
|
961
|
+
field: "texture",
|
|
962
|
+
value: e.texture
|
|
963
|
+
})), {
|
|
964
|
+
errors: t,
|
|
965
|
+
normalized: n
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region api/cesium/startMouseDraw.js
|
|
970
|
+
function ge(e = {}) {
|
|
971
|
+
let t = [], n = { ...e };
|
|
972
|
+
return t.push(...b({
|
|
973
|
+
normalized: n,
|
|
974
|
+
field: "drawMode",
|
|
975
|
+
value: e.drawMode,
|
|
976
|
+
defaultValue: "polyline",
|
|
977
|
+
type: "string",
|
|
978
|
+
list: [
|
|
979
|
+
"polyline",
|
|
980
|
+
"rectangle",
|
|
981
|
+
"circle",
|
|
982
|
+
"polygon"
|
|
983
|
+
]
|
|
984
|
+
})), t.push(...y({
|
|
985
|
+
normalized: n,
|
|
986
|
+
field: "color",
|
|
987
|
+
value: e.color,
|
|
988
|
+
defaultValue: "#FF0000CC"
|
|
989
|
+
})), t.push(...m({
|
|
990
|
+
normalized: n,
|
|
991
|
+
field: "lineWidth",
|
|
992
|
+
value: e.lineWidth,
|
|
993
|
+
defaultValue: 3,
|
|
994
|
+
min: 0
|
|
995
|
+
})), t.push(...g({
|
|
996
|
+
normalized: n,
|
|
997
|
+
field: "name",
|
|
998
|
+
value: e.name
|
|
999
|
+
})), {
|
|
1000
|
+
errors: t,
|
|
1001
|
+
normalized: n
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
//#endregion
|
|
1005
|
+
//#region api/cesium/stopMouseDraw.js
|
|
1006
|
+
function _e(e = {}) {
|
|
1007
|
+
return {
|
|
1008
|
+
errors: [],
|
|
1009
|
+
normalized: { ...e }
|
|
1010
|
+
};
|
|
1011
|
+
}
|
|
1012
|
+
//#endregion
|
|
1013
|
+
//#region api/cesium/getDrawnInfoByName.js
|
|
1014
|
+
function ve(e = {}) {
|
|
1015
|
+
let t = [], n = { ...e };
|
|
1016
|
+
return t.push(...h({
|
|
1017
|
+
normalized: n,
|
|
1018
|
+
field: "name",
|
|
1019
|
+
value: e.name
|
|
1020
|
+
})), {
|
|
1021
|
+
errors: t,
|
|
1022
|
+
normalized: n
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
//#endregion
|
|
1026
|
+
//#region api/cesium/getAllDrawnInfo.js
|
|
1027
|
+
function ye(e = {}) {
|
|
1028
|
+
return {
|
|
1029
|
+
errors: [],
|
|
1030
|
+
normalized: { ...e }
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
//#endregion
|
|
1034
|
+
//#region api/cesium/measureDistance.js
|
|
1035
|
+
function be(e = {}) {
|
|
1036
|
+
let t = [], n = { ...e };
|
|
1037
|
+
t.push(...h({
|
|
1038
|
+
normalized: n,
|
|
1039
|
+
field: "name",
|
|
1040
|
+
value: e.name
|
|
1041
|
+
}));
|
|
1042
|
+
let r = {
|
|
1043
|
+
minLength: 2,
|
|
1044
|
+
field: "points"
|
|
1045
|
+
}, { errors: i, validPoints: a } = S(e.points, r);
|
|
1046
|
+
return t.push(...i), C(n, a, r), {
|
|
1047
|
+
errors: t,
|
|
1048
|
+
normalized: n
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
//#endregion
|
|
1052
|
+
//#region api/cesium/measureArea.js
|
|
1053
|
+
function xe(e = {}) {
|
|
1054
|
+
let t = [], n = { ...e };
|
|
1055
|
+
t.push(...h({
|
|
1056
|
+
normalized: n,
|
|
1057
|
+
field: "name",
|
|
1058
|
+
value: e.name
|
|
1059
|
+
})), t.push(...b({
|
|
1060
|
+
normalized: n,
|
|
1061
|
+
field: "polyType",
|
|
1062
|
+
value: e.polyType,
|
|
1063
|
+
defaultValue: "rectangle",
|
|
1064
|
+
type: "string",
|
|
1065
|
+
list: [
|
|
1066
|
+
"rectangle",
|
|
1067
|
+
"circle",
|
|
1068
|
+
"polygon"
|
|
1069
|
+
]
|
|
1070
|
+
}));
|
|
1071
|
+
let r = n.polyType, i = {
|
|
1072
|
+
minLength: 2,
|
|
1073
|
+
field: "points"
|
|
1074
|
+
};
|
|
1075
|
+
r === "polygon" && (i = {
|
|
1076
|
+
minLength: 3,
|
|
1077
|
+
field: "points"
|
|
1078
|
+
});
|
|
1079
|
+
let { errors: a, validPoints: o } = S(e.points, i);
|
|
1080
|
+
return t.push(...a), C(n, o, i), {
|
|
1081
|
+
errors: t,
|
|
1082
|
+
normalized: n
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
//#endregion
|
|
1086
|
+
//#region api/cesium/cesiumApi.js
|
|
1087
|
+
var Se = r("cesium", {
|
|
1088
|
+
addMultiLine: de,
|
|
1089
|
+
addMultiPolygon: fe,
|
|
1090
|
+
removeDrawn: pe,
|
|
1091
|
+
removeAllDrawn: me,
|
|
1092
|
+
addTexturedQuad: he,
|
|
1093
|
+
startMouseDraw: ge,
|
|
1094
|
+
stopMouseDraw: _e,
|
|
1095
|
+
getDrawnInfoByName: ve,
|
|
1096
|
+
getAllDrawnInfo: ye,
|
|
1097
|
+
measureDistance: be,
|
|
1098
|
+
measureArea: xe
|
|
1099
|
+
});
|
|
1100
|
+
//#endregion
|
|
1101
|
+
//#region api/marker/helpers.js
|
|
1102
|
+
function w(e) {
|
|
1103
|
+
return Array.isArray(e) && e.length === 0 ? void 0 : e;
|
|
1104
|
+
}
|
|
1105
|
+
function T(e) {
|
|
1106
|
+
return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
|
|
1107
|
+
}
|
|
1108
|
+
function E() {
|
|
1109
|
+
return `marker_${Date.now()}`;
|
|
1110
|
+
}
|
|
1111
|
+
function D(e, t, n) {
|
|
1112
|
+
let r = e?.[t];
|
|
1113
|
+
if (r != null) {
|
|
1114
|
+
if (typeof r != "object" || Array.isArray(r)) {
|
|
1115
|
+
n.push(`${t} 必须是对象`);
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
r.color !== void 0 && !T(r.color) && n.push(...y({
|
|
1119
|
+
normalized: r,
|
|
1120
|
+
field: "color",
|
|
1121
|
+
value: r.color
|
|
1122
|
+
})), r.size !== void 0 && !T(r.size) && n.push(..._({
|
|
1123
|
+
normalized: r,
|
|
1124
|
+
field: "size",
|
|
1125
|
+
value: w(r.size),
|
|
1126
|
+
length: 2
|
|
1127
|
+
})), r.padding !== void 0 && !T(r.padding) && n.push(..._({
|
|
1128
|
+
normalized: r,
|
|
1129
|
+
field: "padding",
|
|
1130
|
+
value: w(r.padding),
|
|
1131
|
+
length: 4
|
|
1132
|
+
})), r.backgroundColor !== void 0 && !T(r.backgroundColor) && n.push(...y({
|
|
1133
|
+
normalized: r,
|
|
1134
|
+
field: "backgroundColor",
|
|
1135
|
+
value: r.backgroundColor
|
|
1136
|
+
})), r.margin !== void 0 && !T(r.margin) && n.push(..._({
|
|
1137
|
+
normalized: r,
|
|
1138
|
+
field: "margin",
|
|
1139
|
+
value: w(r.margin),
|
|
1140
|
+
length: 4
|
|
1141
|
+
})), r.borderColor !== void 0 && !T(r.borderColor) && n.push(...y({
|
|
1142
|
+
normalized: r,
|
|
1143
|
+
field: "borderColor",
|
|
1144
|
+
value: r.borderColor
|
|
1145
|
+
})), r.borderWidth !== void 0 && !T(r.borderWidth) && n.push(...m({
|
|
1146
|
+
normalized: r,
|
|
1147
|
+
field: "borderWidth",
|
|
1148
|
+
value: r.borderWidth,
|
|
1149
|
+
min: 0
|
|
1150
|
+
})), r.borderRadius !== void 0 && !T(r.borderRadius) && n.push(...m({
|
|
1151
|
+
normalized: r,
|
|
1152
|
+
field: "borderRadius",
|
|
1153
|
+
value: r.borderRadius,
|
|
1154
|
+
min: 0
|
|
1155
|
+
}));
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
function O(e, t, n) {
|
|
1159
|
+
let r = e?.[t];
|
|
1160
|
+
if (r != null) {
|
|
1161
|
+
if (typeof r != "object" || Array.isArray(r)) {
|
|
1162
|
+
n.push(`${t} 必须是对象`);
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
r.color !== void 0 && !T(r.color) && n.push(...y({
|
|
1166
|
+
normalized: r,
|
|
1167
|
+
field: "color",
|
|
1168
|
+
value: r.color
|
|
1169
|
+
})), r.fontSize !== void 0 && !T(r.fontSize) && n.push(...m({
|
|
1170
|
+
normalized: r,
|
|
1171
|
+
field: "fontSize",
|
|
1172
|
+
value: r.fontSize,
|
|
1173
|
+
min: 0
|
|
1174
|
+
})), r.typeface !== void 0 && !T(r.typeface) && n.push(...b({
|
|
1175
|
+
normalized: r,
|
|
1176
|
+
field: "typeface",
|
|
1177
|
+
value: r.typeface,
|
|
1178
|
+
type: "string",
|
|
1179
|
+
list: [
|
|
1180
|
+
"Bold",
|
|
1181
|
+
"Bold Italic",
|
|
1182
|
+
"Regular",
|
|
1183
|
+
"Italic",
|
|
1184
|
+
"Light"
|
|
1185
|
+
]
|
|
1186
|
+
})), r.outlineSize !== void 0 && !T(r.outlineSize) && n.push(...m({
|
|
1187
|
+
normalized: r,
|
|
1188
|
+
field: "outlineSize",
|
|
1189
|
+
value: r.outlineSize,
|
|
1190
|
+
min: 0
|
|
1191
|
+
})), r.outlineColor !== void 0 && !T(r.outlineColor) && n.push(...y({
|
|
1192
|
+
normalized: r,
|
|
1193
|
+
field: "outlineColor",
|
|
1194
|
+
value: r.outlineColor
|
|
1195
|
+
})), r.shadowOffset !== void 0 && !T(r.shadowOffset) && n.push(..._({
|
|
1196
|
+
normalized: r,
|
|
1197
|
+
field: "shadowOffset",
|
|
1198
|
+
value: w(r.shadowOffset),
|
|
1199
|
+
length: 2
|
|
1200
|
+
})), r.shadowColor !== void 0 && !T(r.shadowColor) && n.push(...y({
|
|
1201
|
+
normalized: r,
|
|
1202
|
+
field: "shadowColor",
|
|
1203
|
+
value: r.shadowColor
|
|
1204
|
+
})), r.padding !== void 0 && !T(r.padding) && n.push(..._({
|
|
1205
|
+
normalized: r,
|
|
1206
|
+
field: "padding",
|
|
1207
|
+
value: w(r.padding),
|
|
1208
|
+
length: 4
|
|
1209
|
+
})), r.backgroundColor !== void 0 && !T(r.backgroundColor) && n.push(...y({
|
|
1210
|
+
normalized: r,
|
|
1211
|
+
field: "backgroundColor",
|
|
1212
|
+
value: r.backgroundColor
|
|
1213
|
+
})), r.margin !== void 0 && !T(r.margin) && n.push(..._({
|
|
1214
|
+
normalized: r,
|
|
1215
|
+
field: "margin",
|
|
1216
|
+
value: w(r.margin),
|
|
1217
|
+
length: 4
|
|
1218
|
+
})), r.borderColor !== void 0 && !T(r.borderColor) && n.push(...y({
|
|
1219
|
+
normalized: r,
|
|
1220
|
+
field: "borderColor",
|
|
1221
|
+
value: r.borderColor
|
|
1222
|
+
})), r.borderWidth !== void 0 && !T(r.borderWidth) && n.push(...m({
|
|
1223
|
+
normalized: r,
|
|
1224
|
+
field: "borderWidth",
|
|
1225
|
+
value: r.borderWidth,
|
|
1226
|
+
min: 0
|
|
1227
|
+
})), r.borderRadius !== void 0 && !T(r.borderRadius) && n.push(...m({
|
|
1228
|
+
normalized: r,
|
|
1229
|
+
field: "borderRadius",
|
|
1230
|
+
value: r.borderRadius,
|
|
1231
|
+
min: 0
|
|
1232
|
+
}));
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
function k(e, t) {
|
|
1236
|
+
let n = e.markerType || "default";
|
|
1237
|
+
e.config ||= {};
|
|
1238
|
+
let r = e.config;
|
|
1239
|
+
n === "flashIcon" ? ke(r, t) : n === "component" ? Te(r, t) : n === "customCom" ? Ee(r, t) : n === "menuIcon" ? Ae(r, t) : n === "flood" ? je(r, t) : n === "capture" ? Me(r, t) : [
|
|
1240
|
+
"anchor1",
|
|
1241
|
+
"anchor2",
|
|
1242
|
+
"anchor3",
|
|
1243
|
+
"anchor4",
|
|
1244
|
+
"anchor5",
|
|
1245
|
+
"anchor6"
|
|
1246
|
+
].includes(n) ? Oe(r, t) : n === "html" ? A(r, t) : n === "url" ? we(r, t) : n === "lod" ? Ce(r, t) : De(r, t);
|
|
1247
|
+
}
|
|
1248
|
+
function Ce(e, t) {
|
|
1249
|
+
if (D(e, "iconStyle", t), O(e, "textStyle", t), e.levels === void 0 || e.levels === null) {
|
|
1250
|
+
e.levels = [];
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1253
|
+
if (!Array.isArray(e.levels)) {
|
|
1254
|
+
t.push("[config.levels]必须是数组");
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
e.levels.forEach((e, n) => {
|
|
1258
|
+
if (!e || typeof e != "object" || Array.isArray(e)) {
|
|
1259
|
+
t.push(`[config.levels[${n}]]必须是对象`);
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
t.push(..._({
|
|
1263
|
+
normalized: e,
|
|
1264
|
+
field: "distance",
|
|
1265
|
+
value: w(e.distance),
|
|
1266
|
+
length: 2
|
|
1267
|
+
})), (!Array.isArray(e.distance) || e.distance.length !== 2) && t.push(`[config.levels[${n}].distance]必填,格式为 [min, max]`), t.push(...g({
|
|
1268
|
+
normalized: e,
|
|
1269
|
+
field: "text",
|
|
1270
|
+
value: e.text,
|
|
1271
|
+
defaultValue: ""
|
|
1272
|
+
})), t.push(...g({
|
|
1273
|
+
normalized: e,
|
|
1274
|
+
field: "iconAddress",
|
|
1275
|
+
value: e.iconAddress,
|
|
1276
|
+
defaultValue: ""
|
|
1277
|
+
})), D(e, "iconStyle", t), O(e, "textStyle", t);
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
function A(e, t) {
|
|
1281
|
+
if (t.push(...m({
|
|
1282
|
+
normalized: e,
|
|
1283
|
+
field: "scale",
|
|
1284
|
+
value: e.scale,
|
|
1285
|
+
defaultValue: 1,
|
|
1286
|
+
min: 0
|
|
1287
|
+
})), t.push(..._({
|
|
1288
|
+
normalized: e,
|
|
1289
|
+
field: "size",
|
|
1290
|
+
value: w(e.size),
|
|
1291
|
+
length: 2
|
|
1292
|
+
})), Array.isArray(e.size) && e.size.length === 2) {
|
|
1293
|
+
let [n, r] = e.size;
|
|
1294
|
+
(typeof n != "number" || Number.isNaN(n) || n <= 0) && t.push("[size[0]]必须是>0的数字"), (typeof r != "number" || Number.isNaN(r) || r <= 0) && t.push("[size[1]]必须是>0的数字");
|
|
1295
|
+
}
|
|
1296
|
+
t.push(...g({
|
|
1297
|
+
normalized: e,
|
|
1298
|
+
field: "content",
|
|
1299
|
+
value: e.content,
|
|
1300
|
+
defaultValue: ""
|
|
1301
|
+
}));
|
|
1302
|
+
}
|
|
1303
|
+
function we(e, t) {
|
|
1304
|
+
if (t.push(..._({
|
|
1305
|
+
normalized: e,
|
|
1306
|
+
field: "size",
|
|
1307
|
+
value: w(e.size),
|
|
1308
|
+
length: 2,
|
|
1309
|
+
defaultValue: [400, 300]
|
|
1310
|
+
})), Array.isArray(e.size) && e.size.length === 2) {
|
|
1311
|
+
let [n, r] = e.size;
|
|
1312
|
+
(typeof n != "number" || Number.isNaN(n) || n <= 0) && t.push("[size[0]]必须是>0的数字"), (typeof r != "number" || Number.isNaN(r) || r <= 0) && t.push("[size[1]]必须是>0的数字");
|
|
1313
|
+
}
|
|
1314
|
+
t.push(...h({
|
|
1315
|
+
normalized: e,
|
|
1316
|
+
field: "url",
|
|
1317
|
+
value: e.url
|
|
1318
|
+
}));
|
|
1319
|
+
}
|
|
1320
|
+
function Te(e, t) {
|
|
1321
|
+
t.push(...y({
|
|
1322
|
+
normalized: e,
|
|
1323
|
+
field: "color",
|
|
1324
|
+
value: e.color,
|
|
1325
|
+
defaultValue: "#1cfeff"
|
|
1326
|
+
})), t.push(..._({
|
|
1327
|
+
normalized: e,
|
|
1328
|
+
field: "padding",
|
|
1329
|
+
value: w(e.padding),
|
|
1330
|
+
length: 4
|
|
1331
|
+
})), t.push(...g({
|
|
1332
|
+
normalized: e,
|
|
1333
|
+
field: "title",
|
|
1334
|
+
value: e.title,
|
|
1335
|
+
defaultValue: ""
|
|
1336
|
+
})), O(e, "titleStyle", t), t.push(..._({
|
|
1337
|
+
normalized: e,
|
|
1338
|
+
field: "dataTexts",
|
|
1339
|
+
value: e.dataTexts,
|
|
1340
|
+
defaultValue: []
|
|
1341
|
+
})), Array.isArray(e.dataTexts) ? e.dataTexts = e.dataTexts.filter((e) => e && typeof e == "object").map((e) => ({
|
|
1342
|
+
key: e.key ?? "",
|
|
1343
|
+
value: e.value ?? ""
|
|
1344
|
+
})) : e.dataTexts = [], O(e, "dataKeyStyle", t), O(e, "dataValueStyle", t);
|
|
1345
|
+
}
|
|
1346
|
+
function Ee(e, t) {
|
|
1347
|
+
t.push(..._({
|
|
1348
|
+
normalized: e,
|
|
1349
|
+
field: "size",
|
|
1350
|
+
value: w(e.size),
|
|
1351
|
+
length: 2,
|
|
1352
|
+
defaultValue: [400, 300]
|
|
1353
|
+
})), t.push(...g({
|
|
1354
|
+
normalized: e,
|
|
1355
|
+
field: "baseAddress",
|
|
1356
|
+
value: e.baseAddress,
|
|
1357
|
+
defaultValue: ""
|
|
1358
|
+
})), t.push(..._({
|
|
1359
|
+
normalized: e,
|
|
1360
|
+
field: "padding",
|
|
1361
|
+
value: w(e.padding),
|
|
1362
|
+
length: 4
|
|
1363
|
+
})), t.push(...g({
|
|
1364
|
+
normalized: e,
|
|
1365
|
+
field: "title",
|
|
1366
|
+
value: e.title,
|
|
1367
|
+
defaultValue: ""
|
|
1368
|
+
})), O(e, "titleStyle", t), t.push(..._({
|
|
1369
|
+
normalized: e,
|
|
1370
|
+
field: "dataTexts",
|
|
1371
|
+
value: e.dataTexts,
|
|
1372
|
+
defaultValue: []
|
|
1373
|
+
})), Array.isArray(e.dataTexts) ? e.dataTexts = e.dataTexts.filter((e) => e && typeof e == "object").map((e) => ({
|
|
1374
|
+
key: e.key ?? "",
|
|
1375
|
+
value: e.value ?? ""
|
|
1376
|
+
})) : e.dataTexts = [], O(e, "dataKeyStyle", t), O(e, "dataValueStyle", t);
|
|
1377
|
+
}
|
|
1378
|
+
function De(e, t) {
|
|
1379
|
+
t.push(...m({
|
|
1380
|
+
normalized: e,
|
|
1381
|
+
field: "scale",
|
|
1382
|
+
value: e.scale,
|
|
1383
|
+
defaultValue: 1,
|
|
1384
|
+
min: 0
|
|
1385
|
+
})), t.push(...g({
|
|
1386
|
+
normalized: e,
|
|
1387
|
+
field: "iconAddress",
|
|
1388
|
+
value: e.iconAddress,
|
|
1389
|
+
defaultValue: ""
|
|
1390
|
+
})), t.push(...g({
|
|
1391
|
+
normalized: e,
|
|
1392
|
+
field: "text",
|
|
1393
|
+
value: e.text,
|
|
1394
|
+
defaultValue: ""
|
|
1395
|
+
})), t.push(..._({
|
|
1396
|
+
normalized: e,
|
|
1397
|
+
field: "textVisibleRange",
|
|
1398
|
+
value: e.textVisibleRange,
|
|
1399
|
+
length: 2,
|
|
1400
|
+
defaultValue: [0, 2147483647]
|
|
1401
|
+
})), D(e, "iconStyle", t), O(e, "textStyle", t);
|
|
1402
|
+
}
|
|
1403
|
+
function Oe(e, t) {
|
|
1404
|
+
t.push(...m({
|
|
1405
|
+
normalized: e,
|
|
1406
|
+
field: "scale",
|
|
1407
|
+
value: e.scale,
|
|
1408
|
+
defaultValue: 1,
|
|
1409
|
+
min: 0
|
|
1410
|
+
})), t.push(...g({
|
|
1411
|
+
normalized: e,
|
|
1412
|
+
field: "iconAddress",
|
|
1413
|
+
value: e.iconAddress,
|
|
1414
|
+
defaultValue: ""
|
|
1415
|
+
})), t.push(...g({
|
|
1416
|
+
normalized: e,
|
|
1417
|
+
field: "text",
|
|
1418
|
+
value: e.text,
|
|
1419
|
+
defaultValue: ""
|
|
1420
|
+
})), t.push(..._({
|
|
1421
|
+
normalized: e,
|
|
1422
|
+
field: "textVisibleRange",
|
|
1423
|
+
value: e.textVisibleRange,
|
|
1424
|
+
length: 2,
|
|
1425
|
+
defaultValue: [0, 2147483647]
|
|
1426
|
+
})), t.push(...y({
|
|
1427
|
+
normalized: e,
|
|
1428
|
+
field: "color",
|
|
1429
|
+
value: e.color
|
|
1430
|
+
})), O(e, "textStyle", t);
|
|
1431
|
+
}
|
|
1432
|
+
function ke(e, t) {
|
|
1433
|
+
t.push(...y({
|
|
1434
|
+
normalized: e,
|
|
1435
|
+
field: "baseColor",
|
|
1436
|
+
value: e.baseColor,
|
|
1437
|
+
defaultValue: "#FF0000"
|
|
1438
|
+
})), t.push(...y({
|
|
1439
|
+
normalized: e,
|
|
1440
|
+
field: "flashColor",
|
|
1441
|
+
value: e.flashColor,
|
|
1442
|
+
defaultValue: "#00FF66"
|
|
1443
|
+
})), t.push(...g({
|
|
1444
|
+
normalized: e,
|
|
1445
|
+
field: "size",
|
|
1446
|
+
value: e.size,
|
|
1447
|
+
defaultValue: "32"
|
|
1448
|
+
})), t.push(...m({
|
|
1449
|
+
normalized: e,
|
|
1450
|
+
field: "centerScale",
|
|
1451
|
+
value: e.centerScale,
|
|
1452
|
+
defaultValue: .5,
|
|
1453
|
+
min: 0,
|
|
1454
|
+
max: 1
|
|
1455
|
+
})), t.push(...m({
|
|
1456
|
+
normalized: e,
|
|
1457
|
+
field: "frequency",
|
|
1458
|
+
value: e.frequency,
|
|
1459
|
+
defaultValue: 1,
|
|
1460
|
+
min: 0
|
|
1461
|
+
}));
|
|
1462
|
+
}
|
|
1463
|
+
function Ae(e, t) {
|
|
1464
|
+
t.push(...y({
|
|
1465
|
+
normalized: e,
|
|
1466
|
+
field: "color",
|
|
1467
|
+
value: e.color,
|
|
1468
|
+
defaultValue: "#1cfeff"
|
|
1469
|
+
})), t.push(...g({
|
|
1470
|
+
normalized: e,
|
|
1471
|
+
field: "title",
|
|
1472
|
+
value: e.title,
|
|
1473
|
+
defaultValue: ""
|
|
1474
|
+
})), t.push(...g({
|
|
1475
|
+
normalized: e,
|
|
1476
|
+
field: "iconAddress",
|
|
1477
|
+
value: e.iconAddress,
|
|
1478
|
+
defaultValue: ""
|
|
1479
|
+
})), t.push(..._({
|
|
1480
|
+
normalized: e,
|
|
1481
|
+
field: "secondVisibleRange",
|
|
1482
|
+
value: e.secondVisibleRange,
|
|
1483
|
+
length: 2,
|
|
1484
|
+
defaultValue: [0, 2147483647]
|
|
1485
|
+
})), t.push(..._({
|
|
1486
|
+
normalized: e,
|
|
1487
|
+
field: "textVisibleRange",
|
|
1488
|
+
value: e.textVisibleRange,
|
|
1489
|
+
length: 2,
|
|
1490
|
+
defaultValue: [0, 2147483647]
|
|
1491
|
+
}));
|
|
1492
|
+
let n = _({
|
|
1493
|
+
normalized: e,
|
|
1494
|
+
field: "tagList",
|
|
1495
|
+
value: e.tagList,
|
|
1496
|
+
length: 4,
|
|
1497
|
+
defaultValue: [
|
|
1498
|
+
{
|
|
1499
|
+
tagId: "id1",
|
|
1500
|
+
iconAddress: 1
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
tagId: "id2",
|
|
1504
|
+
iconAddress: 2
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
tagId: "id3",
|
|
1508
|
+
iconAddress: 3
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
tagId: "id4",
|
|
1512
|
+
iconAddress: 4
|
|
1513
|
+
}
|
|
1514
|
+
]
|
|
1515
|
+
});
|
|
1516
|
+
t.push(...n), n.length === 0 && Array.isArray(e.tagList) && e.tagList.forEach((e, n) => {
|
|
1517
|
+
if (!e) {
|
|
1518
|
+
t.push(`tagList[${n}] 必须是对象`);
|
|
1519
|
+
return;
|
|
1520
|
+
}
|
|
1521
|
+
t.push(...h({
|
|
1522
|
+
normalized: e,
|
|
1523
|
+
field: "tagId",
|
|
1524
|
+
value: e.tagId
|
|
1525
|
+
})), t.push(...m({
|
|
1526
|
+
normalized: e,
|
|
1527
|
+
field: "iconAddress",
|
|
1528
|
+
value: e.iconAddress,
|
|
1529
|
+
min: 0
|
|
1530
|
+
}));
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
function je(e, t) {
|
|
1534
|
+
t.push(...y({
|
|
1535
|
+
normalized: e,
|
|
1536
|
+
field: "color",
|
|
1537
|
+
value: e.color,
|
|
1538
|
+
defaultValue: "#1cfeff"
|
|
1539
|
+
})), t.push(...g({
|
|
1540
|
+
normalized: e,
|
|
1541
|
+
field: "showName",
|
|
1542
|
+
value: e.showName,
|
|
1543
|
+
defaultValue: ""
|
|
1544
|
+
})), t.push(...g({
|
|
1545
|
+
normalized: e,
|
|
1546
|
+
field: "showValue",
|
|
1547
|
+
value: e.showValue,
|
|
1548
|
+
defaultValue: ""
|
|
1549
|
+
})), t.push(...g({
|
|
1550
|
+
normalized: e,
|
|
1551
|
+
field: "showTime",
|
|
1552
|
+
value: e.showTime,
|
|
1553
|
+
defaultValue: ""
|
|
1554
|
+
}));
|
|
1555
|
+
}
|
|
1556
|
+
function Me(e, t) {
|
|
1557
|
+
t.push(...y({
|
|
1558
|
+
normalized: e,
|
|
1559
|
+
field: "color",
|
|
1560
|
+
value: e.color,
|
|
1561
|
+
defaultValue: "#1cfeff"
|
|
1562
|
+
})), t.push(..._({
|
|
1563
|
+
normalized: e,
|
|
1564
|
+
field: "margin",
|
|
1565
|
+
value: w(e.margin),
|
|
1566
|
+
length: 4,
|
|
1567
|
+
defaultValue: [
|
|
1568
|
+
0,
|
|
1569
|
+
0,
|
|
1570
|
+
0,
|
|
1571
|
+
0
|
|
1572
|
+
]
|
|
1573
|
+
})), t.push(...g({
|
|
1574
|
+
normalized: e,
|
|
1575
|
+
field: "title",
|
|
1576
|
+
value: e.title,
|
|
1577
|
+
defaultValue: ""
|
|
1578
|
+
})), O(e, "titleStyle", t), t.push(..._({
|
|
1579
|
+
normalized: e,
|
|
1580
|
+
field: "dataTexts",
|
|
1581
|
+
value: e.dataTexts,
|
|
1582
|
+
defaultValue: []
|
|
1583
|
+
})), Array.isArray(e.dataTexts) && e.dataTexts.length > 0 && typeof e.dataTexts[0] == "string" ? e.dataTexts = e.dataTexts.map((e) => ({
|
|
1584
|
+
key: "",
|
|
1585
|
+
value: e
|
|
1586
|
+
})) : Array.isArray(e.dataTexts) && (e.dataTexts = e.dataTexts.filter((e) => e && typeof e == "object").map((e) => ({
|
|
1587
|
+
key: e.key ?? "",
|
|
1588
|
+
value: e.value ?? ""
|
|
1589
|
+
}))), !e.dataKeyStyle && e.dataTextStyle && (e.dataKeyStyle = e.dataTextStyle), !e.dataValueStyle && e.dataTextStyle && (e.dataValueStyle = e.dataTextStyle), O(e, "dataKeyStyle", t), O(e, "dataValueStyle", t), D(e, "imageStyle", t), t.push(..._({
|
|
1590
|
+
normalized: e,
|
|
1591
|
+
field: "coordinates",
|
|
1592
|
+
value: e.coordinates,
|
|
1593
|
+
length: 3,
|
|
1594
|
+
defaultValue: [
|
|
1595
|
+
112.777328,
|
|
1596
|
+
33.726444,
|
|
1597
|
+
381.310616
|
|
1598
|
+
]
|
|
1599
|
+
})), t.push(...m({
|
|
1600
|
+
normalized: e,
|
|
1601
|
+
field: "pitch",
|
|
1602
|
+
value: e.pitch,
|
|
1603
|
+
defaultValue: 0,
|
|
1604
|
+
min: -90,
|
|
1605
|
+
max: 90
|
|
1606
|
+
})), t.push(...m({
|
|
1607
|
+
normalized: e,
|
|
1608
|
+
field: "yaw",
|
|
1609
|
+
value: e.yaw,
|
|
1610
|
+
defaultValue: 0
|
|
1611
|
+
})), t.push(...m({
|
|
1612
|
+
normalized: e,
|
|
1613
|
+
field: "width",
|
|
1614
|
+
value: e.width,
|
|
1615
|
+
defaultValue: 800,
|
|
1616
|
+
min: 0
|
|
1617
|
+
})), t.push(...m({
|
|
1618
|
+
normalized: e,
|
|
1619
|
+
field: "height",
|
|
1620
|
+
value: e.height,
|
|
1621
|
+
defaultValue: 600,
|
|
1622
|
+
min: 0
|
|
1623
|
+
}));
|
|
1624
|
+
}
|
|
1625
|
+
function Ne(e, t) {
|
|
1626
|
+
t.push(...m({
|
|
1627
|
+
normalized: e,
|
|
1628
|
+
field: "scale",
|
|
1629
|
+
value: e.scale,
|
|
1630
|
+
defaultValue: 1,
|
|
1631
|
+
min: 0
|
|
1632
|
+
})), t.push(...g({
|
|
1633
|
+
normalized: e,
|
|
1634
|
+
field: "iconAddress",
|
|
1635
|
+
value: e.iconAddress,
|
|
1636
|
+
defaultValue: ""
|
|
1637
|
+
})), t.push(...g({
|
|
1638
|
+
normalized: e,
|
|
1639
|
+
field: "text",
|
|
1640
|
+
value: e.text,
|
|
1641
|
+
defaultValue: ""
|
|
1642
|
+
})), t.push(..._({
|
|
1643
|
+
normalized: e,
|
|
1644
|
+
field: "textVisibleRange",
|
|
1645
|
+
value: e.textVisibleRange,
|
|
1646
|
+
length: 2,
|
|
1647
|
+
defaultValue: [0, 2147483647]
|
|
1648
|
+
})), t.push(..._({
|
|
1649
|
+
normalized: e,
|
|
1650
|
+
field: "secondVisibleRange",
|
|
1651
|
+
value: e.secondVisibleRange,
|
|
1652
|
+
length: 2,
|
|
1653
|
+
defaultValue: [0, 2147483647]
|
|
1654
|
+
})), t.push(...g({
|
|
1655
|
+
normalized: e,
|
|
1656
|
+
field: "title",
|
|
1657
|
+
value: e.title,
|
|
1658
|
+
defaultValue: ""
|
|
1659
|
+
})), t.push(...g({
|
|
1660
|
+
normalized: e,
|
|
1661
|
+
field: "detailBtnText",
|
|
1662
|
+
value: e.detailBtnText,
|
|
1663
|
+
defaultValue: ""
|
|
1664
|
+
})), O(e, "textStyle", t), O(e, "titleStyle", t), O(e, "detailStyle", t), O(e, "dataKeyStyle", t), O(e, "dataValueStyle", t), Array.isArray(e.dataTexts) ? e.dataTexts = e.dataTexts.filter((e) => e && typeof e == "object").map((e) => ({
|
|
1665
|
+
key: e.key ?? "",
|
|
1666
|
+
value: e.value ?? ""
|
|
1667
|
+
})) : e.dataTexts = [];
|
|
1668
|
+
}
|
|
1669
|
+
var Pe = [0, 2147483647];
|
|
1670
|
+
function j(e, t, n, r = "visibleRange") {
|
|
1671
|
+
n.push(..._({
|
|
1672
|
+
normalized: t,
|
|
1673
|
+
field: r,
|
|
1674
|
+
value: e[r],
|
|
1675
|
+
length: 2,
|
|
1676
|
+
defaultValue: [...Pe]
|
|
1677
|
+
}));
|
|
1678
|
+
let i = t[r];
|
|
1679
|
+
if (!Array.isArray(i) || i.length !== 2) return;
|
|
1680
|
+
let a = Number(i[0]), o = Number(i[1]);
|
|
1681
|
+
if (!Number.isFinite(a) || !Number.isFinite(o)) {
|
|
1682
|
+
n.push(`[${r}]元素必须是数字`);
|
|
1683
|
+
return;
|
|
1684
|
+
}
|
|
1685
|
+
if (a > o) {
|
|
1686
|
+
n.push(`[${r}]最小值不能大于最大值`);
|
|
1687
|
+
return;
|
|
1688
|
+
}
|
|
1689
|
+
t[r] = [a, o];
|
|
1690
|
+
}
|
|
1691
|
+
var M = [
|
|
1692
|
+
"default",
|
|
1693
|
+
"default1",
|
|
1694
|
+
"default2",
|
|
1695
|
+
"default3",
|
|
1696
|
+
"flashIcon",
|
|
1697
|
+
"component",
|
|
1698
|
+
"customCom",
|
|
1699
|
+
"menuIcon",
|
|
1700
|
+
"flood",
|
|
1701
|
+
"capture",
|
|
1702
|
+
"anchor1",
|
|
1703
|
+
"anchor2",
|
|
1704
|
+
"anchor3",
|
|
1705
|
+
"anchor4",
|
|
1706
|
+
"anchor5",
|
|
1707
|
+
"anchor6",
|
|
1708
|
+
"html",
|
|
1709
|
+
"url",
|
|
1710
|
+
"lod"
|
|
1711
|
+
];
|
|
1712
|
+
//#endregion
|
|
1713
|
+
//#region api/marker/iconMarker.js
|
|
1714
|
+
function Fe(e) {
|
|
1715
|
+
let t = [], n = { ...e };
|
|
1716
|
+
if (e.id === void 0 || e.id === null || e.id === "" ? n.id = E() : n.id = e.id, t.push(...f(e.coordinates)), t.push(...g({
|
|
1717
|
+
normalized: n,
|
|
1718
|
+
field: "groupId",
|
|
1719
|
+
value: e.groupId
|
|
1720
|
+
})), j(e, n, t), t.push(...b({
|
|
1721
|
+
normalized: n,
|
|
1722
|
+
field: "isScreenSpace",
|
|
1723
|
+
value: e.isScreenSpace,
|
|
1724
|
+
defaultValue: 1,
|
|
1725
|
+
type: "number",
|
|
1726
|
+
list: [0, 1]
|
|
1727
|
+
})), e.markerState === void 0 || e.markerState === null ? n.markerState = !0 : typeof e.markerState == "boolean" ? n.markerState = e.markerState : t.push("[markerState]必须是布尔类型"), t.push(...b({
|
|
1728
|
+
normalized: n,
|
|
1729
|
+
field: "markerType",
|
|
1730
|
+
value: e.markerType,
|
|
1731
|
+
defaultValue: "default",
|
|
1732
|
+
type: "string",
|
|
1733
|
+
list: M
|
|
1734
|
+
})), e.recordData !== void 0) {
|
|
1735
|
+
let r = e.recordData;
|
|
1736
|
+
if (typeof r != "object" || !r || Array.isArray(r)) t.push("[recordData] 必须是对象类型");
|
|
1737
|
+
else try {
|
|
1738
|
+
n.recordData = JSON.stringify(r);
|
|
1739
|
+
} catch {
|
|
1740
|
+
t.push("[recordData] 序列化失败,请检查是否包含循环引用");
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
return k(n, t), {
|
|
1744
|
+
errors: t,
|
|
1745
|
+
normalized: n
|
|
1746
|
+
};
|
|
1747
|
+
}
|
|
1748
|
+
//#endregion
|
|
1749
|
+
//#region api/marker/followMarker.js
|
|
1750
|
+
function Ie(e) {
|
|
1751
|
+
let t = [], n = { ...e };
|
|
1752
|
+
if (e.id === void 0 || e.id === null || e.id === "" ? n.id = E() : n.id = e.id, t.push(...h({
|
|
1753
|
+
normalized: n,
|
|
1754
|
+
field: "modelId",
|
|
1755
|
+
value: e.modelId
|
|
1756
|
+
})), t.push(...g({
|
|
1757
|
+
normalized: n,
|
|
1758
|
+
field: "groupId",
|
|
1759
|
+
value: e.groupId
|
|
1760
|
+
})), j(e, n, t), t.push(...b({
|
|
1761
|
+
normalized: n,
|
|
1762
|
+
field: "isScreenSpace",
|
|
1763
|
+
value: e.isScreenSpace,
|
|
1764
|
+
defaultValue: 1,
|
|
1765
|
+
type: "number",
|
|
1766
|
+
list: [0, 1]
|
|
1767
|
+
})), e.markerState === void 0 || e.markerState === null ? n.markerState = !0 : typeof e.markerState == "boolean" ? n.markerState = e.markerState : t.push("[markerState]必须是布尔类型"), t.push(...b({
|
|
1768
|
+
normalized: n,
|
|
1769
|
+
field: "markerType",
|
|
1770
|
+
value: e.markerType,
|
|
1771
|
+
defaultValue: "default",
|
|
1772
|
+
type: "string",
|
|
1773
|
+
list: M
|
|
1774
|
+
})), e.recordData !== void 0) {
|
|
1775
|
+
let r = e.recordData;
|
|
1776
|
+
if (typeof r != "object" || !r || Array.isArray(r)) t.push("[recordData] 必须是对象类型");
|
|
1777
|
+
else try {
|
|
1778
|
+
n.recordData = JSON.stringify(r);
|
|
1779
|
+
} catch {
|
|
1780
|
+
t.push("[recordData] 序列化失败,请检查是否包含循环引用");
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
return k(n, t), {
|
|
1784
|
+
errors: t,
|
|
1785
|
+
normalized: n
|
|
1786
|
+
};
|
|
1787
|
+
}
|
|
1788
|
+
//#endregion
|
|
1789
|
+
//#region api/marker/removeMarker.js
|
|
1790
|
+
function Le(e = {}) {
|
|
1791
|
+
let t = [], n = { ...e };
|
|
1792
|
+
return t.push(..._({
|
|
1793
|
+
normalized: n,
|
|
1794
|
+
field: "groupIds",
|
|
1795
|
+
value: e.groupIds,
|
|
1796
|
+
minLength: 1
|
|
1797
|
+
})), {
|
|
1798
|
+
errors: t,
|
|
1799
|
+
normalized: n
|
|
1800
|
+
};
|
|
1801
|
+
}
|
|
1802
|
+
//#endregion
|
|
1803
|
+
//#region api/marker/removeAllMarker.js
|
|
1804
|
+
function Re(e) {
|
|
1805
|
+
return {
|
|
1806
|
+
errors: [],
|
|
1807
|
+
normalized: { ...e }
|
|
1808
|
+
};
|
|
1809
|
+
}
|
|
1810
|
+
//#endregion
|
|
1811
|
+
//#region api/marker/showMarker.js
|
|
1812
|
+
function ze(e = {}) {
|
|
1813
|
+
let t = [], n = { ...e };
|
|
1814
|
+
return t.push(..._({
|
|
1815
|
+
normalized: n,
|
|
1816
|
+
field: "groupIds",
|
|
1817
|
+
value: e.groupIds,
|
|
1818
|
+
minLength: 1
|
|
1819
|
+
})), {
|
|
1820
|
+
errors: t,
|
|
1821
|
+
normalized: n
|
|
1822
|
+
};
|
|
1823
|
+
}
|
|
1824
|
+
//#endregion
|
|
1825
|
+
//#region api/marker/showAllMarker.js
|
|
1826
|
+
function Be(e = {}) {
|
|
1827
|
+
return {
|
|
1828
|
+
errors: [],
|
|
1829
|
+
normalized: { ...e }
|
|
1830
|
+
};
|
|
1831
|
+
}
|
|
1832
|
+
//#endregion
|
|
1833
|
+
//#region api/marker/hideMarker.js
|
|
1834
|
+
function Ve(e = {}) {
|
|
1835
|
+
let t = [], n = { ...e };
|
|
1836
|
+
return t.push(..._({
|
|
1837
|
+
normalized: n,
|
|
1838
|
+
field: "groupIds",
|
|
1839
|
+
value: e.groupIds,
|
|
1840
|
+
minLength: 1
|
|
1841
|
+
})), {
|
|
1842
|
+
errors: t,
|
|
1843
|
+
normalized: n
|
|
1844
|
+
};
|
|
1845
|
+
}
|
|
1846
|
+
//#endregion
|
|
1847
|
+
//#region api/marker/hideAllMarker.js
|
|
1848
|
+
function He(e = {}) {
|
|
1849
|
+
return {
|
|
1850
|
+
errors: [],
|
|
1851
|
+
normalized: { ...e }
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
//#endregion
|
|
1855
|
+
//#region api/marker/iconUrlMarker.js
|
|
1856
|
+
function Ue(e = {}) {
|
|
1857
|
+
let t = [], n = { ...e };
|
|
1858
|
+
return t.push(...h({
|
|
1859
|
+
normalized: n,
|
|
1860
|
+
field: "url",
|
|
1861
|
+
value: e.url
|
|
1862
|
+
})), {
|
|
1863
|
+
errors: t,
|
|
1864
|
+
normalized: n
|
|
1865
|
+
};
|
|
1866
|
+
}
|
|
1867
|
+
//#endregion
|
|
1868
|
+
//#region api/marker/addClustering.js
|
|
1869
|
+
function We(e) {
|
|
1870
|
+
let t = [], n = { ...e };
|
|
1871
|
+
t.push(...b({
|
|
1872
|
+
normalized: n,
|
|
1873
|
+
field: "type",
|
|
1874
|
+
value: e.type,
|
|
1875
|
+
type: "string",
|
|
1876
|
+
list: ["all", "groupId"]
|
|
1877
|
+
})), n.type === "groupId" ? t.push(..._({
|
|
1878
|
+
normalized: n,
|
|
1879
|
+
field: "value",
|
|
1880
|
+
value: e.value,
|
|
1881
|
+
minLength: 1
|
|
1882
|
+
})) : t.push(..._({
|
|
1883
|
+
normalized: n,
|
|
1884
|
+
field: "value",
|
|
1885
|
+
value: e.value
|
|
1886
|
+
})), t.push(...m({
|
|
1887
|
+
normalized: n,
|
|
1888
|
+
field: "distance",
|
|
1889
|
+
value: e.distance,
|
|
1890
|
+
defaultValue: 0,
|
|
1891
|
+
min: 0
|
|
1892
|
+
})), t.push(...b({
|
|
1893
|
+
normalized: n,
|
|
1894
|
+
field: "clusteringType",
|
|
1895
|
+
value: e.clusteringType,
|
|
1896
|
+
type: "string",
|
|
1897
|
+
list: ["clusteringDefault"]
|
|
1898
|
+
})), n.clusteringConfig ||= {};
|
|
1899
|
+
let r = n.clusteringConfig;
|
|
1900
|
+
return t.push(...y({
|
|
1901
|
+
normalized: r,
|
|
1902
|
+
field: "color",
|
|
1903
|
+
value: r.color,
|
|
1904
|
+
defaultValue: "#1cfeff"
|
|
1905
|
+
})), t.push(...g({
|
|
1906
|
+
normalized: r,
|
|
1907
|
+
field: "text",
|
|
1908
|
+
value: r.text,
|
|
1909
|
+
defaultValue: "${number}"
|
|
1910
|
+
})), O(r, "textStyle", t), {
|
|
1911
|
+
errors: t,
|
|
1912
|
+
normalized: n
|
|
1913
|
+
};
|
|
1914
|
+
}
|
|
1915
|
+
//#endregion
|
|
1916
|
+
//#region api/marker/removeClustering.js
|
|
1917
|
+
function Ge(e) {
|
|
1918
|
+
let t = [], n = { ...e };
|
|
1919
|
+
return t.push(...b({
|
|
1920
|
+
normalized: n,
|
|
1921
|
+
field: "type",
|
|
1922
|
+
value: e.type,
|
|
1923
|
+
type: "string",
|
|
1924
|
+
list: ["all", "groupId"]
|
|
1925
|
+
})), n.type === "groupId" ? t.push(..._({
|
|
1926
|
+
normalized: n,
|
|
1927
|
+
field: "value",
|
|
1928
|
+
value: e.value,
|
|
1929
|
+
minLength: 1
|
|
1930
|
+
})) : t.push(..._({
|
|
1931
|
+
normalized: n,
|
|
1932
|
+
field: "value",
|
|
1933
|
+
value: e.value
|
|
1934
|
+
})), {
|
|
1935
|
+
errors: t,
|
|
1936
|
+
normalized: n
|
|
1937
|
+
};
|
|
1938
|
+
}
|
|
1939
|
+
//#endregion
|
|
1940
|
+
//#region api/marker/secondMarker.js
|
|
1941
|
+
function Ke(e) {
|
|
1942
|
+
let t = [], n = { ...e };
|
|
1943
|
+
e.id === void 0 || e.id === null || e.id === "" ? n.id = E() : n.id = e.id, t.push(...f(e.coordinates)), t.push(...g({
|
|
1944
|
+
normalized: n,
|
|
1945
|
+
field: "groupId",
|
|
1946
|
+
value: e.groupId
|
|
1947
|
+
})), j(e, n, t), t.push(...b({
|
|
1948
|
+
normalized: n,
|
|
1949
|
+
field: "isScreenSpace",
|
|
1950
|
+
value: e.isScreenSpace,
|
|
1951
|
+
defaultValue: 1,
|
|
1952
|
+
type: "number",
|
|
1953
|
+
list: [0, 1]
|
|
1954
|
+
})), typeof e.isInitSecond == "boolean" ? n.isInitSecond = e.isInitSecond : e.isInitSecond === void 0 ? n.isInitSecond = !1 : t.push("[isInitSecond]必须是布尔类型"), t.push(...b({
|
|
1955
|
+
normalized: n,
|
|
1956
|
+
field: "triggerType",
|
|
1957
|
+
value: e.triggerType,
|
|
1958
|
+
defaultValue: "click",
|
|
1959
|
+
type: "string",
|
|
1960
|
+
list: ["click", "move"]
|
|
1961
|
+
})), t.push(...b({
|
|
1962
|
+
normalized: n,
|
|
1963
|
+
field: "markerType",
|
|
1964
|
+
value: e.markerType,
|
|
1965
|
+
defaultValue: "menu1",
|
|
1966
|
+
type: "string",
|
|
1967
|
+
list: [
|
|
1968
|
+
"menu1",
|
|
1969
|
+
"menuIcon",
|
|
1970
|
+
"popupCustom1"
|
|
1971
|
+
]
|
|
1972
|
+
})), (!n.config || typeof n.config != "object") && (n.config = {});
|
|
1973
|
+
let r = n.config;
|
|
1974
|
+
if (n.markerType !== "popupCustom1" && t.push(...y({
|
|
1975
|
+
normalized: r,
|
|
1976
|
+
field: "color",
|
|
1977
|
+
value: r.color,
|
|
1978
|
+
defaultValue: "#1cfeff"
|
|
1979
|
+
})), t.push(...g({
|
|
1980
|
+
normalized: r,
|
|
1981
|
+
field: "title",
|
|
1982
|
+
value: r.title,
|
|
1983
|
+
defaultValue: ""
|
|
1984
|
+
})), n.markerType === "popupCustom1" ? Ne(r, t) : (O(r, "titleStyle", t), O(r, "dataKeyStyle", t), O(r, "dataValueStyle", t), Array.isArray(r.dataTexts) ? r.dataTexts = r.dataTexts.filter((e) => e && typeof e == "object").map((e) => ({
|
|
1985
|
+
key: e.key ?? "",
|
|
1986
|
+
value: e.value ?? ""
|
|
1987
|
+
})) : r.dataTexts = []), e.recordData !== void 0) {
|
|
1988
|
+
let r = e.recordData;
|
|
1989
|
+
if (typeof r != "object" || !r || Array.isArray(r)) t.push("[recordData] 必须是对象类型");
|
|
1990
|
+
else try {
|
|
1991
|
+
n.recordData = JSON.stringify(r);
|
|
1992
|
+
} catch {
|
|
1993
|
+
t.push("[recordData] 序列化失败,请检查是否包含循环引用");
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
return {
|
|
1997
|
+
errors: t,
|
|
1998
|
+
normalized: n
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
2001
|
+
//#endregion
|
|
2002
|
+
//#region api/marker/markerApi.js
|
|
2003
|
+
var qe = r("marker", {
|
|
2004
|
+
iconMarker: Fe,
|
|
2005
|
+
followMarker: Ie,
|
|
2006
|
+
removeMarker: Le,
|
|
2007
|
+
removeAllMarker: Re,
|
|
2008
|
+
showMarker: ze,
|
|
2009
|
+
showAllMarker: Be,
|
|
2010
|
+
hideMarker: Ve,
|
|
2011
|
+
hideAllMarker: He,
|
|
2012
|
+
iconUrlMarker: Ue,
|
|
2013
|
+
addClustering: We,
|
|
2014
|
+
removeClustering: Ge,
|
|
2015
|
+
secondMarker: Ke
|
|
2016
|
+
}, { getOptions: (e) => e === "iconUrlMarker" ? { timeout: 12e4 } : {} });
|
|
2017
|
+
//#endregion
|
|
2018
|
+
//#region api/floodPeak/getList.js
|
|
2019
|
+
function Je(e) {
|
|
2020
|
+
return {
|
|
2021
|
+
errors: [],
|
|
2022
|
+
normalized: { ...e }
|
|
2023
|
+
};
|
|
2024
|
+
}
|
|
2025
|
+
//#endregion
|
|
2026
|
+
//#region api/floodPeak/helpers.js
|
|
2027
|
+
var Ye = (e, t, n) => {
|
|
2028
|
+
e && (n === "default" || n === "default1" || n === "default2" || n === "default3" || n === "default4" || n === "flashIcon") && (t.push(...y({
|
|
2029
|
+
normalized: e,
|
|
2030
|
+
field: "color",
|
|
2031
|
+
value: e.color
|
|
2032
|
+
})), t.push(...m({
|
|
2033
|
+
normalized: e,
|
|
2034
|
+
field: "flowVelocity",
|
|
2035
|
+
value: e.flowVelocity,
|
|
2036
|
+
min: 0
|
|
2037
|
+
})), t.push(...m({
|
|
2038
|
+
normalized: e,
|
|
2039
|
+
field: "peakLength",
|
|
2040
|
+
value: e.peakLength,
|
|
2041
|
+
defaultValue: .5,
|
|
2042
|
+
min: 0,
|
|
2043
|
+
max: 1
|
|
2044
|
+
})), t.push(...m({
|
|
2045
|
+
normalized: e,
|
|
2046
|
+
field: "foam",
|
|
2047
|
+
value: e.foam,
|
|
2048
|
+
defaultValue: 1,
|
|
2049
|
+
min: 0,
|
|
2050
|
+
max: 1
|
|
2051
|
+
})));
|
|
2052
|
+
};
|
|
2053
|
+
//#endregion
|
|
2054
|
+
//#region api/floodPeak/record.js
|
|
2055
|
+
function Xe(e) {
|
|
2056
|
+
let t = [], n = { ...e };
|
|
2057
|
+
t.push(...h({
|
|
2058
|
+
normalized: n,
|
|
2059
|
+
field: "floodPeakName",
|
|
2060
|
+
value: e.floodPeakName
|
|
2061
|
+
})), t.push(...b({
|
|
2062
|
+
normalized: n,
|
|
2063
|
+
field: "materialType",
|
|
2064
|
+
value: e.materialType,
|
|
2065
|
+
defaultValue: "default",
|
|
2066
|
+
type: "string",
|
|
2067
|
+
list: [
|
|
2068
|
+
"default",
|
|
2069
|
+
"default1",
|
|
2070
|
+
"default2",
|
|
2071
|
+
"default3",
|
|
2072
|
+
"default4",
|
|
2073
|
+
"flashIcon"
|
|
2074
|
+
]
|
|
2075
|
+
})), t.push(...m({
|
|
2076
|
+
normalized: n,
|
|
2077
|
+
field: "duration",
|
|
2078
|
+
value: e.duration,
|
|
2079
|
+
min: 0
|
|
2080
|
+
}));
|
|
2081
|
+
let r = n.materialType || e.materialType || "default";
|
|
2082
|
+
return Ye(n.config, t, r), {
|
|
2083
|
+
errors: t,
|
|
2084
|
+
normalized: n
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
2087
|
+
//#endregion
|
|
2088
|
+
//#region api/floodPeak/offset.js
|
|
2089
|
+
function Ze(e) {
|
|
2090
|
+
let t = [], n = { ...e };
|
|
2091
|
+
return t.push(...h({
|
|
2092
|
+
normalized: n,
|
|
2093
|
+
field: "floodPeakName",
|
|
2094
|
+
value: e.floodPeakName
|
|
2095
|
+
})), t.push(...p({
|
|
2096
|
+
normalized: n,
|
|
2097
|
+
field: "height",
|
|
2098
|
+
value: e.height
|
|
2099
|
+
})), {
|
|
2100
|
+
errors: t,
|
|
2101
|
+
normalized: n
|
|
2102
|
+
};
|
|
2103
|
+
}
|
|
2104
|
+
//#endregion
|
|
2105
|
+
//#region api/floodPeak/offsetReset.js
|
|
2106
|
+
function Qe(e) {
|
|
2107
|
+
let t = [], n = { ...e };
|
|
2108
|
+
return t.push(...h({
|
|
2109
|
+
normalized: n,
|
|
2110
|
+
field: "floodPeakName",
|
|
2111
|
+
value: e.floodPeakName
|
|
2112
|
+
})), {
|
|
2113
|
+
errors: t,
|
|
2114
|
+
normalized: n
|
|
2115
|
+
};
|
|
2116
|
+
}
|
|
2117
|
+
//#endregion
|
|
2118
|
+
//#region api/floodPeak/setText.js
|
|
2119
|
+
function $e(e) {
|
|
2120
|
+
let t = [], n = { ...e };
|
|
2121
|
+
t.push(...h({
|
|
2122
|
+
normalized: n,
|
|
2123
|
+
field: "floodPeakName",
|
|
2124
|
+
value: e.floodPeakName
|
|
2125
|
+
}));
|
|
2126
|
+
let r = _({
|
|
2127
|
+
normalized: n,
|
|
2128
|
+
field: "textList",
|
|
2129
|
+
value: e.textList,
|
|
2130
|
+
required: !0,
|
|
2131
|
+
minLength: 1
|
|
2132
|
+
});
|
|
2133
|
+
return t.push(...r), Array.isArray(e.textList) && e.textList.forEach((e, n) => {
|
|
2134
|
+
e != null && typeof e != "string" && t.push(`[textList[${n}]]必须是字符串类型`);
|
|
2135
|
+
}), {
|
|
2136
|
+
errors: t,
|
|
2137
|
+
normalized: n
|
|
2138
|
+
};
|
|
2139
|
+
}
|
|
2140
|
+
//#endregion
|
|
2141
|
+
//#region api/floodPeak/close.js
|
|
2142
|
+
function et(e) {
|
|
2143
|
+
let t = [], n = { ...e };
|
|
2144
|
+
return t.push(...h({
|
|
2145
|
+
normalized: n,
|
|
2146
|
+
field: "floodPeakName",
|
|
2147
|
+
value: e.floodPeakName
|
|
2148
|
+
})), {
|
|
2149
|
+
errors: t,
|
|
2150
|
+
normalized: n
|
|
2151
|
+
};
|
|
2152
|
+
}
|
|
2153
|
+
//#endregion
|
|
2154
|
+
//#region api/floodPeak/cameraFollow.js
|
|
2155
|
+
function tt(e) {
|
|
2156
|
+
let t = [], n = { ...e };
|
|
2157
|
+
t.push(...h({
|
|
2158
|
+
normalized: n,
|
|
2159
|
+
field: "floodPeakName",
|
|
2160
|
+
value: e.floodPeakName
|
|
2161
|
+
}));
|
|
2162
|
+
let r = e.state;
|
|
2163
|
+
r == null ? n.state = !0 : typeof r == "boolean" ? n.state = r : t.push("[state]必须是布尔类型");
|
|
2164
|
+
for (let r of [
|
|
2165
|
+
"x",
|
|
2166
|
+
"y",
|
|
2167
|
+
"z",
|
|
2168
|
+
"yaw"
|
|
2169
|
+
]) t.push(...m({
|
|
2170
|
+
normalized: n,
|
|
2171
|
+
field: r,
|
|
2172
|
+
value: e[r],
|
|
2173
|
+
defaultValue: 0
|
|
2174
|
+
}));
|
|
2175
|
+
return t.push(...m({
|
|
2176
|
+
normalized: n,
|
|
2177
|
+
field: "pitch",
|
|
2178
|
+
value: e.pitch,
|
|
2179
|
+
defaultValue: 0,
|
|
2180
|
+
min: -90,
|
|
2181
|
+
max: 90
|
|
2182
|
+
})), {
|
|
2183
|
+
errors: t,
|
|
2184
|
+
normalized: n
|
|
2185
|
+
};
|
|
2186
|
+
}
|
|
2187
|
+
//#endregion
|
|
2188
|
+
//#region api/floodPeak/floodPeakApi.js
|
|
2189
|
+
var nt = r("floodPeak", {
|
|
2190
|
+
getList: Je,
|
|
2191
|
+
record: Xe,
|
|
2192
|
+
offset: Ze,
|
|
2193
|
+
offsetReset: Qe,
|
|
2194
|
+
setText: $e,
|
|
2195
|
+
close: et,
|
|
2196
|
+
cameraFollow: tt
|
|
2197
|
+
}, { getOptions: () => ({ timeout: 0 }) });
|
|
2198
|
+
//#endregion
|
|
2199
|
+
//#region api/animation/play.js
|
|
2200
|
+
function rt(e = {}) {
|
|
2201
|
+
let t = { ...e }, n = [];
|
|
2202
|
+
return n.push(...h({
|
|
2203
|
+
normalized: t,
|
|
2204
|
+
field: "animName",
|
|
2205
|
+
value: e.animName
|
|
2206
|
+
})), n.push(...m({
|
|
2207
|
+
normalized: t,
|
|
2208
|
+
field: "frameRate",
|
|
2209
|
+
value: e.frameRate,
|
|
2210
|
+
defaultValue: 1,
|
|
2211
|
+
min: 0
|
|
2212
|
+
})), n.push(...m({
|
|
2213
|
+
normalized: t,
|
|
2214
|
+
field: "frameIndex",
|
|
2215
|
+
value: e.frameIndex,
|
|
2216
|
+
defaultValue: 0,
|
|
2217
|
+
min: 0
|
|
2218
|
+
})), e.isSyncview === void 0 || e.isSyncview === null || e.isSyncview === "" ? t.isSyncview = !0 : typeof e.isSyncview == "boolean" ? t.isSyncview = e.isSyncview : n.push("[isSyncview]必须是布尔类型"), {
|
|
2219
|
+
errors: n,
|
|
2220
|
+
normalized: t
|
|
2221
|
+
};
|
|
2222
|
+
}
|
|
2223
|
+
//#endregion
|
|
2224
|
+
//#region api/animation/carryOn.js
|
|
2225
|
+
function it(e = {}) {
|
|
2226
|
+
let t = { ...e };
|
|
2227
|
+
return {
|
|
2228
|
+
errors: [...h({
|
|
2229
|
+
normalized: t,
|
|
2230
|
+
field: "animName",
|
|
2231
|
+
value: e.animName
|
|
2232
|
+
})],
|
|
2233
|
+
normalized: t
|
|
2234
|
+
};
|
|
2235
|
+
}
|
|
2236
|
+
//#endregion
|
|
2237
|
+
//#region api/animation/pause.js
|
|
2238
|
+
function at(e = {}) {
|
|
2239
|
+
let t = { ...e };
|
|
2240
|
+
return {
|
|
2241
|
+
errors: [...h({
|
|
2242
|
+
normalized: t,
|
|
2243
|
+
field: "animName",
|
|
2244
|
+
value: e.animName
|
|
2245
|
+
})],
|
|
2246
|
+
normalized: t
|
|
2247
|
+
};
|
|
2248
|
+
}
|
|
2249
|
+
//#endregion
|
|
2250
|
+
//#region api/animation/stop.js
|
|
2251
|
+
function ot(e = {}) {
|
|
2252
|
+
let t = { ...e };
|
|
2253
|
+
return {
|
|
2254
|
+
errors: [...h({
|
|
2255
|
+
normalized: t,
|
|
2256
|
+
field: "animName",
|
|
2257
|
+
value: e.animName
|
|
2258
|
+
})],
|
|
2259
|
+
normalized: t
|
|
2260
|
+
};
|
|
2261
|
+
}
|
|
2262
|
+
//#endregion
|
|
2263
|
+
//#region api/animation/jumpToFrame.js
|
|
2264
|
+
function st(e = {}) {
|
|
2265
|
+
let t = { ...e }, n = [];
|
|
2266
|
+
return n.push(...h({
|
|
2267
|
+
normalized: t,
|
|
2268
|
+
field: "animName",
|
|
2269
|
+
value: e.animName
|
|
2270
|
+
})), n.push(...p({
|
|
2271
|
+
normalized: t,
|
|
2272
|
+
field: "frameIndex",
|
|
2273
|
+
value: e.frameIndex,
|
|
2274
|
+
required: !0,
|
|
2275
|
+
min: 0
|
|
2276
|
+
})), {
|
|
2277
|
+
errors: n,
|
|
2278
|
+
normalized: t
|
|
2279
|
+
};
|
|
2280
|
+
}
|
|
2281
|
+
//#endregion
|
|
2282
|
+
//#region api/animation/setPlaybackFrameRate.js
|
|
2283
|
+
function ct(e = {}) {
|
|
2284
|
+
let t = { ...e }, n = [];
|
|
2285
|
+
return n.push(...h({
|
|
2286
|
+
normalized: t,
|
|
2287
|
+
field: "animName",
|
|
2288
|
+
value: e.animName
|
|
2289
|
+
})), n.push(...p({
|
|
2290
|
+
normalized: t,
|
|
2291
|
+
field: "frameRate",
|
|
2292
|
+
value: e.frameRate,
|
|
2293
|
+
required: !0,
|
|
2294
|
+
min: 0
|
|
2295
|
+
})), {
|
|
2296
|
+
errors: n,
|
|
2297
|
+
normalized: t
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
//#endregion
|
|
2301
|
+
//#region api/animation/onData.js
|
|
2302
|
+
function lt(e = {}) {
|
|
2303
|
+
let t = [];
|
|
2304
|
+
return e.onChange && typeof e.onChange != "function" && t.push("onChange 必须为函数"), {
|
|
2305
|
+
errors: t,
|
|
2306
|
+
normalized: { ...e }
|
|
2307
|
+
};
|
|
2308
|
+
}
|
|
2309
|
+
//#endregion
|
|
2310
|
+
//#region api/animation/animationApi.js
|
|
2311
|
+
var ut = r("animation", {
|
|
2312
|
+
play: rt,
|
|
2313
|
+
carryOn: it,
|
|
2314
|
+
pause: at,
|
|
2315
|
+
stop: ot,
|
|
2316
|
+
jumpToFrame: st,
|
|
2317
|
+
setPlaybackFrameRate: ct,
|
|
2318
|
+
onData: lt
|
|
2319
|
+
});
|
|
2320
|
+
//#endregion
|
|
2321
|
+
//#region api/hydrodynamicForce/create.js
|
|
2322
|
+
function dt(e) {
|
|
2323
|
+
let t = [], n = { ...e };
|
|
2324
|
+
return t.push(...p({
|
|
2325
|
+
normalized: n,
|
|
2326
|
+
field: "xMin",
|
|
2327
|
+
value: e.xMin,
|
|
2328
|
+
required: !0,
|
|
2329
|
+
min: -180,
|
|
2330
|
+
max: 180
|
|
2331
|
+
})), t.push(...p({
|
|
2332
|
+
normalized: n,
|
|
2333
|
+
field: "xMax",
|
|
2334
|
+
value: e.xMax,
|
|
2335
|
+
required: !0,
|
|
2336
|
+
min: e.xMin,
|
|
2337
|
+
max: 180
|
|
2338
|
+
})), t.push(...p({
|
|
2339
|
+
normalized: n,
|
|
2340
|
+
field: "yMin",
|
|
2341
|
+
value: e.yMin,
|
|
2342
|
+
required: !0,
|
|
2343
|
+
min: -90,
|
|
2344
|
+
max: 90
|
|
2345
|
+
})), t.push(...p({
|
|
2346
|
+
normalized: n,
|
|
2347
|
+
field: "yMax",
|
|
2348
|
+
value: e.yMax,
|
|
2349
|
+
required: !0,
|
|
2350
|
+
min: e.yMin,
|
|
2351
|
+
max: 90
|
|
2352
|
+
})), t.push(...p({
|
|
2353
|
+
normalized: n,
|
|
2354
|
+
field: "minTerrain",
|
|
2355
|
+
value: e.minTerrain,
|
|
2356
|
+
required: !0
|
|
2357
|
+
})), t.push(...p({
|
|
2358
|
+
normalized: n,
|
|
2359
|
+
field: "maxTerrain",
|
|
2360
|
+
value: e.maxTerrain,
|
|
2361
|
+
required: !0,
|
|
2362
|
+
min: e.minTerrain
|
|
2363
|
+
})), t.push(...h({
|
|
2364
|
+
normalized: n,
|
|
2365
|
+
field: "mapUrl",
|
|
2366
|
+
value: e.mapUrl
|
|
2367
|
+
})), t.push(...h({
|
|
2368
|
+
normalized: n,
|
|
2369
|
+
field: "key",
|
|
2370
|
+
value: e.key
|
|
2371
|
+
})), {
|
|
2372
|
+
errors: t,
|
|
2373
|
+
normalized: n
|
|
2374
|
+
};
|
|
2375
|
+
}
|
|
2376
|
+
//#endregion
|
|
2377
|
+
//#region api/hydrodynamicForce/waterFlow.js
|
|
2378
|
+
function ft(e) {
|
|
2379
|
+
let t = [], n = { ...e };
|
|
2380
|
+
return t.push(...p({
|
|
2381
|
+
normalized: n,
|
|
2382
|
+
field: "minWater",
|
|
2383
|
+
value: e.minWater,
|
|
2384
|
+
required: !0
|
|
2385
|
+
})), t.push(...p({
|
|
2386
|
+
normalized: n,
|
|
2387
|
+
field: "maxWater",
|
|
2388
|
+
value: e.maxWater,
|
|
2389
|
+
required: !0,
|
|
2390
|
+
min: e.minWater
|
|
2391
|
+
})), t.push(...p({
|
|
2392
|
+
normalized: n,
|
|
2393
|
+
field: "minU",
|
|
2394
|
+
value: e.minU,
|
|
2395
|
+
required: !0
|
|
2396
|
+
})), t.push(...p({
|
|
2397
|
+
normalized: n,
|
|
2398
|
+
field: "maxU",
|
|
2399
|
+
value: e.maxU,
|
|
2400
|
+
required: !0,
|
|
2401
|
+
min: e.minU
|
|
2402
|
+
})), t.push(...p({
|
|
2403
|
+
normalized: n,
|
|
2404
|
+
field: "minV",
|
|
2405
|
+
value: e.minV,
|
|
2406
|
+
required: !0
|
|
2407
|
+
})), t.push(...p({
|
|
2408
|
+
normalized: n,
|
|
2409
|
+
field: "maxV",
|
|
2410
|
+
value: e.maxV,
|
|
2411
|
+
required: !0,
|
|
2412
|
+
min: e.minV
|
|
2413
|
+
})), t.push(...h({
|
|
2414
|
+
normalized: n,
|
|
2415
|
+
field: "waterFlowUrl",
|
|
2416
|
+
value: e.waterFlowUrl
|
|
2417
|
+
})), t.push(...h({
|
|
2418
|
+
normalized: n,
|
|
2419
|
+
field: "key",
|
|
2420
|
+
value: e.key
|
|
2421
|
+
})), {
|
|
2422
|
+
errors: t,
|
|
2423
|
+
normalized: n
|
|
2424
|
+
};
|
|
2425
|
+
}
|
|
2426
|
+
//#endregion
|
|
2427
|
+
//#region api/hydrodynamicForce/waterDepth.js
|
|
2428
|
+
function pt(e) {
|
|
2429
|
+
let t = [], n = { ...e };
|
|
2430
|
+
return t.push(...p({
|
|
2431
|
+
normalized: n,
|
|
2432
|
+
field: "minWater",
|
|
2433
|
+
value: e.minWater,
|
|
2434
|
+
required: !0
|
|
2435
|
+
})), t.push(...p({
|
|
2436
|
+
normalized: n,
|
|
2437
|
+
field: "maxWater",
|
|
2438
|
+
value: e.maxWater,
|
|
2439
|
+
required: !0,
|
|
2440
|
+
min: e.minWater
|
|
2441
|
+
})), e.rangeList === void 0 || e.rangeList === null ? t.push("[rangeList]为必填项") : Array.isArray(e.rangeList) ? e.rangeList.length === 0 ? t.push("[rangeList]不能为空数组") : e.rangeList.forEach((e, n) => {
|
|
2442
|
+
if (typeof e != "object" || !e) {
|
|
2443
|
+
t.push(`[rangeList[${n}]]必须是对象类型`);
|
|
2444
|
+
return;
|
|
2445
|
+
}
|
|
2446
|
+
t.push(...p({
|
|
2447
|
+
normalized: e,
|
|
2448
|
+
field: "rangeDepth",
|
|
2449
|
+
value: e.rangeDepth,
|
|
2450
|
+
required: !0
|
|
2451
|
+
})), t.push(...h({
|
|
2452
|
+
normalized: e,
|
|
2453
|
+
field: "color",
|
|
2454
|
+
value: e.color
|
|
2455
|
+
}));
|
|
2456
|
+
}) : t.push("[rangeList]必须是数组类型"), t.push(...h({
|
|
2457
|
+
normalized: n,
|
|
2458
|
+
field: "waterDepthUrl",
|
|
2459
|
+
value: e.waterDepthUrl
|
|
2460
|
+
})), t.push(...h({
|
|
2461
|
+
normalized: n,
|
|
2462
|
+
field: "key",
|
|
2463
|
+
value: e.key
|
|
2464
|
+
})), {
|
|
2465
|
+
errors: t,
|
|
2466
|
+
normalized: n
|
|
2467
|
+
};
|
|
2468
|
+
}
|
|
2469
|
+
//#endregion
|
|
2470
|
+
//#region api/hydrodynamicForce/sediment.js
|
|
2471
|
+
function mt(e) {
|
|
2472
|
+
let t = [], n = { ...e };
|
|
2473
|
+
return t.push(...h({
|
|
2474
|
+
normalized: n,
|
|
2475
|
+
field: "key",
|
|
2476
|
+
value: e.key
|
|
2477
|
+
})), t.push(...h({
|
|
2478
|
+
normalized: n,
|
|
2479
|
+
field: "sedimentTexUrl",
|
|
2480
|
+
value: e.sedimentTexUrl
|
|
2481
|
+
})), t.push(...p({
|
|
2482
|
+
normalized: n,
|
|
2483
|
+
field: "minWater",
|
|
2484
|
+
value: e.minWater,
|
|
2485
|
+
required: !0
|
|
2486
|
+
})), t.push(...p({
|
|
2487
|
+
normalized: n,
|
|
2488
|
+
field: "maxWater",
|
|
2489
|
+
value: e.maxWater,
|
|
2490
|
+
required: !0,
|
|
2491
|
+
min: e.minWater
|
|
2492
|
+
})), t.push(...p({
|
|
2493
|
+
normalized: n,
|
|
2494
|
+
field: "minDoD",
|
|
2495
|
+
value: e.minDoD,
|
|
2496
|
+
required: !0
|
|
2497
|
+
})), t.push(...p({
|
|
2498
|
+
normalized: n,
|
|
2499
|
+
field: "maxDoD",
|
|
2500
|
+
value: e.maxDoD,
|
|
2501
|
+
required: !0,
|
|
2502
|
+
min: e.minDoD
|
|
2503
|
+
})), {
|
|
2504
|
+
errors: t,
|
|
2505
|
+
normalized: n
|
|
2506
|
+
};
|
|
2507
|
+
}
|
|
2508
|
+
//#endregion
|
|
2509
|
+
//#region api/hydrodynamicForce/materialParams.js
|
|
2510
|
+
function ht(e = {}) {
|
|
2511
|
+
let t = [], n = { ...e };
|
|
2512
|
+
return t.push(...h({
|
|
2513
|
+
normalized: n,
|
|
2514
|
+
field: "key",
|
|
2515
|
+
value: e.key
|
|
2516
|
+
})), t.push(...m({
|
|
2517
|
+
normalized: n,
|
|
2518
|
+
field: "heightOffset",
|
|
2519
|
+
value: e.heightOffset,
|
|
2520
|
+
defaultValue: 0
|
|
2521
|
+
})), t.push(...m({
|
|
2522
|
+
normalized: n,
|
|
2523
|
+
field: "resolutionScale",
|
|
2524
|
+
value: e.resolutionScale,
|
|
2525
|
+
defaultValue: .2,
|
|
2526
|
+
min: 0
|
|
2527
|
+
})), t.push(...m({
|
|
2528
|
+
normalized: n,
|
|
2529
|
+
field: "cameraLODDistance",
|
|
2530
|
+
value: e.cameraLODDistance,
|
|
2531
|
+
defaultValue: 4e4,
|
|
2532
|
+
min: 0
|
|
2533
|
+
})), t.push(...m({
|
|
2534
|
+
normalized: n,
|
|
2535
|
+
field: "cameraLODNum",
|
|
2536
|
+
value: e.cameraLODNum,
|
|
2537
|
+
defaultValue: 4,
|
|
2538
|
+
min: 0
|
|
2539
|
+
})), t.push(...m({
|
|
2540
|
+
normalized: n,
|
|
2541
|
+
field: "cameraRemapMaxOffest",
|
|
2542
|
+
value: e.cameraRemapMaxOffest,
|
|
2543
|
+
defaultValue: 40,
|
|
2544
|
+
min: 0
|
|
2545
|
+
})), t.push(...m({
|
|
2546
|
+
normalized: n,
|
|
2547
|
+
field: "flowAmplitude",
|
|
2548
|
+
value: e.flowAmplitude,
|
|
2549
|
+
defaultValue: .5,
|
|
2550
|
+
min: 0
|
|
2551
|
+
})), t.push(...m({
|
|
2552
|
+
normalized: n,
|
|
2553
|
+
field: "flowFrequency",
|
|
2554
|
+
value: e.flowFrequency,
|
|
2555
|
+
defaultValue: .5,
|
|
2556
|
+
min: 0
|
|
2557
|
+
})), {
|
|
2558
|
+
errors: t,
|
|
2559
|
+
normalized: n
|
|
2560
|
+
};
|
|
2561
|
+
}
|
|
2562
|
+
//#endregion
|
|
2563
|
+
//#region api/hydrodynamicForce/close.js
|
|
2564
|
+
function gt(e) {
|
|
2565
|
+
let t = [], n = { ...e };
|
|
2566
|
+
return t.push(...h({
|
|
2567
|
+
normalized: n,
|
|
2568
|
+
field: "key",
|
|
2569
|
+
value: e.key
|
|
2570
|
+
})), {
|
|
2571
|
+
errors: t,
|
|
2572
|
+
normalized: n
|
|
2573
|
+
};
|
|
2574
|
+
}
|
|
2575
|
+
//#endregion
|
|
2576
|
+
//#region api/hydrodynamicForce/hydrodynamicForceApi.js
|
|
2577
|
+
var _t = r("hydrodynamicForce", {
|
|
2578
|
+
create: dt,
|
|
2579
|
+
waterFlow: ft,
|
|
2580
|
+
waterDepth: pt,
|
|
2581
|
+
sediment: mt,
|
|
2582
|
+
materialParams: ht,
|
|
2583
|
+
close: gt
|
|
2584
|
+
});
|
|
2585
|
+
//#endregion
|
|
2586
|
+
//#region api/sceneModel/getById.js
|
|
2587
|
+
function vt(e) {
|
|
2588
|
+
let t = [], n = { ...e };
|
|
2589
|
+
return t.push(...h({
|
|
2590
|
+
normalized: n,
|
|
2591
|
+
field: "id",
|
|
2592
|
+
value: e.id
|
|
2593
|
+
})), {
|
|
2594
|
+
errors: t,
|
|
2595
|
+
normalized: n
|
|
2596
|
+
};
|
|
2597
|
+
}
|
|
2598
|
+
//#endregion
|
|
2599
|
+
//#region api/sceneModel/getByTag.js
|
|
2600
|
+
function yt(e) {
|
|
2601
|
+
let t = [], n = { ...e };
|
|
2602
|
+
return t.push(...h({
|
|
2603
|
+
normalized: n,
|
|
2604
|
+
field: "tag",
|
|
2605
|
+
value: e.tag
|
|
2606
|
+
})), {
|
|
2607
|
+
errors: t,
|
|
2608
|
+
normalized: n
|
|
2609
|
+
};
|
|
2610
|
+
}
|
|
2611
|
+
//#endregion
|
|
2612
|
+
//#region api/sceneModel/helpers.js
|
|
2613
|
+
var N = (e) => !(e == null || e === "");
|
|
2614
|
+
function P(e, { id: t, tag: n }) {
|
|
2615
|
+
let r = N(t), i = N(n);
|
|
2616
|
+
if (!r && !i) {
|
|
2617
|
+
e.push("[id]和[tag]必须提供其中一个");
|
|
2618
|
+
return;
|
|
2619
|
+
}
|
|
2620
|
+
if (r && i) {
|
|
2621
|
+
e.push("[id]和[tag]不能同时提供");
|
|
2622
|
+
return;
|
|
2623
|
+
}
|
|
2624
|
+
r ? e.push(...g({
|
|
2625
|
+
field: "id",
|
|
2626
|
+
value: t
|
|
2627
|
+
})) : i && e.push(...g({
|
|
2628
|
+
field: "tag",
|
|
2629
|
+
value: n
|
|
2630
|
+
}));
|
|
2631
|
+
}
|
|
2632
|
+
function F(e, t, n) {
|
|
2633
|
+
if (e == null) return;
|
|
2634
|
+
if (typeof e != "object") {
|
|
2635
|
+
n.push(`[${t}]必须是对象类型`);
|
|
2636
|
+
return;
|
|
2637
|
+
}
|
|
2638
|
+
let { x: r, y: i, z: a } = e;
|
|
2639
|
+
if (r != null) {
|
|
2640
|
+
let e = r === "" ? NaN : r;
|
|
2641
|
+
n.push(...m({
|
|
2642
|
+
field: `${t}.x`,
|
|
2643
|
+
value: e
|
|
2644
|
+
}));
|
|
2645
|
+
}
|
|
2646
|
+
if (i != null) {
|
|
2647
|
+
let e = i === "" ? NaN : i;
|
|
2648
|
+
n.push(...m({
|
|
2649
|
+
field: `${t}.y`,
|
|
2650
|
+
value: e
|
|
2651
|
+
}));
|
|
2652
|
+
}
|
|
2653
|
+
if (a != null) {
|
|
2654
|
+
let e = a === "" ? NaN : a;
|
|
2655
|
+
n.push(...m({
|
|
2656
|
+
field: `${t}.z`,
|
|
2657
|
+
value: e
|
|
2658
|
+
}));
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
function I(e, t, n) {
|
|
2662
|
+
let r = (t, n) => N(n) ? Array.isArray(n) ? n.length === 0 ? (e.push(`[${t}]不能为空数组`), !1) : !0 : (e.push(`[${t}]必须是数组类型`), !1) : !1, i = r("ids", t), a = r("tags", n);
|
|
2663
|
+
!i && !a ? e.push("[ids]和[tags]必须提供其中一个") : i && a && e.push("[ids]和[tags]不能同时提供");
|
|
2664
|
+
}
|
|
2665
|
+
var bt = [
|
|
2666
|
+
"None",
|
|
2667
|
+
"Color",
|
|
2668
|
+
"Texture",
|
|
2669
|
+
"Material"
|
|
2670
|
+
];
|
|
2671
|
+
function L(e, t, n, r, i) {
|
|
2672
|
+
if (r == null) {
|
|
2673
|
+
t[n] = i;
|
|
2674
|
+
return;
|
|
2675
|
+
}
|
|
2676
|
+
if (typeof r != "boolean") {
|
|
2677
|
+
e.push(`[${n}]必须是布尔类型`);
|
|
2678
|
+
return;
|
|
2679
|
+
}
|
|
2680
|
+
t[n] = r;
|
|
2681
|
+
}
|
|
2682
|
+
//#endregion
|
|
2683
|
+
//#region api/sceneModel/setTransform.js
|
|
2684
|
+
function xt(e) {
|
|
2685
|
+
let t = [], n = { ...e };
|
|
2686
|
+
return P(t, e), F(e.rotation, "rotation", t), F(e.scale, "scale", t), F(e.translation, "translation", t), t.push(...m({
|
|
2687
|
+
normalized: n,
|
|
2688
|
+
field: "duration",
|
|
2689
|
+
value: e.duration,
|
|
2690
|
+
defaultValue: 0,
|
|
2691
|
+
min: 0
|
|
2692
|
+
})), e.list !== void 0 && e.list !== null && (Array.isArray(e.list) ? e.list.forEach((e, n) => {
|
|
2693
|
+
if (typeof e != "object" || !e) {
|
|
2694
|
+
t.push(`[list[${n}]]必须是对象类型`);
|
|
2695
|
+
return;
|
|
2696
|
+
}
|
|
2697
|
+
F(e.rotation, `list[${n}].rotation`, t), F(e.scale, `list[${n}].scale`, t), F(e.translation, `list[${n}].translation`, t), t.push(...m({
|
|
2698
|
+
normalized: e,
|
|
2699
|
+
field: "duration",
|
|
2700
|
+
value: e.duration,
|
|
2701
|
+
min: 0
|
|
2702
|
+
}));
|
|
2703
|
+
}) : t.push("[list]必须是数组类型")), {
|
|
2704
|
+
errors: t,
|
|
2705
|
+
normalized: n
|
|
2706
|
+
};
|
|
2707
|
+
}
|
|
2708
|
+
//#endregion
|
|
2709
|
+
//#region api/sceneModel/clearTransform.js
|
|
2710
|
+
function St(e) {
|
|
2711
|
+
let t = [], n = { ...e };
|
|
2712
|
+
return P(t, e), {
|
|
2713
|
+
errors: t,
|
|
2714
|
+
normalized: n
|
|
2715
|
+
};
|
|
2716
|
+
}
|
|
2717
|
+
//#endregion
|
|
2718
|
+
//#region api/sceneModel/offset.js
|
|
2719
|
+
function Ct(e) {
|
|
2720
|
+
let t = [], n = { ...e };
|
|
2721
|
+
return P(t, e), F(e.rotation, "rotation", t), F(e.scale, "scale", t), F(e.translation, "translation", t), t.push(...m({
|
|
2722
|
+
normalized: n,
|
|
2723
|
+
field: "duration",
|
|
2724
|
+
value: e.duration,
|
|
2725
|
+
defaultValue: 0,
|
|
2726
|
+
min: 0
|
|
2727
|
+
})), e.list !== void 0 && e.list !== null && (Array.isArray(e.list) ? e.list.forEach((e, n) => {
|
|
2728
|
+
if (typeof e != "object" || !e) {
|
|
2729
|
+
t.push(`[list[${n}]]必须是对象类型`);
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
F(e.rotation, `list[${n}].rotation`, t), F(e.scale, `list[${n}].scale`, t), F(e.translation, `list[${n}].translation`, t), t.push(...m({
|
|
2733
|
+
normalized: e,
|
|
2734
|
+
field: "duration",
|
|
2735
|
+
value: e.duration,
|
|
2736
|
+
min: 0
|
|
2737
|
+
}));
|
|
2738
|
+
}) : t.push("[list]必须是数组类型")), {
|
|
2739
|
+
errors: t,
|
|
2740
|
+
normalized: n
|
|
2741
|
+
};
|
|
2742
|
+
}
|
|
2743
|
+
//#endregion
|
|
2744
|
+
//#region api/sceneModel/clearOffset.js
|
|
2745
|
+
function wt(e) {
|
|
2746
|
+
let t = [], n = { ...e };
|
|
2747
|
+
return P(t, e), {
|
|
2748
|
+
errors: t,
|
|
2749
|
+
normalized: n
|
|
2750
|
+
};
|
|
2751
|
+
}
|
|
2752
|
+
//#endregion
|
|
2753
|
+
//#region api/sceneModel/show.js
|
|
2754
|
+
function Tt(e) {
|
|
2755
|
+
let t = [], n = { ...e };
|
|
2756
|
+
return I(t, e.ids, e.tags), {
|
|
2757
|
+
errors: t,
|
|
2758
|
+
normalized: n
|
|
2759
|
+
};
|
|
2760
|
+
}
|
|
2761
|
+
//#endregion
|
|
2762
|
+
//#region api/sceneModel/hide.js
|
|
2763
|
+
function Et(e) {
|
|
2764
|
+
let t = [], n = { ...e };
|
|
2765
|
+
return I(t, e.ids, e.tags), {
|
|
2766
|
+
errors: t,
|
|
2767
|
+
normalized: n
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
//#endregion
|
|
2771
|
+
//#region api/sceneModel/showOnly.js
|
|
2772
|
+
function Dt(e) {
|
|
2773
|
+
let t = [], n = { ...e };
|
|
2774
|
+
return I(t, e.ids, e.tags), e.isIgnoreMarker !== void 0 && typeof e.isIgnoreMarker != "boolean" ? t.push("[isIgnoreMarker]必须是布尔类型") : e.isIgnoreMarker === void 0 ? n.isIgnoreMarker = !0 : n.isIgnoreMarker = e.isIgnoreMarker, e.isIgnoreSky !== void 0 && typeof e.isIgnoreSky != "boolean" ? t.push("[isIgnoreSky]必须是布尔类型") : e.isIgnoreSky === void 0 ? n.isIgnoreSky = !1 : n.isIgnoreSky = e.isIgnoreSky, {
|
|
2775
|
+
errors: t,
|
|
2776
|
+
normalized: n
|
|
2777
|
+
};
|
|
2778
|
+
}
|
|
2779
|
+
//#endregion
|
|
2780
|
+
//#region api/sceneModel/highLight.js
|
|
2781
|
+
function Ot(e) {
|
|
2782
|
+
let t = [], n = { ...e };
|
|
2783
|
+
return I(t, e.ids, e.tags), n.config ||= {}, t.push(...y({
|
|
2784
|
+
normalized: n.config,
|
|
2785
|
+
field: "color",
|
|
2786
|
+
value: n.config.color,
|
|
2787
|
+
defaultValue: "#003748"
|
|
2788
|
+
})), t.push(...m({
|
|
2789
|
+
normalized: n.config,
|
|
2790
|
+
field: "opacity",
|
|
2791
|
+
value: n.config.opacity,
|
|
2792
|
+
min: 0,
|
|
2793
|
+
max: 1
|
|
2794
|
+
})), t.push(...m({
|
|
2795
|
+
normalized: n.config,
|
|
2796
|
+
field: "minBrightness",
|
|
2797
|
+
value: n.config.minBrightness,
|
|
2798
|
+
min: 0
|
|
2799
|
+
})), t.push(...m({
|
|
2800
|
+
normalized: n.config,
|
|
2801
|
+
field: "maxBrightness",
|
|
2802
|
+
value: n.config.maxBrightness,
|
|
2803
|
+
min: n.config.minBrightness
|
|
2804
|
+
})), t.push(...m({
|
|
2805
|
+
normalized: n.config,
|
|
2806
|
+
field: "frequency",
|
|
2807
|
+
value: n.config.frequency,
|
|
2808
|
+
defaultValue: 2,
|
|
2809
|
+
min: 0
|
|
2810
|
+
})), {
|
|
2811
|
+
errors: t,
|
|
2812
|
+
normalized: n
|
|
2813
|
+
};
|
|
2814
|
+
}
|
|
2815
|
+
//#endregion
|
|
2816
|
+
//#region api/sceneModel/removeHighLight.js
|
|
2817
|
+
function kt(e) {
|
|
2818
|
+
let t = [], n = { ...e };
|
|
2819
|
+
return I(t, e.ids, e.tags), {
|
|
2820
|
+
errors: t,
|
|
2821
|
+
normalized: n
|
|
2822
|
+
};
|
|
2823
|
+
}
|
|
2824
|
+
//#endregion
|
|
2825
|
+
//#region api/sceneModel/setOpacity.js
|
|
2826
|
+
function At(e) {
|
|
2827
|
+
let t = [], n = { ...e };
|
|
2828
|
+
return I(t, e.ids, e.tags), n.config ||= {}, t.push(...m({
|
|
2829
|
+
normalized: n.config,
|
|
2830
|
+
field: "opacity",
|
|
2831
|
+
value: e.config?.opacity,
|
|
2832
|
+
defaultValue: .5,
|
|
2833
|
+
min: 0,
|
|
2834
|
+
max: 1
|
|
2835
|
+
})), t.push(...m({
|
|
2836
|
+
normalized: n.config,
|
|
2837
|
+
field: "selfLuminous",
|
|
2838
|
+
value: e.config?.selfLuminous,
|
|
2839
|
+
defaultValue: 0,
|
|
2840
|
+
min: 0
|
|
2841
|
+
})), t.push(...y({
|
|
2842
|
+
normalized: n.config,
|
|
2843
|
+
field: "color",
|
|
2844
|
+
value: e.config?.color,
|
|
2845
|
+
defaultValue: "#ffffff"
|
|
2846
|
+
})), {
|
|
2847
|
+
errors: t,
|
|
2848
|
+
normalized: n
|
|
2849
|
+
};
|
|
2850
|
+
}
|
|
2851
|
+
//#endregion
|
|
2852
|
+
//#region api/sceneModel/outline.js
|
|
2853
|
+
function jt(e) {
|
|
2854
|
+
let t = [], n = { ...e };
|
|
2855
|
+
return I(t, e.ids, e.tags), n.config ||= {}, t.push(...y({
|
|
2856
|
+
normalized: n.config,
|
|
2857
|
+
field: "color",
|
|
2858
|
+
value: n.config.color,
|
|
2859
|
+
defaultValue: "#1A80CCFF"
|
|
2860
|
+
})), t.push(...m({
|
|
2861
|
+
normalized: n.config,
|
|
2862
|
+
field: "brightness",
|
|
2863
|
+
value: n.config.brightness,
|
|
2864
|
+
defaultValue: 1,
|
|
2865
|
+
min: 0
|
|
2866
|
+
})), t.push(...m({
|
|
2867
|
+
normalized: n.config,
|
|
2868
|
+
field: "width",
|
|
2869
|
+
value: n.config.width,
|
|
2870
|
+
defaultValue: 1,
|
|
2871
|
+
min: 0
|
|
2872
|
+
})), n.config.IsSolidMesh === void 0 ? n.config.IsSolidMesh = !1 : typeof n.config.IsSolidMesh != "boolean" && t.push("[config.IsSolidMesh] 必须是布尔类型"), t.push(...y({
|
|
2873
|
+
normalized: n.config,
|
|
2874
|
+
field: "meshColor",
|
|
2875
|
+
value: n.config.meshColor,
|
|
2876
|
+
defaultValue: "#000305FF"
|
|
2877
|
+
})), t.push(...m({
|
|
2878
|
+
normalized: n.config,
|
|
2879
|
+
field: "meshBrightness",
|
|
2880
|
+
value: n.config.meshBrightness,
|
|
2881
|
+
defaultValue: 1,
|
|
2882
|
+
min: 0
|
|
2883
|
+
})), t.push(...m({
|
|
2884
|
+
normalized: n.config,
|
|
2885
|
+
field: "meshOpacity",
|
|
2886
|
+
value: n.config.meshOpacity,
|
|
2887
|
+
defaultValue: .02,
|
|
2888
|
+
min: 0,
|
|
2889
|
+
max: 1
|
|
2890
|
+
})), {
|
|
2891
|
+
errors: t,
|
|
2892
|
+
normalized: n
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2895
|
+
//#endregion
|
|
2896
|
+
//#region api/sceneModel/removeOutline.js
|
|
2897
|
+
function Mt(e) {
|
|
2898
|
+
let t = [], n = { ...e };
|
|
2899
|
+
return I(t, e.ids, e.tags), {
|
|
2900
|
+
errors: t,
|
|
2901
|
+
normalized: n
|
|
2902
|
+
};
|
|
2903
|
+
}
|
|
2904
|
+
//#endregion
|
|
2905
|
+
//#region api/sceneModel/removeAllOutline.js
|
|
2906
|
+
function Nt(e) {
|
|
2907
|
+
return {
|
|
2908
|
+
errors: [],
|
|
2909
|
+
normalized: { ...e }
|
|
2910
|
+
};
|
|
2911
|
+
}
|
|
2912
|
+
//#endregion
|
|
2913
|
+
//#region api/sceneModel/openSlice.js
|
|
2914
|
+
function R(e = {}) {
|
|
2915
|
+
let t = [], n = { ...e };
|
|
2916
|
+
return t.push(...h({
|
|
2917
|
+
normalized: n,
|
|
2918
|
+
field: "id",
|
|
2919
|
+
value: e.id
|
|
2920
|
+
})), t.push(...b({
|
|
2921
|
+
normalized: n,
|
|
2922
|
+
field: "mode",
|
|
2923
|
+
value: e.mode,
|
|
2924
|
+
defaultValue: "None",
|
|
2925
|
+
type: "string",
|
|
2926
|
+
list: bt
|
|
2927
|
+
})), t.push(...y({
|
|
2928
|
+
normalized: n,
|
|
2929
|
+
field: "color",
|
|
2930
|
+
value: e.color,
|
|
2931
|
+
defaultValue: "#FFFFFF00"
|
|
2932
|
+
})), t.push(...g({
|
|
2933
|
+
normalized: n,
|
|
2934
|
+
field: "texturePath",
|
|
2935
|
+
value: e.texturePath,
|
|
2936
|
+
defaultValue: ""
|
|
2937
|
+
})), t.push(...g({
|
|
2938
|
+
normalized: n,
|
|
2939
|
+
field: "materialName",
|
|
2940
|
+
value: e.materialName,
|
|
2941
|
+
defaultValue: ""
|
|
2942
|
+
})), t.push(..._({
|
|
2943
|
+
normalized: n,
|
|
2944
|
+
field: "uvOffset",
|
|
2945
|
+
value: e.uvOffset,
|
|
2946
|
+
length: 2,
|
|
2947
|
+
defaultValue: [0, 0]
|
|
2948
|
+
})), t.push(..._({
|
|
2949
|
+
normalized: n,
|
|
2950
|
+
field: "uvScale",
|
|
2951
|
+
value: e.uvScale,
|
|
2952
|
+
length: 2,
|
|
2953
|
+
defaultValue: [1, 1]
|
|
2954
|
+
})), L(t, n, "isWorldUV", e.isWorldUV, !1), t.push(..._({
|
|
2955
|
+
normalized: n,
|
|
2956
|
+
field: "direction",
|
|
2957
|
+
value: e.direction,
|
|
2958
|
+
length: 3,
|
|
2959
|
+
defaultValue: [
|
|
2960
|
+
0,
|
|
2961
|
+
0,
|
|
2962
|
+
-1
|
|
2963
|
+
]
|
|
2964
|
+
})), L(t, n, "isWorldDirection", e.isWorldDirection, !1), t.push(...m({
|
|
2965
|
+
normalized: n,
|
|
2966
|
+
field: "ratio",
|
|
2967
|
+
value: e.ratio,
|
|
2968
|
+
defaultValue: .5,
|
|
2969
|
+
min: 0,
|
|
2970
|
+
max: 1
|
|
2971
|
+
})), {
|
|
2972
|
+
errors: t,
|
|
2973
|
+
normalized: n
|
|
2974
|
+
};
|
|
2975
|
+
}
|
|
2976
|
+
//#endregion
|
|
2977
|
+
//#region api/sceneModel/closeSlice.js
|
|
2978
|
+
function Pt(e = {}) {
|
|
2979
|
+
let t = [], n = { ...e };
|
|
2980
|
+
return t.push(...h({
|
|
2981
|
+
normalized: n,
|
|
2982
|
+
field: "id",
|
|
2983
|
+
value: e.id
|
|
2984
|
+
})), {
|
|
2985
|
+
errors: t,
|
|
2986
|
+
normalized: n
|
|
2987
|
+
};
|
|
2988
|
+
}
|
|
2989
|
+
//#endregion
|
|
2990
|
+
//#region api/sceneModel/closeAllSlice.js
|
|
2991
|
+
function Ft(e = {}) {
|
|
2992
|
+
return {
|
|
2993
|
+
errors: [],
|
|
2994
|
+
normalized: { ...e }
|
|
2995
|
+
};
|
|
2996
|
+
}
|
|
2997
|
+
//#endregion
|
|
2998
|
+
//#region api/sceneModel/sceneModelApi.js
|
|
2999
|
+
var It = r("sceneModel", {
|
|
3000
|
+
getById: vt,
|
|
3001
|
+
getByTag: yt,
|
|
3002
|
+
setTransform: xt,
|
|
3003
|
+
clearTransform: St,
|
|
3004
|
+
offset: Ct,
|
|
3005
|
+
clearOffset: wt,
|
|
3006
|
+
show: Tt,
|
|
3007
|
+
hide: Et,
|
|
3008
|
+
showOnly: Dt,
|
|
3009
|
+
highLight: Ot,
|
|
3010
|
+
removeHighLight: kt,
|
|
3011
|
+
setOpacity: At,
|
|
3012
|
+
outline: jt,
|
|
3013
|
+
removeOutline: Mt,
|
|
3014
|
+
removeAllOutline: Nt,
|
|
3015
|
+
openSlice: R,
|
|
3016
|
+
closeSlice: Pt,
|
|
3017
|
+
closeAllSlice: Ft
|
|
3018
|
+
});
|
|
3019
|
+
//#endregion
|
|
3020
|
+
//#region api/atmosphericEffects/time.js
|
|
3021
|
+
function Lt(e) {
|
|
3022
|
+
let t = [], n = { ...e };
|
|
3023
|
+
return t.push(...p({
|
|
3024
|
+
normalized: n,
|
|
3025
|
+
field: "hour",
|
|
3026
|
+
value: e.hour,
|
|
3027
|
+
min: 1,
|
|
3028
|
+
max: 24
|
|
3029
|
+
})), {
|
|
3030
|
+
errors: t,
|
|
3031
|
+
normalized: n
|
|
3032
|
+
};
|
|
3033
|
+
}
|
|
3034
|
+
//#endregion
|
|
3035
|
+
//#region api/atmosphericEffects/weather.js
|
|
3036
|
+
function Rt(e) {
|
|
3037
|
+
let t = [], n = { ...e };
|
|
3038
|
+
return !e.type || typeof e.type != "string" ? t.push("[type]为必填项,且必须是字符串类型") : n.type = e.type, {
|
|
3039
|
+
errors: t,
|
|
3040
|
+
normalized: n
|
|
3041
|
+
};
|
|
3042
|
+
}
|
|
3043
|
+
//#endregion
|
|
3044
|
+
//#region api/atmosphericEffects/atmosphericEffectsApi.js
|
|
3045
|
+
var zt = r("atmosphericEffects", {
|
|
3046
|
+
time: Lt,
|
|
3047
|
+
weather: Rt
|
|
3048
|
+
});
|
|
3049
|
+
//#endregion
|
|
3050
|
+
//#region api/tool/onMouseClick.js
|
|
3051
|
+
function Bt(e) {
|
|
3052
|
+
let t = [], n = { ...e };
|
|
3053
|
+
return t.push(...b({
|
|
3054
|
+
normalized: n,
|
|
3055
|
+
field: "pressKey",
|
|
3056
|
+
value: e.pressKey,
|
|
3057
|
+
defaultValue: "LeftMouseButton",
|
|
3058
|
+
type: "string",
|
|
3059
|
+
list: [
|
|
3060
|
+
"LeftMouseButton",
|
|
3061
|
+
"RightMouseButton",
|
|
3062
|
+
"MiddleMouseButton"
|
|
3063
|
+
]
|
|
3064
|
+
})), n.onMouseClick && typeof n.onMouseClick != "function" && t.push("onMouseClick 参数 onMouseClick 必须为函数"), {
|
|
3065
|
+
errors: t,
|
|
3066
|
+
normalized: n
|
|
3067
|
+
};
|
|
3068
|
+
}
|
|
3069
|
+
//#endregion
|
|
3070
|
+
//#region api/tool/offMouseClick.js
|
|
3071
|
+
function Vt(e) {
|
|
3072
|
+
let t = [], n = { ...e };
|
|
3073
|
+
return t.push(...b({
|
|
3074
|
+
normalized: n,
|
|
3075
|
+
field: "pressKey",
|
|
3076
|
+
value: e.pressKey,
|
|
3077
|
+
defaultValue: "",
|
|
3078
|
+
type: "string",
|
|
3079
|
+
list: [
|
|
3080
|
+
"LeftMouseButton",
|
|
3081
|
+
"RightMouseButton",
|
|
3082
|
+
"MiddleMouseButton"
|
|
3083
|
+
]
|
|
3084
|
+
})), {
|
|
3085
|
+
errors: t,
|
|
3086
|
+
normalized: n
|
|
3087
|
+
};
|
|
3088
|
+
}
|
|
3089
|
+
//#endregion
|
|
3090
|
+
//#region api/tool/onDistance.js
|
|
3091
|
+
function Ht(e) {
|
|
3092
|
+
return {
|
|
3093
|
+
errors: [],
|
|
3094
|
+
normalized: { ...e }
|
|
3095
|
+
};
|
|
3096
|
+
}
|
|
3097
|
+
//#endregion
|
|
3098
|
+
//#region api/tool/offDistance.js
|
|
3099
|
+
function Ut(e) {
|
|
3100
|
+
return {
|
|
3101
|
+
errors: [],
|
|
3102
|
+
normalized: { ...e }
|
|
3103
|
+
};
|
|
3104
|
+
}
|
|
3105
|
+
//#endregion
|
|
3106
|
+
//#region api/tool/editConfigFile.js
|
|
3107
|
+
function Wt(e) {
|
|
3108
|
+
return {
|
|
3109
|
+
errors: [],
|
|
3110
|
+
normalized: { ...e }
|
|
3111
|
+
};
|
|
3112
|
+
}
|
|
3113
|
+
//#endregion
|
|
3114
|
+
//#region api/tool/toolApi.js
|
|
3115
|
+
var Gt = r("tool", {
|
|
3116
|
+
onMouseClick: Bt,
|
|
3117
|
+
offMouseClick: Vt,
|
|
3118
|
+
onDistance: Ht,
|
|
3119
|
+
offDistance: Ut,
|
|
3120
|
+
editConfigFile: Wt
|
|
3121
|
+
});
|
|
3122
|
+
//#endregion
|
|
3123
|
+
//#region api/line/helpers.js
|
|
3124
|
+
function Kt() {
|
|
3125
|
+
return "line_" + Date.now() + "_" + Math.random().toString(36).substring(2, 9);
|
|
3126
|
+
}
|
|
3127
|
+
//#endregion
|
|
3128
|
+
//#region api/line/addLine.js
|
|
3129
|
+
function qt(e) {
|
|
3130
|
+
let t = [], n = { ...e };
|
|
3131
|
+
if (!e.coordinates || !Array.isArray(e.coordinates)) t.push("[coordinates] 为必填项,且必须是数组类型");
|
|
3132
|
+
else if (e.coordinates.length < 2) t.push("[coordinates] 至少需要2个坐标点才能绘制线条");
|
|
3133
|
+
else {
|
|
3134
|
+
let r = [];
|
|
3135
|
+
e.coordinates.forEach((e, n) => {
|
|
3136
|
+
if (!Array.isArray(e) || e.length < 3) t.push(`[coordinates[${n}]] 坐标点格式错误,应为 [经度, 纬度, 高度]`);
|
|
3137
|
+
else {
|
|
3138
|
+
let [i, a, o] = e, s = [];
|
|
3139
|
+
(typeof i != "number" || i < -180 || i > 180) && s.push(`[coordinates[${n}][0]] 经度取值范围:-180~180`), (typeof a != "number" || a < -90 || a > 90) && s.push(`[coordinates[${n}][1]] 纬度取值范围:-90~90`), typeof o != "number" && s.push(`[coordinates[${n}][2]] 高度必须是数字类型`), s.length === 0 ? r.push([
|
|
3140
|
+
i,
|
|
3141
|
+
a,
|
|
3142
|
+
o
|
|
3143
|
+
]) : t.push(...s);
|
|
3144
|
+
}
|
|
3145
|
+
}), r.length >= 2 && (n.coordinates = r);
|
|
3146
|
+
}
|
|
3147
|
+
return t.push(...b({
|
|
3148
|
+
normalized: n,
|
|
3149
|
+
field: "type",
|
|
3150
|
+
value: e.type,
|
|
3151
|
+
defaultValue: 0,
|
|
3152
|
+
type: "number",
|
|
3153
|
+
list: [0, 1]
|
|
3154
|
+
})), t.push(...m({
|
|
3155
|
+
normalized: n,
|
|
3156
|
+
field: "width",
|
|
3157
|
+
value: e.width,
|
|
3158
|
+
defaultValue: 1,
|
|
3159
|
+
min: .1
|
|
3160
|
+
})), e.key === void 0 || e.key === null || e.key === "" ? n.key = Kt() : t.push(...g({
|
|
3161
|
+
normalized: n,
|
|
3162
|
+
field: "key",
|
|
3163
|
+
value: e.key
|
|
3164
|
+
})), t.push(...y({
|
|
3165
|
+
normalized: n,
|
|
3166
|
+
field: "color",
|
|
3167
|
+
value: e.color,
|
|
3168
|
+
defaultValue: "#1cfeff"
|
|
3169
|
+
})), t.push(...m({
|
|
3170
|
+
normalized: n,
|
|
3171
|
+
field: "spacing",
|
|
3172
|
+
value: e.spacing,
|
|
3173
|
+
min: 0
|
|
3174
|
+
})), t.push(...b({
|
|
3175
|
+
normalized: n,
|
|
3176
|
+
field: "interpolate",
|
|
3177
|
+
value: e.interpolate,
|
|
3178
|
+
defaultValue: "smooth",
|
|
3179
|
+
type: "string",
|
|
3180
|
+
list: ["smooth", "linear"]
|
|
3181
|
+
})), t.push(...g({
|
|
3182
|
+
normalized: n,
|
|
3183
|
+
field: "startImg",
|
|
3184
|
+
value: e.startImg
|
|
3185
|
+
})), t.push(...g({
|
|
3186
|
+
normalized: n,
|
|
3187
|
+
field: "endImg",
|
|
3188
|
+
value: e.endImg
|
|
3189
|
+
})), t.push(...g({
|
|
3190
|
+
normalized: n,
|
|
3191
|
+
field: "midImg",
|
|
3192
|
+
value: e.midImg
|
|
3193
|
+
})), {
|
|
3194
|
+
errors: t,
|
|
3195
|
+
normalized: n
|
|
3196
|
+
};
|
|
3197
|
+
}
|
|
3198
|
+
//#endregion
|
|
3199
|
+
//#region api/line/clearLine.js
|
|
3200
|
+
function Jt(e) {
|
|
3201
|
+
let t = [], n = { ...e };
|
|
3202
|
+
if (!e.key || !Array.isArray(e.key)) t.push("[key] 为必填项,且必须是数组类型");
|
|
3203
|
+
else if (e.key.length === 0) t.push("[key] 至少需要一个线条标识");
|
|
3204
|
+
else {
|
|
3205
|
+
let r = [];
|
|
3206
|
+
e.key.forEach((e, n) => {
|
|
3207
|
+
typeof e != "string" || e.trim() === "" ? t.push(`[key[${n}]] 必须是非空字符串`) : r.push(e.trim());
|
|
3208
|
+
}), r.length > 0 && (n.key = r);
|
|
3209
|
+
}
|
|
3210
|
+
return {
|
|
3211
|
+
errors: t,
|
|
3212
|
+
normalized: n
|
|
3213
|
+
};
|
|
3214
|
+
}
|
|
3215
|
+
//#endregion
|
|
3216
|
+
//#region api/line/clearAllLine.js
|
|
3217
|
+
function Yt(e) {
|
|
3218
|
+
return {
|
|
3219
|
+
errors: [],
|
|
3220
|
+
normalized: { ...e }
|
|
3221
|
+
};
|
|
3222
|
+
}
|
|
3223
|
+
//#endregion
|
|
3224
|
+
//#region api/line/lineApi.js
|
|
3225
|
+
var Xt = r("line", {
|
|
3226
|
+
addLine: qt,
|
|
3227
|
+
clearLine: Jt,
|
|
3228
|
+
clearAllLine: Yt
|
|
3229
|
+
});
|
|
3230
|
+
//#endregion
|
|
3231
|
+
//#region api/level/switch.js
|
|
3232
|
+
function Zt(e) {
|
|
3233
|
+
let t = [], n = { ...e };
|
|
3234
|
+
return t.push(...h({
|
|
3235
|
+
normalized: n,
|
|
3236
|
+
field: "levelName",
|
|
3237
|
+
value: e.levelName
|
|
3238
|
+
})), {
|
|
3239
|
+
errors: t,
|
|
3240
|
+
normalized: n
|
|
3241
|
+
};
|
|
3242
|
+
}
|
|
3243
|
+
//#endregion
|
|
3244
|
+
//#region api/level/levelApi.js
|
|
3245
|
+
var Qt = r("level", { switch: Zt });
|
|
3246
|
+
//#endregion
|
|
3247
|
+
//#region api/vtk/getInfo.js
|
|
3248
|
+
function $t(e = {}) {
|
|
3249
|
+
let t = [], n = { ...e };
|
|
3250
|
+
return t.push(...h({
|
|
3251
|
+
normalized: n,
|
|
3252
|
+
field: "id",
|
|
3253
|
+
value: e.id
|
|
3254
|
+
})), {
|
|
3255
|
+
errors: t,
|
|
3256
|
+
normalized: n
|
|
3257
|
+
};
|
|
3258
|
+
}
|
|
3259
|
+
//#endregion
|
|
3260
|
+
//#region api/vtk/getFieldRange.js
|
|
3261
|
+
function en(e = {}) {
|
|
3262
|
+
let t = [], n = { ...e };
|
|
3263
|
+
return t.push(...h({
|
|
3264
|
+
normalized: n,
|
|
3265
|
+
field: "id",
|
|
3266
|
+
value: e.id
|
|
3267
|
+
})), t.push(...h({
|
|
3268
|
+
normalized: n,
|
|
3269
|
+
field: "fieldName",
|
|
3270
|
+
value: e.fieldName
|
|
3271
|
+
})), t.push(..._({
|
|
3272
|
+
normalized: n,
|
|
3273
|
+
field: "indexList",
|
|
3274
|
+
value: e.indexList,
|
|
3275
|
+
defaultValue: []
|
|
3276
|
+
})), Array.isArray(n.indexList) && (n.indexList.forEach((e, n) => {
|
|
3277
|
+
Number.isFinite(Number(e)) || t.push(`[indexList[${n}]]必须是数字`);
|
|
3278
|
+
}), n.indexList = n.indexList.map(Number)), {
|
|
3279
|
+
errors: t,
|
|
3280
|
+
normalized: n
|
|
3281
|
+
};
|
|
3282
|
+
}
|
|
3283
|
+
//#endregion
|
|
3284
|
+
//#region api/vtk/helpers.js
|
|
3285
|
+
function z(e, t, n, r, i) {
|
|
3286
|
+
let a = e[t];
|
|
3287
|
+
if (a == null || a === "") {
|
|
3288
|
+
i[t] = n;
|
|
3289
|
+
return;
|
|
3290
|
+
}
|
|
3291
|
+
if (typeof a != "boolean") {
|
|
3292
|
+
r.push(`[${t}]必须是布尔类型`);
|
|
3293
|
+
return;
|
|
3294
|
+
}
|
|
3295
|
+
i[t] = a;
|
|
3296
|
+
}
|
|
3297
|
+
function tn(e) {
|
|
3298
|
+
let t = [];
|
|
3299
|
+
if (!e || !Array.isArray(e)) return t.push("[coordinates] 为必填项,且必须是数组类型"), t;
|
|
3300
|
+
if (e.length < 3) return t.push("[coordinates]包含:[x, y, z]"), t;
|
|
3301
|
+
let [n, r, i] = e;
|
|
3302
|
+
return d(n) || t.push("[coordinates[0]]必须是数字类型"), d(r) || t.push("[coordinates[1]]必须是数字类型"), d(i) || t.push("[coordinates[2]]必须是数字类型"), t;
|
|
3303
|
+
}
|
|
3304
|
+
function nn(e, t, n) {
|
|
3305
|
+
let r = e.coordinates;
|
|
3306
|
+
if (r == null || r === "" || Array.isArray(r) && r.length === 0) {
|
|
3307
|
+
n.coordinates = [];
|
|
3308
|
+
return;
|
|
3309
|
+
}
|
|
3310
|
+
n.isUseUePos ? t.push(...tn(r)) : t.push(...f(r)), Array.isArray(r) && r.length >= 3 && (n.coordinates = r.slice(0, 3).map(Number));
|
|
3311
|
+
}
|
|
3312
|
+
//#endregion
|
|
3313
|
+
//#region api/vtk/create.js
|
|
3314
|
+
function rn(e) {
|
|
3315
|
+
let t = [];
|
|
3316
|
+
if (!e || !Array.isArray(e)) t.push("[coordinates] 为必填项,且必须是数组类型");
|
|
3317
|
+
else if (e.length < 3) t.push("[coordinates]包含:[x, y, z]");
|
|
3318
|
+
else {
|
|
3319
|
+
let [n, r, i] = e;
|
|
3320
|
+
d(n) || t.push("[coordinates[0]]必须是数字类型"), d(r) || t.push("[coordinates[1]]必须是数字类型"), d(i) || t.push("[coordinates[2]]必须是数字类型");
|
|
3321
|
+
}
|
|
3322
|
+
return t;
|
|
3323
|
+
}
|
|
3324
|
+
function an(e = {}) {
|
|
3325
|
+
let t = [], n = { ...e };
|
|
3326
|
+
return t.push(...h({
|
|
3327
|
+
normalized: n,
|
|
3328
|
+
field: "id",
|
|
3329
|
+
value: e.id
|
|
3330
|
+
})), t.push(...h({
|
|
3331
|
+
normalized: n,
|
|
3332
|
+
field: "url",
|
|
3333
|
+
value: e.url
|
|
3334
|
+
})), z(e, "isUseUePos", !1, t, n), n.isUseUePos ? (t.push(...rn(e.coordinates)), Array.isArray(e.coordinates) && e.coordinates.length >= 3 && (n.coordinates = e.coordinates.slice(0, 3).map(Number))) : t.push(...f(e.coordinates)), t.push(...v({
|
|
3335
|
+
normalized: n,
|
|
3336
|
+
field: "rotation",
|
|
3337
|
+
value: e.rotation,
|
|
3338
|
+
defaultValue: [
|
|
3339
|
+
0,
|
|
3340
|
+
0,
|
|
3341
|
+
0
|
|
3342
|
+
]
|
|
3343
|
+
})), t.push(...v({
|
|
3344
|
+
normalized: n,
|
|
3345
|
+
field: "scale",
|
|
3346
|
+
value: e.scale,
|
|
3347
|
+
defaultValue: [
|
|
3348
|
+
1,
|
|
3349
|
+
1,
|
|
3350
|
+
1
|
|
3351
|
+
]
|
|
3352
|
+
})), {
|
|
3353
|
+
errors: t,
|
|
3354
|
+
normalized: n
|
|
3355
|
+
};
|
|
3356
|
+
}
|
|
3357
|
+
//#endregion
|
|
3358
|
+
//#region api/vtk/close.js
|
|
3359
|
+
function on(e = {}) {
|
|
3360
|
+
let t = [], n = { ...e };
|
|
3361
|
+
return t.push(...h({
|
|
3362
|
+
normalized: n,
|
|
3363
|
+
field: "id",
|
|
3364
|
+
value: e.id
|
|
3365
|
+
})), {
|
|
3366
|
+
errors: t,
|
|
3367
|
+
normalized: n
|
|
3368
|
+
};
|
|
3369
|
+
}
|
|
3370
|
+
//#endregion
|
|
3371
|
+
//#region api/vtk/allClose.js
|
|
3372
|
+
function sn(e = {}) {
|
|
3373
|
+
return {
|
|
3374
|
+
errors: [],
|
|
3375
|
+
normalized: { ...e }
|
|
3376
|
+
};
|
|
3377
|
+
}
|
|
3378
|
+
//#endregion
|
|
3379
|
+
//#region api/vtk/clearCacheByUrl.js
|
|
3380
|
+
function cn(e = {}) {
|
|
3381
|
+
let t = [], n = { ...e };
|
|
3382
|
+
return t.push(...h({
|
|
3383
|
+
normalized: n,
|
|
3384
|
+
field: "url",
|
|
3385
|
+
value: e.url
|
|
3386
|
+
})), {
|
|
3387
|
+
errors: t,
|
|
3388
|
+
normalized: n
|
|
3389
|
+
};
|
|
3390
|
+
}
|
|
3391
|
+
//#endregion
|
|
3392
|
+
//#region api/vtk/clearAllCache.js
|
|
3393
|
+
function ln(e = {}) {
|
|
3394
|
+
return {
|
|
3395
|
+
errors: [],
|
|
3396
|
+
normalized: { ...e }
|
|
3397
|
+
};
|
|
3398
|
+
}
|
|
3399
|
+
//#endregion
|
|
3400
|
+
//#region api/vtk/setField.js
|
|
3401
|
+
function un(e = {}) {
|
|
3402
|
+
let t = [], n = { ...e };
|
|
3403
|
+
return t.push(...h({
|
|
3404
|
+
normalized: n,
|
|
3405
|
+
field: "id",
|
|
3406
|
+
value: e.id
|
|
3407
|
+
})), t.push(...h({
|
|
3408
|
+
normalized: n,
|
|
3409
|
+
field: "fieldName",
|
|
3410
|
+
value: e.fieldName
|
|
3411
|
+
})), t.push(..._({
|
|
3412
|
+
normalized: n,
|
|
3413
|
+
field: "indexList",
|
|
3414
|
+
value: e.indexList,
|
|
3415
|
+
defaultValue: []
|
|
3416
|
+
})), Array.isArray(n.indexList) && (n.indexList.forEach((e, n) => {
|
|
3417
|
+
Number.isFinite(Number(e)) || t.push(`[indexList[${n}]]必须是数字`);
|
|
3418
|
+
}), n.indexList = n.indexList.map(Number)), {
|
|
3419
|
+
errors: t,
|
|
3420
|
+
normalized: n
|
|
3421
|
+
};
|
|
3422
|
+
}
|
|
3423
|
+
//#endregion
|
|
3424
|
+
//#region api/vtk/setMode.js
|
|
3425
|
+
function dn(e = {}) {
|
|
3426
|
+
let t = [], n = { ...e };
|
|
3427
|
+
return t.push(...h({
|
|
3428
|
+
normalized: n,
|
|
3429
|
+
field: "id",
|
|
3430
|
+
value: e.id
|
|
3431
|
+
})), t.push(...b({
|
|
3432
|
+
normalized: n,
|
|
3433
|
+
field: "mode",
|
|
3434
|
+
value: e.mode,
|
|
3435
|
+
defaultValue: "Heatmap",
|
|
3436
|
+
type: "string",
|
|
3437
|
+
list: [
|
|
3438
|
+
"Heatmap",
|
|
3439
|
+
"Wireframe",
|
|
3440
|
+
"Mixed"
|
|
3441
|
+
]
|
|
3442
|
+
})), {
|
|
3443
|
+
errors: t,
|
|
3444
|
+
normalized: n
|
|
3445
|
+
};
|
|
3446
|
+
}
|
|
3447
|
+
//#endregion
|
|
3448
|
+
//#region api/vtk/setCellOpacity.js
|
|
3449
|
+
function fn(e = {}) {
|
|
3450
|
+
let t = [], n = { ...e };
|
|
3451
|
+
return t.push(...h({
|
|
3452
|
+
normalized: n,
|
|
3453
|
+
field: "id",
|
|
3454
|
+
value: e.id
|
|
3455
|
+
})), t.push(...h({
|
|
3456
|
+
normalized: n,
|
|
3457
|
+
field: "fieldName",
|
|
3458
|
+
value: e.fieldName
|
|
3459
|
+
})), t.push(..._({
|
|
3460
|
+
normalized: n,
|
|
3461
|
+
field: "cellTypes",
|
|
3462
|
+
value: e.cellTypes,
|
|
3463
|
+
required: !0,
|
|
3464
|
+
minLength: 1
|
|
3465
|
+
})), Array.isArray(n.cellTypes) && (n.cellTypes.forEach((e, n) => {
|
|
3466
|
+
Number.isFinite(Number(e)) || t.push(`[cellTypes[${n}]]必须是数字`);
|
|
3467
|
+
}), n.cellTypes = n.cellTypes.map(Number)), t.push(...m({
|
|
3468
|
+
normalized: n,
|
|
3469
|
+
field: "value",
|
|
3470
|
+
value: e.value,
|
|
3471
|
+
defaultValue: 0,
|
|
3472
|
+
min: 0,
|
|
3473
|
+
max: 1
|
|
3474
|
+
})), {
|
|
3475
|
+
errors: t,
|
|
3476
|
+
normalized: n
|
|
3477
|
+
};
|
|
3478
|
+
}
|
|
3479
|
+
//#endregion
|
|
3480
|
+
//#region api/vtk/setColorRange.js
|
|
3481
|
+
function pn(e = {}) {
|
|
3482
|
+
let t = [], n = { ...e };
|
|
3483
|
+
if (t.push(...h({
|
|
3484
|
+
normalized: n,
|
|
3485
|
+
field: "id",
|
|
3486
|
+
value: e.id
|
|
3487
|
+
})), e.list === void 0 || e.list === null || e.list === "") n.list = [0, 1];
|
|
3488
|
+
else if (!Array.isArray(e.list) || e.list.length < 2) t.push("[list]必须是包含2个元素的数组");
|
|
3489
|
+
else {
|
|
3490
|
+
let r = e.list.slice(0, 2).map(Number);
|
|
3491
|
+
if (!r.every((e) => Number.isFinite(e))) t.push("[list]数组元素必须是数字");
|
|
3492
|
+
else {
|
|
3493
|
+
let e = !0;
|
|
3494
|
+
r[0] < 0 && (t.push("[list[0]]取值不能小于0"), e = !1), r[1] > 1 && (t.push("[list[1]]取值不能大于1"), e = !1), e && (n.list = r);
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
return {
|
|
3498
|
+
errors: t,
|
|
3499
|
+
normalized: n
|
|
3500
|
+
};
|
|
3501
|
+
}
|
|
3502
|
+
//#endregion
|
|
3503
|
+
//#region api/vtk/setColorBar.js
|
|
3504
|
+
var mn = {
|
|
3505
|
+
0: "#0000FFFF",
|
|
3506
|
+
"0.25": "#00FFFFFF",
|
|
3507
|
+
"0.5": "#00FF00FF",
|
|
3508
|
+
"0.75": "#FFFF00FF",
|
|
3509
|
+
1: "#FF0000FF"
|
|
3510
|
+
};
|
|
3511
|
+
function hn(e = {}) {
|
|
3512
|
+
let t = [], n = { ...e };
|
|
3513
|
+
t.push(...h({
|
|
3514
|
+
normalized: n,
|
|
3515
|
+
field: "id",
|
|
3516
|
+
value: e.id
|
|
3517
|
+
}));
|
|
3518
|
+
let r = e.colorBar;
|
|
3519
|
+
if (r == null || r === "") n.colorBar = { ...mn };
|
|
3520
|
+
else if (typeof r != "object" || Array.isArray(r)) t.push("[colorBar]必须是对象类型");
|
|
3521
|
+
else {
|
|
3522
|
+
let e = Object.keys(r);
|
|
3523
|
+
if (e.length === 0) t.push("[colorBar]不能为空对象");
|
|
3524
|
+
else {
|
|
3525
|
+
let i = {};
|
|
3526
|
+
e.forEach((e) => {
|
|
3527
|
+
let n = Number(e);
|
|
3528
|
+
if (!Number.isFinite(n) || n < 0 || n > 1) {
|
|
3529
|
+
t.push(`[colorBar.${e}]键必须是 0~1 之间的数字`);
|
|
3530
|
+
return;
|
|
3531
|
+
}
|
|
3532
|
+
let o = r[e];
|
|
3533
|
+
if (o == null || o === "") {
|
|
3534
|
+
t.push(`[colorBar.${e}]为必填项`);
|
|
3535
|
+
return;
|
|
3536
|
+
}
|
|
3537
|
+
if (typeof o != "string") {
|
|
3538
|
+
t.push(`[colorBar.${e}]必须是字符串类型`);
|
|
3539
|
+
return;
|
|
3540
|
+
}
|
|
3541
|
+
let s = a(o);
|
|
3542
|
+
if (!s) {
|
|
3543
|
+
t.push(`[colorBar.${e}]颜色格式不正确`);
|
|
3544
|
+
return;
|
|
3545
|
+
}
|
|
3546
|
+
i[e] = s;
|
|
3547
|
+
}), t.length === 0 && (n.colorBar = i);
|
|
3548
|
+
}
|
|
3549
|
+
}
|
|
3550
|
+
return {
|
|
3551
|
+
errors: t,
|
|
3552
|
+
normalized: n
|
|
3553
|
+
};
|
|
3554
|
+
}
|
|
3555
|
+
//#endregion
|
|
3556
|
+
//#region api/vtk/setOpacity.js
|
|
3557
|
+
function gn(e = {}) {
|
|
3558
|
+
let t = [], n = { ...e };
|
|
3559
|
+
return t.push(...h({
|
|
3560
|
+
normalized: n,
|
|
3561
|
+
field: "id",
|
|
3562
|
+
value: e.id
|
|
3563
|
+
})), t.push(...p({
|
|
3564
|
+
normalized: n,
|
|
3565
|
+
field: "value",
|
|
3566
|
+
value: e.value,
|
|
3567
|
+
required: !0,
|
|
3568
|
+
min: 0,
|
|
3569
|
+
max: 1
|
|
3570
|
+
})), {
|
|
3571
|
+
errors: t,
|
|
3572
|
+
normalized: n
|
|
3573
|
+
};
|
|
3574
|
+
}
|
|
3575
|
+
//#endregion
|
|
3576
|
+
//#region api/vtk/setDisplacementScale.js
|
|
3577
|
+
function _n(e = {}) {
|
|
3578
|
+
let t = [], n = { ...e };
|
|
3579
|
+
return t.push(...h({
|
|
3580
|
+
normalized: n,
|
|
3581
|
+
field: "id",
|
|
3582
|
+
value: e.id
|
|
3583
|
+
})), t.push(...h({
|
|
3584
|
+
normalized: n,
|
|
3585
|
+
field: "fieldName",
|
|
3586
|
+
value: e.fieldName
|
|
3587
|
+
})), t.push(...m({
|
|
3588
|
+
normalized: n,
|
|
3589
|
+
field: "scale",
|
|
3590
|
+
value: e.scale,
|
|
3591
|
+
defaultValue: 1,
|
|
3592
|
+
min: 1
|
|
3593
|
+
})), typeof n.scale == "number" && n.scale <= 0 && t.push("[scale]取值必须大于0"), t.push(..._({
|
|
3594
|
+
normalized: n,
|
|
3595
|
+
field: "indexList",
|
|
3596
|
+
value: e.indexList,
|
|
3597
|
+
defaultValue: []
|
|
3598
|
+
})), Array.isArray(n.indexList) && (n.indexList.forEach((e, n) => {
|
|
3599
|
+
Number.isFinite(Number(e)) || t.push(`[indexList[${n}]]必须是数字`);
|
|
3600
|
+
}), n.indexList = n.indexList.map(Number)), {
|
|
3601
|
+
errors: t,
|
|
3602
|
+
normalized: n
|
|
3603
|
+
};
|
|
3604
|
+
}
|
|
3605
|
+
//#endregion
|
|
3606
|
+
//#region api/vtk/closeDisplacementScale.js
|
|
3607
|
+
function vn(e = {}) {
|
|
3608
|
+
let t = [], n = { ...e };
|
|
3609
|
+
return t.push(...h({
|
|
3610
|
+
normalized: n,
|
|
3611
|
+
field: "id",
|
|
3612
|
+
value: e.id
|
|
3613
|
+
})), {
|
|
3614
|
+
errors: t,
|
|
3615
|
+
normalized: n
|
|
3616
|
+
};
|
|
3617
|
+
}
|
|
3618
|
+
//#endregion
|
|
3619
|
+
//#region api/vtk/onMouseClick.js
|
|
3620
|
+
function yn(e = {}) {
|
|
3621
|
+
let t = [], n = { ...e };
|
|
3622
|
+
return t.push(...h({
|
|
3623
|
+
normalized: n,
|
|
3624
|
+
field: "id",
|
|
3625
|
+
value: e.id
|
|
3626
|
+
})), {
|
|
3627
|
+
errors: t,
|
|
3628
|
+
normalized: n
|
|
3629
|
+
};
|
|
3630
|
+
}
|
|
3631
|
+
//#endregion
|
|
3632
|
+
//#region api/vtk/offMouseClick.js
|
|
3633
|
+
function bn(e = {}) {
|
|
3634
|
+
let t = [], n = { ...e };
|
|
3635
|
+
return t.push(...h({
|
|
3636
|
+
normalized: n,
|
|
3637
|
+
field: "id",
|
|
3638
|
+
value: e.id
|
|
3639
|
+
})), {
|
|
3640
|
+
errors: t,
|
|
3641
|
+
normalized: n
|
|
3642
|
+
};
|
|
3643
|
+
}
|
|
3644
|
+
//#endregion
|
|
3645
|
+
//#region api/vtk/playSequence.js
|
|
3646
|
+
function xn(e = {}) {
|
|
3647
|
+
let t = [], n = { ...e };
|
|
3648
|
+
t.push(...h({
|
|
3649
|
+
normalized: n,
|
|
3650
|
+
field: "id",
|
|
3651
|
+
value: e.id
|
|
3652
|
+
})), t.push(...h({
|
|
3653
|
+
normalized: n,
|
|
3654
|
+
field: "fieldName",
|
|
3655
|
+
value: e.fieldName
|
|
3656
|
+
})), t.push(...g({
|
|
3657
|
+
normalized: n,
|
|
3658
|
+
field: "sequenceDirectory",
|
|
3659
|
+
value: e.sequenceDirectory,
|
|
3660
|
+
defaultValue: ""
|
|
3661
|
+
})), t.push(..._({
|
|
3662
|
+
normalized: n,
|
|
3663
|
+
field: "sequenceFiles",
|
|
3664
|
+
value: e.sequenceFiles,
|
|
3665
|
+
defaultValue: []
|
|
3666
|
+
})), Array.isArray(n.sequenceFiles) && (n.sequenceFiles = n.sequenceFiles.map((e) => String(e ?? "").trim()).filter(Boolean));
|
|
3667
|
+
let r = typeof n.sequenceDirectory == "string" && n.sequenceDirectory.trim() !== "", i = Array.isArray(n.sequenceFiles) && n.sequenceFiles.length > 0;
|
|
3668
|
+
return i && r ? t.push("[sequenceFiles]与[sequenceDirectory]二选一,不能同时填写(设置 sequenceDirectory 时 sequenceFiles 必须为空)") : i ? n.sequenceDirectory = "" : r ? (n.sequenceDirectory = n.sequenceDirectory.trim(), n.sequenceFiles = []) : t.push("[sequenceFiles]与[sequenceDirectory]二选一,必须填写其中一个(设置 sequenceDirectory 时 sequenceFiles 必须为空)"), t.push(...m({
|
|
3669
|
+
normalized: n,
|
|
3670
|
+
field: "frameIndex",
|
|
3671
|
+
value: e.frameIndex,
|
|
3672
|
+
defaultValue: 0,
|
|
3673
|
+
min: 0
|
|
3674
|
+
})), t.push(...m({
|
|
3675
|
+
normalized: n,
|
|
3676
|
+
field: "playbackSpeed",
|
|
3677
|
+
value: e.playbackSpeed,
|
|
3678
|
+
defaultValue: 1,
|
|
3679
|
+
min: 0
|
|
3680
|
+
})), typeof n.playbackSpeed == "number" && n.playbackSpeed <= 0 && t.push("[playbackSpeed]取值必须大于0"), z(e, "isUseUePos", !1, t, n), nn(e, t, n), t.push(...v({
|
|
3681
|
+
normalized: n,
|
|
3682
|
+
field: "rotation",
|
|
3683
|
+
value: e.rotation,
|
|
3684
|
+
defaultValue: [
|
|
3685
|
+
0,
|
|
3686
|
+
0,
|
|
3687
|
+
0
|
|
3688
|
+
]
|
|
3689
|
+
})), t.push(...v({
|
|
3690
|
+
normalized: n,
|
|
3691
|
+
field: "scale",
|
|
3692
|
+
value: e.scale,
|
|
3693
|
+
defaultValue: [
|
|
3694
|
+
1,
|
|
3695
|
+
1,
|
|
3696
|
+
1
|
|
3697
|
+
]
|
|
3698
|
+
})), {
|
|
3699
|
+
errors: t,
|
|
3700
|
+
normalized: n
|
|
3701
|
+
};
|
|
3702
|
+
}
|
|
3703
|
+
//#endregion
|
|
3704
|
+
//#region api/vtk/pauseSequence.js
|
|
3705
|
+
function Sn(e = {}) {
|
|
3706
|
+
let t = [], n = { ...e };
|
|
3707
|
+
return t.push(...h({
|
|
3708
|
+
normalized: n,
|
|
3709
|
+
field: "id",
|
|
3710
|
+
value: e.id
|
|
3711
|
+
})), {
|
|
3712
|
+
errors: t,
|
|
3713
|
+
normalized: n
|
|
3714
|
+
};
|
|
3715
|
+
}
|
|
3716
|
+
//#endregion
|
|
3717
|
+
//#region api/vtk/stopSequence.js
|
|
3718
|
+
function Cn(e = {}) {
|
|
3719
|
+
let t = [], n = { ...e };
|
|
3720
|
+
return t.push(...h({
|
|
3721
|
+
normalized: n,
|
|
3722
|
+
field: "id",
|
|
3723
|
+
value: e.id
|
|
3724
|
+
})), {
|
|
3725
|
+
errors: t,
|
|
3726
|
+
normalized: n
|
|
3727
|
+
};
|
|
3728
|
+
}
|
|
3729
|
+
//#endregion
|
|
3730
|
+
//#region api/vtk/setFrame.js
|
|
3731
|
+
function wn(e = {}) {
|
|
3732
|
+
let t = [], n = { ...e };
|
|
3733
|
+
return t.push(...h({
|
|
3734
|
+
normalized: n,
|
|
3735
|
+
field: "id",
|
|
3736
|
+
value: e.id
|
|
3737
|
+
})), t.push(...m({
|
|
3738
|
+
normalized: n,
|
|
3739
|
+
field: "frameIndex",
|
|
3740
|
+
value: e.frameIndex,
|
|
3741
|
+
defaultValue: 0,
|
|
3742
|
+
min: 0
|
|
3743
|
+
})), {
|
|
3744
|
+
errors: t,
|
|
3745
|
+
normalized: n
|
|
3746
|
+
};
|
|
3747
|
+
}
|
|
3748
|
+
//#endregion
|
|
3749
|
+
//#region api/vtk/setPlaybackSpeed.js
|
|
3750
|
+
function Tn(e = {}) {
|
|
3751
|
+
let t = [], n = { ...e };
|
|
3752
|
+
return t.push(...h({
|
|
3753
|
+
normalized: n,
|
|
3754
|
+
field: "id",
|
|
3755
|
+
value: e.id
|
|
3756
|
+
})), t.push(...m({
|
|
3757
|
+
normalized: n,
|
|
3758
|
+
field: "playbackSpeed",
|
|
3759
|
+
value: e.playbackSpeed,
|
|
3760
|
+
defaultValue: 4,
|
|
3761
|
+
min: 0
|
|
3762
|
+
})), typeof n.playbackSpeed == "number" && n.playbackSpeed <= 0 && t.push("[playbackSpeed]取值必须大于0"), {
|
|
3763
|
+
errors: t,
|
|
3764
|
+
normalized: n
|
|
3765
|
+
};
|
|
3766
|
+
}
|
|
3767
|
+
//#endregion
|
|
3768
|
+
//#region api/vtk/clearSequence.js
|
|
3769
|
+
function En(e = {}) {
|
|
3770
|
+
let t = [], n = { ...e };
|
|
3771
|
+
return t.push(...h({
|
|
3772
|
+
normalized: n,
|
|
3773
|
+
field: "id",
|
|
3774
|
+
value: e.id
|
|
3775
|
+
})), z(e, "isClearCache", !0, t, n), {
|
|
3776
|
+
errors: t,
|
|
3777
|
+
normalized: n
|
|
3778
|
+
};
|
|
3779
|
+
}
|
|
3780
|
+
//#endregion
|
|
3781
|
+
//#region api/vtk/clearAllSequence.js
|
|
3782
|
+
function Dn(e = {}) {
|
|
3783
|
+
let t = [], n = { ...e };
|
|
3784
|
+
return z(e, "isClearCache", !0, t, n), {
|
|
3785
|
+
errors: t,
|
|
3786
|
+
normalized: n
|
|
3787
|
+
};
|
|
3788
|
+
}
|
|
3789
|
+
//#endregion
|
|
3790
|
+
//#region api/vtk/vtkApi.js
|
|
3791
|
+
var On = r("VTK", {
|
|
3792
|
+
getInfo: $t,
|
|
3793
|
+
getFieldRange: en,
|
|
3794
|
+
create: an,
|
|
3795
|
+
close: on,
|
|
3796
|
+
allClose: sn,
|
|
3797
|
+
clearCacheByUrl: cn,
|
|
3798
|
+
clearAllCache: ln,
|
|
3799
|
+
setField: un,
|
|
3800
|
+
setMode: dn,
|
|
3801
|
+
setCellOpacity: fn,
|
|
3802
|
+
setColorRange: pn,
|
|
3803
|
+
setColorBar: hn,
|
|
3804
|
+
setOpacity: gn,
|
|
3805
|
+
setDisplacementScale: _n,
|
|
3806
|
+
closeDisplacementScale: vn,
|
|
3807
|
+
onMouseClick: yn,
|
|
3808
|
+
offMouseClick: bn,
|
|
3809
|
+
playSequence: xn,
|
|
3810
|
+
pauseSequence: Sn,
|
|
3811
|
+
stopSequence: Cn,
|
|
3812
|
+
setFrame: wn,
|
|
3813
|
+
setPlaybackSpeed: Tn,
|
|
3814
|
+
clearSequence: En,
|
|
3815
|
+
clearAllSequence: Dn
|
|
3816
|
+
}, { getOptions: () => ({ timeout: 0 }) }), B = !0;
|
|
3817
|
+
function kn(e) {
|
|
3818
|
+
B = !!e;
|
|
3819
|
+
}
|
|
3820
|
+
function V(...e) {
|
|
3821
|
+
B && console.log(...e);
|
|
3822
|
+
}
|
|
3823
|
+
function H(...e) {
|
|
3824
|
+
B && console.warn(...e);
|
|
3825
|
+
}
|
|
3826
|
+
function U(...e) {
|
|
3827
|
+
B && console.error(...e);
|
|
3828
|
+
}
|
|
3829
|
+
//#endregion
|
|
3830
|
+
//#region baseConfig/responses.js
|
|
3831
|
+
function W(e) {
|
|
3832
|
+
return (Array.isArray(e) ? e : [e]).map((e) => {
|
|
3833
|
+
if (typeof e == "string") return e;
|
|
3834
|
+
if (e && typeof e == "object") {
|
|
3835
|
+
if (typeof e.message == "string" && e.message) return e.message;
|
|
3836
|
+
try {
|
|
3837
|
+
return JSON.stringify(e);
|
|
3838
|
+
} catch {
|
|
3839
|
+
return String(e);
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
return e == null ? "" : String(e);
|
|
3843
|
+
}).filter((e) => e !== "");
|
|
3844
|
+
}
|
|
3845
|
+
function An(e, t, n) {
|
|
3846
|
+
return {
|
|
3847
|
+
success: !0,
|
|
3848
|
+
message: e,
|
|
3849
|
+
data: t,
|
|
3850
|
+
command: n
|
|
3851
|
+
};
|
|
3852
|
+
}
|
|
3853
|
+
function G(e, t, n) {
|
|
3854
|
+
let r = {
|
|
3855
|
+
success: !1,
|
|
3856
|
+
message: W(e),
|
|
3857
|
+
params: t,
|
|
3858
|
+
command: n
|
|
3859
|
+
};
|
|
3860
|
+
return U("三维场景报错:", r), r;
|
|
3861
|
+
}
|
|
3862
|
+
function K(e, t, n) {
|
|
3863
|
+
let r = {
|
|
3864
|
+
success: !1,
|
|
3865
|
+
message: W(e),
|
|
3866
|
+
params: t,
|
|
3867
|
+
command: n
|
|
3868
|
+
};
|
|
3869
|
+
return H("三维场景警告:", r), r;
|
|
3870
|
+
}
|
|
3871
|
+
//#endregion
|
|
3872
|
+
//#region api/other/otherApi.js
|
|
3873
|
+
var jn = class {
|
|
3874
|
+
constructor(e) {
|
|
3875
|
+
this.commandManager = e;
|
|
3876
|
+
}
|
|
3877
|
+
_handleSend(e, t = {}, n = {}) {
|
|
3878
|
+
return !e || typeof e != "string" ? G("命令不能为空", t, e || "unknown") : (V("自定义域命令下发:", e), this.commandManager.sendWithDefault({
|
|
3879
|
+
errors: [],
|
|
3880
|
+
normalized: t
|
|
3881
|
+
}, e, n));
|
|
3882
|
+
}
|
|
3883
|
+
}, q = {
|
|
3884
|
+
camera: ue,
|
|
3885
|
+
cesium: Se,
|
|
3886
|
+
marker: qe,
|
|
3887
|
+
floodPeak: nt,
|
|
3888
|
+
animation: ut,
|
|
3889
|
+
hydrodynamicForce: _t,
|
|
3890
|
+
sceneModel: It,
|
|
3891
|
+
atmosphericEffects: zt,
|
|
3892
|
+
tool: Gt,
|
|
3893
|
+
line: Xt,
|
|
3894
|
+
level: Qt,
|
|
3895
|
+
VTK: On
|
|
3896
|
+
}, Mn = [
|
|
3897
|
+
"oneDimensionalHydrodynamics",
|
|
3898
|
+
"customDomain",
|
|
3899
|
+
"arrow",
|
|
3900
|
+
"NC",
|
|
3901
|
+
"gateOperation"
|
|
3902
|
+
], J = class {
|
|
3903
|
+
constructor(e) {
|
|
3904
|
+
this._apis = {};
|
|
3905
|
+
for (let [t, n] of Object.entries(q)) this._apis[t] = new n(e);
|
|
3906
|
+
this._otherApi = new jn(e);
|
|
3907
|
+
for (let e of Object.keys(q)) this[e] = (t, n) => this._apis[e]._handleSend(t, n);
|
|
3908
|
+
for (let e of Mn) this[e] = (t, n, r) => this._otherApi._handleSend(`${e}.${t}`, n, r);
|
|
3909
|
+
}
|
|
3910
|
+
};
|
|
3911
|
+
//#endregion
|
|
3912
|
+
//#region commFlow.js
|
|
3913
|
+
function Y() {
|
|
3914
|
+
return {
|
|
3915
|
+
Hovered: {},
|
|
3916
|
+
Click: {},
|
|
3917
|
+
DoubleClick: {},
|
|
3918
|
+
Unhovered: {}
|
|
3919
|
+
};
|
|
3920
|
+
}
|
|
3921
|
+
function X(e, t) {
|
|
3922
|
+
typeof t == "function" && (e.includes(t) || e.push(t));
|
|
3923
|
+
}
|
|
3924
|
+
function Z(e) {
|
|
3925
|
+
return {
|
|
3926
|
+
prepare(t, n) {
|
|
3927
|
+
return t._registerMarkerCallbacks(t[e], n);
|
|
3928
|
+
},
|
|
3929
|
+
dispatch(t, n, r) {
|
|
3930
|
+
return t._dispatchMarkerEvent(t[e], n, r);
|
|
3931
|
+
}
|
|
3932
|
+
};
|
|
3933
|
+
}
|
|
3934
|
+
var Q = {
|
|
3935
|
+
"marker.iconMarker": Z("markerEventCallbacks"),
|
|
3936
|
+
"marker.iconUrlMarker": Z("markerEventCallbacks"),
|
|
3937
|
+
"marker.secondMarker": Z("secondMarkerEventCallbacks"),
|
|
3938
|
+
"marker.followMarker": Z("followMarkerEventCallbacks"),
|
|
3939
|
+
"tool.onMouseClick": {
|
|
3940
|
+
prepare(e, t) {
|
|
3941
|
+
let { onMouseClick: n, ...r } = t || {};
|
|
3942
|
+
return X(e.mouseClickCallback.MouseClick, n), r;
|
|
3943
|
+
},
|
|
3944
|
+
dispatch(e, t, n) {
|
|
3945
|
+
return n.coordinates ? e._executeCallbacks(e.mouseClickCallback.MouseClick, t, n) : !1;
|
|
3946
|
+
}
|
|
3947
|
+
},
|
|
3948
|
+
"tool.offMouseClick": { prepare(e, t) {
|
|
3949
|
+
return e.mouseClickCallback.MouseClick = [], t;
|
|
3950
|
+
} },
|
|
3951
|
+
"VTK.onMouseClick": {
|
|
3952
|
+
prepare(e, t) {
|
|
3953
|
+
let { onMouseClick: n, ...r } = t || {}, i = r?.id;
|
|
3954
|
+
return i != null && i !== "" && typeof n == "function" && (e.vtkMouseClickCallback[i] = n), r;
|
|
3955
|
+
},
|
|
3956
|
+
dispatch(e, t, n) {
|
|
3957
|
+
let r = e.vtkMouseClickCallback;
|
|
3958
|
+
if (!r || !Object.keys(r).length) return !1;
|
|
3959
|
+
let i = n?.id, a = i ? r[i] : null;
|
|
3960
|
+
return a ? e._executeCallback(a, t, n) : e._executeCallbacks(Object.values(r), t, n);
|
|
3961
|
+
}
|
|
3962
|
+
},
|
|
3963
|
+
"VTK.offMouseClick": { prepare(e, t) {
|
|
3964
|
+
let n = t?.id;
|
|
3965
|
+
return n != null && n !== "" && delete e.vtkMouseClickCallback[n], t;
|
|
3966
|
+
} },
|
|
3967
|
+
"animation.onData": {
|
|
3968
|
+
prepare(e, t) {
|
|
3969
|
+
let { onChange: n, ...r } = t || {};
|
|
3970
|
+
return X(e.animationOnDataCallback.Change, n), r;
|
|
3971
|
+
},
|
|
3972
|
+
dispatch(e, t, n) {
|
|
3973
|
+
return n.type ? e._executeCallbacks(e.animationOnDataCallback.Change, t, n) : !1;
|
|
3974
|
+
}
|
|
3975
|
+
}
|
|
3976
|
+
}, $ = class {
|
|
3977
|
+
constructor(e, t = {}) {
|
|
3978
|
+
this.transport = e, this.callbacks = {}, this.requestId = 0, this.timeout = t.timeout ?? 3e3, this._destroyed = !1, this._resetEventCallbacks(), e.bindMessageHandler((e) => {
|
|
3979
|
+
this._handleRawResponse(e);
|
|
3980
|
+
});
|
|
3981
|
+
}
|
|
3982
|
+
_resetEventCallbacks() {
|
|
3983
|
+
this.markerEventCallbacks = Y(), this.secondMarkerEventCallbacks = Y(), this.followMarkerEventCallbacks = Y(), this.animationOnDataCallback = { Change: [] }, this.mouseClickCallback = { MouseClick: [] }, this.vtkMouseClickCallback = {};
|
|
3984
|
+
}
|
|
3985
|
+
destroy() {
|
|
3986
|
+
if (!this._destroyed) {
|
|
3987
|
+
this._destroyed = !0;
|
|
3988
|
+
for (let e of Object.keys(this.callbacks)) {
|
|
3989
|
+
let t = this.callbacks[e];
|
|
3990
|
+
t?.timeoutId && clearTimeout(t.timeoutId), t?.reject?.(/* @__PURE__ */ Error("CommandManager destroyed"));
|
|
3991
|
+
}
|
|
3992
|
+
this.callbacks = {}, this._resetEventCallbacks(), this.transport = null;
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3995
|
+
sendWithDefault(e, t, n = {}) {
|
|
3996
|
+
let r = this._sendPreparePayload(t, e.normalized || {});
|
|
3997
|
+
if (e.errors.length > 0) return G(e.errors, r, t);
|
|
3998
|
+
if (this._destroyed || !this.transport) return G("连接已关闭,无法发送命令", r, t);
|
|
3999
|
+
let i = (++this.requestId).toString(), a = n?.timeout === 0 ? 0 : n?.timeout ?? this.timeout, o = new Promise((e, t) => {
|
|
4000
|
+
let n = null;
|
|
4001
|
+
a !== 0 && (n = setTimeout(() => {
|
|
4002
|
+
delete this.callbacks[i], t(/* @__PURE__ */ Error("Command timeout with no results"));
|
|
4003
|
+
}, a)), this.callbacks[i] = {
|
|
4004
|
+
resolve: e,
|
|
4005
|
+
reject: t,
|
|
4006
|
+
timeoutId: n
|
|
4007
|
+
};
|
|
4008
|
+
}), s = {
|
|
4009
|
+
command: t,
|
|
4010
|
+
requestId: i,
|
|
4011
|
+
params: r
|
|
4012
|
+
};
|
|
4013
|
+
return V("消息下发成功:", s), this.transport.sendTextToDataChannel(JSON.stringify(s)), o.then((e) => {
|
|
4014
|
+
if (e && e.command && e.command === t) switch (e.status) {
|
|
4015
|
+
case "info": return An("操作执行成功", e.data, t);
|
|
4016
|
+
case "warn": return K(e.message, e.data, t);
|
|
4017
|
+
default: return G(e.message, e.data, t);
|
|
4018
|
+
}
|
|
4019
|
+
return G("返回数据格式错乱【请注意command参数】", e?.command, t);
|
|
4020
|
+
}).catch((e) => e && e.message ? e.message === "Command timeout with no results" ? K(e.message, r, t) : G(e.message, r, t) : G("数据返回发生错误", r, t));
|
|
4021
|
+
}
|
|
4022
|
+
_handleRawResponse(e) {
|
|
4023
|
+
if (this._destroyed) return null;
|
|
4024
|
+
if (!e) return U("数据第一步解析失败:", e), null;
|
|
4025
|
+
let t;
|
|
4026
|
+
try {
|
|
4027
|
+
let n = JSON.parse(String(e).trim());
|
|
4028
|
+
if (t = {
|
|
4029
|
+
command: n.command || "",
|
|
4030
|
+
message: n.message || "",
|
|
4031
|
+
data: n.data || {},
|
|
4032
|
+
status: n.status || "error",
|
|
4033
|
+
requestId: n.requestId || ""
|
|
4034
|
+
}, t.message === "The data channel has been connected." || t.message === "The level has been initialized") return null;
|
|
4035
|
+
} catch {
|
|
4036
|
+
return U("数据第二步解析失败:", e), null;
|
|
4037
|
+
}
|
|
4038
|
+
if (this._processEventResponse(t)) return;
|
|
4039
|
+
let { command: n, message: r, data: i, status: a, requestId: o } = t;
|
|
4040
|
+
if (o && this.callbacks[o]) {
|
|
4041
|
+
let { resolve: e, timeoutId: t } = this.callbacks[o];
|
|
4042
|
+
clearTimeout(t), delete this.callbacks[o], e({
|
|
4043
|
+
command: n,
|
|
4044
|
+
message: r,
|
|
4045
|
+
data: i,
|
|
4046
|
+
status: a
|
|
4047
|
+
});
|
|
4048
|
+
return;
|
|
4049
|
+
}
|
|
4050
|
+
H("注意:非常规响应", t);
|
|
4051
|
+
}
|
|
4052
|
+
_registerMarkerCallbacks(e, t) {
|
|
4053
|
+
let { onMarkerClick: n, onMarkerDoubleClick: r, onMarkerDblClick: i, onMouseHover: a, onMouseLeave: o, ...s } = t || {}, c = r || i, l = s?.id, u = l != null && l !== "" ? l : "__default";
|
|
4054
|
+
return typeof a == "function" && (e.Hovered[u] = a), typeof n == "function" && (e.Click[u] = n), typeof c == "function" && (e.DoubleClick[u] = c), typeof o == "function" && (e.Unhovered[u] = o), s;
|
|
4055
|
+
}
|
|
4056
|
+
_dispatchMarkerEvent(e, t, n) {
|
|
4057
|
+
if (typeof n.recordData == "string") try {
|
|
4058
|
+
n.recordData = JSON.parse(n.recordData);
|
|
4059
|
+
} catch {}
|
|
4060
|
+
let { pointId: r, eventType: i } = n;
|
|
4061
|
+
if (!(i && e)) return !1;
|
|
4062
|
+
let a = e[i], o = a?.[r] || a?.__default;
|
|
4063
|
+
return this._executeCallback(o, t, n);
|
|
4064
|
+
}
|
|
4065
|
+
_sendPreparePayload(e, t) {
|
|
4066
|
+
let n = Q[e];
|
|
4067
|
+
return n?.prepare ? n.prepare(this, t) : t;
|
|
4068
|
+
}
|
|
4069
|
+
_processEventResponse(e) {
|
|
4070
|
+
if (!e) return !1;
|
|
4071
|
+
let { command: t, data: n = {} } = e, r = Q[t];
|
|
4072
|
+
return r?.dispatch ? r.dispatch(this, t, n) : !1;
|
|
4073
|
+
}
|
|
4074
|
+
_executeCallback(e, t, n) {
|
|
4075
|
+
if (typeof e != "function") return V(`${t}未监听:${n.eventType}`), !0;
|
|
4076
|
+
try {
|
|
4077
|
+
return e(n), !0;
|
|
4078
|
+
} catch (e) {
|
|
4079
|
+
return U(`执行${t}回调出错:`, e, n), !0;
|
|
4080
|
+
}
|
|
4081
|
+
}
|
|
4082
|
+
_executeCallbacks(e, t, n) {
|
|
4083
|
+
return e ? Array.isArray(e) ? (e.forEach((e) => this._executeCallback(e, t, n)), !0) : this._executeCallback(e, t, n) : !1;
|
|
4084
|
+
}
|
|
4085
|
+
};
|
|
4086
|
+
function Nn(e) {
|
|
4087
|
+
if (!e) return "";
|
|
4088
|
+
try {
|
|
4089
|
+
return JSON.parse(String(e).trim())?.message || "";
|
|
4090
|
+
} catch {
|
|
4091
|
+
return "";
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
function Pn(t = {}) {
|
|
4095
|
+
let { sendText: n, commandTimeout: r = 3e3, onSceneInit: i } = t;
|
|
4096
|
+
if (typeof n != "function") throw Error("createGameSession: sendText 必须是函数");
|
|
4097
|
+
let a = null, o = !1, s = new $({
|
|
4098
|
+
sendTextToDataChannel(e) {
|
|
4099
|
+
n(e);
|
|
4100
|
+
},
|
|
4101
|
+
bindMessageHandler(e) {
|
|
4102
|
+
a = e;
|
|
4103
|
+
}
|
|
4104
|
+
}, { timeout: r }), c = new J(s);
|
|
4105
|
+
function l(e, t) {
|
|
4106
|
+
e && a && a(e), !o && Nn(e) === "The level has been initialized" && (o = !0, i ? i(t === void 0 ? e : t) : V("场景初始化加载成功", t === void 0 ? e : t));
|
|
4107
|
+
}
|
|
4108
|
+
return V(`插件初始化成功 [web3dlink@${e}]`), {
|
|
4109
|
+
gameAPI: c,
|
|
4110
|
+
commandManager: s,
|
|
4111
|
+
handleIncoming: l,
|
|
4112
|
+
destroy() {
|
|
4113
|
+
s.destroy();
|
|
4114
|
+
}
|
|
4115
|
+
};
|
|
4116
|
+
}
|
|
4117
|
+
function Fn(e, t, n) {
|
|
4118
|
+
if (!(!e || !n)) {
|
|
4119
|
+
if (typeof e.off == "function") {
|
|
4120
|
+
e.off(t, n);
|
|
4121
|
+
return;
|
|
4122
|
+
}
|
|
4123
|
+
typeof e.removeListener == "function" && e.removeListener(t, n);
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
function In(e = []) {
|
|
4127
|
+
for (let { target: t, event: n, handler: r } of e) Fn(t, n, r);
|
|
4128
|
+
}
|
|
4129
|
+
//#endregion
|
|
4130
|
+
export { V as a, e as c, J as i, In as n, U as o, $ as r, kn as s, Pn as t };
|
|
4131
|
+
|
|
4132
|
+
//# sourceMappingURL=createGameSession-Ce1m5HFi.js.map
|