@syhr/sy-graph 1.1.0-rc.13 → 1.1.0-rc.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,67 +1,67 @@
1
- import './sy-graph.css';var oa = Object.defineProperty, sa = Object.defineProperties;
2
- var la = Object.getOwnPropertyDescriptors;
3
- var ct = Object.getOwnPropertySymbols;
4
- var ca = Object.prototype.hasOwnProperty, da = Object.prototype.propertyIsEnumerable;
5
- var Qe = (n, e, t) => e in n ? oa(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, c = (n, e) => {
1
+ import './sy-graph.css';var Ia = Object.defineProperty, Sa = Object.defineProperties;
2
+ var ba = Object.getOwnPropertyDescriptors;
3
+ var Et = Object.getOwnPropertySymbols;
4
+ var xa = Object.prototype.hasOwnProperty, Ca = Object.prototype.propertyIsEnumerable;
5
+ var st = (a, e, t) => e in a ? Ia(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t, d = (a, e) => {
6
6
  for (var t in e || (e = {}))
7
- ca.call(e, t) && Qe(n, t, e[t]);
8
- if (ct)
9
- for (var t of ct(e))
10
- da.call(e, t) && Qe(n, t, e[t]);
11
- return n;
12
- }, k = (n, e) => sa(n, la(e));
13
- var we = (n, e, t) => Qe(n, typeof e != "symbol" ? e + "" : e, t);
14
- var te = (n, e, t) => new Promise((a, i) => {
15
- var r = (m) => {
7
+ xa.call(e, t) && st(a, t, e[t]);
8
+ if (Et)
9
+ for (var t of Et(e))
10
+ Ca.call(e, t) && st(a, t, e[t]);
11
+ return a;
12
+ }, D = (a, e) => Sa(a, ba(e));
13
+ var Se = (a, e, t) => st(a, typeof e != "symbol" ? e + "" : e, t);
14
+ var ae = (a, e, t) => new Promise((n, r) => {
15
+ var i = (f) => {
16
16
  try {
17
- l(t.next(m));
18
- } catch (v) {
19
- i(v);
17
+ c(t.next(f));
18
+ } catch (g) {
19
+ r(g);
20
20
  }
21
- }, o = (m) => {
21
+ }, s = (f) => {
22
22
  try {
23
- l(t.throw(m));
24
- } catch (v) {
25
- i(v);
23
+ c(t.throw(f));
24
+ } catch (g) {
25
+ r(g);
26
26
  }
27
- }, l = (m) => m.done ? a(m.value) : Promise.resolve(m.value).then(r, o);
28
- l((t = t.apply(n, e)).next());
27
+ }, c = (f) => f.done ? n(f.value) : Promise.resolve(f.value).then(i, s);
28
+ c((t = t.apply(a, e)).next());
29
29
  });
30
- import { openBlock as ue, createElementBlock as Ee, createElementVNode as me, toDisplayString as nt, createVNode as Me, unref as Fe, withCtx as lt, createTextVNode as Vt, useCssVars as ua, computed as Re, resolveComponent as it, normalizeStyle as Bt, createBlock as ze, createCommentVNode as Ue, inject as ha, ref as Y, shallowRef as ma, watch as rt, nextTick as fa, onMounted as Wt, onUnmounted as Kt, provide as pa } from "vue";
31
- import Aa from "qs";
32
- import ga from "axios";
33
- import va from "mitt";
34
- import wa from "dayjs";
30
+ import { openBlock as ue, createElementBlock as xe, createElementVNode as ge, toDisplayString as At, createVNode as $e, unref as ze, withCtx as _t, createTextVNode as ra, ref as Q, useCssVars as Pa, computed as Ge, resolveComponent as gt, normalizeStyle as ia, createBlock as et, createCommentVNode as je, inject as Ra, shallowRef as Na, watch as vt, nextTick as ka, onMounted as oa, onUnmounted as sa, provide as Da } from "vue";
31
+ import la from "qs";
32
+ import ca from "axios";
33
+ import La from "mitt";
34
+ import Oa from "dayjs";
35
35
  import "crypto-js";
36
- import { SM4 as ke, SM2 as _a } from "gm-crypto";
37
- import { throttle as Yt, isObject as ya, debounce as Ea } from "lodash-es";
38
- import { ElMessage as ie, ElButton as __$t__, ElNotification as Ia } from "element-plus";
39
- import { clearLineCross as Ta, handleLineCross as Sa } from "@meta2d/utils";
40
- import { Meta2d as ba, register as De, registerAnchors as dt, registerCanvasDraw as Oe, LockState as xe, HoverType as ut, setHover as ht, getParent as mt, PenType as Ca, pointInRect as xa, getAllChildren as Pa } from "@meta2d/core";
41
- import { mindBoxPlugin as Ra } from "@meta2d/plugin-mind-core";
42
- import { collapseChildPlugin as Na } from "@meta2d/plugin-mind-collapse";
43
- import { formPens as ka } from "@meta2d/form-diagram";
44
- import { classPens as Da } from "@meta2d/class-diagram";
45
- import { chartsPens as Oa } from "@meta2d/le5le-charts";
46
- import { videos as be } from "@meta2d/core/src/diagrams";
47
- import { flowPens as La, flowAnchors as Ma } from "@meta2d/flow-diagram";
48
- import { ftaPens as Fa, ftaAnchors as Ua, ftaPensbyCtx as Ga } from "@meta2d/fta-diagram";
49
- import { sequencePens as Ha, sequencePensbyCtx as Va } from "@meta2d/sequence-diagram";
50
- import { activityDiagram as Ba, activityDiagramByCtx as Wa } from "@meta2d/activity-diagram";
51
- import { Loading as Ka } from "@element-plus/icons-vue";
52
- const Ya = {
36
+ import { SM4 as Ve, SM2 as Ma } from "gm-crypto";
37
+ import { throttle as da, isObject as Fa, debounce as Tt } from "lodash-es";
38
+ import { ElMessage as he, ElButton as ua, ElNotification as Ua } from "element-plus";
39
+ import { clearLineCross as Ga, handleLineCross as Ha } from "@meta2d/utils";
40
+ import { Meta2d as Va, register as Ke, registerAnchors as It, registerCanvasDraw as We, LockState as Pe, HoverType as Le, setHover as lt, getParent as ct, PenType as Ba, pointInRect as Ka, getAllChildren as Wa } from "@meta2d/core";
41
+ import { mindBoxPlugin as Ya } from "@meta2d/plugin-mind-core";
42
+ import { collapseChildPlugin as $a } from "@meta2d/plugin-mind-collapse";
43
+ import { formPens as za } from "@meta2d/form-diagram";
44
+ import { classPens as ja } from "@meta2d/class-diagram";
45
+ import { chartsPens as Xa } from "@meta2d/le5le-charts";
46
+ import { videos as Oe } from "@meta2d/core/src/diagrams";
47
+ import { flowPens as qa, flowAnchors as Qa } from "@meta2d/flow-diagram";
48
+ import { ftaPens as Ja, ftaAnchors as Za, ftaPensbyCtx as en } from "@meta2d/fta-diagram";
49
+ import { sequencePens as tn, sequencePensbyCtx as an } from "@meta2d/sequence-diagram";
50
+ import { activityDiagram as nn, activityDiagramByCtx as rn } from "@meta2d/activity-diagram";
51
+ import { Loading as on } from "@element-plus/icons-vue";
52
+ const sn = {
53
53
  OFFLINE: 0
54
54
  // 离线
55
- }, $a = {
55
+ }, ln = {
56
56
  STOP: 2
57
57
  // 停止
58
- }, za = {
58
+ }, cn = {
59
59
  1: 1,
60
60
  2: 2,
61
61
  3: 3,
62
62
  4: 4,
63
63
  5: 5
64
- }, H = {
64
+ }, Y = {
65
65
  AREA: 1,
66
66
  // 区域
67
67
  BAY: 2,
@@ -88,21 +88,21 @@ const Ya = {
88
88
  // 定值
89
89
  GIS_SENSOR: 13
90
90
  // 局放
91
- }, ja = {
92
- [H.AREA]: "area",
93
- [H.BAY]: "bay",
94
- [H.DEVICE]: "device",
95
- [H.COMPONENT]: "component",
96
- [H.POINT]: "patrolpoint",
97
- [H.YX]: "yxpoint",
98
- [H.YC]: "ycpoint",
99
- [H.YK]: "ykpoint",
100
- [H.AUX_DEVICE]: "acdevice",
101
- [H.LD]: "ld",
102
- [H.LN]: "ln",
103
- [H.SG]: "sgpoint",
104
- [H.GIS_SENSOR]: "gisuhfsensor"
105
- }, ae = {
91
+ }, dn = {
92
+ [Y.AREA]: "area",
93
+ [Y.BAY]: "bay",
94
+ [Y.DEVICE]: "device",
95
+ [Y.COMPONENT]: "component",
96
+ [Y.POINT]: "patrolpoint",
97
+ [Y.YX]: "yxpoint",
98
+ [Y.YC]: "ycpoint",
99
+ [Y.YK]: "ykpoint",
100
+ [Y.AUX_DEVICE]: "acdevice",
101
+ [Y.LD]: "ld",
102
+ [Y.LN]: "ln",
103
+ [Y.SG]: "sgpoint",
104
+ [Y.GIS_SENSOR]: "gisuhfsensor"
105
+ }, ne = {
106
106
  CUSTOM_MSG: "CUSTOM_MSG",
107
107
  OPEN_CAMERA: "OPEN_CAMERA",
108
108
  // 打开摄像机弹窗
@@ -118,14 +118,14 @@ const Ya = {
118
118
  // 通知弹窗
119
119
  GIS_PROPS_PANEL: "GIS_PROPS_PANEL"
120
120
  // 属性面板
121
- }, Ve = {
121
+ }, Xe = {
122
122
  Emit: 7
123
- }, Be = {
123
+ }, qe = {
124
124
  NONE: "none",
125
125
  WUJIE: "wujie",
126
126
  QIANKUN: "qiankun",
127
127
  MICROAPP: "microapp"
128
- }, b = {
128
+ }, P = {
129
129
  TEXT: "TEXT",
130
130
  // 未特殊定义
131
131
  NORMAL: "NORMAL",
@@ -168,11 +168,11 @@ const Ya = {
168
168
  // 光字牌
169
169
  VIDEO_STREAM: "VIDEO_STREAM"
170
170
  // 视频流
171
- }, ft = {
171
+ }, St = {
172
172
  GRAPH: {
173
173
  SOCKET: "GRAPH_SOCKET"
174
174
  }
175
- }, Je = {
175
+ }, dt = {
176
176
  AC: {
177
177
  ALARM: "ac.channel.alarm",
178
178
  // 智辅告警
@@ -434,181 +434,194 @@ const Ya = {
434
434
  // 超声停障
435
435
  }
436
436
  };
437
- var Xe = {};
437
+ var rt = {};
438
438
  /*!
439
439
  * vite-plugin-qiankun.js v1.0.14
440
440
  * (c) 2021-2022 Teng Mao Qing
441
441
  * Released under the MIT License.
442
442
  */
443
- Object.defineProperty(Xe, "__esModule", { value: !0 });
444
- var Pe = typeof window != "undefined" ? window.proxy || window : {}, zt = function(n) {
445
- Pe != null && Pe.__POWERED_BY_QIANKUN__ && (window.moudleQiankunAppLifeCycles || (window.moudleQiankunAppLifeCycles = {}), Pe.qiankunName && (window.moudleQiankunAppLifeCycles[Pe.qiankunName] = n));
443
+ Object.defineProperty(rt, "__esModule", { value: !0 });
444
+ var Fe = typeof window != "undefined" ? window.proxy || window : {}, ha = function(a) {
445
+ Fe != null && Fe.__POWERED_BY_QIANKUN__ && (window.moudleQiankunAppLifeCycles || (window.moudleQiankunAppLifeCycles = {}), Fe.qiankunName && (window.moudleQiankunAppLifeCycles[Fe.qiankunName] = a));
446
446
  };
447
- Xe.default = zt;
448
- var Ze = Xe.qiankunWindow = Pe;
449
- Xe.renderWithQiankun = zt;
450
- function Xa() {
451
- return window.__POWERED_BY_WUJIE__ || window.$wujie ? Be.WUJIE : window.__POWERED_BY_QIANKUN__ || Ze != null && Ze.__POWERED_BY_QIANKUN__ ? Be.QIANKUN : window.__MICRO_APP_ENVIRONMENT__ || window.microApp ? Be.MICROAPP : Be.NONE;
447
+ rt.default = ha;
448
+ var ut = rt.qiankunWindow = Fe;
449
+ rt.renderWithQiankun = ha;
450
+ function un() {
451
+ return window.__POWERED_BY_WUJIE__ || window.$wujie ? qe.WUJIE : window.__POWERED_BY_QIANKUN__ || ut != null && ut.__POWERED_BY_QIANKUN__ ? qe.QIANKUN : window.__MICRO_APP_ENVIRONMENT__ || window.microApp ? qe.MICROAPP : qe.NONE;
452
452
  }
453
- const $e = "/", jt = window.meta.app.encrypt;
454
- var Et, It;
455
- const qa = ((It = (Et = window == null ? void 0 : window.meta) == null ? void 0 : Et.app) == null ? void 0 : It.isProxy) || !1;
456
- var Tt, St;
457
- const Qa = ((St = (Tt = window == null ? void 0 : window.meta) == null ? void 0 : Tt.app) == null ? void 0 : St.proxyUrl) || "";
458
- Xa();
459
- const Ja = location.protocol === "https:", Za = location.hostname, en = Ja ? "wss:" : "ws:", tn = location.port, an = qa ? `${location.origin}/${Qa}` : `${location.origin}`, pt = `${en}//${location.host}/ws`;
460
- var bt, Ct, xt, Pt, Rt, Nt, kt, Dt, Ot, Lt, Mt, Ft;
461
- (Ct = (bt = window.meta) == null ? void 0 : bt.graph) != null && Ct.savePath, (Pt = (xt = window.meta) == null ? void 0 : xt.graph) != null && Pt.graphPenPath, (Nt = (Rt = window.meta) == null ? void 0 : Rt.graph) != null && Nt.templatePath, (Dt = (kt = window.meta) == null ? void 0 : kt.graph) != null && Dt.graphImgUploadPath, (Lt = (Ot = window.meta) == null ? void 0 : Ot.graph) != null && Lt.threeSavePath, (Ft = (Mt = window.meta) == null ? void 0 : Mt.graph) != null && Ft.threeModelPath;
462
- var Ut;
463
- const L = ga.create({
464
- baseURL: an,
465
- timeout: ((Ut = window.meta.axios) == null ? void 0 : Ut.timeout) || 6e4,
453
+ const Ze = "/", ma = window.meta.app.encrypt;
454
+ var Mt, Ft;
455
+ const tt = ((Ft = (Mt = window == null ? void 0 : window.meta) == null ? void 0 : Mt.app) == null ? void 0 : Ft.proxyUrl) || "";
456
+ var Ut, Gt;
457
+ const bt = ((Gt = (Ut = window == null ? void 0 : window.meta) == null ? void 0 : Ut.app) == null ? void 0 : Gt.singoPrefixUrl) || "";
458
+ var Ht, Vt;
459
+ const xt = ((Vt = (Ht = window == null ? void 0 : window.meta) == null ? void 0 : Ht.app) == null ? void 0 : Vt.singoToken) || "";
460
+ un();
461
+ const hn = location.protocol === "https:", mn = location.hostname, fn = hn ? "wss:" : "ws:", pn = location.port, An = tt ? `${location.origin}/${tt}` : `${location.origin}`, gn = tt ? `${location.origin}/${tt}` : bt ? `${location.origin}/${bt}` : `${location.origin}`, Ct = `${fn}//${location.host}/ws`;
462
+ var Bt, Kt, Wt, Yt, __$t__, zt, jt, Xt, qt, Qt, Jt, Zt;
463
+ (Kt = (Bt = window.meta) == null ? void 0 : Bt.graph) != null && Kt.savePath, (Yt = (Wt = window.meta) == null ? void 0 : Wt.graph) != null && Yt.graphPenPath, (zt = (__$t__ = window.meta) == null ? void 0 : __$t__.graph) != null && zt.templatePath, (Xt = (jt = window.meta) == null ? void 0 : jt.graph) != null && Xt.graphImgUploadPath, (Qt = (qt = window.meta) == null ? void 0 : qt.graph) != null && Qt.threeSavePath, (Zt = (Jt = window.meta) == null ? void 0 : Jt.graph) != null && Zt.threeModelPath;
464
+ var ea;
465
+ const B = ca.create({
466
+ baseURL: An,
467
+ timeout: ((ea = window.meta.axios) == null ? void 0 : ea.timeout) || 6e4,
468
+ withCredentials: !1,
469
+ paramsSerializer: (a) => la.stringify(a)
470
+ });
471
+ B.interceptors.request.use(
472
+ (a) => (a.headers["x-token"] = "ewoglCJhbGcilDogpc3", a),
473
+ (a) => Promise.reject(a)
474
+ );
475
+ B.interceptors.response.use(
476
+ (a) => {
477
+ const { data: e } = a;
478
+ return Promise.resolve(e);
479
+ },
480
+ (a) => Promise.reject(a)
481
+ );
482
+ var ta;
483
+ const it = ca.create({
484
+ baseURL: gn,
485
+ timeout: ((ta = window.meta.axios) == null ? void 0 : ta.timeout) || 6e4,
466
486
  withCredentials: !1,
467
- paramsSerializer: (n) => Aa.stringify(n)
487
+ paramsSerializer: (a) => la.stringify(a)
468
488
  });
469
- L.interceptors.request.use(
470
- (n) => (n.headers["x-token"] = "ewoglCJhbGcilDogpc3", n),
471
- (n) => Promise.reject(n)
489
+ it.interceptors.request.use(
490
+ (a) => (xt && (a.headers["x-token"] = xt), a),
491
+ (a) => Promise.reject(a)
472
492
  );
473
- L.interceptors.response.use(
474
- (n) => {
475
- const { data: e } = n;
493
+ it.interceptors.response.use(
494
+ (a) => {
495
+ const { data: e } = a;
476
496
  return Promise.resolve(e);
477
497
  },
478
- (n) => Promise.reject(n)
498
+ (a) => Promise.reject(a)
479
499
  );
480
- function nn(n, e = {}, t = {}) {
481
- return new Promise((a) => {
482
- L.get(n, c({ params: e }, t)).then((i) => a({ res: i, err: null })).catch((i) => a({ res: null, err: i }));
500
+ function vn(a, e = {}, t = {}) {
501
+ return new Promise((n) => {
502
+ B.get(a, d({ params: e }, t)).then((r) => n({ res: r, err: null })).catch((r) => n({ res: null, err: r }));
483
503
  });
484
504
  }
485
- function rn(n, e = {}, t = {}) {
486
- return new Promise((a) => {
487
- L.post(n, e, t).then((i) => a({ res: i, err: null })).catch((i) => a({ res: null, err: i }));
505
+ function wn(a, e = {}, t = {}) {
506
+ return new Promise((n) => {
507
+ B.post(a, e, t).then((r) => n({ res: r, err: null })).catch((r) => n({ res: null, err: r }));
488
508
  });
489
509
  }
490
- function on(n, e = {}, t = {}) {
491
- return L.get(n, c({ params: e }, t));
510
+ function yn(a, e = {}, t = {}) {
511
+ return B.get(a, d({ params: e }, t));
492
512
  }
493
- function sn(n, e = {}, t = {}) {
494
- return L.post(n, e, t);
513
+ function _n(a, e = {}, t = {}) {
514
+ return B.post(a, e, t);
495
515
  }
496
- function ln(n, e = {}) {
497
- return L.get(`/filehandle/${n}`, { params: e });
516
+ function En(a, e = {}) {
517
+ return B.get(`/filehandle/${a}`, { params: e });
498
518
  }
499
- function cn(n, e = {}, t = {}) {
500
- return L.post(`/filehandle/${n}`, e, t);
519
+ function Tn(a, e = {}, t = {}) {
520
+ return B.post(`/filehandle/${a}`, e, t);
501
521
  }
502
- function dn(n, e = {}) {
503
- return L.get(`/user/${n}`, { params: e });
522
+ function In(a, e = {}) {
523
+ return B.get(`/user/${a}`, { params: e });
504
524
  }
505
- function un(n, e = {}, t = {}) {
506
- return L.post(`/user/${n}`, e, t);
525
+ function Sn(a, e = {}, t = {}) {
526
+ return B.post(`/user/${a}`, e, t);
507
527
  }
508
- function hn(n, e = {}) {
509
- return L.get(`${n}`, e.local ? { params: e, baseURL: $e } : { params: e });
528
+ function bn(a, e = {}) {
529
+ return B.get(`${a}`, e.local ? { params: e, baseURL: Ze } : { params: e });
510
530
  }
511
- function mn(n, e = {}) {
512
- return L.get(`/media/${n}/`, { params: e });
531
+ function xn(a, e = {}) {
532
+ return B.get(`/media/${a}/`, { params: e });
513
533
  }
514
- function fn(n, e = {}, t = {}) {
515
- return L.post(`/media/${n}/`, e, t);
534
+ function Cn(a, e = {}, t = {}) {
535
+ return B.post(`/media/${a}/`, e, t);
516
536
  }
517
- function pn(n, e = {}) {
518
- return L.get(
519
- `/${window.meta.app.isFactory ? window.meta.factory.singo_prefix || "acproxy/common" : "common"}/${n}/`,
520
- { params: e }
521
- );
537
+ function Pn(a, e = {}) {
538
+ return it.get(`/common/${a}/`, { params: e });
522
539
  }
523
- function An(n, e = {}, t = {}) {
524
- return L.post(
525
- `/${window.meta.app.isFactory ? window.meta.factory.singo_prefix || "acproxy/common" : "common"}/${n}/`,
526
- e,
527
- t
528
- );
540
+ function Rn(a, e = {}, t = {}) {
541
+ return it.post(`/common/${a}/`, e, t);
529
542
  }
530
- function gn(n, e = {}) {
531
- return L.get(`/history/${n}`, { params: e });
543
+ function Nn(a, e = {}) {
544
+ return B.get(`/history/${a}`, { params: e });
532
545
  }
533
- function vn(n, e = {}, t = {}) {
534
- return L.post(`/history/${n}`, e, t);
546
+ function kn(a, e = {}, t = {}) {
547
+ return B.post(`/history/${a}`, e, t);
535
548
  }
536
- function wn(n, e = {}) {
537
- return L.get(`/scada/${n}`, { params: e });
549
+ function Dn(a, e = {}) {
550
+ return B.get(`/scada/${a}`, { params: e });
538
551
  }
539
- function _n(n, e = {}, t = {}) {
540
- return L.post(`/scada/${n}`, e, t);
552
+ function Ln(a, e = {}, t = {}) {
553
+ return B.post(`/scada/${a}`, e, t);
541
554
  }
542
- function yn(n, e = {}) {
543
- return L.get(`/common/factory/${n}`, { params: e });
555
+ function On(a, e = {}) {
556
+ return B.get(`/common/factory/${a}`, { params: e });
544
557
  }
545
- function En(n, e = {}, t = {}) {
546
- return L.post(`/common/factory/${n}`, e, t);
558
+ function Mn(a, e = {}, t = {}) {
559
+ return B.post(`/common/factory/${a}`, e, t);
547
560
  }
548
- function In(n, e = {}) {
549
- return L.get(`/factory/${n}`, { params: e });
561
+ function Fn(a, e = {}) {
562
+ return B.get(`/factory/${a}`, { params: e });
550
563
  }
551
- function Tn(n, e = {}, t = {}) {
552
- return L.post(`/factory/${n}`, e, t);
564
+ function Un(a, e = {}, t = {}) {
565
+ return B.post(`/factory/${a}`, e, t);
553
566
  }
554
- function Sn(n, e = {}) {
555
- return L.get(`/pd/${n}`, { params: e });
567
+ function Gn(a, e = {}) {
568
+ return B.get(`/pd/${a}`, { params: e });
556
569
  }
557
- function bn(n, e = {}, t = {}) {
558
- return L.post(`/pd/${n}`, e, t);
570
+ function Hn(a, e = {}, t = {}) {
571
+ return B.post(`/pd/${a}`, e, t);
559
572
  }
560
- const ye = {
561
- getApi: nn,
562
- postApi: rn,
563
- getFileApi: ln,
564
- postFileApi: cn,
565
- getBaseApi: on,
566
- postBaseApi: sn,
567
- getUserApi: dn,
568
- postUserApi: un,
569
- getGraphApi: hn,
570
- getMediaApi: mn,
571
- postMediaApi: fn,
572
- getScadaApi: wn,
573
- postScadaApi: _n,
574
- getCommonApi: pn,
575
- postCommonApi: An,
576
- getHistoryApi: gn,
577
- postHistoryApi: vn,
578
- getFactoryApi: In,
579
- postFactoryApi: Tn,
580
- getCommonFactoryApi: yn,
581
- postCommonFactoryApi: En,
582
- getPDApi: Sn,
583
- postPDApi: bn
584
- }, ot = va(), Cn = [65535, -99999];
585
- function et(n) {
586
- if (typeof n != "string") return !1;
573
+ const Ue = {
574
+ getApi: vn,
575
+ postApi: wn,
576
+ getFileApi: En,
577
+ postFileApi: Tn,
578
+ getBaseApi: yn,
579
+ postBaseApi: _n,
580
+ getUserApi: In,
581
+ postUserApi: Sn,
582
+ getGraphApi: bn,
583
+ getMediaApi: xn,
584
+ postMediaApi: Cn,
585
+ getScadaApi: Dn,
586
+ postScadaApi: Ln,
587
+ getCommonApi: Pn,
588
+ postCommonApi: Rn,
589
+ getHistoryApi: Nn,
590
+ postHistoryApi: kn,
591
+ getFactoryApi: Fn,
592
+ postFactoryApi: Un,
593
+ getCommonFactoryApi: On,
594
+ postCommonFactoryApi: Mn,
595
+ getPDApi: Gn,
596
+ postPDApi: Hn
597
+ }, wt = La(), Vn = [65535, -99999];
598
+ function ht(a) {
599
+ if (typeof a != "string") return !1;
587
600
  const e = /^-?\d+(\.\d+)?$/;
588
- return n.trim() !== "" && e.test(n.trim());
601
+ return a.trim() !== "" && e.test(a.trim());
589
602
  }
590
- function st(n) {
591
- return !["null", "undefined"].includes(n) && n !== void 0 && n !== null && n !== "";
603
+ function yt(a) {
604
+ return !["null", "undefined"].includes(a) && a !== void 0 && a !== null && a !== "";
592
605
  }
593
- function We(n) {
594
- return typeof n == "number" && !Cn.includes(n);
606
+ function Qe(a) {
607
+ return typeof a == "number" && !Vn.includes(a);
595
608
  }
596
- const tt = () => {
597
- var a;
598
- const n = {}, e = ((a = window.location.href.split("?")) == null ? void 0 : a[1]) || "", t = new URLSearchParams(e);
599
- for (const [i, r] of t.entries())
600
- n[i] = r;
601
- return n;
609
+ const mt = () => {
610
+ var n;
611
+ const a = {}, e = ((n = window.location.href.split("?")) == null ? void 0 : n[1]) || "", t = new URLSearchParams(e);
612
+ for (const [r, i] of t.entries())
613
+ a[r] = i;
614
+ return a;
602
615
  };
603
- function at(n) {
604
- return Object.prototype.toString.call(n).slice(8, -1);
616
+ function ft(a) {
617
+ return Object.prototype.toString.call(a).slice(8, -1);
605
618
  }
606
619
  (function() {
607
620
  if (typeof Object.id == "undefined") {
608
- var n = 0;
621
+ var a = 0;
609
622
  Object.id = function(e) {
610
623
  return typeof e.__uniqueid == "undefined" && Object.defineProperty(e, "__uniqueid", {
611
- value: ++n,
624
+ value: ++a,
612
625
  enumerable: !1,
613
626
  // This could go either way, depending on your
614
627
  // interpretation of what an "id" is
@@ -617,8 +630,8 @@ function at(n) {
617
630
  };
618
631
  }
619
632
  })();
620
- function xn() {
621
- var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = [
633
+ function Bn() {
634
+ var a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = [
622
635
  -1,
623
636
  -1,
624
637
  -1,
@@ -749,54 +762,54 @@ function xn() {
749
762
  -1
750
763
  ];
751
764
  this.encode = function(t) {
752
- var a, i, r, o, l, m;
753
- for (r = t.length, i = 0, a = ""; i < r; ) {
754
- if (o = t.charCodeAt(i++) & 255, i == r) {
755
- a += n.charAt(o >> 2), a += n.charAt((o & 3) << 4), a += "==";
765
+ var n, r, i, s, c, f;
766
+ for (i = t.length, r = 0, n = ""; r < i; ) {
767
+ if (s = t.charCodeAt(r++) & 255, r == i) {
768
+ n += a.charAt(s >> 2), n += a.charAt((s & 3) << 4), n += "==";
756
769
  break;
757
770
  }
758
- if (l = t.charCodeAt(i++), i == r) {
759
- a += n.charAt(o >> 2), a += n.charAt((o & 3) << 4 | (l & 240) >> 4), a += n.charAt((l & 15) << 2), a += "=";
771
+ if (c = t.charCodeAt(r++), r == i) {
772
+ n += a.charAt(s >> 2), n += a.charAt((s & 3) << 4 | (c & 240) >> 4), n += a.charAt((c & 15) << 2), n += "=";
760
773
  break;
761
774
  }
762
- m = t.charCodeAt(i++), a += n.charAt(o >> 2), a += n.charAt((o & 3) << 4 | (l & 240) >> 4), a += n.charAt((l & 15) << 2 | (m & 192) >> 6), a += n.charAt(m & 63);
775
+ f = t.charCodeAt(r++), n += a.charAt(s >> 2), n += a.charAt((s & 3) << 4 | (c & 240) >> 4), n += a.charAt((c & 15) << 2 | (f & 192) >> 6), n += a.charAt(f & 63);
763
776
  }
764
- return a;
777
+ return n;
765
778
  }, this.decode = function(t) {
766
- var a, i, r, o, l, m, v;
767
- for (m = t.length, l = 0, v = ""; l < m; ) {
779
+ var n, r, i, s, c, f, g;
780
+ for (f = t.length, c = 0, g = ""; c < f; ) {
768
781
  do
769
- a = e[t.charCodeAt(l++) & 255];
770
- while (l < m && a == -1);
771
- if (a == -1) break;
782
+ n = e[t.charCodeAt(c++) & 255];
783
+ while (c < f && n == -1);
784
+ if (n == -1) break;
772
785
  do
773
- i = e[t.charCodeAt(l++) & 255];
774
- while (l < m && i == -1);
775
- if (i == -1) break;
776
- v += String.fromCharCode(a << 2 | (i & 48) >> 4);
777
- do {
778
- if (r = t.charCodeAt(l++) & 255, r == 61) return v;
779
- r = e[r];
780
- } while (l < m && r == -1);
786
+ r = e[t.charCodeAt(c++) & 255];
787
+ while (c < f && r == -1);
781
788
  if (r == -1) break;
782
- v += String.fromCharCode((i & 15) << 4 | (r & 60) >> 2);
789
+ g += String.fromCharCode(n << 2 | (r & 48) >> 4);
790
+ do {
791
+ if (i = t.charCodeAt(c++) & 255, i == 61) return g;
792
+ i = e[i];
793
+ } while (c < f && i == -1);
794
+ if (i == -1) break;
795
+ g += String.fromCharCode((r & 15) << 4 | (i & 60) >> 2);
783
796
  do {
784
- if (o = t.charCodeAt(l++) & 255, o == 61) return v;
785
- o = e[o];
786
- } while (l < m && o == -1);
787
- if (o == -1) break;
788
- v += String.fromCharCode((r & 3) << 6 | o);
797
+ if (s = t.charCodeAt(c++) & 255, s == 61) return g;
798
+ s = e[s];
799
+ } while (c < f && s == -1);
800
+ if (s == -1) break;
801
+ g += String.fromCharCode((i & 3) << 6 | s);
789
802
  }
790
- return v;
803
+ return g;
791
804
  }, this.utf16to8 = function(t) {
792
- var a, i, r, o;
793
- for (a = "", r = t.length, i = 0; i < r; i++)
794
- o = t.charCodeAt(i), o >= 1 && o <= 127 ? a += t.charAt(i) : o > 2047 ? (a += String.fromCharCode(224 | o >> 12 & 15), a += String.fromCharCode(128 | o >> 6 & 63), a += String.fromCharCode(128 | o >> 0 & 63)) : (a += String.fromCharCode(192 | o >> 6 & 31), a += String.fromCharCode(128 | o >> 0 & 63));
795
- return a;
805
+ var n, r, i, s;
806
+ for (n = "", i = t.length, r = 0; r < i; r++)
807
+ s = t.charCodeAt(r), s >= 1 && s <= 127 ? n += t.charAt(r) : s > 2047 ? (n += String.fromCharCode(224 | s >> 12 & 15), n += String.fromCharCode(128 | s >> 6 & 63), n += String.fromCharCode(128 | s >> 0 & 63)) : (n += String.fromCharCode(192 | s >> 6 & 31), n += String.fromCharCode(128 | s >> 0 & 63));
808
+ return n;
796
809
  }, this.utf8to16 = function(t) {
797
- var a, i, r, o, l, m;
798
- for (a = "", r = t.length, i = 0; i < r; )
799
- switch (o = t.charCodeAt(i++), o >> 4) {
810
+ var n, r, i, s, c, f;
811
+ for (n = "", i = t.length, r = 0; r < i; )
812
+ switch (s = t.charCodeAt(r++), s >> 4) {
800
813
  case 0:
801
814
  case 1:
802
815
  case 2:
@@ -805,58 +818,58 @@ function xn() {
805
818
  case 5:
806
819
  case 6:
807
820
  case 7:
808
- a += t.charAt(i - 1);
821
+ n += t.charAt(r - 1);
809
822
  break;
810
823
  case 12:
811
824
  case 13:
812
- l = t.charCodeAt(i++), a += String.fromCharCode((o & 31) << 6 | l & 63);
825
+ c = t.charCodeAt(r++), n += String.fromCharCode((s & 31) << 6 | c & 63);
813
826
  break;
814
827
  case 14:
815
- l = t.charCodeAt(i++), m = t.charCodeAt(i++), a += String.fromCharCode((o & 15) << 12 | (l & 63) << 6 | (m & 63) << 0);
828
+ c = t.charCodeAt(r++), f = t.charCodeAt(r++), n += String.fromCharCode((s & 15) << 12 | (c & 63) << 6 | (f & 63) << 0);
816
829
  break;
817
830
  }
818
- return a;
831
+ return n;
819
832
  }, this.charToHex = function(t) {
820
- var a, i, r;
821
- for (a = "", i = 0; i < t.length; )
822
- r = t.charCodeAt(i++).toString(16), a += "\\0x" + r, a += i > 0 && i % 8 == 0 ? `\r
833
+ var n, r, i;
834
+ for (n = "", r = 0; r < t.length; )
835
+ i = t.charCodeAt(r++).toString(16), n += "\\0x" + i, n += r > 0 && r % 8 == 0 ? `\r
823
836
  ` : ", ";
824
- return a;
837
+ return n;
825
838
  };
826
839
  }
827
- function Pn() {
828
- var n = 0, e = new Object();
829
- this.add = function(t, a) {
830
- this.containsKey(t) || n++, e[t] = a;
840
+ function Kn() {
841
+ var a = 0, e = new Object();
842
+ this.add = function(t, n) {
843
+ this.containsKey(t) || a++, e[t] = n;
831
844
  }, this.getValue = function(t) {
832
845
  return this.containsKey(t) ? e[t] : null;
833
846
  }, this.remove = function(t) {
834
- this.containsKey(t) && delete e[t] && n--;
847
+ this.containsKey(t) && delete e[t] && a--;
835
848
  }, this.containsKey = function(t) {
836
849
  return t in e;
837
850
  }, this.containsValue = function(t) {
838
- for (var a in e)
839
- if (e[a] == t)
851
+ for (var n in e)
852
+ if (e[n] == t)
840
853
  return !0;
841
854
  return !1;
842
855
  }, this.getValues = function() {
843
856
  var t = [];
844
- for (var a in e)
845
- t.push(e[a]);
857
+ for (var n in e)
858
+ t.push(e[n]);
846
859
  return t;
847
860
  }, this.getKeys = function() {
848
861
  var t = [];
849
- for (var a in e)
850
- t.push(a);
862
+ for (var n in e)
863
+ t.push(n);
851
864
  return t;
852
865
  }, this.getSize = function() {
853
- return n;
866
+ return a;
854
867
  }, this.clear = function() {
855
- n = 0, e = new Object();
868
+ a = 0, e = new Object();
856
869
  };
857
870
  }
858
- function Rn(n) {
859
- if (this.connect = !1, this.ready_func_ = null, this.callbacks_ = new Pn(), this.module_ = "JS_IActiveXCtrl", "WebSocket" in window)
871
+ function Wn(a) {
872
+ if (this.connect = !1, this.ready_func_ = null, this.callbacks_ = new Kn(), this.module_ = "JS_IActiveXCtrl", "WebSocket" in window)
860
873
  this.ws = new WebSocket("ws://127.0.0.1:7321");
861
874
  else
862
875
  throw "WebSocket not supported";
@@ -872,49 +885,49 @@ function Rn(n) {
872
885
  }, this.loadModuleCallBack = function(e) {
873
886
  if (!e) throw e.Response;
874
887
  this.ready_func_ && this.ready_func_();
875
- }.bind(this), this.callbacks_.add("LoadModule", this.loadModuleCallBack), this.exec = function(e, t, a) {
876
- var i = Object.id(a).toString();
877
- this.callbacks_.add(i, a);
878
- var r = {
879
- MsgId: i,
880
- Method: e + "|" + n
888
+ }.bind(this), this.callbacks_.add("LoadModule", this.loadModuleCallBack), this.exec = function(e, t, n) {
889
+ var r = Object.id(n).toString();
890
+ this.callbacks_.add(r, n);
891
+ var i = {
892
+ MsgId: r,
893
+ Method: e + "|" + a
881
894
  };
882
- t && (r.Param = JSON.stringify(t));
883
- var o = JSON.stringify(r);
884
- this.connect && this.ws.send(o);
895
+ t && (i.Param = JSON.stringify(t));
896
+ var s = JSON.stringify(i);
897
+ this.connect && this.ws.send(s);
885
898
  }, this.ready = function(e) {
886
899
  this.ready_func_ = e;
887
900
  }, this._callback = function(e) {
888
- var t = JSON.parse(e.data), a = t.MsgId;
889
- if (this.callbacks_.containsKey(a)) {
890
- var i = this.callbacks_.getValue(a);
891
- i(t.Result, t.Response), this.callbacks_.remove(a);
901
+ var t = JSON.parse(e.data), n = t.MsgId;
902
+ if (this.callbacks_.containsKey(n)) {
903
+ var r = this.callbacks_.getValue(n);
904
+ r(t.Result, t.Response), this.callbacks_.remove(n);
892
905
  }
893
- }, this.ws.onopen = this.loadModule.bind(this), this.Arm_GetDongleInfo = function({ Index: e, DongleInfoNum: t }, a) {
894
- this.exec("Arm_GetDongleInfo", [parseInt(e), parseInt(t)], a);
906
+ }, this.ws.onopen = this.loadModule.bind(this), this.Arm_GetDongleInfo = function({ Index: e, DongleInfoNum: t }, n) {
907
+ this.exec("Arm_GetDongleInfo", [parseInt(e), parseInt(t)], n);
895
908
  }, this.Arm_Enum = function(e) {
896
909
  this.exec("Arm_Enum", null, e);
897
910
  }, this.Arm_Open = function({ Index: e }, t) {
898
911
  this.exec("Arm_Open", [parseInt(e)], t);
899
912
  }, this.Arm_Close = function({ Handle: e }, t) {
900
913
  this.exec("Arm_Close", [parseInt(e)], t);
901
- }, this.Arm_VerifyPIN = function({ Handle: e, UserPin: t, UserType: a }, i) {
902
- this.exec("Arm_VerifyPIN", [parseInt(e), a, t], i);
914
+ }, this.Arm_VerifyPIN = function({ Handle: e, UserPin: t, UserType: n }, r) {
915
+ this.exec("Arm_VerifyPIN", [parseInt(e), n, t], r);
903
916
  }, this.Arm_ResetState = function({ Handle: e }, t) {
904
917
  this.exec("Arm_ResetState", [parseInt(e)], t);
905
- }, this.Arm_GenRandom = function({ Handle: e, RandomLen: t }, a) {
906
- this.exec("Arm_GenRandom", [parseInt(e), parseInt(t)], a);
907
- }, this.Arm_LEDControl = function({ Handle: e, LedFlag: t }, a) {
908
- this.exec("Arm_LEDControl", [parseInt(e), t], a);
909
- }, this.Arm_SwitchProtocol = function({ Handle: e, ProtocolFlag: t }, a) {
910
- this.exec("Arm_SwitchProtocol", [parseInt(e), t], a);
911
- }, this.Arm_CreateFile = function({ Handle: e, FileID: t, FileType: a, AttrBuffer: i }, r) {
912
- this.exec("Arm_CreateFile", [parseInt(e), a, parseInt(t), i], r);
913
- }, this.Arm_WriteFile = function({ Handle: e, FileID: t, FileType: a, FileOffset: i, DataInput: r }, o) {
918
+ }, this.Arm_GenRandom = function({ Handle: e, RandomLen: t }, n) {
919
+ this.exec("Arm_GenRandom", [parseInt(e), parseInt(t)], n);
920
+ }, this.Arm_LEDControl = function({ Handle: e, LedFlag: t }, n) {
921
+ this.exec("Arm_LEDControl", [parseInt(e), t], n);
922
+ }, this.Arm_SwitchProtocol = function({ Handle: e, ProtocolFlag: t }, n) {
923
+ this.exec("Arm_SwitchProtocol", [parseInt(e), t], n);
924
+ }, this.Arm_CreateFile = function({ Handle: e, FileID: t, FileType: n, AttrBuffer: r }, i) {
925
+ this.exec("Arm_CreateFile", [parseInt(e), n, parseInt(t), r], i);
926
+ }, this.Arm_WriteFile = function({ Handle: e, FileID: t, FileType: n, FileOffset: r, DataInput: i }, s) {
914
927
  this.exec(
915
928
  "Arm_WriteFile",
916
- [parseInt(e), a, parseInt(t), parseInt(i), r],
917
- o
929
+ [parseInt(e), n, parseInt(t), parseInt(r), i],
930
+ s
918
931
  );
919
932
  }, this.Arm_ReadFile0001 = function({ Handle: e }, t) {
920
933
  this.exec("Arm_ReadFile", [parseInt(e), parseInt("0001"), parseInt(0), parseInt("64")], t);
@@ -926,48 +939,48 @@ function Rn(n) {
926
939
  this.exec("Arm_ReadFile", [parseInt(e), parseInt("0004"), parseInt(0), parseInt("2048")], t);
927
940
  }, this.Arm_ReadFile0005 = function({ Handle: e }, t) {
928
941
  this.exec("Arm_ReadFile", [parseInt(e), parseInt("0005"), parseInt(0), parseInt("2048")], t);
929
- }, this.Arm_DownloadExeFile = function({ Handle: e, Count: t, ExeFileInfo: a }, i) {
930
- this.exec("Arm_DownloadExeFile", [parseInt(e), parseInt(t), a], i);
931
- }, this.Arm_RunExeFile = function({ Handle: e, FileID: t, InData: a, DataLen: i }, r) {
942
+ }, this.Arm_DownloadExeFile = function({ Handle: e, Count: t, ExeFileInfo: n }, r) {
943
+ this.exec("Arm_DownloadExeFile", [parseInt(e), parseInt(t), n], r);
944
+ }, this.Arm_RunExeFile = function({ Handle: e, FileID: t, InData: n, DataLen: r }, i) {
932
945
  this.exec(
933
946
  "Arm_RunExeFile",
934
- [parseInt(e), parseInt(t), a, a.length, parseInt(i)],
935
- r
947
+ [parseInt(e), parseInt(t), n, n.length, parseInt(r)],
948
+ i
936
949
  );
937
950
  }, this.Arm_ReadRunExeFileData = function(e) {
938
951
  this.exec("Arm_ReadRunExeFileData", null, e);
939
- }, this.Arm_DeleteFile = function({ Handle: e, FileID: t, FileType: a }, i) {
940
- this.exec("Arm_DeleteFile", [parseInt(e), a, parseInt(t)], i);
941
- }, this.Arm_WriteData = function({ Handle: e, Offset: t, DataInput: a }, i) {
942
- this.exec("Arm_WriteData", [parseInt(e), parseInt(t), a], i);
943
- }, this.Arm_ReadData = function({ Handle: e, Offset: t, ReadLength: a }, i) {
944
- this.exec("Arm_ReadData", [parseInt(e), parseInt(t), a], i);
945
- }, this.Arm_WriteShareMemory = function({ Handle: e, DataInput: t }, a) {
946
- this.exec("Arm_WriteShareMemory", [parseInt(e), t], a);
952
+ }, this.Arm_DeleteFile = function({ Handle: e, FileID: t, FileType: n }, r) {
953
+ this.exec("Arm_DeleteFile", [parseInt(e), n, parseInt(t)], r);
954
+ }, this.Arm_WriteData = function({ Handle: e, Offset: t, DataInput: n }, r) {
955
+ this.exec("Arm_WriteData", [parseInt(e), parseInt(t), n], r);
956
+ }, this.Arm_ReadData = function({ Handle: e, Offset: t, ReadLength: n }, r) {
957
+ this.exec("Arm_ReadData", [parseInt(e), parseInt(t), n], r);
958
+ }, this.Arm_WriteShareMemory = function({ Handle: e, DataInput: t }, n) {
959
+ this.exec("Arm_WriteShareMemory", [parseInt(e), t], n);
947
960
  }, this.Arm_ReadShareMemory = function({ Handle: e }, t) {
948
961
  this.exec("Arm_ReadShareMemory", [parseInt(e)], t);
949
- }, this.Arm_GenUniqueKey = function({ Handle: e, Seed: t }, a) {
950
- this.exec("Arm_GenUniqueKey", [parseInt(e), t.length, t], a);
951
- }, this.Arm_ChangePIN = function({ Handle: e, NewPIN: t, OldPIN: a, TryCount: i, PinFlag: r }, o) {
952
- this.exec("Arm_ChangePIN", [parseInt(e), r, a, t, parseInt(i)], o);
953
- }, this.Arm_ResetUserPIN = function({ Handle: e, AdminPIN: t }, a) {
954
- this.exec("Arm_ResetUserPIN", [parseInt(e), t], a);
955
- }, this.Arm_SetUserID = function({ Handle: e, UserID: t }, a) {
956
- this.exec("Arm_SetUserID", [parseInt(e), parseInt(t)], a);
962
+ }, this.Arm_GenUniqueKey = function({ Handle: e, Seed: t }, n) {
963
+ this.exec("Arm_GenUniqueKey", [parseInt(e), t.length, t], n);
964
+ }, this.Arm_ChangePIN = function({ Handle: e, NewPIN: t, OldPIN: n, TryCount: r, PinFlag: i }, s) {
965
+ this.exec("Arm_ChangePIN", [parseInt(e), i, n, t, parseInt(r)], s);
966
+ }, this.Arm_ResetUserPIN = function({ Handle: e, AdminPIN: t }, n) {
967
+ this.exec("Arm_ResetUserPIN", [parseInt(e), t], n);
968
+ }, this.Arm_SetUserID = function({ Handle: e, UserID: t }, n) {
969
+ this.exec("Arm_SetUserID", [parseInt(e), parseInt(t)], n);
957
970
  }, this.Arm_GetDeadline = function({ Handle: e }, t) {
958
971
  this.exec("Arm_GetDeadline", [parseInt(e)], t);
959
- }, this.Arm_SetDeadline = function({ Handle: e, SetDeadTime: t }, a) {
960
- this.exec("Arm_SetDeadline", [parseInt(e), parseInt(t)], a);
972
+ }, this.Arm_SetDeadline = function({ Handle: e, SetDeadTime: t }, n) {
973
+ this.exec("Arm_SetDeadline", [parseInt(e), parseInt(t)], n);
961
974
  }, this.Arm_GetUTCTime = function({ Handle: e }, t) {
962
975
  this.exec("Arm_GetUTCTime", [parseInt(e)], t);
963
976
  }, this.Arm_RFS = function({ Handle: e }, t) {
964
977
  this.exec("Arm_RFS", [parseInt(e)], t);
965
- }, this.Arm_RsaGenPubPriKey = function({ Handle: e, RsaFileId: t }, a) {
966
- this.exec("Arm_RsaGenPubPriKey", [parseInt(e), parseInt(t)], a);
967
- }, this.Arm_EccGenPubPriKey = function({ Handle: e, EccFileId: t }, a) {
968
- this.exec("Arm_EccGenPubPriKey", [parseInt(e), parseInt(t)], a);
969
- }, this.Arm_Sm2GenPubPriKey = function({ Handle: e, Sm2FileId: t }, a) {
970
- this.exec("Arm_Sm2GenPubPriKey", [parseInt(e), parseInt(t)], a);
978
+ }, this.Arm_RsaGenPubPriKey = function({ Handle: e, RsaFileId: t }, n) {
979
+ this.exec("Arm_RsaGenPubPriKey", [parseInt(e), parseInt(t)], n);
980
+ }, this.Arm_EccGenPubPriKey = function({ Handle: e, EccFileId: t }, n) {
981
+ this.exec("Arm_EccGenPubPriKey", [parseInt(e), parseInt(t)], n);
982
+ }, this.Arm_Sm2GenPubPriKey = function({ Handle: e, Sm2FileId: t }, n) {
983
+ this.exec("Arm_Sm2GenPubPriKey", [parseInt(e), parseInt(t)], n);
971
984
  }, this.Arm_ReadRsaPri = function(e) {
972
985
  this.exec("Arm_ReadRsaPri", null, e);
973
986
  }, this.Arm_ReadRsaPub = function(e) {
@@ -980,145 +993,145 @@ function Rn(n) {
980
993
  this.exec("Arm_ReadSm2Pri", null, e);
981
994
  }, this.Arm_ReadSm2Pub = function(e) {
982
995
  this.exec("Arm_ReadSm2Pub", null, e);
983
- }, this.Arm_RsaPri = function({ Handle: e, RsaPri_Flag: t, RsaPriInData: a, RsaPriFileID: i, RsaPriFileSize: r }, o) {
996
+ }, this.Arm_RsaPri = function({ Handle: e, RsaPri_Flag: t, RsaPriInData: n, RsaPriFileID: r, RsaPriFileSize: i }, s) {
984
997
  this.exec(
985
998
  "Arm_RsaPri",
986
- [parseInt(e), parseInt(i), parseInt(r), t, a],
987
- o
999
+ [parseInt(e), parseInt(r), parseInt(i), t, n],
1000
+ s
988
1001
  );
989
- }, this.Arm_RsaPub = function({ Handle: e, RsaPubKey: t, RsaPub_Flag: a, RsaPubInData: i, RsaPubFileSize: r }, o) {
1002
+ }, this.Arm_RsaPub = function({ Handle: e, RsaPubKey: t, RsaPub_Flag: n, RsaPubInData: r, RsaPubFileSize: i }, s) {
990
1003
  this.exec(
991
1004
  "Arm_RsaPub",
992
- [parseInt(e), parseInt(r), a, t, t.length, i],
993
- o
1005
+ [parseInt(e), parseInt(i), n, t, t.length, r],
1006
+ s
994
1007
  );
995
- }, this.Arm_EccSign = function({ Handle: e, HashData: t, EccFileId: a }, i) {
996
- this.exec("Arm_EccSign", [parseInt(e), parseInt(a), t], i);
997
- }, this.Arm_EccVerify = function({ Handle: e, HashData: t, EccPubKey: a, EccSignData: i }, r) {
998
- this.exec("Arm_EccVerify", [parseInt(e), a, a.length, t, i], r);
999
- }, this.Arm_Sm2Sign = function({ Handle: e, HashData: t, Sm2FileId: a }, i) {
1000
- this.exec("Arm_Sm2Sign", [parseInt(e), parseInt(a), t], i);
1001
- }, this.Arm_Sm2Verify = function({ Handle: e, HashData: t, Sm2PubKey: a, Sm2SignData: i }, r) {
1002
- this.exec("Arm_Sm2Verify", [parseInt(e), a, a.length, t, i], r);
1003
- }, this.Arm_TDES = function({ Handle: e, Tdes_Flag: t, TdesFileID: a, TdesInData: i }, r) {
1004
- this.exec("Arm_TDES", [parseInt(e), parseInt(a), t, i], r);
1005
- }, this.Arm_SM4 = function({ Handle: e, Sm4_Flag: t, Sm4FileID: a, Sm4InData: i }, r) {
1006
- this.exec("Arm_SM4", [parseInt(e), parseInt(a), t, i], r);
1007
- }, this.Arm_HASH = function({ Handle: e, Hash_Flag: t, HashInData: a }, i) {
1008
- this.exec("Arm_HASH", [parseInt(e), t, a], i);
1009
- }, this.Arm_Seed = function({ Handle: e, SeedData: t, SeedLength: a }, i) {
1010
- this.exec("Arm_Seed", [parseInt(e), a, t], i);
1011
- }, this.Arm_LimitSeedCount = function({ Handle: e, SeedCount: t }, a) {
1012
- this.exec("Arm_LimitSeedCount", [parseInt(e), parseInt(t)], a);
1013
- }, this.Arm_GenMotherKey = function({ Handle: e, SeedLen: t, SeedForPID: a, SonCount: i, StartUserID: r, AdminTryCount: o, UserPin: l, UserTryCount: m, UpdateRSAPriKey: v }, M) {
1008
+ }, this.Arm_EccSign = function({ Handle: e, HashData: t, EccFileId: n }, r) {
1009
+ this.exec("Arm_EccSign", [parseInt(e), parseInt(n), t], r);
1010
+ }, this.Arm_EccVerify = function({ Handle: e, HashData: t, EccPubKey: n, EccSignData: r }, i) {
1011
+ this.exec("Arm_EccVerify", [parseInt(e), n, n.length, t, r], i);
1012
+ }, this.Arm_Sm2Sign = function({ Handle: e, HashData: t, Sm2FileId: n }, r) {
1013
+ this.exec("Arm_Sm2Sign", [parseInt(e), parseInt(n), t], r);
1014
+ }, this.Arm_Sm2Verify = function({ Handle: e, HashData: t, Sm2PubKey: n, Sm2SignData: r }, i) {
1015
+ this.exec("Arm_Sm2Verify", [parseInt(e), n, n.length, t, r], i);
1016
+ }, this.Arm_TDES = function({ Handle: e, Tdes_Flag: t, TdesFileID: n, TdesInData: r }, i) {
1017
+ this.exec("Arm_TDES", [parseInt(e), parseInt(n), t, r], i);
1018
+ }, this.Arm_SM4 = function({ Handle: e, Sm4_Flag: t, Sm4FileID: n, Sm4InData: r }, i) {
1019
+ this.exec("Arm_SM4", [parseInt(e), parseInt(n), t, r], i);
1020
+ }, this.Arm_HASH = function({ Handle: e, Hash_Flag: t, HashInData: n }, r) {
1021
+ this.exec("Arm_HASH", [parseInt(e), t, n], r);
1022
+ }, this.Arm_Seed = function({ Handle: e, SeedData: t, SeedLength: n }, r) {
1023
+ this.exec("Arm_Seed", [parseInt(e), n, t], r);
1024
+ }, this.Arm_LimitSeedCount = function({ Handle: e, SeedCount: t }, n) {
1025
+ this.exec("Arm_LimitSeedCount", [parseInt(e), parseInt(t)], n);
1026
+ }, this.Arm_GenMotherKey = function({ Handle: e, SeedLen: t, SeedForPID: n, SonCount: r, StartUserID: i, AdminTryCount: s, UserPin: c, UserTryCount: f, UpdateRSAPriKey: g }, O) {
1014
1027
  this.exec(
1015
1028
  "Arm_GenMotherKey",
1016
1029
  [
1017
1030
  parseInt(e),
1018
1031
  parseInt(t),
1019
- a,
1020
- l,
1021
- parseInt(m),
1022
- parseInt(o),
1023
- v,
1024
- parseInt(r),
1025
- parseInt(i)
1032
+ n,
1033
+ c,
1034
+ parseInt(f),
1035
+ parseInt(s),
1036
+ g,
1037
+ parseInt(i),
1038
+ parseInt(r)
1026
1039
  ],
1027
- M
1040
+ O
1028
1041
  );
1029
1042
  }, this.Arm_RequestInit = function({ Handle: e }, t) {
1030
1043
  this.exec("Arm_RequestInit", [parseInt(e)], t);
1031
1044
  }, this.Arm_GetInitDataFromMother = function({ Handle: e }, t) {
1032
1045
  this.exec("Arm_GetInitDataFromMother", [parseInt(e), Request], t);
1033
- }, this.Arm_InitSon = function({ Handle: e, InitData: t }, a) {
1034
- this.exec("Arm_InitSon", [parseInt(e), t], a);
1035
- }, this.Arm_SetUpdatePriKey = function({ Handle: e, UpdatePriKey: t }, a) {
1036
- this.exec("Arm_SetUpdatePriKey", [parseInt(e), t], a);
1037
- }, this.Arm_MakeUpdatePacket = function({ Handle: e, HID: t, Func: a, FileID: i, FileType: r, Offset: o, DataLen: l, DataBuffer: m, UpRSAPubKey: v }, M) {
1046
+ }, this.Arm_InitSon = function({ Handle: e, InitData: t }, n) {
1047
+ this.exec("Arm_InitSon", [parseInt(e), t], n);
1048
+ }, this.Arm_SetUpdatePriKey = function({ Handle: e, UpdatePriKey: t }, n) {
1049
+ this.exec("Arm_SetUpdatePriKey", [parseInt(e), t], n);
1050
+ }, this.Arm_MakeUpdatePacket = function({ Handle: e, HID: t, Func: n, FileID: r, FileType: i, Offset: s, DataLen: c, DataBuffer: f, UpRSAPubKey: g }, O) {
1038
1051
  this.exec(
1039
1052
  "Arm_MakeUpdatePacket",
1040
1053
  [
1041
1054
  parseInt(e),
1042
1055
  t,
1043
- a,
1044
- r,
1045
- parseInt(i),
1046
- parseInt(o),
1047
- m,
1048
- v,
1049
- parseInt(l)
1056
+ n,
1057
+ i,
1058
+ parseInt(r),
1059
+ parseInt(s),
1060
+ f,
1061
+ g,
1062
+ parseInt(c)
1050
1063
  ],
1051
- M
1064
+ O
1052
1065
  );
1053
- }, this.Arm_MakeUpdatePacketFromMother = function({ Handle: e, HID: t, Func: a, FileID: i, FileType: r, Offset: o, DataLen: l, DataBuffer: m }, v) {
1066
+ }, this.Arm_MakeUpdatePacketFromMother = function({ Handle: e, HID: t, Func: n, FileID: r, FileType: i, Offset: s, DataLen: c, DataBuffer: f }, g) {
1054
1067
  this.exec(
1055
1068
  "Arm_MakeUpdatePacketFromMother",
1056
- [parseInt(e), t, a, r, parseInt(i), parseInt(o), m, parseInt(l)],
1057
- v
1069
+ [parseInt(e), t, n, i, parseInt(r), parseInt(s), f, parseInt(c)],
1070
+ g
1058
1071
  );
1059
- }, this.Arm_Update = function({ Handle: e, UpdateData: t }, a) {
1060
- this.exec("Arm_Update", [parseInt(e), t], a);
1061
- }, this.Arm_Set_DATA_FILE_ATTR = function({ Size: e, ReadPriv: t, WritePriv: a }, i) {
1062
- this.exec("Arm_Set_DATA_FILE_ATTR", [parseInt(e), parseInt(t), parseInt(a)], i);
1063
- }, this.Arm_Set_PRIKEY_FILE_ATTR = function({ Count: e, Size: t, Type: a, Priv: i, IsReset: r, IsDecOnRAM: o }, l) {
1072
+ }, this.Arm_Update = function({ Handle: e, UpdateData: t }, n) {
1073
+ this.exec("Arm_Update", [parseInt(e), t], n);
1074
+ }, this.Arm_Set_DATA_FILE_ATTR = function({ Size: e, ReadPriv: t, WritePriv: n }, r) {
1075
+ this.exec("Arm_Set_DATA_FILE_ATTR", [parseInt(e), parseInt(t), parseInt(n)], r);
1076
+ }, this.Arm_Set_PRIKEY_FILE_ATTR = function({ Count: e, Size: t, Type: n, Priv: r, IsReset: i, IsDecOnRAM: s }, c) {
1064
1077
  this.exec(
1065
1078
  "Arm_Set_PRIKEY_FILE_ATTR",
1066
- [a, parseInt(t), parseInt(e), parseInt(i), parseInt(o), parseInt(r)],
1067
- l
1079
+ [n, parseInt(t), parseInt(e), parseInt(r), parseInt(s), parseInt(i)],
1080
+ c
1068
1081
  );
1069
- }, this.Arm_Set_KEY_FILE_ATTR = function({ Size: e, PrivEnc: t }, a) {
1070
- this.exec("Arm_Set_KEY_FILE_ATTR", [parseInt(e), parseInt(t)], a);
1071
- }, this.Arm_Set_EXE_FILE_ATTR = function({ FileLen: e, PrivExe: t }, a) {
1072
- this.exec("Arm_Set_EXE_FILE_ATTR", [parseInt(e), parseInt(t)], a);
1073
- }, this.Arm_Set_DATA_LIC = function({ ReadPriv: e, WritePriv: t }, a) {
1074
- this.exec("Arm_Set_DATA_LIC", [parseInt(e), parseInt(t)], a);
1075
- }, this.Arm_Set_PRIKEY_LIC = function({ Count: e, Priv: t, IsReset: a, IsDecOnRAM: i }, r) {
1082
+ }, this.Arm_Set_KEY_FILE_ATTR = function({ Size: e, PrivEnc: t }, n) {
1083
+ this.exec("Arm_Set_KEY_FILE_ATTR", [parseInt(e), parseInt(t)], n);
1084
+ }, this.Arm_Set_EXE_FILE_ATTR = function({ FileLen: e, PrivExe: t }, n) {
1085
+ this.exec("Arm_Set_EXE_FILE_ATTR", [parseInt(e), parseInt(t)], n);
1086
+ }, this.Arm_Set_DATA_LIC = function({ ReadPriv: e, WritePriv: t }, n) {
1087
+ this.exec("Arm_Set_DATA_LIC", [parseInt(e), parseInt(t)], n);
1088
+ }, this.Arm_Set_PRIKEY_LIC = function({ Count: e, Priv: t, IsReset: n, IsDecOnRAM: r }, i) {
1076
1089
  this.exec(
1077
1090
  "Arm_Set_PRIKEY_LIC",
1078
- [parseInt(e), parseInt(t), parseInt(i), parseInt(a)],
1079
- r
1091
+ [parseInt(e), parseInt(t), parseInt(r), parseInt(n)],
1092
+ i
1080
1093
  );
1081
1094
  }, this.Arm_Set_KEY_LIC = function({ PrivEnc: e }, t) {
1082
1095
  this.exec("Arm_Set_KEY_LIC", [parseInt(e)], t);
1083
1096
  }, this.Arm_Set_EXE_LIC = function({ PrivExe: e }, t) {
1084
1097
  this.exec("Arm_Set_EXE_LIC", [parseInt(e)], t);
1085
- }, this.Arm_Set_EXE_FILE_INFO = function({ FileID: e, FileData: t, FileSize: a, InBuffer: i, CallLimit: r }, o) {
1098
+ }, this.Arm_Set_EXE_FILE_INFO = function({ FileID: e, FileData: t, FileSize: n, InBuffer: r, CallLimit: i }, s) {
1086
1099
  this.exec(
1087
1100
  "Arm_Set_EXE_FILE_INFO",
1088
- [i, parseInt(a), parseInt(e), parseInt(r), t, t.length],
1089
- o
1101
+ [r, parseInt(n), parseInt(e), parseInt(i), t, t.length],
1102
+ s
1090
1103
  );
1091
1104
  }, this.Arm_Clear_EXE_FILE_INFO = function({ InBuffer: e }, t) {
1092
1105
  this.exec("Arm_Clear_EXE_FILE_INFO", [e], t);
1093
1106
  };
1094
1107
  }
1095
- const Nn = {
1108
+ const Yn = {
1096
1109
  HID: 0
1097
- }, Ke = {
1110
+ }, Je = {
1098
1111
  PRODUCT_ID: 0,
1099
1112
  // 产品ID
1100
1113
  USER_ID: 1,
1101
1114
  // 用户ID
1102
1115
  HARDWARE_ID: 2
1103
1116
  // 硬件ID
1104
- }, At = {
1117
+ }, Pt = {
1105
1118
  USER: 0
1106
1119
  // 普通用户
1107
1120
  };
1108
- class Xt {
1121
+ class fa {
1109
1122
  // 加密随机数
1110
1123
  constructor() {
1111
- we(this, "Base64", new xn());
1112
- we(this, "AtlCtrl", null);
1113
- we(this, "ArmCount", 0);
1124
+ Se(this, "Base64", new Bn());
1125
+ Se(this, "AtlCtrl", null);
1126
+ Se(this, "ArmCount", 0);
1114
1127
  // 加密锁数量
1115
- we(this, "ArmIndex", 0);
1128
+ Se(this, "ArmIndex", 0);
1116
1129
  // 加密锁索引
1117
- we(this, "ArmHandle", 0);
1130
+ Se(this, "ArmHandle", 0);
1118
1131
  // 加密锁句柄
1119
- we(this, "ArmRandom", "");
1132
+ Se(this, "ArmRandom", "");
1120
1133
  try {
1121
- this.AtlCtrl = new Rn("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}");
1134
+ this.AtlCtrl = new Wn("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}");
1122
1135
  } catch (e) {
1123
1136
  console.error(e), this.AtlCtrl = null;
1124
1137
  }
@@ -1127,228 +1140,228 @@ class Xt {
1127
1140
  armEnum() {
1128
1141
  if (this.AtlCtrl)
1129
1142
  return new Promise((e, t) => {
1130
- this.AtlCtrl.Arm_Enum((a, i) => {
1131
- a ? (this.ArmCount = +i, e(i)) : t(i);
1143
+ this.AtlCtrl.Arm_Enum((n, r) => {
1144
+ n ? (this.ArmCount = +r, e(r)) : t(r);
1132
1145
  });
1133
1146
  });
1134
1147
  }
1135
1148
  // 打开加密锁,索引值从0开始
1136
1149
  armOpen(e = 0) {
1137
1150
  if (this.AtlCtrl)
1138
- return this.ArmIndex = e, new Promise((t, a) => {
1139
- this.AtlCtrl.Arm_Open({ Index: e }, (i, r) => {
1140
- i ? (this.ArmHandle = +r, t(r)) : (this.ArmHandle = r, a(r));
1151
+ return this.ArmIndex = e, new Promise((t, n) => {
1152
+ this.AtlCtrl.Arm_Open({ Index: e }, (r, i) => {
1153
+ r ? (this.ArmHandle = +i, t(i)) : (this.ArmHandle = i, n(i));
1141
1154
  });
1142
1155
  });
1143
1156
  }
1144
1157
  // 关闭加密锁
1145
1158
  armClose(e = this.ArmHandle) {
1146
1159
  if (this.AtlCtrl)
1147
- return new Promise((t, a) => {
1148
- this.AtlCtrl.Arm_Close({ Handle: e }, (i, r) => {
1149
- i ? t(r) : a(r);
1160
+ return new Promise((t, n) => {
1161
+ this.AtlCtrl.Arm_Close({ Handle: e }, (r, i) => {
1162
+ r ? t(i) : n(i);
1150
1163
  });
1151
1164
  });
1152
1165
  }
1153
1166
  // 修改用户PIN码
1154
- armChangePIN(e, t, a = 255, i = At.USER, r = this.ArmHandle) {
1167
+ armChangePIN(e, t, n = 255, r = Pt.USER, i = this.ArmHandle) {
1155
1168
  if (this.AtlCtrl)
1156
- return new Promise((o, l) => {
1157
- this.AtlCtrl.Arm_ChangePIN({ Handle: r, NewPIN: e, OldPIN: t, TryCount: a, PinFlag: i }, (m, v) => {
1158
- m && v == 0 ? (this.ArmPin = e, o(v)) : l(v);
1169
+ return new Promise((s, c) => {
1170
+ this.AtlCtrl.Arm_ChangePIN({ Handle: i, NewPIN: e, OldPIN: t, TryCount: n, PinFlag: r }, (f, g) => {
1171
+ f && g == 0 ? (this.ArmPin = e, s(g)) : c(g);
1159
1172
  });
1160
1173
  });
1161
1174
  }
1162
1175
  // 生成随机数,随机数长度范围为1~128
1163
1176
  armGenRandom(e = 16, t = this.ArmHandle) {
1164
1177
  if (this.AtlCtrl)
1165
- return new Promise((a, i) => {
1166
- this.AtlCtrl.Arm_GenRandom({ Handle: t, RandomLen: e }, (r, o) => {
1167
- r ? (this.ArmRandom = o, a(o)) : i(o);
1178
+ return new Promise((n, r) => {
1179
+ this.AtlCtrl.Arm_GenRandom({ Handle: t, RandomLen: e }, (i, s) => {
1180
+ i ? (this.ArmRandom = s, n(s)) : r(s);
1168
1181
  });
1169
1182
  });
1170
1183
  }
1171
1184
  // 获取加密锁到期时间
1172
1185
  armGetDeadline(e = this.ArmHandle) {
1173
1186
  if (this.AtlCtrl)
1174
- return new Promise((t, a) => {
1175
- this.AtlCtrl.Arm_GetDeadline({ Handle: e }, (i, r) => {
1176
- i ? (this.ArmDeadline = r, t(r)) : a(r);
1187
+ return new Promise((t, n) => {
1188
+ this.AtlCtrl.Arm_GetDeadline({ Handle: e }, (r, i) => {
1189
+ r ? (this.ArmDeadline = i, t(i)) : n(i);
1177
1190
  });
1178
1191
  });
1179
1192
  }
1180
1193
  // 唯一化锁,种子码为1234567890,唯一化锁后生成密码为0C56DA077DF5CA8C,产品ID为66D23E87
1181
1194
  armGenUniqueKey(e = "MTIzNDU2Nzg5MA==", t = this.ArmHandle) {
1182
1195
  if (this.AtlCtrl)
1183
- return new Promise((a, i) => {
1184
- this.AtlCtrl.Arm_GenUniqueKey({ Handle: t, Seed: e }, (r, o) => {
1185
- r ? (this.ArmUKey = o, a(o)) : i(o);
1196
+ return new Promise((n, r) => {
1197
+ this.AtlCtrl.Arm_GenUniqueKey({ Handle: t, Seed: e }, (i, s) => {
1198
+ i ? (this.ArmUKey = s, n(s)) : r(s);
1186
1199
  });
1187
1200
  });
1188
1201
  }
1189
1202
  // 读取加密锁信息(产品ID/用户ID/硬件ID)
1190
- armGetDongleInfo(e = 0, t = Ke.HARDWARE_ID) {
1203
+ armGetDongleInfo(e = 0, t = Je.HARDWARE_ID) {
1191
1204
  if (this.AtlCtrl)
1192
- return this.ArmIndex = e, new Promise((a, i) => {
1193
- this.AtlCtrl.Arm_GetDongleInfo({ Index: e, DongleInfoNum: t }, (r, o) => {
1194
- if (r) {
1205
+ return this.ArmIndex = e, new Promise((n, r) => {
1206
+ this.AtlCtrl.Arm_GetDongleInfo({ Index: e, DongleInfoNum: t }, (i, s) => {
1207
+ if (i) {
1195
1208
  switch (t) {
1196
- case Ke.USER_ID:
1197
- this.ArmUid = o;
1209
+ case Je.USER_ID:
1210
+ this.ArmUid = s;
1198
1211
  break;
1199
- case Ke.PRODUCT_ID:
1200
- this.ArmPid = o;
1212
+ case Je.PRODUCT_ID:
1213
+ this.ArmPid = s;
1201
1214
  break;
1202
- case Ke.HARDWARE_ID:
1203
- this.ArmHid = o;
1215
+ case Je.HARDWARE_ID:
1216
+ this.ArmHid = s;
1204
1217
  break;
1205
1218
  }
1206
- a(o);
1219
+ n(s);
1207
1220
  } else
1208
- i(o);
1221
+ r(s);
1209
1222
  });
1210
1223
  });
1211
1224
  }
1212
1225
  // LED灯控制操作
1213
1226
  armLEDControl(e, t = this.ArmHandle) {
1214
1227
  if (this.AtlCtrl)
1215
- return new Promise((a, i) => {
1216
- this.AtlCtrl.Arm_LEDControl({ Handle: t, LedFlag: e }, (r, o) => {
1217
- r && o == 0 ? a(o) : i(o);
1228
+ return new Promise((n, r) => {
1229
+ this.AtlCtrl.Arm_LEDControl({ Handle: t, LedFlag: e }, (i, s) => {
1230
+ i && s == 0 ? n(s) : r(s);
1218
1231
  });
1219
1232
  });
1220
1233
  }
1221
1234
  // 一键恢复出厂状态
1222
1235
  armRFS(e = this.ArmHandle) {
1223
1236
  if (this.AtlCtrl)
1224
- return new Promise((t, a) => {
1225
- this.AtlCtrl.Arm_RFS({ Handle: e }, (i, r) => {
1226
- i && r == 0 ? t(r) : a(r);
1237
+ return new Promise((t, n) => {
1238
+ this.AtlCtrl.Arm_RFS({ Handle: e }, (r, i) => {
1239
+ r && i == 0 ? t(i) : n(i);
1227
1240
  });
1228
1241
  });
1229
1242
  }
1230
1243
  // 读取加密锁文件
1231
1244
  armReadFile(e = "0001", t = this.ArmHandle) {
1232
1245
  if (this.AtlCtrl)
1233
- return new Promise((a, i) => {
1234
- this.AtlCtrl[`Arm_ReadFile${e}`]({ Handle: t }, (r, o) => {
1235
- if (r && o.length > 0)
1246
+ return new Promise((n, r) => {
1247
+ this.AtlCtrl[`Arm_ReadFile${e}`]({ Handle: t }, (i, s) => {
1248
+ if (i && s.length > 0)
1236
1249
  try {
1237
- o = this.Base64.decode(o), a(o);
1238
- } catch (l) {
1239
- console.error(l), a(o);
1250
+ s = this.Base64.decode(s), n(s);
1251
+ } catch (c) {
1252
+ console.error(c), n(s);
1240
1253
  }
1241
1254
  else
1242
- i(o);
1255
+ r(s);
1243
1256
  });
1244
1257
  });
1245
1258
  }
1246
1259
  // 清除PIN码验证状态
1247
1260
  armResetState(e = this.ArmHandle) {
1248
1261
  if (this.AtlCtrl)
1249
- return new Promise((t, a) => {
1250
- this.AtlCtrl.Arm_ResetState({ Handle: e }, (i, r) => {
1251
- i && r == 0 ? t(r) : a(r);
1262
+ return new Promise((t, n) => {
1263
+ this.AtlCtrl.Arm_ResetState({ Handle: e }, (r, i) => {
1264
+ r && i == 0 ? t(i) : n(i);
1252
1265
  });
1253
1266
  });
1254
1267
  }
1255
1268
  // 重置用户PIN码,空锁不能重置
1256
1269
  armResetUserPIN(e, t = this.ArmHandle) {
1257
1270
  if (this.AtlCtrl)
1258
- return new Promise((a, i) => {
1259
- this.AtlCtrl.Arm_ResetUserPIN({ Handle: t, AdminPIN: e }, (r, o) => {
1260
- r && o == 0 ? a(o) : i(o);
1271
+ return new Promise((n, r) => {
1272
+ this.AtlCtrl.Arm_ResetUserPIN({ Handle: t, AdminPIN: e }, (i, s) => {
1273
+ i && s == 0 ? n(s) : r(s);
1261
1274
  });
1262
1275
  });
1263
1276
  }
1264
1277
  // 设置用户ID
1265
1278
  armSetUserID(e, t = this.ArmHandle) {
1266
1279
  if (this.AtlCtrl)
1267
- return new Promise((a, i) => {
1268
- this.AtlCtrl.Arm_SetUserID({ Handle: t, UserID: e }, (r, o) => {
1269
- r && o == 0 ? a(o) : i(o);
1280
+ return new Promise((n, r) => {
1281
+ this.AtlCtrl.Arm_SetUserID({ Handle: t, UserID: e }, (i, s) => {
1282
+ i && s == 0 ? n(s) : r(s);
1270
1283
  });
1271
1284
  });
1272
1285
  }
1273
1286
  // 设置加密锁到期时间
1274
1287
  armSetDeadline(e, t = this.ArmHandle) {
1275
1288
  if (this.AtlCtrl)
1276
- return new Promise((a, i) => {
1277
- this.AtlCtrl.Arm_SetDeadline({ Handle: t, SetDeadTime: e }, (r, o) => {
1278
- r && o == 0 ? a(o) : i(o);
1289
+ return new Promise((n, r) => {
1290
+ this.AtlCtrl.Arm_SetDeadline({ Handle: t, SetDeadTime: e }, (i, s) => {
1291
+ i && s == 0 ? n(s) : r(s);
1279
1292
  });
1280
1293
  });
1281
1294
  }
1282
1295
  // 切换通讯协议
1283
- armSwitchProtocol(e = Nn.HID, t = this.ArmHandle) {
1296
+ armSwitchProtocol(e = Yn.HID, t = this.ArmHandle) {
1284
1297
  if (this.AtlCtrl)
1285
- return new Promise((a, i) => {
1286
- this.AtlCtrl.Arm_SwitchProtocol({ Handle: t, ProtocolFlag: e }, (r, o) => {
1287
- r && o == 0 ? a(o) : i(o);
1298
+ return new Promise((n, r) => {
1299
+ this.AtlCtrl.Arm_SwitchProtocol({ Handle: t, ProtocolFlag: e }, (i, s) => {
1300
+ i && s == 0 ? n(s) : r(s);
1288
1301
  });
1289
1302
  });
1290
1303
  }
1291
1304
  // 验证加密锁PIN码
1292
- armVerifyPIN(e, t = At.USER, a = this.ArmHandle) {
1305
+ armVerifyPIN(e, t = Pt.USER, n = this.ArmHandle) {
1293
1306
  if (this.AtlCtrl)
1294
- return new Promise((i, r) => {
1295
- this.AtlCtrl.Arm_VerifyPIN({ Handle: a, UserPin: e, UserType: t }, (o, l) => {
1296
- o && l == 0 ? (this.ArmPin = e, i(l)) : r(l);
1307
+ return new Promise((r, i) => {
1308
+ this.AtlCtrl.Arm_VerifyPIN({ Handle: n, UserPin: e, UserType: t }, (s, c) => {
1309
+ s && c == 0 ? (this.ArmPin = e, r(c)) : i(c);
1297
1310
  });
1298
1311
  });
1299
1312
  }
1300
1313
  // 读取锁内数据区数据
1301
- armReadData(e = 0, t = 128, a = this.ArmHandle) {
1314
+ armReadData(e = 0, t = 128, n = this.ArmHandle) {
1302
1315
  if (this.AtlCtrl)
1303
- return new Promise((i, r) => {
1304
- this.AtlCtrl.Arm_ReadData({ Handle: a, Offset: e, ReadLength: t }, (o, l) => {
1305
- o ? (this.ArmData = l, i(l)) : r(l);
1316
+ return new Promise((r, i) => {
1317
+ this.AtlCtrl.Arm_ReadData({ Handle: n, Offset: e, ReadLength: t }, (s, c) => {
1318
+ s ? (this.ArmData = c, r(c)) : i(c);
1306
1319
  });
1307
1320
  });
1308
1321
  }
1309
1322
  // 写入锁内数据区数据
1310
- armWriteData(e, t = 0, a = this.ArmHandle) {
1323
+ armWriteData(e, t = 0, n = this.ArmHandle) {
1311
1324
  if (this.AtlCtrl)
1312
- return new Promise((i, r) => {
1313
- this.AtlCtrl.Arm_WriteData({ Handle: a, Offset: t, DataInput: e }, (o, l) => {
1314
- o && l == 0 ? i(l) : r(l);
1325
+ return new Promise((r, i) => {
1326
+ this.AtlCtrl.Arm_WriteData({ Handle: n, Offset: t, DataInput: e }, (s, c) => {
1327
+ s && c == 0 ? r(c) : i(c);
1315
1328
  });
1316
1329
  });
1317
1330
  }
1318
1331
  // 读取共享内存数据
1319
1332
  armReadShareMemory(e = this.ArmHandle) {
1320
1333
  if (this.AtlCtrl)
1321
- return new Promise((t, a) => {
1322
- this.AtlCtrl.Arm_ReadShareMemory({ Handle: e }, (i, r) => {
1323
- i ? (this.ArmData = r, t(r)) : a(r);
1334
+ return new Promise((t, n) => {
1335
+ this.AtlCtrl.Arm_ReadShareMemory({ Handle: e }, (r, i) => {
1336
+ r ? (this.ArmData = i, t(i)) : n(i);
1324
1337
  });
1325
1338
  });
1326
1339
  }
1327
1340
  // 设置共享内存数据
1328
1341
  armWriteShareMemory(e, t = this.ArmHandle) {
1329
1342
  if (this.AtlCtrl)
1330
- return new Promise((a, i) => {
1331
- this.AtlCtrl.Arm_WriteShareMemory({ Handle: t, DataInput: e }, (r, o) => {
1332
- r && o == 0 ? a(o) : i(o);
1343
+ return new Promise((n, r) => {
1344
+ this.AtlCtrl.Arm_WriteShareMemory({ Handle: t, DataInput: e }, (i, s) => {
1345
+ i && s == 0 ? n(s) : r(s);
1333
1346
  });
1334
1347
  });
1335
1348
  }
1336
1349
  }
1337
- const qt = "0123456789abcdeffedcba9876543210", Qt = "4b0de988570c3a0f", kn = window.ENCRYPT;
1338
- let Ne = kn && new Xt();
1339
- function Jt(n = 16, e = "0123456789abcdefghijklmnopqrstuvwxyz") {
1340
- let t = "", a = e.length;
1341
- for (; n > 0; )
1342
- t += e[Math.floor(Math.random() * a)], n--;
1350
+ const pa = "0123456789abcdeffedcba9876543210", Aa = "4b0de988570c3a0f", $n = window.ENCRYPT;
1351
+ let He = $n && new fa();
1352
+ function ga(a = 16, e = "0123456789abcdefghijklmnopqrstuvwxyz") {
1353
+ let t = "", n = e.length;
1354
+ for (; a > 0; )
1355
+ t += e[Math.floor(Math.random() * n)], a--;
1343
1356
  return t;
1344
1357
  }
1345
- function Zt() {
1346
- return te(this, null, function* () {
1347
- return Ne || (Ne = new Xt()), new Promise((n, e) => {
1348
- Ne.armEnum().then((t) => {
1349
- n(+t);
1358
+ function va() {
1359
+ return ae(this, null, function* () {
1360
+ return He || (He = new fa()), new Promise((a, e) => {
1361
+ He.armEnum().then((t) => {
1362
+ a(+t);
1350
1363
  }).catch((t) => {
1351
- ie({
1364
+ he({
1352
1365
  type: "warning",
1353
1366
  ElMessage: "未找到U盘锁,请检查U盘锁!"
1354
1367
  }), e(t);
@@ -1356,21 +1369,21 @@ function Zt() {
1356
1369
  });
1357
1370
  });
1358
1371
  }
1359
- Yt(
1360
- () => te(void 0, null, function* () {
1361
- const n = yield Zt(), e = {};
1362
- if (typeof n != "number" || n <= 0)
1363
- ie({
1372
+ da(
1373
+ () => ae(void 0, null, function* () {
1374
+ const a = yield va(), e = {};
1375
+ if (typeof a != "number" || a <= 0)
1376
+ he({
1364
1377
  type: "warning",
1365
1378
  ElMessage: "未找到U盘锁,请检查U盘锁!"
1366
1379
  }), e.resetToken();
1367
1380
  else {
1368
- const t = yield On();
1381
+ const t = yield jn();
1369
1382
  if (!e.token) return;
1370
- t.length ? t.includes(e.ukeyHid) || (ie({
1383
+ t.length ? t.includes(e.ukeyHid) || (he({
1371
1384
  type: "error",
1372
1385
  ElMessage: "U盘锁不匹配,请检查U盘锁!"
1373
- }), e.resetToken()) : (ie({
1386
+ }), e.resetToken()) : (he({
1374
1387
  type: "warning",
1375
1388
  ElMessage: "未找到U盘锁,请检查U盘锁!"
1376
1389
  }), e.resetToken());
@@ -1379,193 +1392,199 @@ Yt(
1379
1392
  5e3,
1380
1393
  { trailing: !1 }
1381
1394
  );
1382
- function Dn(n = 0) {
1383
- return te(this, null, function* () {
1384
- return Ne ? new Promise((e, t) => {
1385
- Ne.armGetDongleInfo(n).then((a) => {
1386
- a ? e(a) : (ie({
1395
+ function zn(a = 0) {
1396
+ return ae(this, null, function* () {
1397
+ return He ? new Promise((e, t) => {
1398
+ He.armGetDongleInfo(a).then((n) => {
1399
+ n ? e(n) : (he({
1387
1400
  type: "warning",
1388
1401
  ElMessage: "U盘锁信息为空,请检查U盘锁!"
1389
- }), t(a));
1390
- }).catch((a) => {
1391
- t(a);
1402
+ }), t(n));
1403
+ }).catch((n) => {
1404
+ t(n);
1392
1405
  });
1393
- }) : ie({
1406
+ }) : he({
1394
1407
  type: "warning",
1395
1408
  ElMessage: "未找到U盘锁程序,请检查后台程序!"
1396
1409
  });
1397
1410
  });
1398
1411
  }
1399
- function On() {
1400
- return te(this, null, function* () {
1401
- if (!Ne)
1402
- return ie({
1412
+ function jn() {
1413
+ return ae(this, null, function* () {
1414
+ if (!He)
1415
+ return he({
1403
1416
  type: "warning",
1404
1417
  ElMessage: "未找到U盘锁程序,请检查后台程序!"
1405
1418
  });
1406
- const n = yield Zt();
1419
+ const a = yield va();
1407
1420
  let e = [];
1408
- for (let t = 0; t < n; t++) {
1409
- const a = yield Dn(t);
1410
- e.push(a);
1421
+ for (let t = 0; t < a; t++) {
1422
+ const n = yield zn(t);
1423
+ e.push(n);
1411
1424
  }
1412
1425
  return e;
1413
1426
  });
1414
1427
  }
1415
- Jt(16);
1416
- Jt(16);
1417
- const ea = window.meta.app.inspect ? ke.constants.CBC : ke.constants.ECB, { publicKey: Hi, privateKey: Vi } = _a.generateKeyPair();
1418
- function Ln(n, e, t = {}) {
1419
- const a = ta(Qt), i = t.mode || ea;
1420
- t = i === ke.constants.ECB ? c({
1421
- mode: i,
1428
+ ga(16);
1429
+ ga(16);
1430
+ const wa = window.meta.app.inspect ? Ve.constants.CBC : Ve.constants.ECB, { publicKey: di, privateKey: ui } = Ma.generateKeyPair();
1431
+ function Xn(a, e, t = {}) {
1432
+ const n = ya(Aa), r = t.mode || wa;
1433
+ t = r === Ve.constants.ECB ? d({
1434
+ mode: r,
1422
1435
  // ECB
1423
1436
  inputEncoding: "utf8",
1424
1437
  outputEncoding: "hex"
1425
- }, t) : c({
1426
- iv: qt,
1427
- mode: i,
1438
+ }, t) : d({
1439
+ iv: pa,
1440
+ mode: r,
1428
1441
  // ECB
1429
1442
  inputEncoding: "utf8",
1430
1443
  outputEncoding: "hex"
1431
1444
  }, t);
1432
- let r = "";
1445
+ let i = "";
1433
1446
  try {
1434
- r = ke.encrypt(n, a, t);
1435
- } catch (o) {
1436
- console.log("err: ", o);
1447
+ i = Ve.encrypt(a, n, t);
1448
+ } catch (s) {
1449
+ console.log("err: ", s);
1437
1450
  }
1438
- return r;
1451
+ return i;
1439
1452
  }
1440
- function Mn(n, e, t = {}) {
1441
- const a = ta(Qt), i = t.mode || ea;
1442
- return t = i === ke.constants.ECB ? c({
1443
- mode: i,
1453
+ function qn(a, e, t = {}) {
1454
+ const n = ya(Aa), r = t.mode || wa;
1455
+ return t = r === Ve.constants.ECB ? d({
1456
+ mode: r,
1444
1457
  inputEncoding: "hex",
1445
1458
  outputEncoding: "utf8"
1446
- }, t) : c({
1447
- iv: qt,
1448
- mode: i,
1459
+ }, t) : d({
1460
+ iv: pa,
1461
+ mode: r,
1449
1462
  inputEncoding: "hex",
1450
1463
  outputEncoding: "utf8"
1451
- }, t), ke.decrypt(n, a, t);
1464
+ }, t), Ve.decrypt(a, n, t);
1452
1465
  }
1453
- function ta(n) {
1454
- return [...n].map((e) => e.charCodeAt().toString(16)).join("");
1466
+ function ya(a) {
1467
+ return [...a].map((e) => e.charCodeAt().toString(16)).join("");
1455
1468
  }
1456
- function Ye(n) {
1457
- return n = jt && st(n) ? Mn(n) : n, st(n) ? JSON.parse(n) : n;
1469
+ function pt(a) {
1470
+ return a = ma && yt(a) ? qn(a) : a, yt(a) ? JSON.parse(a) : a;
1458
1471
  }
1459
- function gt(n) {
1460
- return n = jt && st(n) ? Ln(n) : n, JSON.stringify(n);
1472
+ function Rt(a) {
1473
+ return a = ma && yt(a) ? Xn(a) : a, JSON.stringify(a);
1461
1474
  }
1462
- function Ce(n, e, t, a) {
1463
- const i = new StorageEvent("storage", {
1475
+ function Me(a, e, t, n) {
1476
+ const r = new StorageEvent("storage", {
1464
1477
  url: window.location.href,
1465
- key: n,
1478
+ key: a,
1466
1479
  oldValue: e,
1467
1480
  newValue: t,
1468
- storageArea: a
1481
+ storageArea: n
1469
1482
  });
1470
- window.dispatchEvent(i);
1483
+ window.dispatchEvent(r);
1471
1484
  }
1472
- const vt = {
1473
- getLocal: (n) => {
1485
+ const at = {
1486
+ getLocal: (a) => {
1474
1487
  try {
1475
- const e = window.localStorage.getItem(n);
1476
- return Ye(e);
1488
+ const e = window.localStorage.getItem(a);
1489
+ return pt(e);
1477
1490
  } catch (e) {
1478
1491
  console.error(e);
1479
1492
  }
1480
1493
  },
1481
- setLocal: (n, e) => {
1494
+ setLocal: (a, e) => {
1482
1495
  try {
1483
- const t = window.localStorage.getItem(n), a = gt(e);
1484
- window.localStorage.setItem(n, a), Ce(n, t, a, window.localStorage);
1496
+ const t = window.localStorage.getItem(a), n = Rt(e);
1497
+ window.localStorage.setItem(a, n), Me(a, t, n, window.localStorage);
1485
1498
  } catch (t) {
1486
1499
  console.error(t);
1487
1500
  }
1488
1501
  },
1489
- eachLocal: (n) => {
1490
- if (!n || at(n) !== "Function")
1502
+ eachLocal: (a) => {
1503
+ if (!a || ft(a) !== "Function")
1491
1504
  return console.error("传递参数非函数类型!");
1492
- for (let e = 0, t = window.localStorage.length; e < t; e++) {
1493
- const a = window.localStorage.key(e);
1494
- n((void 0).getLocal(a), a);
1505
+ for (let e = 0; e < window.localStorage.length; e++) {
1506
+ const t = window.localStorage.key(e);
1507
+ a(at.getLocal(t), t);
1495
1508
  }
1496
1509
  },
1497
1510
  clearLocal: () => {
1498
- window.localStorage.clear(), Ce(null, null, null, window.localStorage);
1511
+ window.localStorage.clear(), Me(null, null, null, window.localStorage);
1499
1512
  },
1500
- removeLocal: (n) => {
1501
- const e = window.localStorage.getItem(n);
1502
- window.localStorage.removeItem(n), Ce(n, e, null, window.localStorage);
1513
+ removeLocal: (a) => {
1514
+ const e = window.localStorage.getItem(a);
1515
+ window.localStorage.removeItem(a), Me(a, e, null, window.localStorage);
1503
1516
  },
1504
- getSession: (n) => {
1517
+ getSession: (a) => {
1505
1518
  try {
1506
- const e = window.sessionStorage.getItem(n);
1507
- return Ye(e);
1519
+ const e = window.sessionStorage.getItem(a);
1520
+ return pt(e);
1508
1521
  } catch (e) {
1509
1522
  console.error(e);
1510
1523
  }
1511
1524
  },
1512
- setSession: (n, e) => {
1525
+ setSession: (a, e) => {
1513
1526
  try {
1514
- const t = window.sessionStorage.getItem(n), a = gt(e);
1515
- window.sessionStorage.setItem(n, a), Ce(n, t, a, window.sessionStorage);
1527
+ const t = window.sessionStorage.getItem(a), n = Rt(e);
1528
+ window.sessionStorage.setItem(a, n), Me(a, t, n, window.sessionStorage);
1516
1529
  } catch (t) {
1517
1530
  console.error(t);
1518
1531
  }
1519
1532
  },
1520
- eachSession: (n) => {
1521
- if (!n || at(n) !== "Function")
1533
+ eachSession: (a) => {
1534
+ if (!a || ft(a) !== "Function")
1522
1535
  return console.error("传递参数非函数类型!");
1523
- for (let e = 0, t = window.sessionStorage.length; e < t; e++) {
1524
- const a = window.sessionStorage.key(e);
1525
- n((void 0).getSession(a), a);
1536
+ for (let e = 0; e < window.sessionStorage.length; e++) {
1537
+ const t = window.sessionStorage.key(e);
1538
+ a(at.getSession(t), t);
1526
1539
  }
1527
1540
  },
1528
1541
  clearSession: () => {
1529
- window.sessionStorage.clear(), Ce(null, null, null, window.sessionStorage);
1542
+ window.sessionStorage.clear(), Me(null, null, null, window.sessionStorage);
1530
1543
  },
1531
- removeSession: (n) => {
1532
- const e = window.sessionStorage.getItem(n);
1533
- window.sessionStorage.removeItem(n), Ce(n, e, null, window.sessionStorage);
1544
+ removeSession: (a) => {
1545
+ const e = window.sessionStorage.getItem(a);
1546
+ window.sessionStorage.removeItem(a), Me(a, e, null, window.sessionStorage);
1534
1547
  },
1535
1548
  // 监听storage变化
1536
- onStorageChange: (n) => {
1537
- if (!n || at(n) !== "Function")
1549
+ onStorageChange: (a) => {
1550
+ if (!a || ft(a) !== "Function")
1538
1551
  return console.error("传递参数非函数类型!");
1539
- const e = (t) => {
1540
- n({
1541
- url: t.url,
1542
- key: t.key,
1543
- newValue: t.newValue ? Ye(t.newValue) : null,
1544
- oldValue: t.oldValue ? Ye(t.oldValue) : null,
1545
- storageArea: t.storageArea
1552
+ const e = (n) => {
1553
+ try {
1554
+ return pt(n);
1555
+ } catch (r) {
1556
+ return console.error(r), n;
1557
+ }
1558
+ }, t = (n) => {
1559
+ a({
1560
+ url: n.url,
1561
+ key: n.key,
1562
+ newValue: n.newValue ? e(n.newValue) : null,
1563
+ oldValue: n.oldValue ? e(n.oldValue) : null,
1564
+ storageArea: n.storageArea
1546
1565
  });
1547
1566
  };
1548
- return window.addEventListener("storage", e), () => {
1549
- window.removeEventListener("storage", e);
1567
+ return window.addEventListener("storage", t), () => {
1568
+ window.removeEventListener("storage", t);
1550
1569
  };
1551
1570
  }
1552
- }, wt = (n) => {
1553
- const { quality: e, value: t, function_id: a } = n;
1554
- return (e >> 7 & 1) === 1 || e === 0 && a === 2 && t === 1;
1555
- }, _t = "USER_TOKEN", yt = "STATION_ID", Fn = [
1571
+ }, Nt = (a) => {
1572
+ const { quality: e, value: t, function_id: n } = a;
1573
+ return (e >> 7 & 1) === 1 || e === 0 && n === 2 && t === 1;
1574
+ }, kt = "USER_TOKEN", Dt = "STATION_ID", Qn = [
1556
1575
  { key: 0, value: "离线" },
1557
1576
  { key: 1, value: "在线" }
1558
- ], Un = [
1577
+ ], Jn = [
1559
1578
  { key: 0, value: "反向" },
1560
1579
  { key: 1, value: "正向" },
1561
1580
  { key: 2, value: "停止" }
1562
- ], Gn = [
1581
+ ], Zn = [
1563
1582
  { key: 1, value: 1 },
1564
1583
  { key: 2, value: 2 },
1565
1584
  { key: 3, value: 3 },
1566
1585
  { key: 4, value: 4 },
1567
1586
  { key: 5, value: 5 }
1568
- ], Hn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1753954524851'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1506'%20width='256'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M888.65792%20280.15616a46.80704%2046.80704%200%200%200-46.80704-46.80704H233.34912a46.80704%2046.80704%200%200%200-46.80704%2046.80704v93.61408h702.11584V280.15616zM186.54208%20420.5824v374.46144a46.80704%2046.80704%200%200%200%2046.80704%2046.80704h608.49664a46.80704%2046.80704%200%200%200%2046.80704-46.80704V420.5824H186.54208z%20m442.9056%2084.98688l30.92992%2011.47904c-15.62624%2024.23808-35.39968%2050.38592-50.70848%2067.6096l-25.51296-10.84416c15.31392-17.85856%2034.7648-46.56128%2045.29152-68.24448z%20m-184.64768-1.59744c17.54112%2020.09088%2038.26688%2047.5136%2047.5136%2065.37728l-25.51296%2015.62624c-8.61184-17.85856-28.70272-46.23872-45.92128-67.28704l23.92064-13.71648z%20m199.95136%20267.2384h-45.28128c-32.20992%200-39.86432-8.92928-39.86432-39.86432v-102.36416h-46.23872c-5.73952%2069.8368-21.6832%20121.18528-101.0944%20149.56544-3.5072-7.97184-11.47904-19.456-18.49344-25.51296%2072.07424-22.9632%2083.87072-66.01728%2088.65792-124.05248H399.19616v-28.70272h122.7776V483.88096h30.92992v116.39808h122.46016v28.70272h-85.7856v102.04672c0%2010.5216%201.90976%2012.11904%2013.71136%2012.11904h38.90176c8.92928%200%2010.84416-4.1472%2011.8016-28.38016%206.69696%204.78208%2019.12832%209.56928%2027.42272%2011.47904-3.49696%2035.39968-11.4688%2044.96384-36.66432%2044.96384z'%20fill='%23005CFF'%20p-id='1507'%3e%3c/path%3e%3c/svg%3e", _e = window.meta.graph.penFormMap ? window.meta.graph.penFormMap : {
1587
+ ], er = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1753954524851'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1506'%20width='256'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M888.65792%20280.15616a46.80704%2046.80704%200%200%200-46.80704-46.80704H233.34912a46.80704%2046.80704%200%200%200-46.80704%2046.80704v93.61408h702.11584V280.15616zM186.54208%20420.5824v374.46144a46.80704%2046.80704%200%200%200%2046.80704%2046.80704h608.49664a46.80704%2046.80704%200%200%200%2046.80704-46.80704V420.5824H186.54208z%20m442.9056%2084.98688l30.92992%2011.47904c-15.62624%2024.23808-35.39968%2050.38592-50.70848%2067.6096l-25.51296-10.84416c15.31392-17.85856%2034.7648-46.56128%2045.29152-68.24448z%20m-184.64768-1.59744c17.54112%2020.09088%2038.26688%2047.5136%2047.5136%2065.37728l-25.51296%2015.62624c-8.61184-17.85856-28.70272-46.23872-45.92128-67.28704l23.92064-13.71648z%20m199.95136%20267.2384h-45.28128c-32.20992%200-39.86432-8.92928-39.86432-39.86432v-102.36416h-46.23872c-5.73952%2069.8368-21.6832%20121.18528-101.0944%20149.56544-3.5072-7.97184-11.47904-19.456-18.49344-25.51296%2072.07424-22.9632%2083.87072-66.01728%2088.65792-124.05248H399.19616v-28.70272h122.7776V483.88096h30.92992v116.39808h122.46016v28.70272h-85.7856v102.04672c0%2010.5216%201.90976%2012.11904%2013.71136%2012.11904h38.90176c8.92928%200%2010.84416-4.1472%2011.8016-28.38016%206.69696%204.78208%2019.12832%209.56928%2027.42272%2011.47904-3.49696%2035.39968-11.4688%2044.96384-36.66432%2044.96384z'%20fill='%23005CFF'%20p-id='1507'%3e%3c/path%3e%3c/svg%3e", be = window.meta.graph.penFormMap ? window.meta.graph.penFormMap : {
1569
1588
  NORMAL: [
1570
1589
  {
1571
1590
  name: "颜色",
@@ -1649,7 +1668,7 @@ const vt = {
1649
1668
  ]
1650
1669
  }
1651
1670
  ]
1652
- }, aa = window.meta.graph.lightPlateColorMap ? window.meta.graph.lightPlateColorMap : {
1671
+ }, _a = window.meta.graph.lightPlateColorMap ? window.meta.graph.lightPlateColorMap : {
1653
1672
  0: "#00d200",
1654
1673
  // 正常
1655
1674
  1: "#e2ac06",
@@ -1660,7 +1679,7 @@ const vt = {
1660
1679
  // 严重
1661
1680
  4: "#ff0000"
1662
1681
  // 危急
1663
- }, na = window.meta.graph.lightPlateTextMap ? window.meta.graph.lightPlateTextMap : {
1682
+ }, Ea = window.meta.graph.lightPlateTextMap ? window.meta.graph.lightPlateTextMap : {
1664
1683
  0: "#fff",
1665
1684
  // 正常
1666
1685
  1: "#fff",
@@ -1671,16 +1690,16 @@ const vt = {
1671
1690
  // 严重
1672
1691
  4: "#fff"
1673
1692
  // 危急
1674
- }, W = {
1693
+ }, j = {
1675
1694
  form: [
1676
1695
  {
1677
1696
  name: "带电状态",
1678
1697
  key: "charged_state",
1679
1698
  type: "select",
1680
1699
  dataIds: {},
1681
- options: Fn.map((n) => ({
1682
- label: n.value,
1683
- value: n.key
1700
+ options: Qn.map((a) => ({
1701
+ label: a.value,
1702
+ value: a.key
1684
1703
  }))
1685
1704
  },
1686
1705
  {
@@ -1688,9 +1707,9 @@ const vt = {
1688
1707
  key: "electric_direction",
1689
1708
  type: "select",
1690
1709
  dataIds: {},
1691
- options: Un.map((n) => ({
1692
- label: n.value,
1693
- value: n.key
1710
+ options: Jn.map((a) => ({
1711
+ label: a.value,
1712
+ value: a.key
1694
1713
  }))
1695
1714
  },
1696
1715
  {
@@ -1698,9 +1717,9 @@ const vt = {
1698
1717
  key: "electric_size",
1699
1718
  type: "select",
1700
1719
  dataIds: {},
1701
- options: Gn.map((n) => ({
1702
- label: n.value,
1703
- value: n.key
1720
+ options: Zn.map((a) => ({
1721
+ label: a.value,
1722
+ value: a.key
1704
1723
  }))
1705
1724
  }
1706
1725
  ],
@@ -1716,27 +1735,28 @@ const vt = {
1716
1735
  // 默认按照名称批量匹配
1717
1736
  visibleLevel: window.visibleLevel
1718
1737
  // 默认显示数据类型为设备层级
1719
- }, A = k(c({
1720
- penType: b.NORMAL
1721
- }, W), {
1722
- form: [..._e[b.NORMAL], ...W.form]
1738
+ }, A = D(d({
1739
+ penType: P.NORMAL
1740
+ }, j), {
1741
+ form: [...be[P.NORMAL] || [], ...j.form]
1723
1742
  });
1724
- H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form, window.dataType, window.dataProp, window.visibleLevel, W.form, window.dataType, window.dataProp, window.visibleLevel, W.form, window.dataType, window.dataProp, window.visibleLevel, na[0], b.LIGHT_PLATE, aa[0], W.anchors, window.visibleLevel, [..._e[b.LIGHT_PLATE], ...W.form], $e + "", b.SENSOR, W.anchors, window.visibleLevel, [..._e[b.LIGHT_PLATE], ...W.form], k(c({
1743
+ Y.YX, Y.YX, Y.YX, P.POINT_VALUE, j.anchors, window.visibleLevel, j.form, j.form, window.dataType, window.dataProp, window.visibleLevel, j.form, window.dataType, window.dataProp, window.visibleLevel, j.form, window.dataType, window.dataProp, window.visibleLevel, Ea[0], P.LIGHT_PLATE, _a[0], j.anchors, window.visibleLevel, [...be[P.LIGHT_PLATE], ...j.form], Ze + "", P.SENSOR, j.anchors, window.visibleLevel, [...be[P.LIGHT_PLATE], ...j.form], D(d({
1725
1744
  width: 100,
1726
1745
  height: 30,
1727
1746
  name: "text",
1728
1747
  penName: "文本",
1729
1748
  text: "文本",
1749
+ ellipsis: !1,
1730
1750
  disableAnchor: !0,
1731
- penType: b.TEXT
1732
- }, W), {
1733
- form: [..._e[b.TEXT], ...W.form]
1734
- }), c({
1751
+ penType: P.TEXT
1752
+ }, j), {
1753
+ form: [...be[P.TEXT], ...j.form]
1754
+ }), d({
1735
1755
  width: 100,
1736
1756
  height: 100,
1737
1757
  name: "square",
1738
1758
  penName: "正方形"
1739
- }, A), k(c({
1759
+ }, A), D(d({
1740
1760
  type: 1,
1741
1761
  name: "line",
1742
1762
  width: 100,
@@ -1753,74 +1773,74 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1753
1773
  { x: 0, y: 0.5, id: "0" },
1754
1774
  { x: 1, y: 0.5, id: "1" }
1755
1775
  ]
1756
- }), c({
1776
+ }), d({
1757
1777
  width: 200,
1758
1778
  height: 50,
1759
1779
  borderRadius: 0,
1760
1780
  name: "rectangle",
1761
1781
  penName: "矩形"
1762
- }, A), c({
1782
+ }, A), d({
1763
1783
  width: 100,
1764
1784
  height: 100,
1765
1785
  name: "circle",
1766
1786
  penName: "圆"
1767
- }, A), c({
1787
+ }, A), d({
1768
1788
  width: 100,
1769
1789
  height: 100,
1770
1790
  name: "triangle",
1771
1791
  penName: "三角形"
1772
- }, A), c({
1792
+ }, A), d({
1773
1793
  width: 100,
1774
1794
  height: 100,
1775
1795
  name: "diamond",
1776
1796
  penName: "菱形"
1777
- }, A), c({
1797
+ }, A), d({
1778
1798
  width: 100,
1779
1799
  height: 100,
1780
1800
  name: "pentagon",
1781
1801
  penName: "五边形"
1782
- }, A), c({
1802
+ }, A), d({
1783
1803
  width: 100,
1784
1804
  height: 100,
1785
1805
  name: "hexagon",
1786
1806
  penName: "六边形"
1787
- }, A), c({
1807
+ }, A), d({
1788
1808
  width: 100,
1789
1809
  height: 100,
1790
1810
  name: "pentagram",
1791
1811
  penName: "五角星"
1792
- }, A), c({
1812
+ }, A), d({
1793
1813
  width: 120,
1794
1814
  height: 60,
1795
1815
  name: "leftArrow",
1796
1816
  penName: "左箭头"
1797
- }, A), c({
1817
+ }, A), d({
1798
1818
  width: 120,
1799
1819
  height: 60,
1800
1820
  penName: "右箭头",
1801
1821
  name: "rightArrow"
1802
- }, A), c({
1822
+ }, A), d({
1803
1823
  width: 150,
1804
1824
  height: 60,
1805
1825
  name: "twowayArrow",
1806
1826
  penName: "双向箭头"
1807
- }, A), c({
1827
+ }, A), d({
1808
1828
  width: 100,
1809
1829
  height: 100,
1810
1830
  name: "cloud",
1811
1831
  penName: "云"
1812
- }, A), c({
1832
+ }, A), d({
1813
1833
  textTop: -0.1,
1814
1834
  width: 100,
1815
1835
  height: 100,
1816
1836
  name: "message",
1817
1837
  penName: "消息框"
1818
- }, A), c({
1838
+ }, A), d({
1819
1839
  width: 80,
1820
1840
  height: 100,
1821
1841
  name: "file",
1822
1842
  penName: "文件"
1823
- }, A), k(c({
1843
+ }, A), D(d({
1824
1844
  width: 60,
1825
1845
  height: 100,
1826
1846
  name: "cube",
@@ -1853,12 +1873,12 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1853
1873
  }
1854
1874
  ]
1855
1875
  }
1856
- }), c({
1876
+ }), d({
1857
1877
  width: 70,
1858
1878
  height: 100,
1859
1879
  name: "people",
1860
1880
  penName: "人"
1861
- }, A), k(c({
1881
+ }, A), D(d({
1862
1882
  name: "rectangle",
1863
1883
  penName: "按钮",
1864
1884
  width: 80,
@@ -1877,8 +1897,8 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1877
1897
  hoverColor: "#40a9ff",
1878
1898
  hoverTextColor: "#fff"
1879
1899
  }, A), {
1880
- penType: b.BUTTON
1881
- }), k(c({
1900
+ penType: P.BUTTON
1901
+ }), D(d({
1882
1902
  name: "rectangle",
1883
1903
  penName: "输入框",
1884
1904
  height: 50,
@@ -1894,8 +1914,8 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1894
1914
  activeTextColor: "#000000FF",
1895
1915
  textLeft: 10
1896
1916
  }, A), {
1897
- penType: b.INPUT
1898
- }), k(c({
1917
+ penType: P.INPUT
1918
+ }), D(d({
1899
1919
  name: "rectangle",
1900
1920
  penName: "选择器",
1901
1921
  height: 50,
@@ -1921,8 +1941,8 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1921
1941
  }
1922
1942
  ]
1923
1943
  }, A), {
1924
- penType: b.SELECT
1925
- }), k(c({
1944
+ penType: P.SELECT
1945
+ }), D(d({
1926
1946
  name: "slider",
1927
1947
  penName: "进度条",
1928
1948
  width: 300,
@@ -1938,20 +1958,20 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1938
1958
  textColor: "#222",
1939
1959
  unit: "%"
1940
1960
  }, A), {
1941
- penType: b.SLIDER
1942
- }), k(c({
1961
+ penType: P.SLIDER
1962
+ }), D(d({
1943
1963
  name: "time",
1944
1964
  penName: "时间",
1945
1965
  width: 300,
1946
1966
  height: 40,
1947
- text: `${wa().format("YYYY-MM-DD HH:mm:ss")}`,
1967
+ text: `${Oa().format("YYYY-MM-DD HH:mm:ss")}`,
1948
1968
  lineWidth: 0,
1949
1969
  fontSize: 20,
1950
1970
  // 绘画帧时长
1951
1971
  interval: 67,
1952
1972
  fillZero: !0
1953
1973
  }, A), {
1954
- penType: b.TIME,
1974
+ penType: P.TIME,
1955
1975
  form: [
1956
1976
  {
1957
1977
  key: "timeFormat",
@@ -1966,7 +1986,7 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1966
1986
  ...A.form
1967
1987
  ],
1968
1988
  timeFormat: "`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"
1969
- }), k(c({
1989
+ }), D(d({
1970
1990
  name: "switch",
1971
1991
  penName: "开关",
1972
1992
  height: 30,
@@ -1978,9 +1998,9 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1978
1998
  disableOnColor: "#A3D3FF",
1979
1999
  locked: 0
1980
2000
  }, A), {
1981
- penType: b.SWITCH
2001
+ penType: P.SWITCH
1982
2002
  //disable: true,
1983
- }), k(c({
2003
+ }), D(d({
1984
2004
  name: "radio",
1985
2005
  penName: "单选框",
1986
2006
  direction: "horizontal",
@@ -1989,8 +2009,8 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1989
2009
  checked: "",
1990
2010
  options: [{ text: "选项一" }, { text: "选项二" }, { text: "选项三", isForbidden: !0 }]
1991
2011
  }, A), {
1992
- penType: b.RADIO
1993
- }), k(c({
2012
+ penType: P.RADIO
2013
+ }), D(d({
1994
2014
  name: "checkbox",
1995
2015
  penName: "多选框",
1996
2016
  width: 30,
@@ -1999,8 +2019,8 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
1999
2019
  // isForbidden: true,
2000
2020
  value: "选项一"
2001
2021
  }, A), {
2002
- penType: b.CHECKBOX
2003
- }), k(c({
2022
+ penType: P.CHECKBOX
2023
+ }), D(d({
2004
2024
  name: "table2",
2005
2025
  penName: "表格",
2006
2026
  width: 80,
@@ -2017,7 +2037,7 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2017
2037
  color: "#333",
2018
2038
  textColor: "#444"
2019
2039
  }, A), {
2020
- penType: b.TABLE,
2040
+ penType: P.TABLE,
2021
2041
  replaceMode: 2,
2022
2042
  data: [
2023
2043
  ["设备 ID", "设备名称", "数据协议", "级别"],
@@ -2068,7 +2088,7 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2068
2088
  textColor: "#000"
2069
2089
  }
2070
2090
  ]
2071
- }), k(c({
2091
+ }), D(d({
2072
2092
  name: "table2",
2073
2093
  penName: "斑马纹表格",
2074
2094
  width: 80,
@@ -2085,7 +2105,7 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2085
2105
  color: "#333",
2086
2106
  textColor: "#444"
2087
2107
  }, A), {
2088
- penType: b.TABLE,
2108
+ penType: P.TABLE,
2089
2109
  replaceMode: 2,
2090
2110
  data: [
2091
2111
  ["设备 ID", "设备名称", "数据协议", "级别"],
@@ -2136,7 +2156,7 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2136
2156
  textColor: "#000"
2137
2157
  }
2138
2158
  ]
2139
- }), k(c({
2159
+ }), D(d({
2140
2160
  name: "table2",
2141
2161
  penName: "滚动表格",
2142
2162
  width: 80,
@@ -2155,7 +2175,7 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2155
2175
  color: "#333",
2156
2176
  textColor: "#444"
2157
2177
  }, A), {
2158
- penType: b.TABLE,
2178
+ penType: P.TABLE,
2159
2179
  replaceMode: 2,
2160
2180
  data: [
2161
2181
  ["设备 ID", "设备名称", "数据协议", "级别"],
@@ -2216,95 +2236,95 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2216
2236
  textColor: "#000"
2217
2237
  }
2218
2238
  ]
2219
- }), k(c({
2239
+ }), D(d({
2220
2240
  name: "svg",
2221
2241
  width: 100,
2222
2242
  height: 100,
2223
- image: $e + "/icon/audio.svg",
2243
+ image: Ze + "/icon/audio.svg",
2224
2244
  audioId: "",
2225
2245
  penName: "音频",
2226
2246
  datable: !0,
2227
- penType: b.AUDIO
2228
- }, W), {
2229
- form: [..._e[b.AUDIO], ...W.form],
2247
+ penType: P.AUDIO
2248
+ }, j), {
2249
+ form: [...be[P.AUDIO], ...j.form],
2230
2250
  events: [
2231
2251
  {
2232
2252
  name: "enter",
2233
- action: Ve.Emit,
2234
- value: ae.OPEN_AUDIO,
2253
+ action: Xe.Emit,
2254
+ value: ne.OPEN_AUDIO,
2235
2255
  where: {
2236
2256
  type: ""
2237
2257
  },
2238
2258
  params: JSON.stringify({
2239
- action: ae.OPEN_AUDIO,
2259
+ action: ne.OPEN_AUDIO,
2240
2260
  data: ""
2241
2261
  // 音频id
2242
2262
  })
2243
2263
  },
2244
2264
  {
2245
2265
  name: "leave",
2246
- action: Ve.Emit,
2247
- value: ae.CLOSE_AUDIO,
2266
+ action: Xe.Emit,
2267
+ value: ne.CLOSE_AUDIO,
2248
2268
  where: {
2249
2269
  type: ""
2250
2270
  },
2251
2271
  params: JSON.stringify({
2252
- action: ae.CLOSE_AUDIO,
2272
+ action: ne.CLOSE_AUDIO,
2253
2273
  data: ""
2254
2274
  // 音频id
2255
2275
  })
2256
2276
  }
2257
2277
  ]
2258
- }), k(c({
2278
+ }), D(d({
2259
2279
  name: "svg",
2260
2280
  width: 100,
2261
2281
  height: 100,
2262
- image: $e + "/icon/camera.svg",
2282
+ image: Ze + "/icon/camera.svg",
2263
2283
  cameraId: "",
2264
2284
  penName: "摄像机",
2265
2285
  datable: !0,
2266
2286
  events: [
2267
2287
  {
2268
2288
  name: "enter",
2269
- action: Ve.Emit,
2270
- value: ae.OPEN_CAMERA,
2289
+ action: Xe.Emit,
2290
+ value: ne.OPEN_CAMERA,
2271
2291
  where: {
2272
2292
  type: ""
2273
2293
  },
2274
2294
  params: JSON.stringify({
2275
- action: ae.OPEN_CAMERA,
2295
+ action: ne.OPEN_CAMERA,
2276
2296
  data: ""
2277
2297
  // 摄像机id
2278
2298
  })
2279
2299
  },
2280
2300
  {
2281
2301
  name: "leave",
2282
- action: Ve.Emit,
2283
- value: ae.CLOSE_CAMERA,
2302
+ action: Xe.Emit,
2303
+ value: ne.CLOSE_CAMERA,
2284
2304
  where: {
2285
2305
  type: ""
2286
2306
  },
2287
2307
  params: JSON.stringify({
2288
- action: ae.CLOSE_CAMERA,
2308
+ action: ne.CLOSE_CAMERA,
2289
2309
  data: ""
2290
2310
  // 摄像机id
2291
2311
  })
2292
2312
  }
2293
2313
  ],
2294
- penType: b.CAMERA
2295
- }, W), {
2296
- form: [..._e[b.CAMERA], ...W.form]
2297
- }), k(c({
2314
+ penType: P.CAMERA
2315
+ }, j), {
2316
+ form: [...be[P.CAMERA], ...j.form]
2317
+ }), D(d({
2298
2318
  name: "video",
2299
2319
  width: 100,
2300
2320
  height: 100,
2301
2321
  video: "https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",
2302
2322
  autoPlay: !0,
2303
2323
  penName: "MP4",
2304
- penType: b.MP4
2305
- }, W), {
2306
- form: [..._e[b.MP4], ...W.form]
2307
- }), k(c({
2324
+ penType: P.MP4
2325
+ }, j), {
2326
+ form: [...be[P.MP4], ...j.form]
2327
+ }), D(d({
2308
2328
  name: "video",
2309
2329
  width: 100,
2310
2330
  height: 100,
@@ -2312,102 +2332,102 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2312
2332
  datable: !0,
2313
2333
  video: "https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",
2314
2334
  autoPlay: !0,
2315
- penType: b.VIDEO_STREAM
2316
- }, W), {
2317
- form: [..._e[b.VIDEO_STREAM], ...W.form]
2318
- }), c({
2335
+ penType: P.VIDEO_STREAM
2336
+ }, j), {
2337
+ form: [...be[P.VIDEO_STREAM], ...j.form]
2338
+ }), d({
2319
2339
  text: "开始/结束",
2320
2340
  width: 120,
2321
2341
  height: 40,
2322
2342
  borderRadius: 0.5,
2323
2343
  name: "rectangle",
2324
2344
  penName: "开始/结束"
2325
- }, A), c({
2345
+ }, A), d({
2326
2346
  text: "流程",
2327
2347
  width: 120,
2328
2348
  height: 40,
2329
2349
  name: "rectangle",
2330
2350
  penName: "流程"
2331
- }, A), c({
2351
+ }, A), d({
2332
2352
  text: "判定",
2333
2353
  width: 120,
2334
2354
  height: 60,
2335
2355
  name: "diamond",
2336
2356
  penName: "判定"
2337
- }, A), c({
2357
+ }, A), d({
2338
2358
  text: "数据",
2339
2359
  width: 120,
2340
2360
  height: 50,
2341
2361
  name: "flowData",
2342
2362
  penName: "数据",
2343
2363
  offsetX: 0.14
2344
- }, A), c({
2364
+ }, A), d({
2345
2365
  text: "准备",
2346
2366
  width: 120,
2347
2367
  height: 50,
2348
2368
  name: "hexagon",
2349
2369
  penName: "准备"
2350
- }, A), c({
2370
+ }, A), d({
2351
2371
  text: "子流程",
2352
2372
  width: 120,
2353
2373
  height: 50,
2354
2374
  name: "flowSubprocess",
2355
2375
  penName: "子流程"
2356
- }, A), c({
2376
+ }, A), d({
2357
2377
  text: "数据库",
2358
2378
  width: 80,
2359
2379
  height: 120,
2360
2380
  name: "flowDb",
2361
2381
  penName: "数据库"
2362
- }, A), c({
2382
+ }, A), d({
2363
2383
  text: "文档",
2364
2384
  width: 120,
2365
2385
  height: 100,
2366
2386
  name: "flowDocument",
2367
2387
  penName: "文档"
2368
- }, A), c({
2388
+ }, A), d({
2369
2389
  text: "内部存储",
2370
2390
  width: 120,
2371
2391
  height: 80,
2372
2392
  name: "flowInternalStorage",
2373
2393
  penName: "内部存储"
2374
- }, A), c({
2394
+ }, A), d({
2375
2395
  text: "外部存储",
2376
2396
  width: 120,
2377
2397
  height: 80,
2378
2398
  name: "flowExternStorage",
2379
2399
  penName: "外部存储"
2380
- }, A), c({
2400
+ }, A), d({
2381
2401
  text: "队列",
2382
2402
  width: 100,
2383
2403
  height: 100,
2384
2404
  name: "flowQueue",
2385
2405
  penName: "队列"
2386
- }, A), c({
2406
+ }, A), d({
2387
2407
  text: "手动输入",
2388
2408
  width: 120,
2389
2409
  height: 80,
2390
2410
  name: "flowManually",
2391
2411
  penName: "手动输入"
2392
- }, A), c({
2412
+ }, A), d({
2393
2413
  text: "展示",
2394
2414
  width: 120,
2395
2415
  height: 80,
2396
2416
  name: "flowDisplay",
2397
2417
  penName: "展示"
2398
- }, A), c({
2418
+ }, A), d({
2399
2419
  text: "并行模式",
2400
2420
  width: 120,
2401
2421
  height: 50,
2402
2422
  name: "flowParallel",
2403
2423
  penName: "并行模式"
2404
- }, A), c({
2424
+ }, A), d({
2405
2425
  text: "注释",
2406
2426
  width: 100,
2407
2427
  height: 100,
2408
2428
  name: "flowComment",
2409
2429
  penName: "注释"
2410
- }, A), c({
2430
+ }, A), d({
2411
2431
  text: "",
2412
2432
  width: 30,
2413
2433
  height: 30,
@@ -2415,25 +2435,25 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2415
2435
  penName: "开始",
2416
2436
  background: "#555",
2417
2437
  lineWidth: 0
2418
- }, A), c({
2438
+ }, A), d({
2419
2439
  width: 30,
2420
2440
  height: 30,
2421
2441
  name: "activityFinal",
2422
2442
  penName: "结束"
2423
- }, A), c({
2443
+ }, A), d({
2424
2444
  text: "活动",
2425
2445
  width: 120,
2426
2446
  height: 50,
2427
2447
  borderRadius: 0.25,
2428
2448
  name: "rectangle",
2429
2449
  penName: "活动"
2430
- }, A), c({
2450
+ }, A), d({
2431
2451
  text: "决策/合并",
2432
2452
  width: 120,
2433
2453
  height: 50,
2434
2454
  name: "diamond",
2435
2455
  penName: "决策/合并"
2436
- }, A), c({
2456
+ }, A), d({
2437
2457
  text: "垂直泳道",
2438
2458
  width: 200,
2439
2459
  height: 500,
@@ -2443,7 +2463,7 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2443
2463
  textTop: 20,
2444
2464
  // textHeight: ,
2445
2465
  lineTop: 0.08
2446
- }, A), c({
2466
+ }, A), d({
2447
2467
  text: "水平泳道",
2448
2468
  width: 500,
2449
2469
  height: 200,
@@ -2453,7 +2473,7 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2453
2473
  textLeft: 0.04,
2454
2474
  textAlign: "left",
2455
2475
  lineLeft: 0.08
2456
- }, A), c({
2476
+ }, A), d({
2457
2477
  text: "垂直分岔/汇合",
2458
2478
  width: 10,
2459
2479
  height: 150,
@@ -2461,7 +2481,7 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2461
2481
  penName: "垂直分岔/汇合",
2462
2482
  fillStyle: "#555",
2463
2483
  strokeStyle: "transparent"
2464
- }, A), c({
2484
+ }, A), d({
2465
2485
  text: "水平分岔/汇合",
2466
2486
  width: 150,
2467
2487
  height: 10,
@@ -2469,76 +2489,76 @@ H.YX, H.YX, H.YX, b.POINT_VALUE, W.anchors, window.visibleLevel, W.form, W.form,
2469
2489
  penName: "水平分岔/汇合",
2470
2490
  fillStyle: "#555",
2471
2491
  strokeStyle: "transparent"
2472
- }, A), c({
2492
+ }, A), d({
2473
2493
  name: "andGate",
2474
2494
  penName: "与门",
2475
2495
  width: 100,
2476
2496
  height: 150
2477
- }, A), c({
2497
+ }, A), d({
2478
2498
  name: "basicEvent",
2479
2499
  penName: "基本事件",
2480
2500
  width: 100,
2481
2501
  height: 150
2482
- }, A), c({
2502
+ }, A), d({
2483
2503
  name: "unexpandedEvent",
2484
2504
  penName: "未展开事件",
2485
2505
  width: 100,
2486
2506
  height: 150
2487
- }, A), c({
2507
+ }, A), d({
2488
2508
  name: "priorityAndGate",
2489
2509
  penName: "优先AND门",
2490
2510
  width: 100,
2491
2511
  height: 150
2492
- }, A), c({
2512
+ }, A), d({
2493
2513
  name: "forbiddenGate",
2494
2514
  penName: "禁止门",
2495
2515
  width: 100,
2496
2516
  height: 150
2497
- }, A), c({
2517
+ }, A), d({
2498
2518
  name: "event",
2499
2519
  penName: "事件",
2500
2520
  width: 100,
2501
2521
  height: 150
2502
- }, A), c({
2522
+ }, A), d({
2503
2523
  name: "switchEvent",
2504
2524
  penName: "开关事件",
2505
2525
  width: 100,
2506
2526
  height: 150
2507
- }, A), c({
2527
+ }, A), d({
2508
2528
  name: "conditionalEvent",
2509
2529
  penName: "条件事件",
2510
2530
  width: 150,
2511
2531
  height: 100
2512
- }, A), c({
2532
+ }, A), d({
2513
2533
  name: "transferSymbol",
2514
2534
  penName: "转移符号",
2515
2535
  width: 100,
2516
2536
  height: 150
2517
- }, A), c({
2537
+ }, A), d({
2518
2538
  name: "orGate",
2519
2539
  penName: "或门",
2520
2540
  width: 100,
2521
2541
  height: 150
2522
- }, A), c({
2542
+ }, A), d({
2523
2543
  name: "xorGate",
2524
2544
  penName: "异或门",
2525
2545
  width: 100,
2526
2546
  height: 150
2527
- }, A), c({
2547
+ }, A), d({
2528
2548
  name: "votingGate",
2529
2549
  penName: "表决门",
2530
2550
  width: 100,
2531
2551
  height: 150
2532
2552
  }, A);
2533
- const Vn = (n, e = { isDev: !1, devServerUrl: "", devServerPort: 8443 }) => (n = n.replace(
2553
+ const tr = (a, e = { isDev: !1, devServerUrl: "", devServerPort: 8443 }) => (a = a.replace(
2534
2554
  /(https?:\/\/)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(:(\d+))?/,
2535
- `$1${e.isDev ? e.devServerUrl : Za}:${e.isDev ? e.devServerPort : tn}`
2536
- ), e.isDev ? n : n.replace("/baseUrl", "")), qe = (n, e) => {
2537
- const t = n.__vccOpts || n;
2538
- for (const [a, i] of e)
2539
- t[a] = i;
2555
+ `$1${e.isDev ? e.devServerUrl : mn}:${e.isDev ? e.devServerPort : pn}`
2556
+ ), e.isDev ? a : a.replace("/baseUrl", "")), ot = (a, e) => {
2557
+ const t = a.__vccOpts || a;
2558
+ for (const [n, r] of e)
2559
+ t[n] = r;
2540
2560
  return t;
2541
- }, Bn = { class: "props-panel__title" }, Wn = { class: "props-panel__value" }, Kn = { class: "value-left" }, Yn = { class: "props-panel__value-num" }, $n = { class: "value-right" }, zn = /* @__PURE__ */ Object.assign({ name: "PropsPanle" }, {
2561
+ }, ar = { class: "props-panel__title" }, nr = { class: "props-panel__value" }, rr = { class: "value-left" }, ir = { class: "props-panel__value-num" }, or = { class: "value-right" }, sr = /* @__PURE__ */ Object.assign({ name: "PropsPanle" }, {
2542
2562
  __name: "PropsPanle",
2543
2563
  props: {
2544
2564
  data: {
@@ -2547,39 +2567,39 @@ const Vn = (n, e = { isDev: !1, devServerUrl: "", devServerPort: 8443 }) => (n =
2547
2567
  }
2548
2568
  },
2549
2569
  emits: ["close", "enter", "view-history"],
2550
- setup(n, { emit: e }) {
2551
- const t = n, a = e;
2552
- function i(m) {
2553
- return m == null || m === "—" ? "—" : typeof m == "number" ? m.toFixed(2) : m;
2570
+ setup(a, { emit: e }) {
2571
+ const t = a, n = e;
2572
+ function r(f) {
2573
+ return f == null || f === "—" ? "—" : typeof f == "number" ? f.toFixed(2) : f;
2554
2574
  }
2555
- const r = () => {
2556
- a("close");
2557
- }, o = () => {
2558
- a("enter");
2559
- }, l = () => {
2560
- a("view-history", t.data);
2575
+ const i = () => {
2576
+ n("close");
2577
+ }, s = () => {
2578
+ n("enter");
2579
+ }, c = () => {
2580
+ n("view-history", t.data);
2561
2581
  };
2562
- return (m, v) => {
2563
- var M, F;
2564
- return ue(), Ee("div", {
2582
+ return (f, g) => {
2583
+ var O, U;
2584
+ return ue(), xe("div", {
2565
2585
  class: "props-panel",
2566
- onMouseleave: r,
2567
- onMouseover: o
2586
+ onMouseleave: i,
2587
+ onMouseover: s
2568
2588
  }, [
2569
- me("div", Bn, nt(((M = t == null ? void 0 : t.data) == null ? void 0 : M.name) || "—"), 1),
2570
- v[2] || (v[2] = me("div", { class: "props-panel__label" }, "脉冲峰值", -1)),
2571
- me("div", Wn, [
2572
- me("div", Kn, [
2573
- me("span", Yn, nt(i((F = t == null ? void 0 : t.data) == null ? void 0 : F.value)), 1),
2574
- v[0] || (v[0] = me("span", { class: "props-panel__unit" }, "dBm", -1))
2589
+ ge("div", ar, At(((O = t == null ? void 0 : t.data) == null ? void 0 : O.name) || "—"), 1),
2590
+ g[2] || (g[2] = ge("div", { class: "props-panel__label" }, "脉冲峰值", -1)),
2591
+ ge("div", nr, [
2592
+ ge("div", rr, [
2593
+ ge("span", ir, At(r((U = t == null ? void 0 : t.data) == null ? void 0 : U.value)), 1),
2594
+ g[0] || (g[0] = ge("span", { class: "props-panel__unit" }, "dBm", -1))
2575
2595
  ]),
2576
- me("div", $n, [
2577
- Me(Fe(__$t__), {
2596
+ ge("div", or, [
2597
+ $e(ze(ua), {
2578
2598
  type: "primary",
2579
- onClick: l
2599
+ onClick: c
2580
2600
  }, {
2581
- default: lt(() => [...v[1] || (v[1] = [
2582
- Vt("查看历史", -1)
2601
+ default: _t(() => [...g[1] || (g[1] = [
2602
+ ra("查看历史", -1)
2583
2603
  ])]),
2584
2604
  _: 1
2585
2605
  })
@@ -2588,10 +2608,10 @@ const Vn = (n, e = { isDev: !1, devServerUrl: "", devServerPort: 8443 }) => (n =
2588
2608
  ], 32);
2589
2609
  };
2590
2610
  }
2591
- }), jn = /* @__PURE__ */ qe(zn, [["__scopeId", "data-v-937ebfaa"]]);
2592
- class Xn {
2611
+ }), lr = /* @__PURE__ */ ot(sr, [["__scopeId", "data-v-937ebfaa"]]);
2612
+ class cr {
2593
2613
  constructor(e) {
2594
- we(this, "editor");
2614
+ Se(this, "editor");
2595
2615
  this.editor = e;
2596
2616
  }
2597
2617
  /**
@@ -2600,92 +2620,162 @@ class Xn {
2600
2620
  * @param {*} target 目标组件
2601
2621
  * @param {*} options 配置信息
2602
2622
  */
2603
- initPlugin(e, t, a = {}) {
2623
+ initPlugin(e, t, n = {}) {
2604
2624
  e.installPenPlugins({ name: t }, [
2605
2625
  {
2606
- plugin: Ra,
2607
- options: a
2626
+ plugin: Ya,
2627
+ options: n
2608
2628
  },
2609
2629
  {
2610
- plugin: Na,
2611
- options: a
2630
+ plugin: $a,
2631
+ options: n
2612
2632
  }
2613
2633
  ]);
2614
2634
  }
2615
2635
  }
2616
- function qn(n, e) {
2617
- var re, q;
2618
- const t = e || new Path2D(), { x: a, y: i, width: r, height: o } = n.calculative.worldRect, l = a + r / 2, m = i + o / 2, v = r / 2, M = (re = n.startAngle) != null ? re : 0, F = (q = n.endAngle) != null ? q : 2 * Math.PI;
2619
- if (t.arc(l, m, v, M, F, n.anticlockwise), t instanceof Path2D) return t;
2636
+ function dr(a, e) {
2637
+ var $, Z;
2638
+ const t = e || new Path2D(), { x: n, y: r, width: i, height: s } = a.calculative.worldRect, c = n + i / 2, f = r + s / 2, g = i / 2, O = ($ = a.startAngle) != null ? $ : 0, U = (Z = a.endAngle) != null ? Z : 2 * Math.PI;
2639
+ if (t.arc(c, f, g, O, U, a.anticlockwise), t instanceof Path2D) return t;
2620
2640
  }
2621
- function Qn(n, e) {
2622
- const t = e || new Path2D(), { x: a, y: i, width: r, height: o } = n.calculative.worldRect;
2623
- if (t.rect(a, i, r, o), t instanceof Path2D) return t;
2641
+ function ur(a, e) {
2642
+ const t = e || new Path2D(), { x: n, y: r, width: i, height: s } = a.calculative.worldRect;
2643
+ if (t.rect(n, r, i, s), t instanceof Path2D) return t;
2624
2644
  }
2625
- function Jn(n, e) {
2626
- const t = n || new Path2D(), a = e.dimensionData;
2627
- if (!a) return t;
2628
- const i = e.calculative.worldRect, r = (U) => ({
2629
- x: i.x + U.x * i.width,
2630
- y: i.y + U.y * i.height
2631
- }), o = r(a.tp1), l = r(a.tp2), m = r(a.dimStart), v = r(a.dimEnd), M = e.calculative.fontSize || 12;
2632
- n && n.beginPath && (n.save(), n.beginPath(), n.strokeStyle = e.color || "#000", n.lineWidth = e.calculative.lineWidth || 1);
2633
- const F = Math.max(5, M * 0.4), re = m.x - o.x, q = m.y - o.y, $ = Math.hypot(re, q) || 1, oe = m.x + re / $ * F, O = m.y + q / $ * F, fe = v.x - l.x, ce = v.y - l.y, Ae = Math.hypot(fe, ce) || 1, Ie = v.x + fe / Ae * F, ne = v.y + ce / Ae * F;
2634
- t.moveTo(o.x, o.y), t.lineTo(oe, O), t.moveTo(l.x, l.y), t.lineTo(Ie, ne), t.moveTo(m.x, m.y), t.lineTo(v.x, v.y);
2635
- const Se = Math.hypot(v.x - m.x, v.y - m.y), Q = Math.min(10, Se / 2.1), pe = (U, z) => {
2636
- if (Q < 1) return;
2637
- const de = Math.atan2(z.y - U.y, z.x - U.x), he = Math.PI / 6, d = z.x - Q * Math.cos(de - he), f = z.y - Q * Math.sin(de - he), E = z.x - Q * Math.cos(de + he), R = z.y - Q * Math.sin(de + he);
2638
- t.moveTo(z.x, z.y), t.lineTo(d, f), t.lineTo(E, R), t.closePath();
2645
+ function hr(a, e) {
2646
+ const t = a || new Path2D(), n = e.dimensionData;
2647
+ if (!n) return t;
2648
+ const r = e.calculative.worldRect, i = (G) => ({
2649
+ x: r.x + G.x * r.width,
2650
+ y: r.y + G.y * r.height
2651
+ }), s = i(n.tp1), c = i(n.tp2), f = i(n.dimStart), g = i(n.dimEnd), O = e.calculative.fontSize || 12;
2652
+ a && a.beginPath && (a.save(), a.beginPath(), a.strokeStyle = e.color || "#000", a.lineWidth = e.calculative.lineWidth || 1);
2653
+ const U = Math.max(5, O * 0.4), $ = f.x - s.x, Z = f.y - s.y, K = Math.hypot($, Z) || 1, te = f.x + $ / K * U, L = f.y + Z / K * U, W = g.x - c.x, me = g.y - c.y, _e = Math.hypot(W, me) || 1, Re = g.x + W / _e * U, re = g.y + me / _e * U;
2654
+ t.moveTo(s.x, s.y), t.lineTo(te, L), t.moveTo(c.x, c.y), t.lineTo(Re, re), t.moveTo(f.x, f.y), t.lineTo(g.x, g.y);
2655
+ const Ne = Math.hypot(g.x - f.x, g.y - f.y), J = Math.min(10, Ne / 2.1), fe = (G, ee) => {
2656
+ if (J < 1) return;
2657
+ const se = Math.atan2(ee.y - G.y, ee.x - G.x), pe = Math.PI / 6, Ee = ee.x - J * Math.cos(se - pe), le = ee.y - J * Math.sin(se - pe), ie = ee.x - J * Math.cos(se + pe), ce = ee.y - J * Math.sin(se + pe);
2658
+ t.moveTo(ee.x, ee.y), t.lineTo(Ee, le), t.lineTo(ie, ce), t.closePath();
2639
2659
  };
2640
- if (pe(v, m), pe(m, v), n && n.stroke && (n.stroke(), n.restore()), n && n.fillText && a.text) {
2641
- n.save(), n.fillStyle = e.textColor || e.color || "#000", n.textAlign = "center", n.textBaseline = "bottom";
2642
- let U = M;
2643
- n.font = `${e.fontStyle || ""} ${e.fontWeight || ""} ${U}px ${e.fontFamily || "Arial"}`;
2644
- const z = n.measureText(a.text), de = Se * 0.9;
2645
- if (z.width > de && de > 0) {
2646
- const E = de / z.width;
2647
- U = U * E, n.font = `${e.fontStyle || ""} ${e.fontWeight || ""} ${U}px ${e.fontFamily || "Arial"}`;
2660
+ if (fe(g, f), fe(f, g), a && a.stroke && (a.stroke(), a.restore()), a && a.fillText && n.text) {
2661
+ a.save(), a.fillStyle = e.textColor || e.color || "#000", a.textAlign = "center", a.textBaseline = "bottom";
2662
+ let G = O;
2663
+ a.font = `${e.fontStyle || ""} ${e.fontWeight || ""} ${G}px ${e.fontFamily || "Arial"}`;
2664
+ const ee = a.measureText(n.text), se = Ne * 0.9;
2665
+ if (ee.width > se && se > 0) {
2666
+ const ie = se / ee.width;
2667
+ G = G * ie, a.font = `${e.fontStyle || ""} ${e.fontWeight || ""} ${G}px ${e.fontFamily || "Arial"}`;
2648
2668
  }
2649
- const he = (m.x + v.x) / 2, d = (m.y + v.y) / 2;
2650
- let f = Math.atan2(v.y - m.y, v.x - m.x);
2651
- (f > Math.PI / 2 || f < -Math.PI / 2) && (f += Math.PI), n.translate(he, d), n.rotate(f), n.fillText(a.text, 0, -U * 0.2), n.restore();
2669
+ const pe = (f.x + g.x) / 2, Ee = (f.y + g.y) / 2;
2670
+ let le = Math.atan2(g.y - f.y, g.x - f.x);
2671
+ (le > Math.PI / 2 || le < -Math.PI / 2) && (le += Math.PI), a.translate(pe, Ee), a.rotate(le), a.fillText(n.text, 0, -G * 0.2), a.restore();
2652
2672
  }
2653
2673
  if (t instanceof Path2D) return t;
2654
2674
  }
2655
- function Zn(n, e) {
2656
- const t = e || new Path2D(), { x: a, y: i, width: r, height: o } = n.calculative.worldRect;
2657
- if ((n.anchors && n.anchors.length >= 3 ? n.anchors.slice(0, 3) : [
2675
+ function mr(a, e) {
2676
+ const t = e || new Path2D(), { x: n, y: r, width: i, height: s } = a.calculative.worldRect;
2677
+ if ((a.anchors && a.anchors.length >= 3 ? a.anchors.slice(0, 3) : [
2658
2678
  { x: 0, y: 1 },
2659
2679
  { x: 1, y: 1 },
2660
2680
  { x: 0.5, y: 0 }
2661
- ]).forEach((m, v) => {
2662
- const M = a + m.x * r, F = i + m.y * o;
2663
- v === 0 ? t.moveTo(M, F) : t.lineTo(M, F);
2681
+ ]).forEach((f, g) => {
2682
+ const O = n + f.x * i, U = r + f.y * s;
2683
+ g === 0 ? t.moveTo(O, U) : t.lineTo(O, U);
2664
2684
  }), t.closePath(), t instanceof Path2D) return t;
2665
2685
  }
2666
- function ei(n, e) {
2667
- var q, $;
2668
- const t = e || new Path2D(), { x: a, y: i, width: r, height: o } = n.calculative.worldRect, l = a + r / 2, m = i + o / 2, v = r / 2, M = o / 2, F = (q = n.startAngle) != null ? q : 0, re = ($ = n.endAngle) != null ? $ : 2 * Math.PI;
2669
- if (t.ellipse(l, m, v, M, 0, F, re, n.anticlockwise), t instanceof Path2D) return t;
2686
+ function fr(a, e) {
2687
+ var Z, K;
2688
+ const t = e || new Path2D(), { x: n, y: r, width: i, height: s } = a.calculative.worldRect, c = n + i / 2, f = r + s / 2, g = i / 2, O = s / 2, U = (Z = a.startAngle) != null ? Z : 0, $ = (K = a.endAngle) != null ? K : 2 * Math.PI;
2689
+ if (t.ellipse(c, f, g, O, 0, U, $, a.anticlockwise), t instanceof Path2D) return t;
2670
2690
  }
2671
- function ti() {
2672
- return te(this, null, function* () {
2673
- yield meta2d.register({ arc: qn, mtext: Qn, arrow: Zn, ellipse: ei }), yield meta2d.registerCanvasDraw({ dimension: Jn });
2691
+ function pr() {
2692
+ return ae(this, null, function* () {
2693
+ yield meta2d.register({ arc: dr, mtext: ur, arrow: mr, ellipse: fr }), yield meta2d.registerCanvasDraw({ dimension: hr });
2674
2694
  });
2675
2695
  }
2676
- const ai = "original_meta2d";
2677
- function ni() {
2678
- return localStorage.removeItem(ai);
2696
+ const Ta = "meta2d-pen-size:", Ar = Q(0), gr = ["uhf:"], vr = (a) => gr.some((e) => a == null ? void 0 : a.startsWith(e)), Lt = (a) => Math.round(a * 100) / 100;
2697
+ function wr(a, e) {
2698
+ var n, r;
2699
+ if (!a) return null;
2700
+ if (typeof a.getPenRect == "function")
2701
+ return a.getPenRect(e);
2702
+ const t = ((r = (n = a.store) == null ? void 0 : n.data) == null ? void 0 : r.scale) || 1;
2703
+ return {
2704
+ x: (e.x || 0) / t,
2705
+ y: (e.y || 0) / t,
2706
+ width: (e.width || 0) / t,
2707
+ height: (e.height || 0) / t
2708
+ };
2679
2709
  }
2680
- let Le = {};
2681
- const ii = (n) => {
2710
+ function yr(a) {
2711
+ var r, i, s;
2712
+ const e = (s = (i = (r = a == null ? void 0 : a.calculative) == null ? void 0 : r.canvas) == null ? void 0 : i.store) == null ? void 0 : s.pens, t = [], n = (c) => {
2713
+ (c.children || []).forEach((f) => {
2714
+ const g = e == null ? void 0 : e[f];
2715
+ g && (t.push(g), n(g));
2716
+ });
2717
+ };
2718
+ return n(a), t;
2719
+ }
2720
+ function _r(a) {
2721
+ const e = yr(a);
2722
+ if (e.length)
2723
+ return e.map((t) => typeof t.fontSize == "number" ? t.fontSize : null);
2724
+ }
2725
+ function Er(a) {
2726
+ if (!a) return null;
2727
+ try {
2728
+ const e = localStorage.getItem(Ta + a);
2729
+ return e ? JSON.parse(e) : null;
2730
+ } catch (e) {
2731
+ return null;
2732
+ }
2733
+ }
2734
+ function Tr(a, e) {
2735
+ if (!(!a || !e))
2736
+ try {
2737
+ localStorage.setItem(Ta + a, JSON.stringify(e)), Ar.value += 1;
2738
+ } catch (t) {
2739
+ }
2740
+ }
2741
+ function Ir(a, e) {
2742
+ if (!a || !(e != null && e.length)) return;
2743
+ const t = /* @__PURE__ */ new Map();
2744
+ e.forEach((n) => {
2745
+ if (!n || n.parentId || !n.libraryKey) return;
2746
+ const r = wr(a, n);
2747
+ if (!r || !(r.width > 0) || !(r.height > 0)) return;
2748
+ const i = t.get(n.libraryKey) || [];
2749
+ i.push({ pen: n, rect: r }), t.set(n.libraryKey, i);
2750
+ }), t.forEach((n, r) => {
2751
+ var U;
2752
+ let i, s;
2753
+ if (n.length === 1 || vr(r))
2754
+ ({ width: i, height: s } = n[0].rect);
2755
+ else {
2756
+ const $ = n.map((W) => W.rect), Z = Math.min(...$.map((W) => W.x)), K = Math.min(...$.map((W) => W.y)), te = Math.max(...$.map((W) => W.x + W.width)), L = Math.max(...$.map((W) => W.y + W.height));
2757
+ i = te - Z, s = L - K;
2758
+ }
2759
+ if (!(i > 0) || !(s > 0)) return;
2760
+ const c = Er(r) || {}, f = D(d({}, c), { width: Lt(i), height: Lt(s) }), g = _r(n[0].pen);
2761
+ g && (f.childFontSizes = g);
2762
+ const O = n[0].pen;
2763
+ (U = O.children) != null && U.length && typeof O.fontSize == "number" && (f.rootFontSize = O.fontSize), Tr(r, f);
2764
+ });
2765
+ }
2766
+ const Sr = "original_meta2d";
2767
+ function br() {
2768
+ return localStorage.removeItem(Sr);
2769
+ }
2770
+ let Ye = {};
2771
+ const xr = (a) => {
2682
2772
  const e = document.querySelectorAll("video");
2683
2773
  let t = null;
2684
- if (e.forEach((i) => {
2685
- i.getAttribute("src") === n.video && (t = i);
2774
+ if (e.forEach((r) => {
2775
+ r.getAttribute("src") === a.video && (t = r);
2686
2776
  }), !t) return;
2687
2777
  t.setAttribute("muted", "muted"), t.setAttribute("autoplay", "autoplay"), t.setAttribute("loop", "loop"), t.setAttribute("crossorigin", ""), t.setAttribute("controls", ""), t.style.display = "none", t.parentElement.style.border = "2px solid #ffc878";
2688
- const a = new JessibucaPro({
2778
+ const n = new JessibucaPro({
2689
2779
  container: t.parentElement,
2690
2780
  background: "",
2691
2781
  // 背景图片
@@ -2746,15 +2836,15 @@ const ii = (n) => {
2746
2836
  videoBufferDelay: 1
2747
2837
  // 缓存延迟(延迟超过会触发丢帧)
2748
2838
  });
2749
- return n.autoPlay && n.streamUrl && a.play(n.streamUrl), Le[n.id] = a, a;
2750
- }, ri = () => {
2751
- Object.keys(Le).forEach((n) => {
2752
- Le[n].destroy(), Le[n] = null;
2753
- }), Le = {};
2754
- }, oi = { class: "sy-empty" }, si = {
2839
+ return a.autoPlay && a.streamUrl && n.play(a.streamUrl), Ye[a.id] = n, n;
2840
+ }, Cr = () => {
2841
+ Object.keys(Ye).forEach((a) => {
2842
+ Ye[a].destroy(), Ye[a] = null;
2843
+ }), Ye = {};
2844
+ }, Pr = { class: "sy-empty" }, Rr = {
2755
2845
  key: 1,
2756
2846
  class: "sy-empty-picture"
2757
- }, li = { class: "sy-empty-description" }, ci = /* @__PURE__ */ Object.assign({
2847
+ }, Nr = { class: "sy-empty-description" }, kr = /* @__PURE__ */ Object.assign({
2758
2848
  name: "SyEmpty"
2759
2849
  }, {
2760
2850
  __name: "index",
@@ -2776,53 +2866,53 @@ const ii = (n) => {
2776
2866
  default: !1
2777
2867
  }
2778
2868
  },
2779
- setup(n) {
2780
- ua((i) => ({
2781
- v7ddea5d8: a.value.width,
2782
- v4735fb99: a.value.height
2869
+ setup(a) {
2870
+ Pa((r) => ({
2871
+ v7ddea5d8: n.value.width,
2872
+ v4735fb99: n.value.height
2783
2873
  }));
2784
- const e = n, t = Re(() => ({
2874
+ const e = a, t = Ge(() => ({
2785
2875
  "font-size": e.imageSize ? `${e.imageSize}px` : "80px"
2786
- })), a = Re(() => e.imageSize ? {
2876
+ })), n = Ge(() => e.imageSize ? {
2787
2877
  width: e.imageSize * 1.2 + "px",
2788
2878
  height: e.imageSize + "px"
2789
2879
  } : {
2790
2880
  width: "187px",
2791
2881
  height: "144px"
2792
2882
  });
2793
- return (i, r) => {
2794
- const o = it("SyIcon"), l = it("el-icon");
2795
- return ue(), Ee("div", oi, [
2796
- n.image !== "empty" ? (ue(), Ee("span", {
2883
+ return (r, i) => {
2884
+ const s = gt("SyIcon"), c = gt("el-icon");
2885
+ return ue(), xe("div", Pr, [
2886
+ a.image !== "empty" ? (ue(), xe("span", {
2797
2887
  key: 0,
2798
2888
  class: "sy-empty-image",
2799
- style: Bt(t.value)
2889
+ style: ia(t.value)
2800
2890
  }, [
2801
- n.image !== "loading" ? (ue(), ze(o, {
2891
+ a.image !== "loading" ? (ue(), et(s, {
2802
2892
  key: 0,
2803
- name: n.image,
2893
+ name: a.image,
2804
2894
  gradient: ""
2805
- }, null, 8, ["name"])) : (ue(), ze(l, {
2895
+ }, null, 8, ["name"])) : (ue(), et(c, {
2806
2896
  key: 1,
2807
2897
  class: "is-loading",
2808
2898
  style: { color: "#1671d4" }
2809
2899
  }, {
2810
- default: lt(() => [
2811
- Me(Fe(Ka))
2900
+ default: _t(() => [
2901
+ $e(ze(on))
2812
2902
  ]),
2813
2903
  _: 1
2814
2904
  }))
2815
- ], 4)) : n.onlyText ? Ue("", !0) : (ue(), Ee("span", si)),
2816
- me("div", li, [
2817
- me("p", null, nt(n.description), 1)
2905
+ ], 4)) : a.onlyText ? je("", !0) : (ue(), xe("span", Rr)),
2906
+ ge("div", Nr, [
2907
+ ge("p", null, At(a.description), 1)
2818
2908
  ])
2819
2909
  ]);
2820
2910
  };
2821
2911
  }
2822
- }), di = /* @__PURE__ */ qe(ci, [["__scopeId", "data-v-97343c87"]]), ui = {
2912
+ }), Dr = /* @__PURE__ */ ot(kr, [["__scopeId", "data-v-97343c87"]]), Lr = {
2823
2913
  key: 1,
2824
2914
  class: "move-step-panel"
2825
- }, hi = /* @__PURE__ */ Object.assign({
2915
+ }, Ot = 30, Or = /* @__PURE__ */ Object.assign({
2826
2916
  name: "Meta2dEditor"
2827
2917
  }, {
2828
2918
  __name: "index",
@@ -2854,285 +2944,316 @@ const ii = (n) => {
2854
2944
  }
2855
2945
  },
2856
2946
  emits: ["loaded", "load-error"],
2857
- setup(n, { expose: e, emit: t }) {
2858
- const a = t, i = n, r = ha("isComponent"), o = Y(null), l = ma(), m = Y(1), v = Y(!1), M = Re(() => !!(i.data || i.url));
2859
- rt(
2860
- () => [i.data, i.url],
2947
+ setup(a, { expose: e, emit: t }) {
2948
+ const n = t, r = a, i = Ra("isComponent"), s = Q(null), c = Na(), f = Q(1), g = Q(!1);
2949
+ let O = 0, U = null, $ = null;
2950
+ const Z = Ge(() => !!(r.data || r.url));
2951
+ vt(
2952
+ () => [r.data, r.url],
2861
2953
  () => {
2862
- M.value && re();
2954
+ Z.value && te();
2863
2955
  }
2864
2956
  );
2865
- let F = Y(!0);
2866
- function re() {
2867
- return te(this, null, function* () {
2868
- var d;
2957
+ let K = Q(!0);
2958
+ function te() {
2959
+ return ae(this, null, function* () {
2960
+ var h;
2961
+ const l = ++O;
2869
2962
  try {
2870
- if (F.value = !0, yield fa(), !o.value) {
2963
+ if (K.value = !0, yield ka(), l !== O) return;
2964
+ if (!s.value) {
2871
2965
  console.error("未找到meta2d元素!");
2872
2966
  return;
2873
2967
  }
2874
- let f = null;
2875
- if (i.data ? f = i.data : i.url && (f = yield de()), !f || !f.data) {
2876
- F.value = !1, console.log("图纸数据为空"), a("load-error");
2968
+ let v = null;
2969
+ if (r.data ? v = r.data : r.url && (v = yield ke()), l !== O) return;
2970
+ if (!v || !v.data) {
2971
+ K.value = !1, console.log("图纸数据为空"), n("load-error");
2877
2972
  return;
2878
2973
  }
2879
- const E = f.options || {
2974
+ const y = v.options || {
2880
2975
  background: "#eee",
2881
- disableAnchor: (r == null ? void 0 : r.value) || !1
2976
+ disableAnchor: (i == null ? void 0 : i.value) || !1
2882
2977
  };
2883
- if (l.value && (l.value.destroy(!0), l.value = null), !o.value) {
2978
+ if (L(), !s.value) {
2884
2979
  console.error("Meta2D 容器元素不可用");
2885
2980
  return;
2886
2981
  }
2887
- l.value = new ba(o.value, k(c({}, E), {
2888
- disableAnchor: (r == null ? void 0 : r.value) || !1,
2889
- rotateCursor: "rotate.cur",
2982
+ if (c.value = new Va(s.value, D(d({}, y), {
2983
+ disableAnchor: (i == null ? void 0 : i.value) || !1,
2984
+ rotateCursor: "/rotate.cur",
2890
2985
  // 性能优化:DXF/大图元素多时,用近似宽度计算替代每帧 measureText,降低文本换行开销
2891
2986
  measureTextWidth: !1,
2892
2987
  // 渲染节流调大 + 自动帧率,减少连续交互时的全量重绘频率
2893
- interval: Math.max((d = E.interval) != null ? d : 30, 40),
2988
+ interval: Math.max((h = y.interval) != null ? h : 30, 40),
2894
2989
  autoFPS: !0
2895
- })), E.visibleLevel && l.value.scale(E.visibleLevel), q(), $(), yield oe(f.data), l.value.render(), fe(), setTimeout(() => {
2896
- window.meta2dTools && window.registerToolsNew();
2897
- }, 1e3), a("loaded", l.value);
2898
- } catch (f) {
2899
- console.error("初始化编辑器失败:", f);
2990
+ })), y.visibleLevel && c.value.scale(y.visibleLevel), W(), me(), yield _e(v.data), l !== O) return;
2991
+ c.value.render(), se(), clearTimeout(U), U = setTimeout(() => {
2992
+ U = null, window.meta2dTools && window.registerToolsNew && window.registerToolsNew();
2993
+ }, 1e3), n("loaded", c.value);
2994
+ } catch (v) {
2995
+ console.error("初始化编辑器失败:", v);
2900
2996
  }
2901
2997
  });
2902
2998
  }
2903
- function q() {
2904
- if (!l.value) return;
2905
- new Xn({}).initPlugin(l.value, "mindNode", {});
2999
+ const L = () => {
3000
+ var v, y;
3001
+ if (!c.value) return;
3002
+ const l = c.value, h = l.canvas;
3003
+ Cr(), (v = J.cancel) == null || v.call(J), (y = we.cancel) == null || y.call(we), clearTimeout(U), U = null, clearTimeout($), $ = null, h && (ie && h.getHover !== ie && (h.getHover = ie), ce && h.drawline !== ce && (h.drawline = ce), re && h.pushHistory !== re && (h.pushHistory = re), h.__keydownGuarded && G && (document.removeEventListener("keydown", h.onkeydown), h.onkeydown = G, h.__keydownGuarded = !1, G = null), h.__hoverOverridden = !1, h.__historyLimited = !1, l.destroy(!0)), window.meta2d === l && (window.meta2d = null), c.value = null;
3004
+ };
3005
+ function W() {
3006
+ if (!c.value) return;
3007
+ new cr({}).initPlugin(c.value, "mindNode", {});
2906
3008
  }
2907
- function $() {
2908
- ti(), De(Da()), De(La()), dt(Ma()), De(Ha()), Oe(Va()), De(Ba()), Oe(Wa()), Oe(ka()), Oe(Oa()), De(Fa()), dt(Ua()), Oe(Ga());
3009
+ function me() {
3010
+ pr(), Ke(ja()), Ke(qa()), It(Qa()), Ke(tn()), We(an()), Ke(nn()), We(rn()), We(za()), We(Xa()), Ke(Ja()), It(Za()), We(en());
2909
3011
  }
2910
- function oe(d) {
2911
- var f;
2912
- if (l.value) {
2913
- if (typeof d.locked == "undefined" && (d.locked = 0), d.bkImage && l.value.setBackgroundImage(d.bkImage), d.pens && d.pens.length > 0) {
2914
- const E = [];
2915
- d.pens.forEach((g) => {
2916
- g.name === "video" && g.streamUrl ? E.push(g) : g.name === "image" && g.image ? g.image = Vn(g.image, i.devConfig) : g.lineType === "gisLine" ? g.visible = !i.preview : g.penType === b.TABLE && g.dataType ? O(g) : g.penType === b.GIS_SENSOR_WRAPPER && i.preview && (g.title = "");
2917
- }), E.length > 0 && setTimeout(() => {
2918
- E.forEach((g) => {
2919
- ii(g);
3012
+ function _e(l) {
3013
+ var h, v, y;
3014
+ if (c.value) {
3015
+ if (typeof l.locked == "undefined" && (l.locked = 0), l.bkImage && c.value.setBackgroundImage(l.bkImage), l.pens && l.pens.length > 0) {
3016
+ const T = [], k = [];
3017
+ l.pens.forEach((N) => {
3018
+ N.name === "video" && N.streamUrl ? T.push(N) : N.name === "image" && N.image ? N.image = tr(N.image, r.devConfig) : N.lineType === "gisLine" ? N.visible = !r.preview : N.penType === P.TABLE && N.dataType ? k.push(Re(N)) : N.penType === P.GIS_SENSOR_WRAPPER && r.preview && (N.title = "");
3019
+ }), k.length > 0 && Promise.allSettled(k), T.length > 0 && (clearTimeout($), $ = setTimeout(() => {
3020
+ $ = null, T.forEach((N) => {
3021
+ xr(N);
2920
3022
  });
2921
- }, 500);
2922
- const R = window.meta.graph.penCountThreshold || 2e3;
2923
- d.pens.length > R && d.scale && d.pens.forEach((g) => {
2924
- const V = g.visibleLevel;
2925
- V !== void 0 ? (g.visible = d.scale >= V, g.visible || (g.disabled = !0, g.locked = xe.Disable)) : (g.visible = !0, g.disabled = !1, g.locked = xe.None);
3023
+ }, 500));
3024
+ const z = ((v = (h = window.meta) == null ? void 0 : h.graph) == null ? void 0 : v.penCountThreshold) || 2e3;
3025
+ l.pens.length > z && l.scale && l.pens.forEach((N) => {
3026
+ const M = N.visibleLevel;
3027
+ M !== void 0 ? (N.visible = l.scale >= M, N.visible || (N.disabled = !0, N.locked = Pe.Disable)) : (N.visible = !0, N.disabled = !1, N.locked = Pe.None);
2926
3028
  });
2927
3029
  }
2928
- l.value.open(k(c({}, d), { disableAnchor: (r == null ? void 0 : r.value) || !1 })), !i.preview && ((f = d.networks) != null && f.length) && l.value.closeNetwork();
3030
+ c.value.open(D(d({}, l), { disableAnchor: (i == null ? void 0 : i.value) || !1 })), !r.preview && ((y = l.networks) != null && y.length) && c.value.closeNetwork();
2929
3031
  }
2930
3032
  }
2931
- const O = (d) => te(this, null, function* () {
2932
- var E;
2933
- const f = yield ye.getCommonApi(ja[d.dataType], {
3033
+ const Re = (l) => ae(this, null, function* () {
3034
+ var v;
3035
+ const h = yield Ue.getCommonApi(dn[l.dataType], {
2934
3036
  offset: 0,
2935
- limit: d.tableSize || 10
3037
+ limit: l.tableSize || 10
2936
3038
  });
2937
- if ((E = f.data) != null && E.length) {
2938
- const R = d.tableHeader || [
3039
+ if ((v = h.data) != null && v.length) {
3040
+ const y = l.tableHeader || [
2939
3041
  { prop: "id", label: "ID" },
2940
3042
  { prop: "guid", label: "标识" },
2941
3043
  { prop: "name", label: "名称" }
2942
- ], x = f.data.map((g) => R.filter((V) => V.isShow).map((V) => {
2943
- const X = g[V.prop];
2944
- return V.choices ? V.choices[X] || X : ya(X) ? X.name : X;
3044
+ ], T = h.data.map((k) => y.filter((z) => z.isShow).map((z) => {
3045
+ const H = k[z.prop];
3046
+ return z.choices ? z.choices[H] || H : Fa(H) ? H.name : H;
2945
3047
  }));
2946
- l.value.setValue({
2947
- id: d.id,
2948
- dataY: x
3048
+ c.value.setValue({
3049
+ id: l.id,
3050
+ dataY: T
2949
3051
  });
2950
3052
  } else
2951
- l.value.setValue({
2952
- id: d.id,
3053
+ c.value.setValue({
3054
+ id: l.id,
2953
3055
  dataY: []
2954
3056
  });
2955
- }), fe = () => {
2956
- var d, f;
2957
- l.value && ((f = (d = l.value.canvas) == null ? void 0 : d.tooltip) != null && f.box && (l.value.canvas.tooltip.box.style.pointerEvents = "none"), l.value.on("scale", U), i.preview || (l.value.on("connectLine", z), l.value.on("active", ce), l.value.on("inactive", Ae), document.addEventListener("keydown", Ie, !0)), Se());
2958
- }, ce = (d) => {
2959
- v.value = (d == null ? void 0 : d.length) > 0;
2960
- }, Ae = () => {
2961
- v.value = !1;
2962
- }, Ie = (d) => {
2963
- var g;
2964
- if (m.value <= 0 || !l.value) return;
2965
- const f = (g = l.value.store) == null ? void 0 : g.active;
2966
- if (!(f != null && f.length)) return;
2967
- const E = m.value * (l.value.store.data.scale || 1);
2968
- let R = 0, x = 0;
2969
- switch (d.key) {
3057
+ });
3058
+ let re = null;
3059
+ const Ne = () => {
3060
+ var v;
3061
+ const l = (v = c.value) == null ? void 0 : v.canvas;
3062
+ if (!l || l.__historyLimited) return;
3063
+ l.__historyLimited = !0;
3064
+ const h = l.pushHistory.bind(l);
3065
+ re = h, l.pushHistory = (y) => {
3066
+ h(y);
3067
+ const T = l.store;
3068
+ if (T != null && T.histories && T.histories.length > Ot) {
3069
+ const k = T.histories.length - Ot;
3070
+ T.histories.splice(0, k), typeof T.historyIndex == "number" && (T.historyIndex = Math.max(0, T.historyIndex - k));
3071
+ }
3072
+ };
3073
+ }, J = Tt((l) => {
3074
+ Ir(c.value, l);
3075
+ }, 300), fe = (l) => {
3076
+ if (!l || typeof l.closest != "function") return !1;
3077
+ const { tagName: h } = l;
3078
+ return h === "INPUT" || h === "TEXTAREA" || h === "SELECT" || l.isContentEditable ? !0 : !!l.closest(
3079
+ '.el-input, .el-input-number, .el-textarea, .el-select, .el-slider, .el-color-picker, .el-date-editor, [contenteditable="true"]'
3080
+ );
3081
+ };
3082
+ let G = null;
3083
+ const ee = () => {
3084
+ var v;
3085
+ const l = (v = c.value) == null ? void 0 : v.canvas;
3086
+ if (!l || l.__keydownGuarded || typeof l.onkeydown != "function") return;
3087
+ l.__keydownGuarded = !0, G = l.onkeydown;
3088
+ const h = G;
3089
+ l.onkeydown = (y) => {
3090
+ fe(y.target) || h(y);
3091
+ }, document.removeEventListener("keydown", h), document.addEventListener("keydown", l.onkeydown);
3092
+ }, se = () => {
3093
+ var l, h;
3094
+ c.value && ((h = (l = c.value.canvas) == null ? void 0 : l.tooltip) != null && h.box && (c.value.canvas.tooltip.box.style.pointerEvents = "none"), c.value.on("scale", we), r.preview || (c.value.on("connectLine", Te), c.value.on("active", pe), c.value.on("inactive", Ee), c.value.on("resizePens", J), document.addEventListener("keydown", le, !0)), ee(), Ce(), Ne());
3095
+ }, pe = (l) => {
3096
+ g.value = (l == null ? void 0 : l.length) > 0;
3097
+ }, Ee = () => {
3098
+ g.value = !1;
3099
+ }, le = (l) => {
3100
+ var k, z, H, N, M;
3101
+ if (f.value <= 0 || !c.value || ((z = (k = c.value.canvas) == null ? void 0 : k.inputDiv) == null ? void 0 : z.contentEditable) === "true" || fe(l.target) || ((N = (H = c.value.store) == null ? void 0 : H.data) == null ? void 0 : N.locked) >= Pe.DisableEdit) return;
3102
+ const h = (M = c.value.store) == null ? void 0 : M.active;
3103
+ if (!(h != null && h.length)) return;
3104
+ const v = f.value * (c.value.store.data.scale || 1);
3105
+ let y = 0, T = 0;
3106
+ switch (l.key) {
2970
3107
  case "ArrowLeft":
2971
- R = -E;
3108
+ y = -v;
2972
3109
  break;
2973
3110
  case "ArrowRight":
2974
- R = E;
3111
+ y = v;
2975
3112
  break;
2976
3113
  case "ArrowUp":
2977
- x = -E;
3114
+ T = -v;
2978
3115
  break;
2979
3116
  case "ArrowDown":
2980
- x = E;
3117
+ T = v;
2981
3118
  break;
2982
3119
  default:
2983
3120
  return;
2984
3121
  }
2985
- d.preventDefault(), d.stopPropagation(), l.value.translatePens(f, R, x);
3122
+ l.preventDefault(), l.stopPropagation(), c.value.translatePens(h, y, T);
2986
3123
  };
2987
- let ne = null;
2988
- const Se = () => {
2989
- const d = l.value.canvas;
2990
- d && (ne = d.getHover.bind(d), d.getHover = (f) => {
2991
- var x;
2992
- if (ne(f), d.hoverType !== ut.Node && d.hoverType !== ut.Line || !d.store.hover) return;
2993
- const E = pe(f, d.store.data.pens, d.store.data.scale || 1);
2994
- if (!E || E.id === d.store.hover.id) return;
2995
- const R = d.store.hover;
2996
- R.calculative.hover = !1, ht(mt(R, !0) || R, !1), d.store.hover = E, E.calculative.hover = !0, ht(mt(E, !0) || E), d.store.lastHover = E, d.patchFlags = !0, (x = d.initTemplateCanvas) == null || x.call(d, [E]);
3124
+ let ie = null, ce = null;
3125
+ const Ce = () => {
3126
+ const l = c.value.canvas;
3127
+ !l || l.__hoverOverridden || (l.__hoverOverridden = !0, ie = l.getHover.bind(l), l.getHover = (h) => {
3128
+ var T;
3129
+ if (ie(h), (l.drawingLineName || l.pencil) && !l.drawingLine && (l.hoverType === Le.Node || l.hoverType === Le.Line || l.hoverType === Le.NodeAnchor)) {
3130
+ l.store.hover && (l.store.hover.calculative.hover = !1, lt(ct(l.store.hover, !0) || l.store.hover, !1), l.store.hover = void 0), l.store.hoverAnchor = void 0, l.hoverType = Le.None, l.externalElements.style.cursor = "crosshair";
3131
+ return;
3132
+ }
3133
+ if (l.hoverType !== Le.Node && l.hoverType !== Le.Line || !l.store.hover) return;
3134
+ const v = ve(h, l.store.data.pens, l.store.data.scale || 1);
3135
+ if (!v || v.id === l.store.hover.id) return;
3136
+ const y = l.store.hover;
3137
+ y.calculative.hover = !1, lt(ct(y, !0) || y, !1), l.store.hover = v, v.calculative.hover = !0, lt(ct(v, !0) || v), l.store.lastHover = v, l.patchFlags = !0, (T = l.initTemplateCanvas) == null || T.call(l, [v]);
3138
+ }, ce = l.drawline.bind(l), l.drawline = (h) => {
3139
+ if (l.drawingLine && !l.dock && (l.drawingLineName === "polyline" || l.drawingLineName === "line")) {
3140
+ const v = l.drawingLine.calculative.worldAnchors;
3141
+ if (v.length >= 2) {
3142
+ const y = v[v.length - 1], T = v[v.length - 2];
3143
+ if (y && T && !y.connectTo) {
3144
+ const k = 8 / (l.store.data.scale || 1), z = Math.abs(y.x - T.x), H = Math.abs(y.y - T.y);
3145
+ z < k && H >= k ? y.x = T.x : H < k && z >= k && (y.y = T.y);
3146
+ }
3147
+ }
3148
+ }
3149
+ ce(h);
2997
3150
  });
2998
- }, Q = (d, f, E) => {
2999
- const R = E.x - f.x, x = E.y - f.y;
3000
- if (R === 0 && x === 0) return Math.hypot(d.x - f.x, d.y - f.y);
3001
- const g = Math.max(0, Math.min(1, ((d.x - f.x) * R + (d.y - f.y) * x) / (R * R + x * x)));
3002
- return Math.hypot(d.x - (f.x + g * R), d.y - (f.y + g * x));
3003
- }, pe = (d, f, E) => {
3004
- var X, se, B, K;
3005
- let R = null, x = 1 / 0, g = 1 / 0;
3006
- const V = 5 / E;
3007
- for (let J = 0; J < f.length; J++) {
3008
- const Z = f[J];
3009
- if (!(Z.visible === !1 || Z.calculative.inView === !1) && Z.locked !== xe.Disable && !Z.parentId)
3010
- if (Z.type === Ca.Line) {
3011
- const G = Z.calculative.worldAnchors;
3012
- if (!G || G.length < 2) continue;
3013
- let N = 1 / 0;
3014
- for (let ge = 0; ge < G.length - 1; ge++) {
3015
- const ve = Q(d, G[ge], G[ge + 1]);
3016
- ve < N && (N = ve);
3151
+ }, oe = (l, h, v) => {
3152
+ const y = v.x - h.x, T = v.y - h.y;
3153
+ if (y === 0 && T === 0) return Math.hypot(l.x - h.x, l.y - h.y);
3154
+ const k = Math.max(0, Math.min(1, ((l.x - h.x) * y + (l.y - h.y) * T) / (y * y + T * T)));
3155
+ return Math.hypot(l.x - (h.x + k * y), l.y - (h.y + k * T));
3156
+ }, ve = (l, h, v) => {
3157
+ var H, N, M, Ie;
3158
+ let y = null, T = 1 / 0, k = 1 / 0;
3159
+ const z = 5 / v;
3160
+ for (let X = 0; X < h.length; X++) {
3161
+ const q = h[X];
3162
+ if (!(q.visible === !1 || q.calculative.inView === !1) && q.locked !== Pe.Disable && !q.parentId)
3163
+ if (q.type === Ba.Line) {
3164
+ const F = q.calculative.worldAnchors;
3165
+ if (!F || F.length < 2) continue;
3166
+ let Ae = 1 / 0;
3167
+ for (let ye = 0; ye < F.length - 1; ye++) {
3168
+ const o = oe(l, F[ye], F[ye + 1]);
3169
+ o < Ae && (Ae = o);
3017
3170
  }
3018
- if (N > V) continue;
3019
- (0 < x || x === 0 && N < g) && (R = Z, x = 0, g = N);
3171
+ if (Ae > z) continue;
3172
+ (0 < T || T === 0 && Ae < k) && (y = q, T = 0, k = Ae);
3020
3173
  } else {
3021
- if (Z.type) continue;
3022
- const G = Z.calculative.worldRect;
3023
- if (!G || !xa(d, G)) continue;
3024
- const N = G.width * G.height, ge = d.x - ((se = (X = G.center) == null ? void 0 : X.x) != null ? se : G.x + G.width / 2), ve = d.y - ((K = (B = G.center) == null ? void 0 : B.y) != null ? K : G.y + G.height / 2), Ge = ge * ge + ve * ve;
3025
- (N < x || N === x && Ge < g) && (R = Z, x = N, g = Ge);
3174
+ if (q.type) continue;
3175
+ const F = q.calculative.worldRect;
3176
+ if (!F || !Ka(l, F)) continue;
3177
+ const Ae = F.width * F.height, ye = l.x - ((N = (H = F.center) == null ? void 0 : H.x) != null ? N : F.x + F.width / 2), o = l.y - ((Ie = (M = F.center) == null ? void 0 : M.y) != null ? Ie : F.y + F.height / 2), u = ye * ye + o * o;
3178
+ (Ae < T || Ae === T && u < k) && (y = q, T = Ae, k = u);
3026
3179
  }
3027
3180
  }
3028
- return R;
3029
- }, U = Ea((d) => {
3030
- var f, E, R, x;
3181
+ return y;
3182
+ }, we = Tt((l) => {
3183
+ var h, v, y, T, k, z;
3031
3184
  try {
3032
- if (!l.value) return;
3033
- ot.emit("graph-scale", d);
3034
- let g = l.value.store.data.pens;
3035
- const V = window.meta.graph.penCountThreshold || 2e3, X = g.length > V;
3036
- for (let se = 0; se < g.length; se++) {
3037
- const B = g[se];
3038
- if ([b.VIDEO_STREAM, b.MP4].includes(B.penType)) {
3039
- if (((E = (f = be[B.id]) == null ? void 0 : f.children) == null ? void 0 : E.length) === 3) {
3040
- let K = be[B.id].children[0], J = be[B.id].children[2];
3041
- K.style.width = J.currentTime / J.duration * B.calculative.worldRect.width + "px";
3042
- } else if (((x = (R = be[B.id]) == null ? void 0 : R.children) == null ? void 0 : x.length) === 2) {
3043
- let K = be[B.id].children[0], J = be[B.id].children[1];
3044
- K.style.width = J.currentTime / J.duration * B.calculative.worldRect.width + "px";
3185
+ if (!c.value) return;
3186
+ wt.emit("graph-scale", l);
3187
+ let H = c.value.store.data.pens;
3188
+ const N = ((v = (h = window.meta) == null ? void 0 : h.graph) == null ? void 0 : v.penCountThreshold) || 2e3, M = H.length > N;
3189
+ for (let Ie = 0; Ie < H.length; Ie++) {
3190
+ const X = H[Ie];
3191
+ if ([P.VIDEO_STREAM, P.MP4].includes(X.penType)) {
3192
+ if (((T = (y = Oe[X.id]) == null ? void 0 : y.children) == null ? void 0 : T.length) === 3) {
3193
+ let q = Oe[X.id].children[0], F = Oe[X.id].children[2];
3194
+ q.style.width = (F.duration > 0 ? F.currentTime / F.duration : 0) * X.calculative.worldRect.width + "px";
3195
+ } else if (((z = (k = Oe[X.id]) == null ? void 0 : k.children) == null ? void 0 : z.length) === 2) {
3196
+ let q = Oe[X.id].children[0], F = Oe[X.id].children[1];
3197
+ q.style.width = (F.duration > 0 ? F.currentTime / F.duration : 0) * X.calculative.worldRect.width + "px";
3045
3198
  }
3046
3199
  }
3047
- if (X) {
3048
- const K = B.visibleLevel !== void 0 ? d >= B.visibleLevel : !0;
3049
- l.value._setValue({
3050
- id: B.id,
3051
- visible: K,
3052
- disabled: !K,
3053
- locked: K ? xe.None : xe.Disable
3200
+ if (M) {
3201
+ const q = X.visibleLevel !== void 0 ? l >= X.visibleLevel : !0;
3202
+ c.value._setValue({
3203
+ id: X.id,
3204
+ visible: q,
3205
+ disabled: !q,
3206
+ locked: q ? Pe.None : Pe.Disable
3054
3207
  });
3055
3208
  }
3056
3209
  }
3057
- l.value.render();
3058
- } catch (g) {
3059
- console.error("处理缩放失败:", g);
3210
+ c.value.render();
3211
+ } catch (H) {
3212
+ console.error("处理缩放失败:", H);
3060
3213
  }
3061
- }, 500), z = (R) => te(this, [R], function* ({ line: d, lineAnchor: f, pen: E }) {
3062
- var G;
3063
- if (f != null && f.start || (E == null ? void 0 : E.penType) !== b.GIS_SENSOR)
3064
- return;
3065
- const x = (G = d == null ? void 0 : d.calculative) == null ? void 0 : G.worldAnchors;
3066
- if (x.length !== 2 || x != null && x.some((N) => !N.connectTo))
3067
- return;
3068
- const [g, V] = x;
3069
- if (g.connectTo === V.connectTo)
3070
- return;
3071
- const X = window.meta2d.findOne(g.connectTo), se = window.meta2d.findOne(V.connectTo);
3072
- let B = X == null ? void 0 : X.bindData, K = se == null ? void 0 : se.bindData;
3073
- if (!B || !K)
3074
- return;
3075
- const J = yield ye.postPDApi("setchannelpaired/", {
3076
- data: [
3077
- {
3078
- channel1: B.guid,
3079
- channel2: K.guid
3080
- }
3081
- ]
3082
- }), Z = yield ye.postCommonApi("sgpoint", {
3083
- ln__in: `${B.guid},${K.guid}`,
3084
- group_number__in: 6
3085
- // 一次接线图配对时确认组号
3086
- });
3087
- J.success && Z.success ? (l.value.setValue({
3088
- id: d.id,
3089
- color: "#00d200",
3090
- lineDash: [3, 3],
3091
- lineWidth: 2,
3092
- lineType: "gisLine"
3093
- }), ie.success("配对成功")) : ie.error("配对失败", J.detail || Z.detail);
3214
+ }, 500), Te = (y) => ae(this, [y], function* ({ line: l, lineAnchor: h, pen: v }) {
3215
+ console.log("🚀 ~ handleConnectLine ~ line:", l), h != null && h.start || (v == null || v.penType, P.GIS_SENSOR);
3094
3216
  });
3095
- function de() {
3096
- return te(this, null, function* () {
3097
- if (!i.url)
3098
- return ie.error("图纸路径为空!"), null;
3217
+ function ke() {
3218
+ return ae(this, null, function* () {
3219
+ if (!r.url)
3220
+ return he.error("图纸路径为空!"), null;
3099
3221
  try {
3100
- return (yield ye.getGraphApi(i.url, {
3101
- local: i.local
3222
+ return (yield Ue.getGraphApi(r.url, {
3223
+ local: r.local
3102
3224
  })) || null;
3103
- } catch (d) {
3225
+ } catch (l) {
3104
3226
  return null;
3105
3227
  }
3106
3228
  });
3107
3229
  }
3108
- const he = () => {
3109
- l.value && (l.value.resize(), l.value.fitView(!0, 10));
3230
+ const De = () => {
3231
+ c.value && (c.value.resize(), c.value.fitView(!0, 10));
3110
3232
  };
3111
- return Wt(() => {
3112
- var d, f;
3113
- M.value && (d = o.value) != null && d.clientHeight && (f = o.value) != null && f.clientWidth && re(), window.addEventListener("resize", he);
3114
- }), Kt(() => {
3115
- var d;
3116
- ri(), ni(), ne && ((d = l.value) != null && d.canvas) && (l.value.canvas.getHover = ne, ne = null), document.removeEventListener("keydown", Ie, !0), l.value && (i.preview ? (Ta(), l.value.destroy(!0)) : (l.value.off("scale", U), l.value.off("active", ce), l.value.off("inactive", Ae))), window.removeEventListener("resize", he);
3233
+ return oa(() => {
3234
+ var l, h;
3235
+ Z.value && (l = s.value) != null && l.clientHeight && (h = s.value) != null && h.clientWidth && te(), window.addEventListener("resize", De);
3236
+ }), sa(() => {
3237
+ r.preview && Ga(), c.value && (c.value.off("scale", we), c.value.off("connectLine", Te), c.value.off("active", pe), c.value.off("inactive", Ee), c.value.off("resizePens", J)), L(), br(), document.removeEventListener("keydown", le, !0), window.removeEventListener("resize", De), ie = null, ce = null, re = null;
3117
3238
  }), e({
3118
- stage: l
3119
- }), (d, f) => {
3120
- const E = it("el-input-number");
3121
- return ue(), Ee("div", {
3239
+ stage: c
3240
+ }), (l, h) => {
3241
+ const v = gt("el-input-number");
3242
+ return ue(), xe("div", {
3122
3243
  ref_key: "meta2dRef",
3123
- ref: o,
3244
+ ref: s,
3124
3245
  class: "meta2d-editor"
3125
3246
  }, [
3126
- Fe(F) ? Ue("", !0) : (ue(), ze(di, {
3247
+ ze(K) ? je("", !0) : (ue(), et(Dr, {
3127
3248
  key: 0,
3128
3249
  class: "meta2d-empty",
3129
3250
  description: "图纸不存在"
3130
3251
  })),
3131
- v.value && !i.preview ? (ue(), Ee("div", ui, [
3132
- f[1] || (f[1] = me("span", { class: "move-step-label" }, "移动步长", -1)),
3133
- Me(E, {
3134
- modelValue: m.value,
3135
- "onUpdate:modelValue": f[0] || (f[0] = (R) => m.value = R),
3252
+ g.value && !r.preview ? (ue(), xe("div", Lr, [
3253
+ h[1] || (h[1] = ge("span", { class: "move-step-label" }, "移动步长", -1)),
3254
+ $e(v, {
3255
+ modelValue: f.value,
3256
+ "onUpdate:modelValue": h[0] || (h[0] = (y) => f.value = y),
3136
3257
  min: 0.1,
3137
3258
  max: 200,
3138
3259
  step: 0.5,
@@ -3141,17 +3262,17 @@ const ii = (n) => {
3141
3262
  "controls-position": "right",
3142
3263
  class: "move-step-input"
3143
3264
  }, null, 8, ["modelValue"]),
3144
- f[2] || (f[2] = me("span", { class: "move-step-tip" }, "方向键按步长移动", -1))
3145
- ])) : Ue("", !0)
3265
+ h[2] || (h[2] = ge("span", { class: "move-step-tip" }, "方向键按步长移动", -1))
3266
+ ])) : je("", !0)
3146
3267
  ], 512);
3147
3268
  };
3148
3269
  }
3149
- }), mi = /* @__PURE__ */ qe(hi, [["__scopeId", "data-v-bb512c48"]]), fi = {
3270
+ }), Mr = /* @__PURE__ */ ot(Or, [["__scopeId", "data-v-7453d72e"]]), Fr = {
3150
3271
  key: 0,
3151
3272
  class: "back-btn"
3152
3273
  };
3153
- var Gt, Ht;
3154
- const pi = /* @__PURE__ */ Object.assign({
3274
+ var aa, na;
3275
+ const Ur = /* @__PURE__ */ Object.assign({
3155
3276
  name: "Meta2dPreview"
3156
3277
  }, {
3157
3278
  __name: "index",
@@ -3175,22 +3296,22 @@ const pi = /* @__PURE__ */ Object.assign({
3175
3296
  // 图纸语言
3176
3297
  lang: {
3177
3298
  type: String,
3178
- default: ((Ht = (Gt = window.meta) == null ? void 0 : Gt.app) == null ? void 0 : Ht.lang) || "zh-cn"
3299
+ default: ((na = (aa = window.meta) == null ? void 0 : aa.app) == null ? void 0 : na.lang) || "zh-cn"
3179
3300
  },
3180
3301
  // 配置选项
3181
3302
  config: {
3182
3303
  type: Object,
3183
3304
  default: () => ({
3184
- socketUrl: pt,
3185
- stationIdKey: yt,
3305
+ socketUrl: Ct,
3306
+ stationIdKey: Dt,
3186
3307
  enableToken: !0,
3187
- userTokenKey: _t,
3308
+ userTokenKey: kt,
3188
3309
  userToken: void 0,
3189
3310
  messageDelay: 200,
3190
3311
  debounceDelay: 100,
3191
3312
  enableAutoFit: !0,
3192
3313
  enableWebSocket: !0,
3193
- graphSocket: ft.GRAPH.SOCKET
3314
+ graphSocket: St.GRAPH.SOCKET
3194
3315
  })
3195
3316
  },
3196
3317
  showMap: {
@@ -3208,11 +3329,11 @@ const pi = /* @__PURE__ */ Object.assign({
3208
3329
  // 外部依赖注入
3209
3330
  apiInstance: {
3210
3331
  type: Object,
3211
- default: () => ye
3332
+ default: () => Ue
3212
3333
  },
3213
3334
  mittInstance: {
3214
3335
  type: Object,
3215
- default: () => ot
3336
+ default: () => wt
3216
3337
  },
3217
3338
  // 自定义回调
3218
3339
  customCallbacks: {
@@ -3238,577 +3359,589 @@ const pi = /* @__PURE__ */ Object.assign({
3238
3359
  }
3239
3360
  },
3240
3361
  emits: ["error", "loaded", "custom-msg", "socket-msg", "view-history"],
3241
- setup(n, { expose: e, emit: t }) {
3242
- const a = t, i = n;
3243
- let r = Y(!1), o = Y(""), l = Y(""), m = Y(!1);
3244
- const v = Y(!1);
3245
- pa("isComponent", v);
3246
- const M = Y(null), F = Y(null), re = Y(null), q = Y(""), $ = Y(""), oe = Y(!1), O = Re(() => {
3247
- var s;
3248
- return (s = re.value) == null ? void 0 : s.stage;
3249
- }), fe = Re(() => {
3250
- var s;
3251
- return (s = O.value) == null ? void 0 : s.store;
3252
- }), ce = Re(() => c({
3253
- socketUrl: pt,
3254
- stationIdKey: yt,
3362
+ setup(a, { expose: e, emit: t }) {
3363
+ const n = t, r = a;
3364
+ let i = Q(!1), s = Q(""), c = Q(""), f = Q(!1);
3365
+ const g = Q(!1);
3366
+ Da("isComponent", g);
3367
+ const O = Q(null), U = Q(null), $ = Q(null), Z = Q(""), K = Q(""), te = Q(!1), L = Ge(() => {
3368
+ var o;
3369
+ return (o = $.value) == null ? void 0 : o.stage;
3370
+ }), W = Ge(() => {
3371
+ var o;
3372
+ return (o = L.value) == null ? void 0 : o.store;
3373
+ }), me = Ge(() => d({
3374
+ socketUrl: Ct,
3375
+ stationIdKey: Dt,
3255
3376
  enableToken: !0,
3256
- userTokenKey: _t,
3377
+ userTokenKey: kt,
3257
3378
  userToken: void 0,
3258
3379
  messageDelay: 200,
3259
3380
  debounceDelay: 100,
3260
3381
  enableAutoFit: !0,
3261
3382
  fitPadding: 10,
3262
3383
  enableWebSocket: !0,
3263
- graphSocket: ft.GRAPH.SOCKET
3264
- }, i.config)), Ae = () => i.apiInstance || ye, Ie = () => i.mittInstance || ot, ne = (s, u = "") => {
3265
- const _ = {
3266
- error: s,
3384
+ graphSocket: St.GRAPH.SOCKET
3385
+ }, r.config)), _e = () => r.apiInstance || Ue, Re = () => r.mittInstance || wt, re = (o, u = "") => {
3386
+ const w = {
3387
+ error: o,
3267
3388
  message: u,
3268
3389
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
3269
3390
  };
3270
- a("error", _), i.errorHandler.callback ? i.errorHandler.callback(_) : i.errorHandler.showMessage && ie && ie.error(`${u}: ${s.message || s}`);
3271
- }, Se = () => {
3272
- o.value ? ($.value = o.value, oe.value = m.value) : l.value && (q.value = l.value, K(q.value)), r.value = !1;
3273
- }, Q = {}, pe = Y(!1), U = Y({ left: 0, top: 0 }), z = Y(!1), de = () => {
3274
- z.value = !1, pe.value = !1, U.value = { left: 0, top: 0 }, x.value = {};
3275
- }, he = () => {
3276
- z.value = !0;
3277
- }, d = (s) => {
3278
- a("view-history", s);
3279
- }, f = (s, u) => {
3280
- if (!M.value)
3391
+ n("error", w), r.errorHandler.callback ? r.errorHandler.callback(w) : r.errorHandler.showMessage && he && he.error(`${u}: ${o.message || o}`);
3392
+ }, Ne = () => {
3393
+ s.value ? (K.value = s.value, te.value = f.value) : c.value && (Z.value = c.value, k(Z.value)), i.value = !1;
3394
+ }, J = {}, fe = Q(!1), G = Q({ left: 0, top: 0 }), ee = Q(!1), se = () => {
3395
+ ee.value = !1, fe.value = !1, G.value = { left: 0, top: 0 }, Ce.value = {};
3396
+ }, pe = () => {
3397
+ ee.value = !0;
3398
+ }, Ee = (o) => {
3399
+ n("view-history", o);
3400
+ }, le = (o, u) => {
3401
+ if (!O.value)
3281
3402
  return {
3282
- left: s + 20,
3403
+ left: o + 20,
3283
3404
  top: u + 20
3284
3405
  };
3285
- const _ = M.value.getBoundingClientRect(), P = s - _.left, D = u - _.top;
3286
- let S = 300, I = 150;
3287
- if (F.value) {
3288
- const y = F.value.$el || F.value;
3289
- y && y.offsetWidth && (S = y.offsetWidth, I = y.offsetHeight);
3406
+ const w = O.value.getBoundingClientRect(), R = o - w.left, x = u - w.top;
3407
+ let b = 300, E = 150;
3408
+ if (U.value) {
3409
+ const C = U.value.$el || U.value;
3410
+ C && C.offsetWidth && (b = C.offsetWidth, E = C.offsetHeight);
3290
3411
  }
3291
- let p = P + 20, T = D + 20;
3292
- return p + S > _.width && (p = P - S - 20), T + I > _.height && (T = D - I - 20), {
3293
- left: Math.max(0, Math.min(p, _.width - S)),
3294
- top: Math.max(0, Math.min(T, _.height - I))
3412
+ let m = R + 20, I = x + 20;
3413
+ return m + b > w.width && (m = R - b - 20), I + E > w.height && (I = x - E - 20), {
3414
+ left: Math.max(0, Math.min(m, w.width - b)),
3415
+ top: Math.max(0, Math.min(I, w.height - E))
3295
3416
  };
3296
- }, E = (s) => {
3297
- pe.value && (U.value.left || (U.value = f(s.clientX, s.clientY)));
3298
- }, R = (s) => {
3299
- var u, _, P, D, S, I;
3417
+ }, ie = (o) => {
3418
+ fe.value && (G.value.left || (G.value = le(o.clientX, o.clientY)));
3419
+ }, ce = (o) => {
3420
+ var u, w, R, x, b, E;
3300
3421
  try {
3301
- if (!s) return;
3302
- if ((u = s == null ? void 0 : s.includes) != null && u.call(s, "token 必传"))
3303
- return ie.warning(s);
3304
- const p = typeof s == "string" ? JSON.parse(s) : s;
3305
- if ((p == null ? void 0 : p.data) === "服务错误" || (P = (_ = p == null ? void 0 : p.data) == null ? void 0 : _.includes) != null && P.call(_, "token is expired"))
3306
- return ie.warning(p.data);
3307
- switch (a("socket-msg", p), p.action) {
3308
- case Je.ACPOINT.YCVALUE:
3309
- case Je.ACPOINT.YXVALUE:
3310
- if ((D = p == null ? void 0 : p.data) != null && D.point_id) {
3311
- const T = O.value.find(p.data.point_id);
3312
- T && (Q[p.data.point_id] = p.action === Je.ACPOINT.YXVALUE ? We(p.data.value) ? p.data.value : 0 : We(p.data.value_disp || p.data.value) ? p.data.value_disp || p.data.value : 0, He(T, p.data));
3422
+ if (!o) return;
3423
+ if ((u = o == null ? void 0 : o.includes) != null && u.call(o, "token 必传"))
3424
+ return he.warning(o);
3425
+ const m = typeof o == "string" ? JSON.parse(o) : o;
3426
+ if ((m == null ? void 0 : m.data) === "服务错误" || (R = (w = m == null ? void 0 : m.data) == null ? void 0 : w.includes) != null && R.call(w, "token is expired"))
3427
+ return he.warning(m.data);
3428
+ switch (n("socket-msg", m), m.action) {
3429
+ case dt.ACPOINT.YCVALUE:
3430
+ case dt.ACPOINT.YXVALUE:
3431
+ if ((x = m == null ? void 0 : m.data) != null && x.point_id) {
3432
+ const I = L.value.find(m.data.point_id);
3433
+ I && (J[m.data.point_id] = m.action === dt.ACPOINT.YXVALUE ? Qe(m.data.value) ? m.data.value : 0 : Qe(m.data.value_disp || m.data.value) ? m.data.value_disp || m.data.value : 0, F(I, m.data));
3313
3434
  }
3314
3435
  break;
3315
3436
  default:
3316
- if (((S = p.data) == null ? void 0 : S.length) > 0) {
3317
- const T = setTimeout(() => {
3318
- clearTimeout(T), O.value && (p.data.forEach((y) => {
3319
- Q[y.dataId || y.point_id] = y.value_disp || y.value;
3320
- }), p.data.forEach((y) => {
3321
- const C = O.value.find(y.dataId || y.point_id);
3322
- He(C, y);
3437
+ if (((b = m.data) == null ? void 0 : b.length) > 0) {
3438
+ const I = setTimeout(() => {
3439
+ clearTimeout(I), L.value && (m.data.forEach((C) => {
3440
+ J[C.dataId || C.point_id] = C.value_disp || C.value;
3441
+ }), m.data.forEach((C) => {
3442
+ const S = L.value.find(C.dataId || C.point_id);
3443
+ F(S, C);
3323
3444
  }));
3324
- }, ce.value.messageDelay);
3325
- i.customCallbacks.onWebSocketMessage && i.customCallbacks.onWebSocketMessage(p), (I = window.customSocketFn) == null || I.call(window, s);
3445
+ }, me.value.messageDelay);
3446
+ r.customCallbacks.onWebSocketMessage && r.customCallbacks.onWebSocketMessage(m), (E = window.customSocketFn) == null || E.call(window, o);
3326
3447
  }
3327
3448
  break;
3328
3449
  }
3329
3450
  return !0;
3330
- } catch (p) {
3331
- return ne(p, "WebSocket消息处理"), !0;
3451
+ } catch (m) {
3452
+ return re(m, "WebSocket消息处理"), !0;
3332
3453
  }
3333
- }, x = Y({});
3334
- let g = {}, V = null;
3335
- const X = (s) => te(this, null, function* () {
3454
+ }, Ce = Q({});
3455
+ let oe = {}, ve = null, we = null, Te = null;
3456
+ const ke = /* @__PURE__ */ new Set(), De = /* @__PURE__ */ new Map(), l = (o) => ae(this, null, function* () {
3336
3457
  try {
3337
- if (s.msgName)
3338
- switch (s.msgName) {
3339
- case ae.CHANGE_GRAPH:
3340
- case ae.NOTIFY_DIALOG:
3341
- case ae.GIS_PROPS_PANEL:
3342
- se(s);
3458
+ if (o.msgName)
3459
+ switch (o.msgName) {
3460
+ case ne.CHANGE_GRAPH:
3461
+ case ne.NOTIFY_DIALOG:
3462
+ case ne.GIS_PROPS_PANEL:
3463
+ h(o);
3343
3464
  break;
3344
3465
  }
3345
3466
  else
3346
- se(s);
3347
- a("custom-msg", s), i.customCallbacks.onCustomMessage && i.customCallbacks.onCustomMessage(s);
3467
+ h(o);
3468
+ n("custom-msg", o), r.customCallbacks.onCustomMessage && r.customCallbacks.onCustomMessage(o);
3348
3469
  } catch (u) {
3349
- ne(u, "自定义消息处理");
3470
+ re(u, "自定义消息处理");
3350
3471
  }
3351
- }), se = (s) => {
3352
- var P, D;
3472
+ }), h = (o) => {
3473
+ var R, x, b, E;
3353
3474
  let u;
3354
- if (s.params)
3475
+ if (o.params)
3355
3476
  try {
3356
- u = JSON.parse(s.params);
3357
- } catch (S) {
3358
- u = s.params;
3477
+ u = JSON.parse(o.params);
3478
+ } catch (m) {
3479
+ u = o.params;
3359
3480
  }
3360
- switch (s.msgName) {
3361
- case ae.CHANGE_GRAPH:
3362
- (u == null ? void 0 : u.data) !== "图纸id" && (u != null && u.data) ? (o.value = $.value, m.value = oe.value, r.value = u.isBack, (P = u == null ? void 0 : u.data) != null && P.startsWith("/") ? ($.value = u == null ? void 0 : u.data, oe.value = !0) : (oe.value = !1, l.value = K(u.data))) : u ? (oe.value = !1, l.value = q.value, r.value = !0, K(u)) : console.warn("切换图纸信息为空");
3481
+ switch (o.msgName) {
3482
+ case ne.CHANGE_GRAPH:
3483
+ (u == null ? void 0 : u.data) !== "图纸id" && (u != null && u.data) ? (s.value = K.value, f.value = te.value, i.value = u.isBack, (R = u == null ? void 0 : u.data) != null && R.startsWith("/") ? (K.value = u == null ? void 0 : u.data, te.value = !0) : (te.value = !1, c.value = k(u.data))) : u ? (te.value = !1, c.value = Z.value, i.value = !0, k(u)) : console.warn("切换图纸信息为空");
3363
3484
  break;
3364
- case ae.NOTIFY_DIALOG:
3365
- u.msg !== "通知内容" ? Ia(c({
3485
+ case ne.NOTIFY_DIALOG:
3486
+ u != null && u.msg && u.msg !== "通知内容" ? Ua(d({
3366
3487
  message: u.msg
3367
3488
  }, u)) : console.warn("通知内容为空");
3368
3489
  break;
3369
- case ae.GIS_PROPS_PANEL:
3370
- s.eventName === "enter" ? (pe.value = !0, s.pen.penType === b.GIS_SENSOR ? x.value = ((D = s == null ? void 0 : s.pen) == null ? void 0 : D.bindData) || {} : s.pen.penType === b.GIS_SENSOR_WRAPPER && s.pen.children.forEach((S) => {
3371
- const I = O.value.findOne(S);
3372
- I && I.penType === b.GIS_SENSOR && (x.value = I.bindData || {});
3373
- }), s.e && (U.value = f(s.e.clientX, s.e.clientY))) : setTimeout(() => {
3374
- z.value || (pe.value = !1, U.value = { left: 0, top: 0 }, x.value = {});
3375
- }, 200);
3490
+ case ne.GIS_PROPS_PANEL:
3491
+ o.eventName === "enter" ? (fe.value = !0, o.pen.penType === P.GIS_SENSOR ? Ce.value = ((x = o == null ? void 0 : o.pen) == null ? void 0 : x.bindData) || {} : o.pen.penType === P.GIS_SENSOR_WRAPPER && ((E = (b = o.pen) == null ? void 0 : b.children) == null || E.forEach((m) => {
3492
+ const I = L.value.findOne(m);
3493
+ I && I.penType === P.GIS_SENSOR && (Ce.value = I.bindData || {});
3494
+ })), o.e && (G.value = le(o.e.clientX, o.e.clientY))) : (clearTimeout(we), we = setTimeout(() => {
3495
+ ee.value || (fe.value = !1, G.value = { left: 0, top: 0 }, Ce.value = {});
3496
+ }, 200));
3376
3497
  break;
3377
3498
  }
3378
- }, B = (s) => {
3379
- var u, _, P, D, S, I, p, T, y;
3499
+ }, v = (o) => {
3500
+ o != null && o.on && (y(o), Object.values(ne).forEach((u) => {
3501
+ const w = (R) => {
3502
+ l(D(d({}, R), { msgName: u }));
3503
+ };
3504
+ De.set(u, w), o.on(u, w);
3505
+ }));
3506
+ }, y = (o) => {
3507
+ o != null && o.off && (De.forEach((u, w) => {
3508
+ o.off(w, u);
3509
+ }), De.clear());
3510
+ }, T = (o) => {
3511
+ var u, w, R, x, b, E, m, I, C;
3380
3512
  try {
3381
- a("loaded", s);
3382
- const C = tt(), h = ce.value, w = vt.getSession(h.stationIdKey), j = vt.getSession(h.userTokenKey);
3383
- h.enableWebSocket && w && j && ((P = (_ = (u = s.store) == null ? void 0 : u.data) == null ? void 0 : _.networks) != null && P.length ? (I = (S = (D = s.store) == null ? void 0 : D.data) == null ? void 0 : S.networks) == null || I.forEach((ee) => {
3384
- var Te;
3385
- ee.protocol === "websocket" && ((Te = ee.url) != null && Te.includes("station_id") || (ee.url = `${ee.url}?station_id=${w}`), h.enableToken ? ee.protocols = h.userToken || j : ee.protocols = void 0);
3386
- }) : (T = (p = s.store) == null ? void 0 : p.data) != null && T.websocket ? ((y = s.store.data.websocket) != null && y.includes("station_id") || (s.store.data.websocket = `${s.store.data.websocket}?station_id=${w}`), h.enableToken ? s.store.data.websocketProtocols = h.userToken || j : s.store.data.websocketProtocols = void 0, s.closeSocket(), s.connectSocket()) : (s.store.data.websocket = `${h.socketUrl}?station_id=${w}`, h.enableToken ? s.store.data.websocketProtocols = j : s.store.data.websocketProtocols = void 0, s.connectWebsocket())), (i.showMap || C.showMap === "true") && s.showMap(), s.setRule({ rule: !1 }), s.setOptions({ disableRuleLine: !0 }), s.setGrid({ grid: !1 }), s.lock(xe.DisableEdit), ve().forEach((ee) => {
3387
- var Te;
3388
- (Te = ee == null ? void 0 : ee.events) != null && Te.length ? N({ id: ee.id, locked: 1 }, !1) : N({ id: ee.id, locked: 10 }, !1);
3389
- }), s.render(), h.enableAutoFit && s.fitView(!0, h.fitPadding), Object.values(ae).forEach((ee) => {
3390
- s.on(
3391
- ee,
3392
- (Te) => X(k(c({}, Te), {
3393
- msgName: ee
3394
- }))
3395
- );
3396
- }), s && (s.socketFn = R), i.customCallbacks.onStageLoaded && i.customCallbacks.onStageLoaded(s), i.isInitData && Z(s), window.addEventListener("mousemove", E);
3397
- } catch (C) {
3398
- ne(C, "图纸加载完成处理");
3513
+ n("loaded", o);
3514
+ const S = mt(), p = me.value, _ = at.getSession(p.stationIdKey), V = at.getSession(p.userTokenKey);
3515
+ p.enableWebSocket && _ && V && ((R = (w = (u = o.store) == null ? void 0 : u.data) == null ? void 0 : w.networks) != null && R.length ? (E = (b = (x = o.store) == null ? void 0 : x.data) == null ? void 0 : b.networks) == null || E.forEach((de) => {
3516
+ var Be;
3517
+ de.protocol === "websocket" && ((Be = de.url) != null && Be.includes("station_id") || (de.url = `${de.url}?station_id=${_}`), p.enableToken ? de.protocols = p.userToken || V : de.protocols = void 0);
3518
+ }) : (I = (m = o.store) == null ? void 0 : m.data) != null && I.websocket ? ((C = o.store.data.websocket) != null && C.includes("station_id") || (o.store.data.websocket = `${o.store.data.websocket}?station_id=${_}`), p.enableToken ? o.store.data.websocketProtocols = p.userToken || V : o.store.data.websocketProtocols = void 0, o.closeSocket(), o.connectSocket()) : (o.store.data.websocket = `${p.socketUrl}?station_id=${_}`, p.enableToken ? o.store.data.websocketProtocols = V : o.store.data.websocketProtocols = void 0, o.connectWebsocket())), (r.showMap || S.showMap === "true") && o.showMap(), o.setRule({ rule: !1 }), o.setOptions({ disableRuleLine: !0 }), o.setGrid({ grid: !1 }), o.lock(Pe.DisableEdit), X().forEach((de) => {
3519
+ var Be;
3520
+ (Be = de == null ? void 0 : de.events) != null && Be.length ? M({ id: de.id, locked: 1 }, !1) : M({ id: de.id, locked: 10 }, !1);
3521
+ }), o.render(), p.enableAutoFit && o.fitView(!0, p.fitPadding), v(o), o && (o.socketFn = ce), r.customCallbacks.onStageLoaded && r.customCallbacks.onStageLoaded(o), r.isInitData && H(o), window.addEventListener("mousemove", ie);
3522
+ } catch (S) {
3523
+ re(S, "图纸加载完成处理");
3399
3524
  }
3400
- }, K = Yt((s) => te(this, null, function* () {
3525
+ }, k = da((o) => ae(this, null, function* () {
3401
3526
  var u;
3402
3527
  try {
3403
- if (window.isFactory = i.isFactory, i.url) {
3404
- oe.value = i.local, $.value = i.url;
3528
+ if (window.isFactory = r.isFactory, r.url) {
3529
+ te.value = r.local, K.value = r.url;
3405
3530
  return;
3406
3531
  }
3407
- const _ = tt();
3408
- if (s = s || i.gid || _.id, _.local === "true" && (oe.value = !0), s) {
3409
- const P = Ae();
3410
- if (P && P.getCommonApi) {
3411
- const D = yield P.getCommonApi(i.isFactory ? "graph" : "floorplan", { guid: s });
3412
- if ((u = D.data) != null && u.length)
3413
- yield J(D.data[0].path);
3532
+ const w = mt();
3533
+ if (o = o || r.gid || w.id, w.local === "true" && (te.value = !0), o) {
3534
+ const R = _e();
3535
+ if (R && R.getCommonApi) {
3536
+ const x = yield R.getCommonApi(r.isFactory ? "graph" : "floorplan", { guid: o });
3537
+ if ((u = x.data) != null && u.length)
3538
+ yield z(x.data[0].path);
3414
3539
  else {
3415
- const S = "未找到图纸!";
3416
- ne(new Error(S), "获取图纸数据");
3540
+ const b = "未找到图纸!";
3541
+ re(new Error(b), "获取图纸数据");
3417
3542
  }
3418
3543
  } else
3419
- ne(new Error("API实例不可用"), "初始化图纸数据!");
3544
+ re(new Error("API实例不可用"), "初始化图纸数据!");
3420
3545
  } else
3421
- oe.value = i.local, yield J(i.url);
3422
- i.customCallbacks.onGraphLoaded && i.customCallbacks.onGraphLoaded($.value);
3423
- } catch (_) {
3424
- ne(_, "获取图纸数据失败");
3546
+ te.value = r.local, yield z(r.url);
3547
+ r.customCallbacks.onGraphLoaded && r.customCallbacks.onGraphLoaded(K.value);
3548
+ } catch (w) {
3549
+ re(w, "获取图纸数据失败");
3550
+ }
3551
+ })), z = (o) => ae(this, null, function* () {
3552
+ if (!o) {
3553
+ K.value = "";
3554
+ return;
3425
3555
  }
3426
- })), J = (s) => te(this, null, function* () {
3427
- const u = s.split(".");
3428
- if (s.includes(i.lang) || u.length !== 3) {
3429
- $.value = s;
3556
+ const u = o.split(".");
3557
+ if (o.includes(r.lang) || u.length !== 3) {
3558
+ K.value = o;
3430
3559
  return;
3431
3560
  }
3432
- const _ = `${u[0]}.${i.lang}.${u[2]}`;
3561
+ const w = `${u[0]}.${r.lang}.${u[2]}`;
3433
3562
  try {
3434
- const P = yield ye.getGraphApi(_, { local: i.local }).catch(() => {
3563
+ const R = yield Ue.getGraphApi(w, { local: r.local }).catch(() => {
3435
3564
  console.warn("多语言图纸不存在,使用默认图纸");
3436
3565
  });
3437
- $.value = P ? _ : s;
3438
- } catch (P) {
3439
- $.value = s;
3566
+ K.value = R ? w : o;
3567
+ } catch (R) {
3568
+ K.value = o;
3440
3569
  }
3441
- }), Z = (s) => te(this, null, function* () {
3442
- var u, _, P, D;
3443
- if (s) {
3444
- let S = [], I = [], p = [];
3445
- g = {};
3446
- const T = s.store.data.pens;
3447
- for (let C = 0; C < T.length; C++) {
3448
- const h = T[C];
3449
- h.bindDataId ? (u = h.form) != null && u.length ? h.form.forEach((w) => {
3450
- if (w.dataIds.dataId)
3451
- switch (w.dataIds.dataType) {
3452
- case H.YC:
3453
- S.push(k(c({}, w), {
3454
- nodeName: w.dataIds.name,
3455
- penId: h.id,
3456
- penName: h.penName
3570
+ }), H = (o) => ae(this, null, function* () {
3571
+ var u, w, R, x;
3572
+ if (o) {
3573
+ let b = [], E = [], m = [];
3574
+ oe = {};
3575
+ const I = o.store.data.pens;
3576
+ for (let S = 0; S < I.length; S++) {
3577
+ const p = I[S];
3578
+ p.bindDataId ? (u = p.form) != null && u.length ? p.form.forEach((_) => {
3579
+ if (_.dataIds.dataId)
3580
+ switch (_.dataIds.dataType) {
3581
+ case Y.YC:
3582
+ b.push(D(d({}, _), {
3583
+ nodeName: _.dataIds.name,
3584
+ penId: p.id,
3585
+ penName: p.penName
3457
3586
  }));
3458
3587
  break;
3459
- case H.YX:
3460
- I.push(k(c({}, w), {
3461
- nodeName: w.dataIds.name,
3462
- penId: h.id,
3463
- penName: h.penName
3588
+ case Y.YX:
3589
+ E.push(D(d({}, _), {
3590
+ nodeName: _.dataIds.name,
3591
+ penId: p.id,
3592
+ penName: p.penName
3464
3593
  }));
3465
3594
  break;
3466
- case H.SG:
3467
- I.push(k(c({}, w), {
3468
- nodeName: w.dataIds.name,
3469
- penId: h.id,
3470
- penName: h.penName
3595
+ case Y.SG:
3596
+ E.push(D(d({}, _), {
3597
+ nodeName: _.dataIds.name,
3598
+ penId: p.id,
3599
+ penName: p.penName
3471
3600
  }));
3472
3601
  break;
3473
- case H.POINT:
3474
- p.push(k(c({}, w), {
3475
- nodeName: w.dataIds.name,
3476
- penId: h.id,
3477
- penName: h.penName
3602
+ case Y.POINT:
3603
+ m.push(D(d({}, _), {
3604
+ nodeName: _.dataIds.name,
3605
+ penId: p.id,
3606
+ penName: p.penName
3478
3607
  }));
3479
3608
  break;
3480
3609
  }
3481
- }) : (h.penType === b.GIS_SENSOR || h.penType === b.GIS_DB_VALUE) && h.bindData && (g[h.bindData.ied_id] || (g[h.bindData.ied_id] = []), N({
3482
- id: h.id,
3610
+ }) : (p.penType === P.GIS_SENSOR || p.penType === P.GIS_DB_VALUE) && p.bindData && (oe[p.bindData.ied_id] || (oe[p.bindData.ied_id] = []), M({
3611
+ id: p.id,
3483
3612
  title: void 0
3484
- }), g[h.bindData.ied_id].push(c({
3485
- penId: h.id,
3486
- penType: h.penType
3487
- }, h.bindData))) : (_ = h.statusBindData) != null && _.length && h.statusBindData.forEach((w) => {
3488
- if (w.dataId)
3489
- switch (w.dataType) {
3490
- case H.YX:
3491
- I.push({
3613
+ }), oe[p.bindData.ied_id].push(d({
3614
+ penId: p.id,
3615
+ penType: p.penType
3616
+ }, p.bindData))) : (w = p.statusBindData) != null && w.length && p.statusBindData.forEach((_) => {
3617
+ if (_.dataId)
3618
+ switch (_.dataType) {
3619
+ case Y.YX:
3620
+ E.push({
3492
3621
  showChild: 0,
3493
3622
  value: 0,
3494
- nodeName: w.dataName,
3495
- penId: h.id,
3496
- penName: h.penName,
3497
- dataId: w.dataId
3623
+ nodeName: _.dataName,
3624
+ penId: p.id,
3625
+ penName: p.penName,
3626
+ dataId: _.dataId
3498
3627
  });
3499
3628
  break;
3500
- case H.SG:
3501
- I.push({
3629
+ case Y.SG:
3630
+ E.push({
3502
3631
  showChild: 0,
3503
3632
  value: 0,
3504
- nodeName: w.dataName,
3505
- penId: h.id,
3506
- penName: h.penName,
3507
- dataId: w.dataId
3633
+ nodeName: _.dataName,
3634
+ penId: p.id,
3635
+ penName: p.penName,
3636
+ dataId: _.dataId
3508
3637
  });
3509
3638
  break;
3510
3639
  }
3511
3640
  });
3512
3641
  }
3513
- let y = [];
3514
- if (S.length) {
3515
- const C = Ae();
3516
- if (C && C.postCommonApi) {
3517
- const h = yield C.postCommonApi("queryrealtimepoint", {
3518
- point_id: S.map((w) => {
3519
- var j;
3520
- return ((j = w == null ? void 0 : w.dataIds) == null ? void 0 : j.dataId) || w.dataId;
3642
+ let C = [];
3643
+ if (b.length) {
3644
+ const S = _e();
3645
+ if (S && S.postCommonApi) {
3646
+ const p = yield S.postCommonApi("queryrealtimepoint", {
3647
+ point_id: b.map((_) => {
3648
+ var V;
3649
+ return ((V = _ == null ? void 0 : _.dataIds) == null ? void 0 : V.dataId) || _.dataId;
3521
3650
  }).join(",")
3522
3651
  });
3523
- (P = h == null ? void 0 : h.data) != null && P.length && (h.data.forEach((w) => {
3524
- Q[w.guid] = w.value_disp || w.value;
3525
- }), y = [...y, ...h.data]);
3652
+ (R = p == null ? void 0 : p.data) != null && R.length && (p.data.forEach((_) => {
3653
+ J[_.guid] = _.value_disp || _.value;
3654
+ }), C = [...C, ...p.data]);
3526
3655
  }
3527
3656
  }
3528
- if (I.length) {
3529
- const C = Ae();
3530
- if (C && C.postCommonApi) {
3531
- const h = yield C.postCommonApi("queryrealtimepoint", {
3532
- point_id: I.map((w) => {
3533
- var j;
3534
- return ((j = w == null ? void 0 : w.dataIds) == null ? void 0 : j.dataId) || w.dataId;
3657
+ if (E.length) {
3658
+ const S = _e();
3659
+ if (S && S.postCommonApi) {
3660
+ const p = yield S.postCommonApi("queryrealtimepoint", {
3661
+ point_id: E.map((_) => {
3662
+ var V;
3663
+ return ((V = _ == null ? void 0 : _.dataIds) == null ? void 0 : V.dataId) || _.dataId;
3535
3664
  }).join(",")
3536
3665
  });
3537
- (D = h == null ? void 0 : h.data) != null && D.length && (h.data.forEach((w) => {
3538
- Q[w.guid] = et(w.value) ? Number(w.value) : w.value;
3539
- }), y = [...y, ...h.data]);
3666
+ (x = p == null ? void 0 : p.data) != null && x.length && (p.data.forEach((_) => {
3667
+ J[_.guid] = ht(_.value) ? Number(_.value) : _.value;
3668
+ }), C = [...C, ...p.data]);
3540
3669
  }
3541
3670
  }
3542
- y.length && y.forEach((C) => {
3543
- const h = s.find(C.guid);
3544
- He(h, k(c({}, C), {
3545
- value: et(C.value) ? We(Number(C.value)) ? Number(C.value) : 0 : C.value,
3546
- value_disp: C.value_disp,
3547
- alarm_value: C.alarm_value,
3548
- point_id: C.guid
3671
+ C.length && C.forEach((S) => {
3672
+ const p = o.find(S.guid);
3673
+ F(p, D(d({}, S), {
3674
+ value: ht(S.value) ? Qe(Number(S.value)) ? Number(S.value) : 0 : S.value,
3675
+ value_disp: S.value_disp,
3676
+ alarm_value: S.alarm_value,
3677
+ point_id: S.guid
3549
3678
  }));
3550
- }), g && Object.keys(g).length ? (V && clearInterval(V), G(), V = setInterval(() => {
3551
- G();
3552
- }, 3e3)) : V && clearInterval(V);
3679
+ }), oe && Object.keys(oe).length ? (ve && clearInterval(ve), N(), ve = setInterval(() => {
3680
+ N();
3681
+ }, 3e3)) : ve && clearInterval(ve);
3553
3682
  }
3554
- }), G = () => te(this, null, function* () {
3555
- var s;
3556
- if (g) {
3557
- const u = Object.keys(g);
3558
- if (u.length) {
3559
- const _ = yield ye.postPDApi("querychannelstatus/", {
3560
- data: u.map((P) => ({
3561
- ied_id: P,
3562
- ln_list: g[P].map((D) => D.ln_id)
3563
- }))
3564
- });
3565
- (s = _ == null ? void 0 : _.data) != null && s.length && (u.forEach((P) => {
3566
- const D = _.data.find((I) => I.ied_id === P), S = g[P];
3567
- S != null && S.length && S.forEach((I) => {
3568
- const p = D.result.find((T) => T.ln_id === I.ln_id);
3569
- if (p) {
3570
- const T = et(p.amp_peak) ? We(Number(p.amp_peak)) ? Number(p.amp_peak) : 0 : p.amp_peak;
3571
- I.penType === b.GIS_SENSOR ? N(
3572
- {
3573
- id: I.penId,
3574
- showChild: p.status === "告警" ? 2 : p.status === "正常" ? 1 : 0,
3575
- bindData: k(c({}, I), {
3576
- name: p.name || I.name,
3577
- status: p.status,
3578
- value: T
3579
- })
3580
- },
3581
- !1
3582
- ) : N(
3583
- {
3584
- id: I.penId,
3585
- text: `${T} dBm`
3586
- },
3587
- !1
3588
- );
3589
- }
3683
+ }), N = () => ae(this, null, function* () {
3684
+ var o;
3685
+ try {
3686
+ if (oe) {
3687
+ const u = Object.keys(oe);
3688
+ if (u.length) {
3689
+ const w = yield Ue.postPDApi("querychannelstatus/", {
3690
+ data: u.map((R) => ({
3691
+ ied_id: R,
3692
+ ln_list: oe[R].map((x) => x.ln_id)
3693
+ }))
3590
3694
  });
3591
- }), O.value.render());
3695
+ (o = w == null ? void 0 : w.data) != null && o.length && (u.forEach((R) => {
3696
+ const x = w.data.find((E) => E.ied_id === R), b = oe[R];
3697
+ b != null && b.length && b.forEach((E) => {
3698
+ var I;
3699
+ const m = (I = x == null ? void 0 : x.result) == null ? void 0 : I.find((C) => C.ln_id === E.ln_id);
3700
+ if (m) {
3701
+ const C = ht(m.amp_peak) ? Qe(Number(m.amp_peak)) ? Number(m.amp_peak) : 0 : m.amp_peak;
3702
+ E.penType === P.GIS_SENSOR ? M(
3703
+ {
3704
+ id: E.penId,
3705
+ showChild: m.status === "告警" ? 2 : m.status === "正常" ? 1 : 0,
3706
+ bindData: D(d({}, E), {
3707
+ name: m.name || E.name,
3708
+ status: m.status,
3709
+ value: C
3710
+ })
3711
+ },
3712
+ !1
3713
+ ) : M(
3714
+ {
3715
+ id: E.penId,
3716
+ text: `${C} dBm`
3717
+ },
3718
+ !1
3719
+ );
3720
+ }
3721
+ });
3722
+ }), L.value.render());
3723
+ }
3592
3724
  }
3725
+ } catch (u) {
3726
+ console.warn("局放状态获取失败", u);
3593
3727
  }
3594
- }), N = (s, u = !0) => {
3595
- if (O.value)
3596
- return O.value.setValue(s, { render: u });
3597
- }, ge = () => O.value, ve = () => {
3598
- var s, u;
3599
- return ((u = (s = fe.value) == null ? void 0 : s.data) == null ? void 0 : u.pens) || [];
3600
- }, Ge = () => b, He = /* @__PURE__ */ (() => {
3601
- let s = null;
3602
- const u = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), P = (S) => {
3603
- var p;
3604
- if (!((p = S.children) != null && p.length)) return [];
3605
- const I = S.id || "";
3606
- if (!I) return [];
3607
- if (!_.has(I) && fe.value) {
3608
- const T = Pa(S, fe.value);
3609
- _.set(I, T);
3728
+ }), M = (o, u = !0) => {
3729
+ if (L.value)
3730
+ return L.value.setValue(o, { render: u });
3731
+ }, Ie = () => L.value, X = () => {
3732
+ var o, u;
3733
+ return ((u = (o = W.value) == null ? void 0 : o.data) == null ? void 0 : u.pens) || [];
3734
+ }, q = () => P, F = /* @__PURE__ */ (() => {
3735
+ const o = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), w = (x) => {
3736
+ var E;
3737
+ if (!((E = x.children) != null && E.length)) return [];
3738
+ const b = x.id || "";
3739
+ if (!b) return [];
3740
+ if (!u.has(b) && W.value) {
3741
+ const m = Wa(x, W.value);
3742
+ u.set(b, m);
3610
3743
  }
3611
- return _.get(I) || [];
3612
- }, D = () => {
3613
- if (u.size === 0 || !O.value || !fe.value) return;
3614
- const S = [], I = [], p = fe.value.animates;
3615
- u.forEach(({ pen: T, dataItem: y, formKey: C }) => {
3744
+ return u.get(b) || [];
3745
+ }, R = () => {
3746
+ if (o.size === 0 || !L.value || !W.value) return;
3747
+ const x = [], b = [], E = W.value.animates;
3748
+ o.forEach(({ pen: m, dataItem: I, formKey: C }) => {
3616
3749
  switch (C) {
3617
3750
  case "showChild":
3618
- N({ id: T.id, showChild: +y.value }, !1);
3751
+ M({ id: m.id, showChild: +I.value }, !1);
3619
3752
  break;
3620
3753
  case "text":
3621
- N({ id: T.id, text: y.value_disp || y.value }, !1);
3754
+ M({ id: m.id, text: I.value_disp || I.value }, !1);
3622
3755
  break;
3623
3756
  case "light_plate":
3624
3757
  {
3625
- const h = y.value === -1 || wt(y) ? "#999999" : na[y.value !== void 0 ? y.value : y.alarm_value], w = y.value === -1 || wt(y) ? "#cccccc" : aa[y.value !== void 0 ? y.value : y.alarm_value];
3626
- N({ id: T.id, textColor: h, background: w }, !1);
3758
+ const S = I.value === -1 || Nt(I) ? "#999999" : Ea[I.value !== void 0 ? I.value : I.alarm_value], p = I.value === -1 || Nt(I) ? "#cccccc" : _a[I.value !== void 0 ? I.value : I.alarm_value];
3759
+ M({ id: m.id, textColor: S, background: p }, !1);
3627
3760
  }
3628
3761
  break;
3629
3762
  case "point_value":
3630
- T.penType === b.POINT_VALUE && P(T).forEach((w) => {
3631
- w.name === "text" && N({ id: w.id, text: y.value }, !1);
3763
+ m.penType === P.POINT_VALUE && w(m).forEach((p) => {
3764
+ p.name === "text" && M({ id: p.id, text: I.value }, !1);
3632
3765
  });
3633
3766
  break;
3634
3767
  case "online_state":
3635
3768
  {
3636
- let h = y.value ? void 0 : "contrast(0%)";
3637
- N({ id: T.id, filter: h }, !1), P(T).forEach((j) => {
3638
- N({ id: j.id, filter: h }, !1);
3769
+ let S = I.value ? void 0 : "contrast(0%)";
3770
+ M({ id: m.id, filter: S }, !1), w(m).forEach((_) => {
3771
+ M({ id: _.id, filter: S }, !1);
3639
3772
  });
3640
3773
  }
3641
3774
  break;
3642
3775
  case "charged_state":
3643
3776
  {
3644
- const h = y.value === Ya.OFFLINE ? "contrast(0%)" : void 0;
3645
- h !== T.filter && (N({ id: T.id, filter: h }, !1), P(T).forEach((j) => {
3646
- N({ id: j.id, filter: h }, !1);
3777
+ const S = I.value === sn.OFFLINE ? "contrast(0%)" : void 0;
3778
+ S !== m.filter && (M({ id: m.id, filter: S }, !1), w(m).forEach((_) => {
3779
+ M({ id: _.id, filter: S }, !1);
3647
3780
  }));
3648
3781
  }
3649
3782
  break;
3650
3783
  case "electric_direction":
3651
- y.value === $a.STOP ? p != null && p.has(T) && I.push(T) : !!y.value !== T.animateReverse && (N(
3784
+ I.value === ln.STOP ? E != null && E.has(m) && b.push(m) : !!I.value !== m.animateReverse && (M(
3652
3785
  {
3653
- id: T.id,
3654
- animateReverse: !!y.value
3786
+ id: m.id,
3787
+ animateReverse: !!I.value
3655
3788
  },
3656
3789
  !1
3657
- ), p != null && p.has(T) || S.push(T));
3790
+ ), E != null && E.has(m) || x.push(m));
3658
3791
  break;
3659
3792
  case "electric_size":
3660
3793
  {
3661
- const h = za[y.value];
3662
- h !== void 0 && h !== T.lineWidth && N(
3794
+ const S = cn[I.value];
3795
+ S !== void 0 && S !== m.lineWidth && M(
3663
3796
  {
3664
- id: T.id,
3665
- lineWidth: h
3797
+ id: m.id,
3798
+ lineWidth: S
3666
3799
  },
3667
3800
  !1
3668
3801
  );
3669
3802
  }
3670
3803
  break;
3671
3804
  default:
3672
- N(
3805
+ M(
3673
3806
  {
3674
- id: T.id,
3675
- [C]: y.value
3807
+ id: m.id,
3808
+ [C]: I.value
3676
3809
  },
3677
3810
  !1
3678
3811
  );
3679
3812
  break;
3680
3813
  }
3681
- }), I.length > 0 && O.value.stopAnimate(I), S.length > 0 && O.value.startAnimate(S), u.clear(), O.value.render();
3814
+ }), b.length > 0 && L.value.stopAnimate(b), x.length > 0 && L.value.startAnimate(x), o.clear(), L.value.render();
3682
3815
  };
3683
- return (S, I) => {
3684
- S != null && S.length && (S.forEach((p) => {
3685
- var y;
3686
- const T = p.form;
3687
- if ((y = p.statusBindData) != null && y.length) {
3688
- if (!Q[I.guid]) return;
3689
- const C = [...p.statusBindData], h = C.findIndex((w) => w.dataId === I.guid);
3690
- if (h !== -1) {
3691
- const w = C[h];
3816
+ return (x, b) => {
3817
+ x != null && x.length && (x.forEach((E) => {
3818
+ var I;
3819
+ const m = E.form;
3820
+ if ((I = E.statusBindData) != null && I.length) {
3821
+ if (!J[b.guid]) return;
3822
+ const C = [...E.statusBindData], S = C.findIndex((p) => p.dataId === b.guid);
3823
+ if (S !== -1) {
3824
+ const p = C[S];
3692
3825
  C.find(
3693
- (le) => w.sort < le.sort && Q[le.dataId]
3694
- ) || u.set(p.id, {
3695
- pen: p,
3826
+ (V) => p.sort < V.sort && J[V.dataId]
3827
+ ) || o.set(E.id, {
3828
+ pen: E,
3696
3829
  formKey: "showChild",
3697
- dataItem: k(c({}, I), { value: h })
3830
+ dataItem: D(d({}, b), { value: S })
3698
3831
  });
3699
3832
  }
3700
- } else T != null && T.length && T.forEach((C) => {
3833
+ } else m != null && m.length && m.forEach((C) => {
3701
3834
  if (!(Array.isArray(C.dataIds) ? C.dataIds : [C.dataIds]).some(
3702
- (le) => (le == null ? void 0 : le.dataId) && ((le == null ? void 0 : le.dataId) === I.dataId || (le == null ? void 0 : le.dataId) === I.point_id)
3835
+ (V) => (V == null ? void 0 : V.dataId) && ((V == null ? void 0 : V.dataId) === b.dataId || (V == null ? void 0 : V.dataId) === b.point_id)
3703
3836
  )) return;
3704
- const j = `${p.id}-${C.key}`;
3705
- u.set(j, {
3706
- pen: p,
3707
- dataItem: I,
3837
+ const _ = `${E.id}-${C.key}`;
3838
+ o.set(_, {
3839
+ pen: E,
3840
+ dataItem: b,
3708
3841
  formKey: C.key
3709
3842
  });
3710
3843
  });
3711
- }), s && clearTimeout(s), s = setTimeout(() => {
3712
- D(), s = null;
3713
- }, ce.value.debounceDelay));
3844
+ }), Te && clearTimeout(Te), Te = setTimeout(() => {
3845
+ R(), Te = null;
3846
+ }, me.value.debounceDelay));
3714
3847
  };
3715
- })(), ia = (s) => {
3716
- if (O.value) {
3717
- for (let u = 0; u < s.length; u++) {
3718
- const _ = s[u];
3719
- Q[_.dataId || _.point_id] = _.value_disp || _.value;
3720
- const P = O.value.find(_.dataId);
3721
- setTimeout(() => {
3722
- He(P, _);
3723
- }, ce.value.messageDelay);
3848
+ })(), Ae = (o) => {
3849
+ if (L.value) {
3850
+ for (let u = 0; u < o.length; u++) {
3851
+ const w = o[u];
3852
+ J[w.dataId || w.point_id] = w.value_disp || w.value;
3853
+ const R = L.value.find(w.dataId), x = setTimeout(() => {
3854
+ ke.delete(x), F(R, w);
3855
+ }, me.value.messageDelay);
3856
+ ke.add(x);
3724
3857
  }
3725
- O.value.render(), i.customCallbacks.onBatchUpdate && i.customCallbacks.onBatchUpdate(s);
3858
+ L.value.render(), r.customCallbacks.onBatchUpdate && r.customCallbacks.onBatchUpdate(o);
3726
3859
  }
3727
- }, ra = (s, u = !1) => {
3728
- if (!O.value) return;
3729
- const _ = ve();
3730
- for (let P = 0; P < _.length; P++) {
3731
- const D = _[P];
3732
- let S = !1;
3733
- u ? S = s === D.dataProp : S = s === 5 ? !0 : D.dataProp <= s, N({ id: D.id, visible: S }, !1);
3860
+ }, ye = (o, u = !1) => {
3861
+ if (!L.value) return;
3862
+ const w = X();
3863
+ for (let R = 0; R < w.length; R++) {
3864
+ const x = w[R];
3865
+ let b = !1;
3866
+ u ? b = o === x.dataProp : b = o === 5 ? !0 : x.dataProp <= o, M({ id: x.id, visible: b }, !1);
3734
3867
  }
3735
- O.value.fitView(), O.value.render(), i.customCallbacks.onLevelChange && i.customCallbacks.onLevelChange(s, u);
3868
+ L.value.fitView(), L.value.render(), r.customCallbacks.onLevelChange && r.customCallbacks.onLevelChange(o, u);
3736
3869
  };
3737
- return rt(
3738
- () => [i.gid, i.url, i.data, i.lang, i.local, i.isFactory],
3870
+ return vt(
3871
+ () => [r.gid, r.url, r.data, r.lang, r.local, r.isFactory],
3739
3872
  () => {
3740
- K();
3873
+ k();
3741
3874
  }
3742
- ), rt(
3743
- () => i.showMap,
3744
- (s) => {
3745
- O.value && (s ? O.value.showMap() : O.value.hideMap());
3875
+ ), vt(
3876
+ () => r.showMap,
3877
+ (o) => {
3878
+ L.value && (o ? L.value.showMap() : L.value.hideMap());
3746
3879
  }
3747
- ), Wt(() => {
3748
- const s = Ie();
3749
- s && s.on && s.on(ce.value.graphSocket, R);
3750
- const u = tt();
3751
- q.value = i.gid || u.id, K();
3752
- }), Kt(() => {
3753
- g = null;
3754
- const s = Ie();
3755
- s && s.off && s.off(ce.value.graphSocket, R), window.removeEventListener("mousemove", E);
3880
+ ), oa(() => {
3881
+ const o = Re();
3882
+ o && o.on && o.on(me.value.graphSocket, ce);
3883
+ const u = mt();
3884
+ Z.value = r.gid || u.id, k();
3885
+ }), sa(() => {
3886
+ oe = null, ve && clearInterval(ve), ve = null, clearTimeout(we), clearTimeout(Te), ke.forEach((u) => clearTimeout(u)), ke.clear(), y(L.value);
3887
+ const o = Re();
3888
+ o && o.off && o.off(me.value.graphSocket, ce), window.removeEventListener("mousemove", ie);
3756
3889
  }), e({
3757
- setValue: N,
3758
- getStage: ge,
3759
- getAllPens: ve,
3760
- getCustomPenType: Ge,
3761
- batchUpdatePen: ia,
3762
- handleLineCross: Sa,
3763
- changeVisibleByLevel: ra
3764
- }), (s, u) => (ue(), Ee("div", {
3890
+ setValue: M,
3891
+ getStage: Ie,
3892
+ getAllPens: X,
3893
+ getCustomPenType: q,
3894
+ batchUpdatePen: Ae,
3895
+ handleLineCross: Ha,
3896
+ changeVisibleByLevel: ye
3897
+ }), (o, u) => (ue(), xe("div", {
3765
3898
  ref_key: "previewRef",
3766
- ref: M,
3899
+ ref: O,
3767
3900
  class: "meta2d-preview"
3768
3901
  }, [
3769
- Me(mi, {
3902
+ $e(Mr, {
3770
3903
  ref_key: "graphRef",
3771
- ref: re,
3772
- url: $.value,
3773
- local: oe.value,
3774
- data: i.data,
3775
- "dev-config": i.devConfig,
3904
+ ref: $,
3905
+ url: K.value,
3906
+ local: te.value,
3907
+ data: r.data,
3908
+ "dev-config": r.devConfig,
3776
3909
  preview: "",
3777
- onLoaded: B
3910
+ onLoaded: T
3778
3911
  }, null, 8, ["url", "local", "data", "dev-config"]),
3779
- Fe(r) ? (ue(), Ee("div", fi, [
3780
- Me(Fe(__$t__), {
3912
+ ze(i) ? (ue(), xe("div", Fr, [
3913
+ $e(ze(ua), {
3781
3914
  type: "primary",
3782
- onClick: Se
3915
+ onClick: Ne
3783
3916
  }, {
3784
- default: lt(() => [...u[0] || (u[0] = [
3785
- Vt("返回", -1)
3917
+ default: _t(() => [...u[0] || (u[0] = [
3918
+ ra("返回", -1)
3786
3919
  ])]),
3787
3920
  _: 1
3788
3921
  })
3789
- ])) : Ue("", !0),
3790
- pe.value ? (ue(), ze(jn, {
3922
+ ])) : je("", !0),
3923
+ fe.value ? (ue(), et(lr, {
3791
3924
  key: 1,
3792
3925
  ref_key: "panelRef",
3793
- ref: F,
3794
- data: x.value,
3795
- style: Bt({
3796
- top: U.value.top + "px",
3797
- left: U.value.left + "px",
3926
+ ref: U,
3927
+ data: Ce.value,
3928
+ style: ia({
3929
+ top: G.value.top + "px",
3930
+ left: G.value.left + "px",
3798
3931
  position: "absolute"
3799
3932
  }),
3800
- onClose: de,
3801
- onEnter: he,
3802
- onViewHistory: d
3803
- }, null, 8, ["data", "style"])) : Ue("", !0)
3933
+ onClose: se,
3934
+ onEnter: pe,
3935
+ onViewHistory: Ee
3936
+ }, null, 8, ["data", "style"])) : je("", !0)
3804
3937
  ], 512));
3805
3938
  }
3806
- }), je = /* @__PURE__ */ qe(pi, [["__scopeId", "data-v-fe1ca54c"]]);
3807
- je.name || (je.name = "SyGraph");
3808
- const Ai = (n) => {
3809
- n.component(je.name || "SyGraph", je);
3810
- }, Bi = { install: Ai };
3939
+ }), nt = /* @__PURE__ */ ot(Ur, [["__scopeId", "data-v-2a591df2"]]);
3940
+ nt.name || (nt.name = "SyGraph");
3941
+ const Gr = (a) => {
3942
+ a.component(nt.name || "SyGraph", nt);
3943
+ }, hi = { install: Gr };
3811
3944
  export {
3812
- je as SyGraph,
3813
- Bi as default
3945
+ nt as SyGraph,
3946
+ hi as default
3814
3947
  };