@shjjs/visual-ui 3.0.2 → 3.0.4
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/es/commons/plugins/datasource/index.mjs +16 -16
- package/es/commons/plugins/datasource/sources/api.mjs +63 -42
- package/es/commons/plugins/datasource/utils/mappingData.mjs +28 -27
- package/es/commons/plugins/datasource/utils/utils.mjs +93 -239
- package/es/components/Scene/components/Map3d/index.vue.mjs +2 -2
- package/es/components/Scene/components/Map3d/index.vue2.mjs +88 -82
- package/es/packages/commons/plugins/datasource/sources/api.d.ts +1 -1
- package/es/packages/commons/plugins/datasource/utils/mappingData.d.ts +6 -0
- package/es/packages/commons/plugins/datasource/utils/utils.d.ts +6 -96
- package/es/packages/components/Scene/components/Map3d/index.vue.d.ts +1 -0
- package/es/widgets.css +1 -1
- package/package.json +1 -1
- package/umd/index.js +421 -421
- package/umd/widgets.css +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as P, computed as
|
|
2
|
-
import { cloneDeep as v, isEqual as
|
|
1
|
+
import { defineComponent as P, computed as O, ref as f, onMounted as X, nextTick as Y, onBeforeUnmount as Z, watch as E, createElementBlock as u, openBlock as d, createElementVNode as B, normalizeClass as W, createCommentVNode as L, normalizeStyle as h, Fragment as z, renderList as T, toDisplayString as x, unref as _ } from "vue";
|
|
2
|
+
import { cloneDeep as v, isEqual as w } from "lodash";
|
|
3
3
|
import $ from "gsap";
|
|
4
|
-
import { useFps as
|
|
5
|
-
import { World as
|
|
6
|
-
import { initWatch as
|
|
4
|
+
import { useFps as ee } from "@vueuse/core";
|
|
5
|
+
import { World as te } from "./utils/map.mjs";
|
|
6
|
+
import { initWatch as oe } from "./watch.mjs";
|
|
7
7
|
import "three";
|
|
8
8
|
import "d3-geo";
|
|
9
9
|
import "three/examples/jsm/controls/OrbitControls";
|
|
10
10
|
import "three/examples/jsm/loaders/GLTFLoader";
|
|
11
11
|
import "three/examples/jsm/loaders/DRACOLoader.js";
|
|
12
|
-
import { createHistory as
|
|
12
|
+
import { createHistory as re } from "./utils/mini3d/utils/CreateHistory.mjs";
|
|
13
13
|
import "three/examples/jsm/libs/lil-gui.module.min";
|
|
14
14
|
import "three/examples/jsm/utils/BufferGeometryUtils";
|
|
15
15
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
@@ -168,15 +168,15 @@ import "../UnityIframe/index.mjs";
|
|
|
168
168
|
import "../UnityWebgl/index.mjs";
|
|
169
169
|
import "../Vr/index.mjs";
|
|
170
170
|
import "../Earth/index.mjs";
|
|
171
|
-
import { SHJDatasourceV2 as
|
|
171
|
+
import { SHJDatasourceV2 as ae } from "../../../../commons/plugins/datasource/index.mjs";
|
|
172
172
|
import { SHJParseEvent as s } from "../../../../commons/plugins/event/index.mjs";
|
|
173
|
-
import { upgradeMap3d as
|
|
174
|
-
import { Utils as
|
|
175
|
-
const
|
|
173
|
+
import { upgradeMap3d as le } from "./version.mjs";
|
|
174
|
+
import { Utils as k } from "../../../../commons/utils/utils.mjs";
|
|
175
|
+
const ie = { style: { width: "100%", height: "100%" } }, ne = { class: "value" }, ce = ["onClick"], pe = {
|
|
176
176
|
key: 3,
|
|
177
177
|
class: "fps"
|
|
178
|
-
},
|
|
179
|
-
...
|
|
178
|
+
}, se = P({ name: "ShjMap3d" }), Cr = /* @__PURE__ */ P({
|
|
179
|
+
...se,
|
|
180
180
|
props: {
|
|
181
181
|
option: {},
|
|
182
182
|
sources: {},
|
|
@@ -195,10 +195,10 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
195
195
|
"on-return",
|
|
196
196
|
"on-data-change"
|
|
197
197
|
],
|
|
198
|
-
setup(l, { expose:
|
|
199
|
-
const a =
|
|
198
|
+
setup(l, { expose: V, emit: N }) {
|
|
199
|
+
const a = O(() => le(l.option)), p = N, r = f(), H = f(!1), j = f(!1), C = "zerov-map3d-scene", y = f(), i = new re(), g = f(!1), b = (e = !0) => {
|
|
200
200
|
r.value.cleanAllBar(), r.value.cleanAllScatter(), r.value.cleanAllFlyLine(), r.value.createAllRegionalLevel(), l.sources && l.sources.length > 0 && a.value.widgets.forEach((o, t) => {
|
|
201
|
-
|
|
201
|
+
ae.parse({
|
|
202
202
|
sources: [l.sources[t]],
|
|
203
203
|
callback: (n) => {
|
|
204
204
|
try {
|
|
@@ -224,15 +224,15 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
226
|
});
|
|
227
|
-
},
|
|
227
|
+
}, U = () => {
|
|
228
228
|
try {
|
|
229
|
-
|
|
229
|
+
y.value && document.getElementById(C) && y.value.removeChild(document.getElementById(C));
|
|
230
230
|
const e = document.createElement("canvas");
|
|
231
|
-
e.id =
|
|
231
|
+
e.id = C, e.className = "zerov-map-3d", e.style.width = "100%", e.style.height = "100%", y.value.appendChild(e);
|
|
232
232
|
} catch {
|
|
233
233
|
}
|
|
234
|
-
},
|
|
235
|
-
document.getElementById(
|
|
234
|
+
}, S = (e) => (H.value = !1, j.value = !1, r.value && (r.value.destroy(), r.value = null), U(), new te(
|
|
235
|
+
document.getElementById(C),
|
|
236
236
|
{ geoProjectionCenter: [108.55, 36.32] },
|
|
237
237
|
e,
|
|
238
238
|
{
|
|
@@ -246,14 +246,14 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
246
246
|
if (p("on-area-click", t), s.parseEvents(l.useEvents, "on-area-click", t), t.adcode !== i.present && e.scene.isDrilling && e.scene.defaultMapAdcode !== 1) {
|
|
247
247
|
p("on-drill-down", t), s.parseEvents(l.useEvents, "on-drill-down", t);
|
|
248
248
|
const n = v(e);
|
|
249
|
-
n.scene.defaultMapAdcode = t.adcode, r.value =
|
|
249
|
+
n.scene.defaultMapAdcode = t.adcode, r.value = S(n), i.push(t.adcode), i.past.length <= 0 ? g.value = !1 : g.value = !0;
|
|
250
250
|
}
|
|
251
251
|
},
|
|
252
252
|
onMapSuccess: () => {
|
|
253
|
-
|
|
253
|
+
H.value = !0, p("on-loaded"), s.parseEvents(l.useEvents, "on-loaded", null);
|
|
254
254
|
},
|
|
255
255
|
onMapAnimationSuccess: () => {
|
|
256
|
-
|
|
256
|
+
b(), j.value = !0, p("on-animated"), s.parseEvents(l.useEvents, "on-animated", null);
|
|
257
257
|
},
|
|
258
258
|
onClickBar: (t) => {
|
|
259
259
|
p("on-bar-click", t), s.parseEvents(l.useEvents, "on-bar-click", t);
|
|
@@ -265,18 +265,24 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
265
265
|
p("on-flyline-click", t), s.parseEvents(l.useEvents, "on-flyline-click", t);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
))
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
)), A = () => {
|
|
269
|
+
if (!y.value) return;
|
|
270
|
+
const { clientWidth: e, clientHeight: o } = y.value;
|
|
271
|
+
!e || !o || (r.value = S(a.value), i.push(a.value.scene.defaultMapAdcode), oe(
|
|
271
272
|
{ option: a.value, sources: l.sources, useEvents: l.useEvents },
|
|
272
273
|
r,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
)
|
|
277
|
-
|
|
274
|
+
S,
|
|
275
|
+
b,
|
|
276
|
+
D
|
|
277
|
+
));
|
|
278
|
+
};
|
|
279
|
+
X(() => {
|
|
280
|
+
Y(() => {
|
|
281
|
+
A();
|
|
282
|
+
}), window.addEventListener("resize", () => {
|
|
283
|
+
A();
|
|
278
284
|
});
|
|
279
|
-
}),
|
|
285
|
+
}), Z(() => {
|
|
280
286
|
r.value && r.value.destroy();
|
|
281
287
|
});
|
|
282
288
|
const I = () => {
|
|
@@ -288,10 +294,10 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
288
294
|
adcode: i.present
|
|
289
295
|
}), i.undo();
|
|
290
296
|
const e = v(a.value);
|
|
291
|
-
e.scene.defaultMapAdcode = i.present, r.value =
|
|
292
|
-
},
|
|
293
|
-
i.empty(), i.push(a.value.scene.defaultMapAdcode), r.value =
|
|
294
|
-
},
|
|
297
|
+
e.scene.defaultMapAdcode = i.present, r.value = S(e), i.past.length <= 0 ? g.value = !1 : g.value = !0;
|
|
298
|
+
}, D = () => {
|
|
299
|
+
i.empty(), i.push(a.value.scene.defaultMapAdcode), r.value = S(a.value), i.past.length <= 0 ? g.value = !1 : g.value = !0;
|
|
300
|
+
}, J = (e, o, t) => {
|
|
295
301
|
$.timeline().add(
|
|
296
302
|
$.to(r.value.camera.instance.position, {
|
|
297
303
|
duration: 2,
|
|
@@ -303,29 +309,29 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
303
309
|
})
|
|
304
310
|
);
|
|
305
311
|
};
|
|
306
|
-
|
|
307
|
-
refresh: () =>
|
|
308
|
-
refreshView: () =>
|
|
309
|
-
refreshData: () =>
|
|
312
|
+
V({
|
|
313
|
+
refresh: () => b(),
|
|
314
|
+
refreshView: () => b(),
|
|
315
|
+
refreshData: () => b(),
|
|
310
316
|
// 返回上一级
|
|
311
317
|
goBack: () => I(),
|
|
312
318
|
// 更新相机位置
|
|
313
|
-
setCameraPosition: (e, o, t) =>
|
|
319
|
+
setCameraPosition: (e, o, t) => J(e, o, t)
|
|
314
320
|
});
|
|
315
|
-
const
|
|
321
|
+
const q = ee(), M = f(), G = (e) => {
|
|
316
322
|
if (M.value && e) {
|
|
317
323
|
const o = `url(${e.backgroundImage})`;
|
|
318
324
|
return {
|
|
319
|
-
...
|
|
320
|
-
...
|
|
321
|
-
...
|
|
325
|
+
...k.json2cssObject(e.background),
|
|
326
|
+
...k.json2cssObject(e.border),
|
|
327
|
+
...k.json2cssObject(e.text),
|
|
322
328
|
left: a.value.backButton.left + "%",
|
|
323
329
|
bottom: a.value.backButton.bottom + "%",
|
|
324
330
|
"background-image": o
|
|
325
331
|
};
|
|
326
332
|
}
|
|
327
333
|
return {};
|
|
328
|
-
}, m = f(v(a.value.widgets)), c =
|
|
334
|
+
}, m = f(v(a.value.widgets)), c = O(() => {
|
|
329
335
|
try {
|
|
330
336
|
const e = m.value.filter(
|
|
331
337
|
(o) => o.type === "regionalLevel"
|
|
@@ -335,22 +341,22 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
335
341
|
return null;
|
|
336
342
|
}
|
|
337
343
|
});
|
|
338
|
-
|
|
344
|
+
E(
|
|
339
345
|
() => v(a.value.widgets),
|
|
340
346
|
(e, o) => {
|
|
341
347
|
try {
|
|
342
|
-
!
|
|
348
|
+
!w(e, o) && r.value && (m.value = v(a.value.widgets));
|
|
343
349
|
} catch {
|
|
344
350
|
}
|
|
345
351
|
},
|
|
346
352
|
{
|
|
347
353
|
deep: !0
|
|
348
354
|
}
|
|
349
|
-
),
|
|
355
|
+
), E(
|
|
350
356
|
() => v(m.value.filter((e) => e.type === "bar")),
|
|
351
357
|
(e, o) => {
|
|
352
358
|
try {
|
|
353
|
-
!
|
|
359
|
+
!w(e, o) && r.value && e.length === o.length && e.forEach((t) => {
|
|
354
360
|
r.value.createBar(t, void 0, !1);
|
|
355
361
|
});
|
|
356
362
|
} catch {
|
|
@@ -359,11 +365,11 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
359
365
|
{
|
|
360
366
|
deep: !0
|
|
361
367
|
}
|
|
362
|
-
),
|
|
368
|
+
), E(
|
|
363
369
|
() => v(m.value.filter((e) => e.type === "scatter")),
|
|
364
370
|
(e, o) => {
|
|
365
371
|
try {
|
|
366
|
-
!
|
|
372
|
+
!w(e, o) && r.value && e.length === o.length && e.forEach((t) => {
|
|
367
373
|
r.value.createScatter(t, void 0, !1);
|
|
368
374
|
});
|
|
369
375
|
} catch {
|
|
@@ -372,11 +378,11 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
372
378
|
{
|
|
373
379
|
deep: !0
|
|
374
380
|
}
|
|
375
|
-
),
|
|
381
|
+
), E(
|
|
376
382
|
() => v(m.value.filter((e) => e.type === "flyline")),
|
|
377
383
|
(e, o) => {
|
|
378
384
|
try {
|
|
379
|
-
!
|
|
385
|
+
!w(e, o) && r.value && e.length === o.length && e.forEach((t) => {
|
|
380
386
|
r.value.createFlyLine(t, void 0, !1);
|
|
381
387
|
});
|
|
382
388
|
} catch {
|
|
@@ -385,11 +391,11 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
385
391
|
{
|
|
386
392
|
deep: !0
|
|
387
393
|
}
|
|
388
|
-
),
|
|
394
|
+
), E(
|
|
389
395
|
() => v(m.value.filter((e) => e.type === "regionalLevel")),
|
|
390
396
|
(e, o) => {
|
|
391
397
|
try {
|
|
392
|
-
!
|
|
398
|
+
!w(e, o) && r.value && e.length === o.length && e.forEach((t) => {
|
|
393
399
|
r.value.createRegionalLevel(t, void 0, !1);
|
|
394
400
|
});
|
|
395
401
|
} catch {
|
|
@@ -399,40 +405,40 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
399
405
|
deep: !0
|
|
400
406
|
}
|
|
401
407
|
);
|
|
402
|
-
const
|
|
408
|
+
const K = (e) => {
|
|
403
409
|
try {
|
|
404
410
|
e.isHide === void 0 ? e.isHide = !0 : e.isHide = !e.isHide;
|
|
405
411
|
} catch {
|
|
406
412
|
}
|
|
407
|
-
},
|
|
413
|
+
}, Q = () => {
|
|
408
414
|
try {
|
|
409
415
|
const e = m.value.every((o) => !o.isHide);
|
|
410
416
|
m.value.forEach((o) => o.isHide = e);
|
|
411
417
|
} catch {
|
|
412
418
|
}
|
|
413
|
-
},
|
|
414
|
-
const o = `url(${e.backgroundImage})`, t = `url(${
|
|
419
|
+
}, R = (e) => {
|
|
420
|
+
const o = `url(${e.backgroundImage})`, t = `url(${F(e.hover.backgroundImage)})`, n = `url(${F(e.active.backgroundImage)})`;
|
|
415
421
|
return {
|
|
416
|
-
...
|
|
417
|
-
...
|
|
418
|
-
...
|
|
422
|
+
...k.json2cssObject(e),
|
|
423
|
+
...k.json2cssObject(e.hover, "hover"),
|
|
424
|
+
...k.json2cssObject(e.active, "active"),
|
|
419
425
|
"background-image": o,
|
|
420
426
|
"--hover-background-image": t,
|
|
421
427
|
"--active-background-image": n
|
|
422
428
|
};
|
|
423
|
-
},
|
|
424
|
-
return (e, o) => (d(), u("div",
|
|
429
|
+
}, F = (e) => !e.startsWith("http") && !e.startsWith("//") ? "../" + e : e;
|
|
430
|
+
return (e, o) => (d(), u("div", ie, [
|
|
425
431
|
B("div", {
|
|
426
432
|
ref_key: "map3dWrapRef",
|
|
427
|
-
ref:
|
|
428
|
-
class:
|
|
433
|
+
ref: y,
|
|
434
|
+
class: W(["map-3d-wrap", { show: H.value }])
|
|
429
435
|
}, [
|
|
430
|
-
|
|
436
|
+
j.value && g.value && a.value.backButton.show ? (d(), u("div", {
|
|
431
437
|
key: 0,
|
|
432
438
|
ref_key: "buttonRef",
|
|
433
439
|
ref: M,
|
|
434
440
|
class: "return-btn",
|
|
435
|
-
style: h(
|
|
441
|
+
style: h(G(a.value.backButton)),
|
|
436
442
|
onClick: I
|
|
437
443
|
}, " 返回上一级 ", 4)) : L("", !0),
|
|
438
444
|
c.value ? (d(), u("div", {
|
|
@@ -452,7 +458,7 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
452
458
|
"--color-borderRadius": c.value.labelStyle.colorStyle.borderRadius + "px"
|
|
453
459
|
})
|
|
454
460
|
}, [
|
|
455
|
-
(d(!0), u(
|
|
461
|
+
(d(!0), u(z, null, T(c.value.rules, (t, n) => (d(), u("div", {
|
|
456
462
|
key: n,
|
|
457
463
|
class: "item"
|
|
458
464
|
}, [
|
|
@@ -460,7 +466,7 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
460
466
|
class: "color",
|
|
461
467
|
style: h({ backgroundColor: t.color })
|
|
462
468
|
}, null, 4),
|
|
463
|
-
B("span",
|
|
469
|
+
B("span", ne, x(t.label), 1)
|
|
464
470
|
]))), 128))
|
|
465
471
|
], 4)) : L("", !0),
|
|
466
472
|
a.value.widgets.length > 0 && a.value.widgetControlStyle && a.value.widgetControlStyle.show ? (d(), u("div", {
|
|
@@ -476,26 +482,26 @@ const ae = { style: { width: "100%", height: "100%" } }, le = { class: "value" }
|
|
|
476
482
|
})
|
|
477
483
|
}, [
|
|
478
484
|
B("div", {
|
|
479
|
-
class:
|
|
485
|
+
class: W(["control-button", {
|
|
480
486
|
active: m.value.every((t) => !t.isHide)
|
|
481
487
|
}]),
|
|
482
|
-
style: h(
|
|
483
|
-
onClick:
|
|
484
|
-
},
|
|
485
|
-
(d(!0), u(
|
|
488
|
+
style: h(R(a.value.widgetControlStyle)),
|
|
489
|
+
onClick: Q
|
|
490
|
+
}, x(m.value.every((t) => !t.isHide) ? "隐藏" : "显示") + "/全部 ", 7),
|
|
491
|
+
(d(!0), u(z, null, T(m.value, (t) => (d(), u("div", {
|
|
486
492
|
key: t.id,
|
|
487
|
-
class:
|
|
493
|
+
class: W(["control-button", {
|
|
488
494
|
active: !t.isHide
|
|
489
495
|
}]),
|
|
490
|
-
style: h(
|
|
491
|
-
onClick: (n) =>
|
|
492
|
-
},
|
|
496
|
+
style: h(R(a.value.widgetControlStyle)),
|
|
497
|
+
onClick: (n) => K(t)
|
|
498
|
+
}, x(t.name || "-"), 15, ce))), 128))
|
|
493
499
|
], 4)) : L("", !0),
|
|
494
|
-
a.value.debugger ? (d(), u("div",
|
|
500
|
+
a.value.debugger ? (d(), u("div", pe, "fps:" + x(_(q)), 1)) : L("", !0)
|
|
495
501
|
], 2)
|
|
496
502
|
]));
|
|
497
503
|
}
|
|
498
504
|
});
|
|
499
505
|
export {
|
|
500
|
-
|
|
506
|
+
Cr as default
|
|
501
507
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { httpRequest } from "../utils/request";
|
|
2
|
-
export declare const parseAPIPort: (source: any, noUseMapping: boolean, callback: (data: any) => void) => void;
|
|
3
2
|
export { httpRequest };
|
|
3
|
+
export declare const parseAPIPort: (source: any, noUseMapping: boolean, callback: (data: any) => void) => Promise<void>;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { IMapping } from "../types";
|
|
2
2
|
export declare const mappingData: (data: any[], mapping: IMapping[], dynamicMapping: boolean, isUserdata: boolean) => any;
|
|
3
|
+
export declare const dynamicMappingData: (item: any, mapping: IMapping[]) => {
|
|
4
|
+
alias: string;
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
mapping: string;
|
|
8
|
+
}[];
|
|
@@ -3,119 +3,29 @@ import { IVariable } from "../types";
|
|
|
3
3
|
* 数据源工具类
|
|
4
4
|
*/
|
|
5
5
|
export declare class DataSourceUtils {
|
|
6
|
-
static
|
|
6
|
+
static executeAllVariable(variableData: IVariable[]): void;
|
|
7
7
|
static replaceObjectVariables(obj: any): any;
|
|
8
8
|
static replaceStringVariables(str: string): string;
|
|
9
|
-
static getURLVariableNames(url: string): string[];
|
|
10
9
|
static getObjectVariableNames(obj: any): string[];
|
|
11
10
|
static getStringVariableNames(str: string): string[];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
static parseVariablePath(path: any): {
|
|
12
|
+
varName: any;
|
|
13
|
+
propPath: any;
|
|
14
|
+
};
|
|
16
15
|
static getEnvironments(): {
|
|
17
16
|
envName: string;
|
|
18
17
|
envBaseUrl: string;
|
|
19
18
|
};
|
|
20
|
-
/**
|
|
21
|
-
* 设置环境变量
|
|
22
|
-
* @param environments 环境变量
|
|
23
|
-
*/
|
|
24
19
|
static setEnvironments(environments: any[]): void;
|
|
25
|
-
/**
|
|
26
|
-
* 获取变量数据
|
|
27
|
-
* @returns 变量数据
|
|
28
|
-
*/
|
|
29
20
|
static getVariables(): any[];
|
|
30
|
-
/**
|
|
31
|
-
* 设置变量数据
|
|
32
|
-
* @param variable 变量数据
|
|
33
|
-
*/
|
|
34
21
|
static setVariables(variable: any[]): void;
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
* @param id
|
|
38
|
-
* @returns
|
|
39
|
-
*/
|
|
22
|
+
static setVariableById(variable: any, value: any, updateWidget?: boolean): void;
|
|
40
23
|
static getVariableById(id: string): any;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @param name
|
|
44
|
-
* @returns
|
|
45
|
-
*/
|
|
46
24
|
static getVariableByName(name: string): any;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @param name
|
|
50
|
-
* @returns
|
|
51
|
-
*/
|
|
52
25
|
static getVariableValueByName(name: string): any;
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
* @param name
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
static getVariableInitialStateByName(name: string): any;
|
|
59
|
-
/**
|
|
60
|
-
* 设置变量数据
|
|
61
|
-
* @param id 变量 ID
|
|
62
|
-
* @param variable 变量数据
|
|
63
|
-
*/
|
|
64
|
-
static setVariableById(variable: any, value: any, updateWidget?: boolean): void;
|
|
65
|
-
/**
|
|
66
|
-
* 新增变量
|
|
67
|
-
* @param data
|
|
68
|
-
*/
|
|
69
26
|
static addVariable: (variable: any) => void;
|
|
70
|
-
/**
|
|
71
|
-
* 更新变量
|
|
72
|
-
* @param data
|
|
73
|
-
*/
|
|
74
27
|
static updateVariable: (variable: any) => void;
|
|
75
|
-
/**
|
|
76
|
-
* 更新变量
|
|
77
|
-
* @param data
|
|
78
|
-
*/
|
|
79
28
|
static deleteVariableById: (id: any) => void;
|
|
80
|
-
/**
|
|
81
|
-
* 检查 WebSocket 是否已存在且有效
|
|
82
|
-
* @param wsInstances WebSocket 实例
|
|
83
|
-
* @param tId WebSocket 实例的 ID
|
|
84
|
-
* @param sourceId WebSocket 实例的源 ID
|
|
85
|
-
* @returns 是否有效
|
|
86
|
-
*/
|
|
87
|
-
static hasValidWebSocket(wsInstances: any, tId: string, sourceId: string): boolean;
|
|
88
|
-
/**
|
|
89
|
-
* 只在必要时清理 WebSocket 连接
|
|
90
|
-
* @param wsInstances WebSocket 实例
|
|
91
|
-
* @param sourceIds 源 ID
|
|
92
|
-
* @param tId WebSocket 实例的 ID
|
|
93
|
-
*/
|
|
94
|
-
static cleanupPreviousWebSockets(wsInstances: any, sourceIds: string[], tId: string): void;
|
|
95
|
-
/**
|
|
96
|
-
* 使用 Function 构造函数获取对象中的嵌套值(更简洁但安全性较低)
|
|
97
|
-
* @param obj 源对象
|
|
98
|
-
* @param path 路径字符串,例如 ".a[0].value"
|
|
99
|
-
* @returns 获取到的值,如果路径不存在则返回 undefined
|
|
100
|
-
*/
|
|
101
|
-
static getNestedValue(obj: any, path: string): any;
|
|
102
|
-
/**
|
|
103
|
-
* 从路径字符串中提取变量名
|
|
104
|
-
* @param path 路径字符串,例如 "测试.test" 或 "333[0].aa"
|
|
105
|
-
* @returns 提取出的变量名
|
|
106
|
-
*/
|
|
107
|
-
static extractVariableName(path: string): string;
|
|
108
|
-
/**
|
|
109
|
-
* 初始化所有变量
|
|
110
|
-
* @param variableData
|
|
111
|
-
* @returns
|
|
112
|
-
*/
|
|
113
|
-
static executeAllVariable(variableData: IVariable[]): void;
|
|
114
|
-
/**
|
|
115
|
-
* 返回空数据
|
|
116
|
-
* @param id 数据源 ID
|
|
117
|
-
* @returns 空数据
|
|
118
|
-
*/
|
|
119
29
|
static noneData(id: string): {
|
|
120
30
|
id: string;
|
|
121
31
|
finalKeyData: {
|
|
@@ -26,6 +26,7 @@ declare const _sfc_main: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
26
26
|
initData: (isAnimation?: boolean) => void;
|
|
27
27
|
initDom: () => void;
|
|
28
28
|
createWorld: (option: any) => World;
|
|
29
|
+
safeCreateWorld: () => void;
|
|
29
30
|
goBack: () => void;
|
|
30
31
|
cleanAndCreateWorld: () => void;
|
|
31
32
|
setCameraPosition: (x: number, y: number, z: number) => void;
|