@syhr/sy-graph 1.0.9 → 1.1.0-rc.10

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.
@@ -0,0 +1,3693 @@
1
+ import './sy-graph.css';var Zt = Object.defineProperty, ea = Object.defineProperties;
2
+ var ta = Object.getOwnPropertyDescriptors;
3
+ var nt = Object.getOwnPropertySymbols;
4
+ var aa = Object.prototype.hasOwnProperty, na = Object.prototype.propertyIsEnumerable;
5
+ var Ke = (n, e, t) => e in n ? Zt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, c = (n, e) => {
6
+ for (var t in e || (e = {}))
7
+ aa.call(e, t) && Ke(n, t, e[t]);
8
+ if (nt)
9
+ for (var t of nt(e))
10
+ na.call(e, t) && Ke(n, t, e[t]);
11
+ return n;
12
+ }, x = (n, e) => ea(n, ta(e));
13
+ var ue = (n, e, t) => Ke(n, typeof e != "symbol" ? e + "" : e, t);
14
+ var q = (n, e, t) => new Promise((a, i) => {
15
+ var r = (f) => {
16
+ try {
17
+ l(t.next(f));
18
+ } catch (g) {
19
+ i(g);
20
+ }
21
+ }, o = (f) => {
22
+ try {
23
+ l(t.throw(f));
24
+ } catch (g) {
25
+ i(g);
26
+ }
27
+ }, l = (f) => f.done ? a(f.value) : Promise.resolve(f.value).then(r, o);
28
+ l((t = t.apply(n, e)).next());
29
+ });
30
+ import { openBlock as ie, createElementBlock as pe, createElementVNode as se, toDisplayString as qe, createVNode as Me, unref as xe, withCtx as et, createTextVNode as Pt, useCssVars as ia, computed as we, resolveComponent as it, normalizeStyle as Rt, createBlock as Fe, createCommentVNode as Ue, inject as ra, ref as K, shallowRef as oa, watch as Qe, nextTick as sa, onMounted as Nt, onUnmounted as kt } from "vue";
31
+ import la from "qs";
32
+ import ca from "axios";
33
+ import da from "mitt";
34
+ import ua from "dayjs";
35
+ import "crypto-js";
36
+ import { SM4 as ye, SM2 as ha } from "gm-crypto";
37
+ import { throttle as Ot, isObject as ma, debounce as fa } from "lodash-es";
38
+ import { ElMessage as J, ElButton as Dt, ElNotification as pa } from "element-plus";
39
+ import { clearLineCross as Aa, handleLineCross as ga } from "@meta2d/utils";
40
+ import { Meta2d as _a, register as Te, registerAnchors as rt, registerCanvasDraw as Se, LockState as be, getAllChildren as wa } from "@meta2d/core";
41
+ import { mindBoxPlugin as va } from "@meta2d/plugin-mind-core";
42
+ import { collapseChildPlugin as ya } from "@meta2d/plugin-mind-collapse";
43
+ import { formPens as Ea } from "@meta2d/form-diagram";
44
+ import { classPens as Ia } from "@meta2d/class-diagram";
45
+ import { chartsPens as Ta } from "@meta2d/le5le-charts";
46
+ import { videos as Ae } from "@meta2d/core/src/diagrams";
47
+ import { flowPens as Sa, flowAnchors as ba } from "@meta2d/flow-diagram";
48
+ import { ftaPens as Ca, ftaAnchors as xa, ftaPensbyCtx as Pa } from "@meta2d/fta-diagram";
49
+ import { sequencePens as Ra, sequencePensbyCtx as Na } from "@meta2d/sequence-diagram";
50
+ import { activityDiagram as ka, activityDiagramByCtx as Oa } from "@meta2d/activity-diagram";
51
+ import { Loading as Da } from "@element-plus/icons-vue";
52
+ const La = {
53
+ OFFLINE: 0
54
+ // 离线
55
+ }, Ma = {
56
+ STOP: 2
57
+ // 停止
58
+ }, Fa = {
59
+ 1: 1,
60
+ 2: 2,
61
+ 3: 3,
62
+ 4: 4,
63
+ 5: 5
64
+ }, L = {
65
+ AREA: 1,
66
+ // 区域
67
+ BAY: 2,
68
+ // 间隔
69
+ DEVICE: 3,
70
+ // 设备
71
+ COMPONENT: 4,
72
+ // 组件
73
+ POINT: 5,
74
+ // 测点
75
+ YX: 6,
76
+ // 遥信
77
+ YC: 7,
78
+ // 遥测
79
+ YK: 8,
80
+ // 遥控
81
+ AUX_DEVICE: 9,
82
+ // 辅助设备
83
+ LD: 10,
84
+ // ld 逻辑设备
85
+ LN: 11,
86
+ // ln 逻辑节点
87
+ SG: 12,
88
+ // 定值
89
+ GIS_SENSOR: 13
90
+ // 局放
91
+ }, Ua = {
92
+ [L.AREA]: "area",
93
+ [L.BAY]: "bay",
94
+ [L.DEVICE]: "device",
95
+ [L.COMPONENT]: "component",
96
+ [L.POINT]: "patrolpoint",
97
+ [L.YX]: "yxpoint",
98
+ [L.YC]: "ycpoint",
99
+ [L.YK]: "ykpoint",
100
+ [L.AUX_DEVICE]: "acdevice",
101
+ [L.LD]: "ld",
102
+ [L.LN]: "ln",
103
+ [L.SG]: "sgpoint",
104
+ [L.GIS_SENSOR]: "gisuhfsensor"
105
+ }, Q = {
106
+ CUSTOM_MSG: "CUSTOM_MSG",
107
+ OPEN_CAMERA: "OPEN_CAMERA",
108
+ // 打开摄像机弹窗
109
+ CLOSE_CAMERA: "CLOSE_CAMERA",
110
+ // 关闭摄像机弹窗
111
+ OPEN_AUDIO: "OPEN_AUDIO",
112
+ // 打开音频弹窗
113
+ CLOSE_AUDIO: "CLOSE_AUDIO",
114
+ // 关闭音频弹窗
115
+ CHANGE_GRAPH: "CHANGE_GRAPH",
116
+ // 切换图纸
117
+ NOTIFY_DIALOG: "NOTIFY_DIALOG",
118
+ // 通知弹窗
119
+ GIS_PROPS_PANEL: "GIS_PROPS_PANEL"
120
+ // 属性面板
121
+ }, Re = {
122
+ Emit: 7
123
+ }, Ne = {
124
+ NONE: "none",
125
+ WUJIE: "wujie",
126
+ QIANKUN: "qiankun",
127
+ MICROAPP: "microapp"
128
+ }, T = {
129
+ TEXT: "TEXT",
130
+ // 未特殊定义
131
+ NORMAL: "NORMAL",
132
+ // 未特殊定义
133
+ MP4: "MP4",
134
+ // MP4
135
+ TIME: "TIME",
136
+ // 时间
137
+ AUDIO: "AUDIO",
138
+ // 音频
139
+ RADIO: "RADIO",
140
+ // 单选
141
+ TABLE: "TABLE",
142
+ // 表格
143
+ INPUT: "INPUT",
144
+ // 输入框
145
+ BUTTON: "BUTTON",
146
+ // 按钮
147
+ CAMERA: "CAMERA",
148
+ // 摄像机
149
+ SELECT: "SELECT",
150
+ // 选择框
151
+ SENSOR: "SENSOR",
152
+ // 传感器
153
+ GIS_SENSOR: "GIS_SENSOR",
154
+ // 局放传感器
155
+ GIS_SENSOR_WRAPPER: "GIS_SENSOR_WRAPPER",
156
+ // 局放传感器外层,主要用于在编辑时展示tooltip
157
+ GIS_DB_VALUE: "GIS_DB_VALUE",
158
+ // 局放幅值
159
+ SLIDER: "SLIDER",
160
+ // 滑动条
161
+ SWITCH: "SWITCH",
162
+ // 开关
163
+ CHECKBOX: "CHECKBOX",
164
+ // 复选框
165
+ POINT_VALUE: "POINT_VALUE",
166
+ // 测点
167
+ LIGHT_PLATE: "LIGHT_PLATE",
168
+ // 光字牌
169
+ VIDEO_STREAM: "VIDEO_STREAM"
170
+ // 视频流
171
+ }, ot = {
172
+ GRAPH: {
173
+ SOCKET: "GRAPH_SOCKET"
174
+ }
175
+ }, Ye = {
176
+ AC: {
177
+ ALARM: "ac.channel.alarm",
178
+ // 智辅告警
179
+ CONDITION: "ac.channel.gk",
180
+ // 智辅工况
181
+ OPERATION: "ac.channel.op"
182
+ // 智辅操作
183
+ },
184
+ AUDIT: {
185
+ MSG: "audit.msg",
186
+ // 审计信息推送
187
+ ALARM: "audit.alarm"
188
+ // 审计容量告警推送
189
+ },
190
+ DATA: {
191
+ TASK_STATUS: "data.patroldevice.taskstatus",
192
+ // 设备任务状态
193
+ TASK_RESULT: "data.patroldevice.taskresult"
194
+ // 设备任务结果
195
+ },
196
+ HOST: {
197
+ STATUS: "status.platform.hoststatus"
198
+ // 巡视主机状态
199
+ },
200
+ NEST: {
201
+ BATTERY: "status.platform.nestbattery",
202
+ // 机巢电量
203
+ HUMIDITY: "status.platform.nesthumidity",
204
+ // 机巢舱内湿度
205
+ TEMPERATURE: "status.platform.nesttemperature",
206
+ // 机巢舱内温度
207
+ AIR_STATE: "status.platform.nestairstate",
208
+ // 机巢空调状态
209
+ DOOR_STATE: "status.platform.nestdoorstate",
210
+ // 机巢舱门状态
211
+ CHARGE_STATE: "status.platform.nestchargestate",
212
+ // 机巢充电状态
213
+ RUNNING_STATE: "status.platform.nestrunningstate",
214
+ // 机巢运行状态
215
+ BATTERY_STATE: "status.platform.nestbatterystate",
216
+ // 机巢电池状态
217
+ BATTERY_ENABLE: "status.platform.nestbatteryenable",
218
+ // 机巢电池使⽤状态
219
+ BATTERY_VOLTAGE: "status.platform.nestbatteryvoltage",
220
+ // 机巢电池电压
221
+ PLATFORM_STATE: "status.platform.nestsysstate"
222
+ // 机巢平台状态
223
+ },
224
+ MEDIA: {
225
+ NVR_INFO: "status.platform.nvrinfo",
226
+ // 录像机信息
227
+ NVR_STATUS: "status.platform.nvrstatus",
228
+ // 录像机状态
229
+ CAMERA_STATUS: "status.platform.camerastatus"
230
+ // 摄像机状态
231
+ },
232
+ DRONE: {
233
+ STATUS: "status.platform.dronestatus",
234
+ // 无人机状态
235
+ ELECTRICITY: "status.platform.droneelectricity",
236
+ // 无人机电流
237
+ FLIGHT_TIME: "status.platform.flighttime",
238
+ // 无人机飞行时长
239
+ FLIGHT_HEIGHT: "status.platform.flightheight",
240
+ // 无人机飞行高度
241
+ FLIGHT_STATUS: "status.platform.flightstatus",
242
+ // 无人机飞行状态
243
+ FLIGHT_DISTANCE: "status.platform.flightdistance",
244
+ // 无人机飞行距离
245
+ PTZ_ELEVATION: "status.platform.ptzelevation",
246
+ // 无人机云台仰角
247
+ PTZ_YAW_ANGLE: "status.platform.ptzyawangle",
248
+ // 无人机云台偏航角
249
+ PTZ_ROLL_ANGLE: "status.platform.ptzrollangle",
250
+ // 无人机云台横滚角
251
+ LOW_BATTERY: "status.platform.lowbattery",
252
+ // 无人机电池电量低
253
+ COMM_ABNORMAL: "status.platform.commabnormal",
254
+ // 无人机通信状态
255
+ DRIVE_EXCEPTION: "status.platform.driveexception",
256
+ // 无人机驱动异常
257
+ FAULT_ALARM: "status.platform.faultalarm",
258
+ // 无人机故障报警
259
+ CONTROL_STATUS: "status.platform.controlstatus",
260
+ // 无人机控制状态
261
+ MILEAGE: "status.platform.mileage",
262
+ // 无人机行驶里程
263
+ CONTROL_MODE: "status.platform.controlmode"
264
+ // 无人机控制模式
265
+ },
266
+ ROBOT: {
267
+ SPEED: "status.platform.robotspeed",
268
+ // 机器人速度
269
+ STATUS: "status.platform.robotstatus",
270
+ // 机器人状态
271
+ BATTERY: "status.platform.robotbattery",
272
+ // 机器人电池电量
273
+ MILEAGE: "status.platform.robotmileage",
274
+ // 机器人行驶里程
275
+ HUMIDITY: "status.platform.robothumidity",
276
+ // 机器人湿度上报
277
+ WINDSPEED: "status.platform.robotwindspeed",
278
+ // 机器人风速上报
279
+ COORDINATE: "status.platform.robotcoordinate",
280
+ // 机器人坐标上报
281
+ COORDINATES: "status.platform.robotcoordinates",
282
+ // 机器人巡视路线
283
+ FAULT_ALARM: "status.platform.robotfaultalarm",
284
+ // 机器人故障报警
285
+ LOW_BATTERY: "status.platform.robotlowbattery",
286
+ // 机器人电池电量低
287
+ TEMPERATURE: "status.platform.robottemperature",
288
+ // 机器人温度上报
289
+ CONTROL_MODE: "status.platform.robotcontrolmode",
290
+ // 机器人控制模式
291
+ COMM_ABNORMAL: "status.platform.robotcommabnormal",
292
+ // 机器人通信状态
293
+ RUNNING_STATE: "status.platform.robotrunningstate",
294
+ // 机器人运行状态
295
+ CONTROL_STATUS: "status.platform.robotcontrolstatus",
296
+ // 机器人控制状态
297
+ DRIVE_EXCEPTION: "status.platform.robotdriveexception",
298
+ // 机器人驱动异常
299
+ TRANSPORT_STATUS: "status.platform.robottransportstatus",
300
+ // 机器人轮转状态
301
+ ULTRASONIC_STOPPING: "status.platform.robotultrasonicstopping"
302
+ // 机器人超声停障
303
+ },
304
+ VOICE: {
305
+ STATUS: "voiceprint.status",
306
+ // 在离线状态
307
+ DATA: "voice.data",
308
+ VOICEPRINT: "voiceprint.data",
309
+ TIME_DOMAIN: "voiceprint.time.domain",
310
+ FREQ_DOMAIN: "voiceprint.freq.domain"
311
+ },
312
+ PATROL: {
313
+ ALARM: "patrol.alarm",
314
+ // 任务巡视告警
315
+ TASK_ITEM: "patrol.task.item",
316
+ // 任务巡视结果
317
+ TASK_INDEX: "patrol.task.index",
318
+ // 任务巡视状态
319
+ SINGLE_RESULT: "patrol.single.result",
320
+ // 单点识别结果
321
+ CAMERA_ITEM: "patrol.camera.item",
322
+ // 任务调用的摄像机
323
+ PATROLDEVICE_TASKSTATUS: "data.patroldevice.taskstatus",
324
+ // 机器人/无人机任务状态
325
+ PATROLDEVICE_TASKRESULT: "data.patroldevice.taskresult",
326
+ // 机器人/无人机任务结果
327
+ MASTER_ALARM: "patrol.master.alarm",
328
+ // 集控巡视任务告警
329
+ MASTER_SILENCE: "patrol.task.master.silence",
330
+ // 集控静默监视推送
331
+ MASTER_TASK_ITEM: "patrol.task.master.item",
332
+ // 集控任务状态推送
333
+ MASTER_TASK_INDEX: "patrol.task.master.index"
334
+ // 集控任务结果推送
335
+ },
336
+ REPORT: {
337
+ ALARM: "report.alarm.message",
338
+ EXCEL: "report.excel.message",
339
+ PATROL: "report.patrol.message",
340
+ PICTURE: "report.picture.message"
341
+ },
342
+ ACPOINT: {
343
+ YCVALUE: "status.platform.ycvalue",
344
+ // 遥测信号值
345
+ YXVALUE: "status.platform.yxvalue"
346
+ // 遥信信号值
347
+ },
348
+ ALARM: {
349
+ VOICE: "alarm.platform.alarm"
350
+ // 声纹告警
351
+ },
352
+ LINKAGE: {
353
+ TASK: "linkage.record.task",
354
+ // 任务联动
355
+ CAMERA: "linkage.record.camera",
356
+ // 摄像机联动
357
+ PRESET: "linkage.record.preset",
358
+ // 预置位联动
359
+ CONTROL: "linkage.record.control",
360
+ // 一键顺控
361
+ PATROLPOINT: "linkage.record.patrolpoint"
362
+ // 点位联动
363
+ },
364
+ METRICS: {
365
+ SERVER: "metrics.metrics.server",
366
+ // 服务器指标
367
+ CONTAINER: "metrics.metrics.container"
368
+ // 容器指标
369
+ },
370
+ STATION: {
371
+ SF6: "status.platform.stationsf6",
372
+ // 变电站SF6浓度
373
+ OXYGEN: "status.platform.stationoxygen",
374
+ // 变电站氧气浓度
375
+ HUMIDITY: "status.platform.stationhumidity",
376
+ // 变电站湿度
377
+ PRESSURE: "status.platform.stationpressure",
378
+ // 变电站气压
379
+ RAINFALL: "status.platform.stationrainfall",
380
+ // 变电站降雨量
381
+ WINDSPEED: "status.platform.stationwindspeed",
382
+ // 变电站风速
383
+ TEMPERATURE: "status.platform.stationtemperature",
384
+ // 变电站温度
385
+ WINDDIRECTION: "status.platform.stationwinddirection"
386
+ // 变电站风向
387
+ },
388
+ // 通信接口
389
+ INTERFACE: {
390
+ ANALYSIS: "analyse.pic.result",
391
+ ALGORITHM: "algorithm.update.result"
392
+ },
393
+ // 巡视设备(1摄像机/2机器⼈/3巡视主机/4⽆⼈机)
394
+ PATROL_DEVICE: {
395
+ BATTERY: "status.platform.battery",
396
+ // 电池电量
397
+ MILEAGE: "status.platform.mileage",
398
+ // 行驶里程
399
+ GEOGRAPHY: "status.platform.coordinate_geography",
400
+ // 设备坐标
401
+ COORDINATE: "status.platform.coordinate",
402
+ // 设备坐标
403
+ COORDINATES: "status.platform.coordinates",
404
+ // 路线
405
+ ELECTRICITY: "status.platform.electricity",
406
+ // 电池电流
407
+ PTZYAWANGLE: "status.platform.ptzyawangle",
408
+ // 偏航
409
+ PTZELEVATION: "status.platform.ptzelevation",
410
+ // 俯仰
411
+ PTZROLLANGLE: "status.platform.ptzrollangle",
412
+ // 横滚角
413
+ VERTICAL_SPEED: "status.platform.verticalspeed",
414
+ // 垂直速度
415
+ HORIZONTAL_SPEED: "status.platform.horizontalspeed",
416
+ // 水平速度
417
+ FAULT_ALARM: "status.platform.faultalarm",
418
+ // 故障报警
419
+ LOW_BATTERY: "status.platform.lowbattery",
420
+ // 电池电量低
421
+ CONTROL_MODE: "status.platform.controlmode",
422
+ // 控制模式
423
+ COMM_ABNORMAL: "status.platform.commabnormal",
424
+ // 通信状态
425
+ RUNNING_STATE: "status.platform.runningstate",
426
+ // 运行状态
427
+ CONTROL_STATUS: "status.platform.controlstatus",
428
+ // 控制权状态
429
+ DRIVE_EXCEPTION: "status.platform.driveexception",
430
+ // 驱动异常
431
+ TRANSPORT_STATUS: "status.platform.transportstatus",
432
+ // 轮转状态
433
+ ULTRASONIC_STOPPING: "status.platform.ultrasonicstopping"
434
+ // 超声停障
435
+ }
436
+ };
437
+ var He = {};
438
+ /*!
439
+ * vite-plugin-qiankun.js v1.0.14
440
+ * (c) 2021-2022 Teng Mao Qing
441
+ * Released under the MIT License.
442
+ */
443
+ Object.defineProperty(He, "__esModule", { value: !0 });
444
+ var _e = typeof window != "undefined" ? window.proxy || window : {}, Lt = function(n) {
445
+ _e != null && _e.__POWERED_BY_QIANKUN__ && (window.moudleQiankunAppLifeCycles || (window.moudleQiankunAppLifeCycles = {}), _e.qiankunName && (window.moudleQiankunAppLifeCycles[_e.qiankunName] = n));
446
+ };
447
+ He.default = Lt;
448
+ var $e = He.qiankunWindow = _e;
449
+ He.renderWithQiankun = Lt;
450
+ function Ga() {
451
+ return window.__POWERED_BY_WUJIE__ || window.$wujie ? Ne.WUJIE : window.__POWERED_BY_QIANKUN__ || $e != null && $e.__POWERED_BY_QIANKUN__ ? Ne.QIANKUN : window.__MICRO_APP_ENVIRONMENT__ || window.microApp ? Ne.MICROAPP : Ne.NONE;
452
+ }
453
+ const Le = "/", Mt = window.meta.app.encrypt;
454
+ Ga();
455
+ const Ha = location.protocol === "https:", Va = location.hostname, Ba = Ha ? "wss:" : "ws:", Wa = location.port, Ka = location.origin, st = `${Ba}//${location.host}/ws`;
456
+ var ft, pt, At, gt, _t, wt, vt, yt, Et, It, Tt, St;
457
+ (pt = (ft = window.meta) == null ? void 0 : ft.graph) != null && pt.savePath, (gt = (At = window.meta) == null ? void 0 : At.graph) != null && gt.graphPenPath, (wt = (_t = window.meta) == null ? void 0 : _t.graph) != null && wt.templatePath, (yt = (vt = window.meta) == null ? void 0 : vt.graph) != null && yt.graphImgUploadPath, (It = (Et = window.meta) == null ? void 0 : Et.graph) != null && It.threeSavePath, (St = (Tt = window.meta) == null ? void 0 : Tt.graph) != null && St.threeModelPath;
458
+ var bt;
459
+ const k = ca.create({
460
+ baseURL: Ka,
461
+ timeout: ((bt = window.meta.axios) == null ? void 0 : bt.timeout) || 6e4,
462
+ withCredentials: !1,
463
+ paramsSerializer: (n) => la.stringify(n)
464
+ });
465
+ k.interceptors.request.use(
466
+ (n) => (n.headers["x-token"] = "ewoglCJhbGcilDogpc3", n),
467
+ (n) => Promise.reject(n)
468
+ );
469
+ k.interceptors.response.use(
470
+ (n) => {
471
+ const { data: e } = n;
472
+ return Promise.resolve(e);
473
+ },
474
+ (n) => Promise.reject(n)
475
+ );
476
+ function Ya(n, e = {}, t = {}) {
477
+ return new Promise((a) => {
478
+ k.get(n, c({ params: e }, t)).then((i) => a({ res: i, err: null })).catch((i) => a({ res: null, err: i }));
479
+ });
480
+ }
481
+ function $a(n, e = {}, t = {}) {
482
+ return new Promise((a) => {
483
+ k.post(n, e, t).then((i) => a({ res: i, err: null })).catch((i) => a({ res: null, err: i }));
484
+ });
485
+ }
486
+ function za(n, e = {}, t = {}) {
487
+ return k.get(n, c({ params: e }, t));
488
+ }
489
+ function ja(n, e = {}, t = {}) {
490
+ return k.post(n, e, t);
491
+ }
492
+ function Xa(n, e = {}) {
493
+ return k.get(`/filehandle/${n}`, { params: e });
494
+ }
495
+ function qa(n, e = {}, t = {}) {
496
+ return k.post(`/filehandle/${n}`, e, t);
497
+ }
498
+ function Qa(n, e = {}) {
499
+ return k.get(`/user/${n}`, { params: e });
500
+ }
501
+ function Ja(n, e = {}, t = {}) {
502
+ return k.post(`/user/${n}`, e, t);
503
+ }
504
+ function Za(n, e = {}) {
505
+ return k.get(`${n}`, e.local ? { params: e, baseURL: Le } : { params: e });
506
+ }
507
+ function en(n, e = {}) {
508
+ return k.get(`/media/${n}/`, { params: e });
509
+ }
510
+ function tn(n, e = {}, t = {}) {
511
+ return k.post(`/media/${n}/`, e, t);
512
+ }
513
+ function an(n, e = {}) {
514
+ return k.get(
515
+ `/${window.meta.app.isFactory ? window.meta.factory.singo_prefix || "acproxy/common" : "common"}/${n}/`,
516
+ { params: e }
517
+ );
518
+ }
519
+ function nn(n, e = {}, t = {}) {
520
+ return k.post(
521
+ `/${window.meta.app.isFactory ? window.meta.factory.singo_prefix || "acproxy/common" : "common"}/${n}/`,
522
+ e,
523
+ t
524
+ );
525
+ }
526
+ function rn(n, e = {}) {
527
+ return k.get(`/history/${n}`, { params: e });
528
+ }
529
+ function on(n, e = {}, t = {}) {
530
+ return k.post(`/history/${n}`, e, t);
531
+ }
532
+ function sn(n, e = {}) {
533
+ return k.get(`/scada/${n}`, { params: e });
534
+ }
535
+ function ln(n, e = {}, t = {}) {
536
+ return k.post(`/scada/${n}`, e, t);
537
+ }
538
+ function cn(n, e = {}) {
539
+ return k.get(`/common/factory/${n}`, { params: e });
540
+ }
541
+ function dn(n, e = {}, t = {}) {
542
+ return k.post(`/common/factory/${n}`, e, t);
543
+ }
544
+ function un(n, e = {}) {
545
+ return k.get(`/factory/${n}`, { params: e });
546
+ }
547
+ function hn(n, e = {}, t = {}) {
548
+ return k.post(`/factory/${n}`, e, t);
549
+ }
550
+ function mn(n, e = {}) {
551
+ return k.get(`/pd/${n}`, { params: e });
552
+ }
553
+ function fn(n, e = {}, t = {}) {
554
+ return k.post(`/pd/${n}`, e, t);
555
+ }
556
+ const me = {
557
+ getApi: Ya,
558
+ postApi: $a,
559
+ getFileApi: Xa,
560
+ postFileApi: qa,
561
+ getBaseApi: za,
562
+ postBaseApi: ja,
563
+ getUserApi: Qa,
564
+ postUserApi: Ja,
565
+ getGraphApi: Za,
566
+ getMediaApi: en,
567
+ postMediaApi: tn,
568
+ getScadaApi: sn,
569
+ postScadaApi: ln,
570
+ getCommonApi: an,
571
+ postCommonApi: nn,
572
+ getHistoryApi: rn,
573
+ postHistoryApi: on,
574
+ getFactoryApi: un,
575
+ postFactoryApi: hn,
576
+ getCommonFactoryApi: cn,
577
+ postCommonFactoryApi: dn,
578
+ getPDApi: mn,
579
+ postPDApi: fn
580
+ }, Je = da(), pn = [65535, -99999];
581
+ function ze(n) {
582
+ if (typeof n != "string") return !1;
583
+ const e = /^-?\d+(\.\d+)?$/;
584
+ return n.trim() !== "" && e.test(n.trim());
585
+ }
586
+ function Ze(n) {
587
+ return !["null", "undefined"].includes(n) && n !== void 0 && n !== null && n !== "";
588
+ }
589
+ function ke(n) {
590
+ return typeof n == "number" && !pn.includes(n);
591
+ }
592
+ const je = () => {
593
+ var a;
594
+ const n = {}, e = ((a = window.location.href.split("?")) == null ? void 0 : a[1]) || "", t = new URLSearchParams(e);
595
+ for (const [i, r] of t.entries())
596
+ n[i] = r;
597
+ return n;
598
+ };
599
+ function Xe(n) {
600
+ return Object.prototype.toString.call(n).slice(8, -1);
601
+ }
602
+ (function() {
603
+ if (typeof Object.id == "undefined") {
604
+ var n = 0;
605
+ Object.id = function(e) {
606
+ return typeof e.__uniqueid == "undefined" && Object.defineProperty(e, "__uniqueid", {
607
+ value: ++n,
608
+ enumerable: !1,
609
+ // This could go either way, depending on your
610
+ // interpretation of what an "id" is
611
+ writable: !1
612
+ }), e.__uniqueid;
613
+ };
614
+ }
615
+ })();
616
+ function An() {
617
+ var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = [
618
+ -1,
619
+ -1,
620
+ -1,
621
+ -1,
622
+ -1,
623
+ -1,
624
+ -1,
625
+ -1,
626
+ -1,
627
+ -1,
628
+ -1,
629
+ -1,
630
+ -1,
631
+ -1,
632
+ -1,
633
+ -1,
634
+ -1,
635
+ -1,
636
+ -1,
637
+ -1,
638
+ -1,
639
+ -1,
640
+ -1,
641
+ -1,
642
+ -1,
643
+ -1,
644
+ -1,
645
+ -1,
646
+ -1,
647
+ -1,
648
+ -1,
649
+ -1,
650
+ -1,
651
+ -1,
652
+ -1,
653
+ -1,
654
+ -1,
655
+ -1,
656
+ -1,
657
+ -1,
658
+ -1,
659
+ -1,
660
+ -1,
661
+ 62,
662
+ -1,
663
+ -1,
664
+ -1,
665
+ 63,
666
+ 52,
667
+ 53,
668
+ 54,
669
+ 55,
670
+ 56,
671
+ 57,
672
+ 58,
673
+ 59,
674
+ 60,
675
+ 61,
676
+ -1,
677
+ -1,
678
+ -1,
679
+ -1,
680
+ -1,
681
+ -1,
682
+ -1,
683
+ 0,
684
+ 1,
685
+ 2,
686
+ 3,
687
+ 4,
688
+ 5,
689
+ 6,
690
+ 7,
691
+ 8,
692
+ 9,
693
+ 10,
694
+ 11,
695
+ 12,
696
+ 13,
697
+ 14,
698
+ 15,
699
+ 16,
700
+ 17,
701
+ 18,
702
+ 19,
703
+ 20,
704
+ 21,
705
+ 22,
706
+ 23,
707
+ 24,
708
+ 25,
709
+ -1,
710
+ -1,
711
+ -1,
712
+ -1,
713
+ -1,
714
+ -1,
715
+ 26,
716
+ 27,
717
+ 28,
718
+ 29,
719
+ 30,
720
+ 31,
721
+ 32,
722
+ 33,
723
+ 34,
724
+ 35,
725
+ 36,
726
+ 37,
727
+ 38,
728
+ 39,
729
+ 40,
730
+ 41,
731
+ 42,
732
+ 43,
733
+ 44,
734
+ 45,
735
+ 46,
736
+ 47,
737
+ 48,
738
+ 49,
739
+ 50,
740
+ 51,
741
+ -1,
742
+ -1,
743
+ -1,
744
+ -1,
745
+ -1
746
+ ];
747
+ this.encode = function(t) {
748
+ var a, i, r, o, l, f;
749
+ for (r = t.length, i = 0, a = ""; i < r; ) {
750
+ if (o = t.charCodeAt(i++) & 255, i == r) {
751
+ a += n.charAt(o >> 2), a += n.charAt((o & 3) << 4), a += "==";
752
+ break;
753
+ }
754
+ if (l = t.charCodeAt(i++), i == r) {
755
+ a += n.charAt(o >> 2), a += n.charAt((o & 3) << 4 | (l & 240) >> 4), a += n.charAt((l & 15) << 2), a += "=";
756
+ break;
757
+ }
758
+ f = t.charCodeAt(i++), a += n.charAt(o >> 2), a += n.charAt((o & 3) << 4 | (l & 240) >> 4), a += n.charAt((l & 15) << 2 | (f & 192) >> 6), a += n.charAt(f & 63);
759
+ }
760
+ return a;
761
+ }, this.decode = function(t) {
762
+ var a, i, r, o, l, f, g;
763
+ for (f = t.length, l = 0, g = ""; l < f; ) {
764
+ do
765
+ a = e[t.charCodeAt(l++) & 255];
766
+ while (l < f && a == -1);
767
+ if (a == -1) break;
768
+ do
769
+ i = e[t.charCodeAt(l++) & 255];
770
+ while (l < f && i == -1);
771
+ if (i == -1) break;
772
+ g += String.fromCharCode(a << 2 | (i & 48) >> 4);
773
+ do {
774
+ if (r = t.charCodeAt(l++) & 255, r == 61) return g;
775
+ r = e[r];
776
+ } while (l < f && r == -1);
777
+ if (r == -1) break;
778
+ g += String.fromCharCode((i & 15) << 4 | (r & 60) >> 2);
779
+ do {
780
+ if (o = t.charCodeAt(l++) & 255, o == 61) return g;
781
+ o = e[o];
782
+ } while (l < f && o == -1);
783
+ if (o == -1) break;
784
+ g += String.fromCharCode((r & 3) << 6 | o);
785
+ }
786
+ return g;
787
+ }, this.utf16to8 = function(t) {
788
+ var a, i, r, o;
789
+ for (a = "", r = t.length, i = 0; i < r; i++)
790
+ 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));
791
+ return a;
792
+ }, this.utf8to16 = function(t) {
793
+ var a, i, r, o, l, f;
794
+ for (a = "", r = t.length, i = 0; i < r; )
795
+ switch (o = t.charCodeAt(i++), o >> 4) {
796
+ case 0:
797
+ case 1:
798
+ case 2:
799
+ case 3:
800
+ case 4:
801
+ case 5:
802
+ case 6:
803
+ case 7:
804
+ a += t.charAt(i - 1);
805
+ break;
806
+ case 12:
807
+ case 13:
808
+ l = t.charCodeAt(i++), a += String.fromCharCode((o & 31) << 6 | l & 63);
809
+ break;
810
+ case 14:
811
+ l = t.charCodeAt(i++), f = t.charCodeAt(i++), a += String.fromCharCode((o & 15) << 12 | (l & 63) << 6 | (f & 63) << 0);
812
+ break;
813
+ }
814
+ return a;
815
+ }, this.charToHex = function(t) {
816
+ var a, i, r;
817
+ for (a = "", i = 0; i < t.length; )
818
+ r = t.charCodeAt(i++).toString(16), a += "\\0x" + r, a += i > 0 && i % 8 == 0 ? `\r
819
+ ` : ", ";
820
+ return a;
821
+ };
822
+ }
823
+ function gn() {
824
+ var n = 0, e = new Object();
825
+ this.add = function(t, a) {
826
+ this.containsKey(t) || n++, e[t] = a;
827
+ }, this.getValue = function(t) {
828
+ return this.containsKey(t) ? e[t] : null;
829
+ }, this.remove = function(t) {
830
+ this.containsKey(t) && delete e[t] && n--;
831
+ }, this.containsKey = function(t) {
832
+ return t in e;
833
+ }, this.containsValue = function(t) {
834
+ for (var a in e)
835
+ if (e[a] == t)
836
+ return !0;
837
+ return !1;
838
+ }, this.getValues = function() {
839
+ var t = [];
840
+ for (var a in e)
841
+ t.push(e[a]);
842
+ return t;
843
+ }, this.getKeys = function() {
844
+ var t = [];
845
+ for (var a in e)
846
+ t.push(a);
847
+ return t;
848
+ }, this.getSize = function() {
849
+ return n;
850
+ }, this.clear = function() {
851
+ n = 0, e = new Object();
852
+ };
853
+ }
854
+ function _n(n) {
855
+ if (this.connect = !1, this.ready_func_ = null, this.callbacks_ = new gn(), this.module_ = "JS_IActiveXCtrl", "WebSocket" in window)
856
+ this.ws = new WebSocket("ws://127.0.0.1:7321");
857
+ else
858
+ throw "WebSocket not supported";
859
+ this.ws.onerror = function() {
860
+ throw "Unable to establish connection to WebSocket";
861
+ }, this.loadModule = function() {
862
+ this.connect = !0;
863
+ var e = JSON.stringify({
864
+ MsgId: "LoadModule",
865
+ Module: this.module_
866
+ });
867
+ this.ws.onmessage = this._callback.bind(this), this.ws.send(e);
868
+ }, this.loadModuleCallBack = function(e) {
869
+ if (!e) throw e.Response;
870
+ this.ready_func_ && this.ready_func_();
871
+ }.bind(this), this.callbacks_.add("LoadModule", this.loadModuleCallBack), this.exec = function(e, t, a) {
872
+ var i = Object.id(a).toString();
873
+ this.callbacks_.add(i, a);
874
+ var r = {
875
+ MsgId: i,
876
+ Method: e + "|" + n
877
+ };
878
+ t && (r.Param = JSON.stringify(t));
879
+ var o = JSON.stringify(r);
880
+ this.connect && this.ws.send(o);
881
+ }, this.ready = function(e) {
882
+ this.ready_func_ = e;
883
+ }, this._callback = function(e) {
884
+ var t = JSON.parse(e.data), a = t.MsgId;
885
+ if (this.callbacks_.containsKey(a)) {
886
+ var i = this.callbacks_.getValue(a);
887
+ i(t.Result, t.Response), this.callbacks_.remove(a);
888
+ }
889
+ }, this.ws.onopen = this.loadModule.bind(this), this.Arm_GetDongleInfo = function({ Index: e, DongleInfoNum: t }, a) {
890
+ this.exec("Arm_GetDongleInfo", [parseInt(e), parseInt(t)], a);
891
+ }, this.Arm_Enum = function(e) {
892
+ this.exec("Arm_Enum", null, e);
893
+ }, this.Arm_Open = function({ Index: e }, t) {
894
+ this.exec("Arm_Open", [parseInt(e)], t);
895
+ }, this.Arm_Close = function({ Handle: e }, t) {
896
+ this.exec("Arm_Close", [parseInt(e)], t);
897
+ }, this.Arm_VerifyPIN = function({ Handle: e, UserPin: t, UserType: a }, i) {
898
+ this.exec("Arm_VerifyPIN", [parseInt(e), a, t], i);
899
+ }, this.Arm_ResetState = function({ Handle: e }, t) {
900
+ this.exec("Arm_ResetState", [parseInt(e)], t);
901
+ }, this.Arm_GenRandom = function({ Handle: e, RandomLen: t }, a) {
902
+ this.exec("Arm_GenRandom", [parseInt(e), parseInt(t)], a);
903
+ }, this.Arm_LEDControl = function({ Handle: e, LedFlag: t }, a) {
904
+ this.exec("Arm_LEDControl", [parseInt(e), t], a);
905
+ }, this.Arm_SwitchProtocol = function({ Handle: e, ProtocolFlag: t }, a) {
906
+ this.exec("Arm_SwitchProtocol", [parseInt(e), t], a);
907
+ }, this.Arm_CreateFile = function({ Handle: e, FileID: t, FileType: a, AttrBuffer: i }, r) {
908
+ this.exec("Arm_CreateFile", [parseInt(e), a, parseInt(t), i], r);
909
+ }, this.Arm_WriteFile = function({ Handle: e, FileID: t, FileType: a, FileOffset: i, DataInput: r }, o) {
910
+ this.exec(
911
+ "Arm_WriteFile",
912
+ [parseInt(e), a, parseInt(t), parseInt(i), r],
913
+ o
914
+ );
915
+ }, this.Arm_ReadFile0001 = function({ Handle: e }, t) {
916
+ this.exec("Arm_ReadFile", [parseInt(e), parseInt("0001"), parseInt(0), parseInt("64")], t);
917
+ }, this.Arm_ReadFile0002 = function({ Handle: e }, t) {
918
+ this.exec("Arm_ReadFile", [parseInt(e), parseInt("0002"), parseInt(0), parseInt("130")], t);
919
+ }, this.Arm_ReadFile0003 = function({ Handle: e }, t) {
920
+ this.exec("Arm_ReadFile", [parseInt(e), parseInt("0003"), parseInt(0), parseInt("130")], t);
921
+ }, this.Arm_ReadFile0004 = function({ Handle: e }, t) {
922
+ this.exec("Arm_ReadFile", [parseInt(e), parseInt("0004"), parseInt(0), parseInt("2048")], t);
923
+ }, this.Arm_ReadFile0005 = function({ Handle: e }, t) {
924
+ this.exec("Arm_ReadFile", [parseInt(e), parseInt("0005"), parseInt(0), parseInt("2048")], t);
925
+ }, this.Arm_DownloadExeFile = function({ Handle: e, Count: t, ExeFileInfo: a }, i) {
926
+ this.exec("Arm_DownloadExeFile", [parseInt(e), parseInt(t), a], i);
927
+ }, this.Arm_RunExeFile = function({ Handle: e, FileID: t, InData: a, DataLen: i }, r) {
928
+ this.exec(
929
+ "Arm_RunExeFile",
930
+ [parseInt(e), parseInt(t), a, a.length, parseInt(i)],
931
+ r
932
+ );
933
+ }, this.Arm_ReadRunExeFileData = function(e) {
934
+ this.exec("Arm_ReadRunExeFileData", null, e);
935
+ }, this.Arm_DeleteFile = function({ Handle: e, FileID: t, FileType: a }, i) {
936
+ this.exec("Arm_DeleteFile", [parseInt(e), a, parseInt(t)], i);
937
+ }, this.Arm_WriteData = function({ Handle: e, Offset: t, DataInput: a }, i) {
938
+ this.exec("Arm_WriteData", [parseInt(e), parseInt(t), a], i);
939
+ }, this.Arm_ReadData = function({ Handle: e, Offset: t, ReadLength: a }, i) {
940
+ this.exec("Arm_ReadData", [parseInt(e), parseInt(t), a], i);
941
+ }, this.Arm_WriteShareMemory = function({ Handle: e, DataInput: t }, a) {
942
+ this.exec("Arm_WriteShareMemory", [parseInt(e), t], a);
943
+ }, this.Arm_ReadShareMemory = function({ Handle: e }, t) {
944
+ this.exec("Arm_ReadShareMemory", [parseInt(e)], t);
945
+ }, this.Arm_GenUniqueKey = function({ Handle: e, Seed: t }, a) {
946
+ this.exec("Arm_GenUniqueKey", [parseInt(e), t.length, t], a);
947
+ }, this.Arm_ChangePIN = function({ Handle: e, NewPIN: t, OldPIN: a, TryCount: i, PinFlag: r }, o) {
948
+ this.exec("Arm_ChangePIN", [parseInt(e), r, a, t, parseInt(i)], o);
949
+ }, this.Arm_ResetUserPIN = function({ Handle: e, AdminPIN: t }, a) {
950
+ this.exec("Arm_ResetUserPIN", [parseInt(e), t], a);
951
+ }, this.Arm_SetUserID = function({ Handle: e, UserID: t }, a) {
952
+ this.exec("Arm_SetUserID", [parseInt(e), parseInt(t)], a);
953
+ }, this.Arm_GetDeadline = function({ Handle: e }, t) {
954
+ this.exec("Arm_GetDeadline", [parseInt(e)], t);
955
+ }, this.Arm_SetDeadline = function({ Handle: e, SetDeadTime: t }, a) {
956
+ this.exec("Arm_SetDeadline", [parseInt(e), parseInt(t)], a);
957
+ }, this.Arm_GetUTCTime = function({ Handle: e }, t) {
958
+ this.exec("Arm_GetUTCTime", [parseInt(e)], t);
959
+ }, this.Arm_RFS = function({ Handle: e }, t) {
960
+ this.exec("Arm_RFS", [parseInt(e)], t);
961
+ }, this.Arm_RsaGenPubPriKey = function({ Handle: e, RsaFileId: t }, a) {
962
+ this.exec("Arm_RsaGenPubPriKey", [parseInt(e), parseInt(t)], a);
963
+ }, this.Arm_EccGenPubPriKey = function({ Handle: e, EccFileId: t }, a) {
964
+ this.exec("Arm_EccGenPubPriKey", [parseInt(e), parseInt(t)], a);
965
+ }, this.Arm_Sm2GenPubPriKey = function({ Handle: e, Sm2FileId: t }, a) {
966
+ this.exec("Arm_Sm2GenPubPriKey", [parseInt(e), parseInt(t)], a);
967
+ }, this.Arm_ReadRsaPri = function(e) {
968
+ this.exec("Arm_ReadRsaPri", null, e);
969
+ }, this.Arm_ReadRsaPub = function(e) {
970
+ this.exec("Arm_ReadRsaPub", null, e);
971
+ }, this.Arm_ReadEccPri = function(e) {
972
+ this.exec("Arm_ReadEccPri", null, e);
973
+ }, this.Arm_ReadEccPub = function(e) {
974
+ this.exec("Arm_ReadEccPub", null, e);
975
+ }, this.Arm_ReadSm2Pri = function(e) {
976
+ this.exec("Arm_ReadSm2Pri", null, e);
977
+ }, this.Arm_ReadSm2Pub = function(e) {
978
+ this.exec("Arm_ReadSm2Pub", null, e);
979
+ }, this.Arm_RsaPri = function({ Handle: e, RsaPri_Flag: t, RsaPriInData: a, RsaPriFileID: i, RsaPriFileSize: r }, o) {
980
+ this.exec(
981
+ "Arm_RsaPri",
982
+ [parseInt(e), parseInt(i), parseInt(r), t, a],
983
+ o
984
+ );
985
+ }, this.Arm_RsaPub = function({ Handle: e, RsaPubKey: t, RsaPub_Flag: a, RsaPubInData: i, RsaPubFileSize: r }, o) {
986
+ this.exec(
987
+ "Arm_RsaPub",
988
+ [parseInt(e), parseInt(r), a, t, t.length, i],
989
+ o
990
+ );
991
+ }, this.Arm_EccSign = function({ Handle: e, HashData: t, EccFileId: a }, i) {
992
+ this.exec("Arm_EccSign", [parseInt(e), parseInt(a), t], i);
993
+ }, this.Arm_EccVerify = function({ Handle: e, HashData: t, EccPubKey: a, EccSignData: i }, r) {
994
+ this.exec("Arm_EccVerify", [parseInt(e), a, a.length, t, i], r);
995
+ }, this.Arm_Sm2Sign = function({ Handle: e, HashData: t, Sm2FileId: a }, i) {
996
+ this.exec("Arm_Sm2Sign", [parseInt(e), parseInt(a), t], i);
997
+ }, this.Arm_Sm2Verify = function({ Handle: e, HashData: t, Sm2PubKey: a, Sm2SignData: i }, r) {
998
+ this.exec("Arm_Sm2Verify", [parseInt(e), a, a.length, t, i], r);
999
+ }, this.Arm_TDES = function({ Handle: e, Tdes_Flag: t, TdesFileID: a, TdesInData: i }, r) {
1000
+ this.exec("Arm_TDES", [parseInt(e), parseInt(a), t, i], r);
1001
+ }, this.Arm_SM4 = function({ Handle: e, Sm4_Flag: t, Sm4FileID: a, Sm4InData: i }, r) {
1002
+ this.exec("Arm_SM4", [parseInt(e), parseInt(a), t, i], r);
1003
+ }, this.Arm_HASH = function({ Handle: e, Hash_Flag: t, HashInData: a }, i) {
1004
+ this.exec("Arm_HASH", [parseInt(e), t, a], i);
1005
+ }, this.Arm_Seed = function({ Handle: e, SeedData: t, SeedLength: a }, i) {
1006
+ this.exec("Arm_Seed", [parseInt(e), a, t], i);
1007
+ }, this.Arm_LimitSeedCount = function({ Handle: e, SeedCount: t }, a) {
1008
+ this.exec("Arm_LimitSeedCount", [parseInt(e), parseInt(t)], a);
1009
+ }, this.Arm_GenMotherKey = function({ Handle: e, SeedLen: t, SeedForPID: a, SonCount: i, StartUserID: r, AdminTryCount: o, UserPin: l, UserTryCount: f, UpdateRSAPriKey: g }, H) {
1010
+ this.exec(
1011
+ "Arm_GenMotherKey",
1012
+ [
1013
+ parseInt(e),
1014
+ parseInt(t),
1015
+ a,
1016
+ l,
1017
+ parseInt(f),
1018
+ parseInt(o),
1019
+ g,
1020
+ parseInt(r),
1021
+ parseInt(i)
1022
+ ],
1023
+ H
1024
+ );
1025
+ }, this.Arm_RequestInit = function({ Handle: e }, t) {
1026
+ this.exec("Arm_RequestInit", [parseInt(e)], t);
1027
+ }, this.Arm_GetInitDataFromMother = function({ Handle: e }, t) {
1028
+ this.exec("Arm_GetInitDataFromMother", [parseInt(e), Request], t);
1029
+ }, this.Arm_InitSon = function({ Handle: e, InitData: t }, a) {
1030
+ this.exec("Arm_InitSon", [parseInt(e), t], a);
1031
+ }, this.Arm_SetUpdatePriKey = function({ Handle: e, UpdatePriKey: t }, a) {
1032
+ this.exec("Arm_SetUpdatePriKey", [parseInt(e), t], a);
1033
+ }, this.Arm_MakeUpdatePacket = function({ Handle: e, HID: t, Func: a, FileID: i, FileType: r, Offset: o, DataLen: l, DataBuffer: f, UpRSAPubKey: g }, H) {
1034
+ this.exec(
1035
+ "Arm_MakeUpdatePacket",
1036
+ [
1037
+ parseInt(e),
1038
+ t,
1039
+ a,
1040
+ r,
1041
+ parseInt(i),
1042
+ parseInt(o),
1043
+ f,
1044
+ g,
1045
+ parseInt(l)
1046
+ ],
1047
+ H
1048
+ );
1049
+ }, this.Arm_MakeUpdatePacketFromMother = function({ Handle: e, HID: t, Func: a, FileID: i, FileType: r, Offset: o, DataLen: l, DataBuffer: f }, g) {
1050
+ this.exec(
1051
+ "Arm_MakeUpdatePacketFromMother",
1052
+ [parseInt(e), t, a, r, parseInt(i), parseInt(o), f, parseInt(l)],
1053
+ g
1054
+ );
1055
+ }, this.Arm_Update = function({ Handle: e, UpdateData: t }, a) {
1056
+ this.exec("Arm_Update", [parseInt(e), t], a);
1057
+ }, this.Arm_Set_DATA_FILE_ATTR = function({ Size: e, ReadPriv: t, WritePriv: a }, i) {
1058
+ this.exec("Arm_Set_DATA_FILE_ATTR", [parseInt(e), parseInt(t), parseInt(a)], i);
1059
+ }, this.Arm_Set_PRIKEY_FILE_ATTR = function({ Count: e, Size: t, Type: a, Priv: i, IsReset: r, IsDecOnRAM: o }, l) {
1060
+ this.exec(
1061
+ "Arm_Set_PRIKEY_FILE_ATTR",
1062
+ [a, parseInt(t), parseInt(e), parseInt(i), parseInt(o), parseInt(r)],
1063
+ l
1064
+ );
1065
+ }, this.Arm_Set_KEY_FILE_ATTR = function({ Size: e, PrivEnc: t }, a) {
1066
+ this.exec("Arm_Set_KEY_FILE_ATTR", [parseInt(e), parseInt(t)], a);
1067
+ }, this.Arm_Set_EXE_FILE_ATTR = function({ FileLen: e, PrivExe: t }, a) {
1068
+ this.exec("Arm_Set_EXE_FILE_ATTR", [parseInt(e), parseInt(t)], a);
1069
+ }, this.Arm_Set_DATA_LIC = function({ ReadPriv: e, WritePriv: t }, a) {
1070
+ this.exec("Arm_Set_DATA_LIC", [parseInt(e), parseInt(t)], a);
1071
+ }, this.Arm_Set_PRIKEY_LIC = function({ Count: e, Priv: t, IsReset: a, IsDecOnRAM: i }, r) {
1072
+ this.exec(
1073
+ "Arm_Set_PRIKEY_LIC",
1074
+ [parseInt(e), parseInt(t), parseInt(i), parseInt(a)],
1075
+ r
1076
+ );
1077
+ }, this.Arm_Set_KEY_LIC = function({ PrivEnc: e }, t) {
1078
+ this.exec("Arm_Set_KEY_LIC", [parseInt(e)], t);
1079
+ }, this.Arm_Set_EXE_LIC = function({ PrivExe: e }, t) {
1080
+ this.exec("Arm_Set_EXE_LIC", [parseInt(e)], t);
1081
+ }, this.Arm_Set_EXE_FILE_INFO = function({ FileID: e, FileData: t, FileSize: a, InBuffer: i, CallLimit: r }, o) {
1082
+ this.exec(
1083
+ "Arm_Set_EXE_FILE_INFO",
1084
+ [i, parseInt(a), parseInt(e), parseInt(r), t, t.length],
1085
+ o
1086
+ );
1087
+ }, this.Arm_Clear_EXE_FILE_INFO = function({ InBuffer: e }, t) {
1088
+ this.exec("Arm_Clear_EXE_FILE_INFO", [e], t);
1089
+ };
1090
+ }
1091
+ const wn = {
1092
+ HID: 0
1093
+ }, Oe = {
1094
+ PRODUCT_ID: 0,
1095
+ // 产品ID
1096
+ USER_ID: 1,
1097
+ // 用户ID
1098
+ HARDWARE_ID: 2
1099
+ // 硬件ID
1100
+ }, lt = {
1101
+ USER: 0
1102
+ // 普通用户
1103
+ };
1104
+ class Ft {
1105
+ // 加密随机数
1106
+ constructor() {
1107
+ ue(this, "Base64", new An());
1108
+ ue(this, "AtlCtrl", null);
1109
+ ue(this, "ArmCount", 0);
1110
+ // 加密锁数量
1111
+ ue(this, "ArmIndex", 0);
1112
+ // 加密锁索引
1113
+ ue(this, "ArmHandle", 0);
1114
+ // 加密锁句柄
1115
+ ue(this, "ArmRandom", "");
1116
+ try {
1117
+ this.AtlCtrl = new _n("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}");
1118
+ } catch (e) {
1119
+ console.error(e), this.AtlCtrl = null;
1120
+ }
1121
+ }
1122
+ // 获取加密锁数量
1123
+ armEnum() {
1124
+ if (this.AtlCtrl)
1125
+ return new Promise((e, t) => {
1126
+ this.AtlCtrl.Arm_Enum((a, i) => {
1127
+ a ? (this.ArmCount = +i, e(i)) : t(i);
1128
+ });
1129
+ });
1130
+ }
1131
+ // 打开加密锁,索引值从0开始
1132
+ armOpen(e = 0) {
1133
+ if (this.AtlCtrl)
1134
+ return this.ArmIndex = e, new Promise((t, a) => {
1135
+ this.AtlCtrl.Arm_Open({ Index: e }, (i, r) => {
1136
+ i ? (this.ArmHandle = +r, t(r)) : (this.ArmHandle = r, a(r));
1137
+ });
1138
+ });
1139
+ }
1140
+ // 关闭加密锁
1141
+ armClose(e = this.ArmHandle) {
1142
+ if (this.AtlCtrl)
1143
+ return new Promise((t, a) => {
1144
+ this.AtlCtrl.Arm_Close({ Handle: e }, (i, r) => {
1145
+ i ? t(r) : a(r);
1146
+ });
1147
+ });
1148
+ }
1149
+ // 修改用户PIN码
1150
+ armChangePIN(e, t, a = 255, i = lt.USER, r = this.ArmHandle) {
1151
+ if (this.AtlCtrl)
1152
+ return new Promise((o, l) => {
1153
+ this.AtlCtrl.Arm_ChangePIN({ Handle: r, NewPIN: e, OldPIN: t, TryCount: a, PinFlag: i }, (f, g) => {
1154
+ f && g == 0 ? (this.ArmPin = e, o(g)) : l(g);
1155
+ });
1156
+ });
1157
+ }
1158
+ // 生成随机数,随机数长度范围为1~128
1159
+ armGenRandom(e = 16, t = this.ArmHandle) {
1160
+ if (this.AtlCtrl)
1161
+ return new Promise((a, i) => {
1162
+ this.AtlCtrl.Arm_GenRandom({ Handle: t, RandomLen: e }, (r, o) => {
1163
+ r ? (this.ArmRandom = o, a(o)) : i(o);
1164
+ });
1165
+ });
1166
+ }
1167
+ // 获取加密锁到期时间
1168
+ armGetDeadline(e = this.ArmHandle) {
1169
+ if (this.AtlCtrl)
1170
+ return new Promise((t, a) => {
1171
+ this.AtlCtrl.Arm_GetDeadline({ Handle: e }, (i, r) => {
1172
+ i ? (this.ArmDeadline = r, t(r)) : a(r);
1173
+ });
1174
+ });
1175
+ }
1176
+ // 唯一化锁,种子码为1234567890,唯一化锁后生成密码为0C56DA077DF5CA8C,产品ID为66D23E87
1177
+ armGenUniqueKey(e = "MTIzNDU2Nzg5MA==", t = this.ArmHandle) {
1178
+ if (this.AtlCtrl)
1179
+ return new Promise((a, i) => {
1180
+ this.AtlCtrl.Arm_GenUniqueKey({ Handle: t, Seed: e }, (r, o) => {
1181
+ r ? (this.ArmUKey = o, a(o)) : i(o);
1182
+ });
1183
+ });
1184
+ }
1185
+ // 读取加密锁信息(产品ID/用户ID/硬件ID)
1186
+ armGetDongleInfo(e = 0, t = Oe.HARDWARE_ID) {
1187
+ if (this.AtlCtrl)
1188
+ return this.ArmIndex = e, new Promise((a, i) => {
1189
+ this.AtlCtrl.Arm_GetDongleInfo({ Index: e, DongleInfoNum: t }, (r, o) => {
1190
+ if (r) {
1191
+ switch (t) {
1192
+ case Oe.USER_ID:
1193
+ this.ArmUid = o;
1194
+ break;
1195
+ case Oe.PRODUCT_ID:
1196
+ this.ArmPid = o;
1197
+ break;
1198
+ case Oe.HARDWARE_ID:
1199
+ this.ArmHid = o;
1200
+ break;
1201
+ }
1202
+ a(o);
1203
+ } else
1204
+ i(o);
1205
+ });
1206
+ });
1207
+ }
1208
+ // LED灯控制操作
1209
+ armLEDControl(e, t = this.ArmHandle) {
1210
+ if (this.AtlCtrl)
1211
+ return new Promise((a, i) => {
1212
+ this.AtlCtrl.Arm_LEDControl({ Handle: t, LedFlag: e }, (r, o) => {
1213
+ r && o == 0 ? a(o) : i(o);
1214
+ });
1215
+ });
1216
+ }
1217
+ // 一键恢复出厂状态
1218
+ armRFS(e = this.ArmHandle) {
1219
+ if (this.AtlCtrl)
1220
+ return new Promise((t, a) => {
1221
+ this.AtlCtrl.Arm_RFS({ Handle: e }, (i, r) => {
1222
+ i && r == 0 ? t(r) : a(r);
1223
+ });
1224
+ });
1225
+ }
1226
+ // 读取加密锁文件
1227
+ armReadFile(e = "0001", t = this.ArmHandle) {
1228
+ if (this.AtlCtrl)
1229
+ return new Promise((a, i) => {
1230
+ this.AtlCtrl[`Arm_ReadFile${e}`]({ Handle: t }, (r, o) => {
1231
+ if (r && o.length > 0)
1232
+ try {
1233
+ o = this.Base64.decode(o), a(o);
1234
+ } catch (l) {
1235
+ console.error(l), a(o);
1236
+ }
1237
+ else
1238
+ i(o);
1239
+ });
1240
+ });
1241
+ }
1242
+ // 清除PIN码验证状态
1243
+ armResetState(e = this.ArmHandle) {
1244
+ if (this.AtlCtrl)
1245
+ return new Promise((t, a) => {
1246
+ this.AtlCtrl.Arm_ResetState({ Handle: e }, (i, r) => {
1247
+ i && r == 0 ? t(r) : a(r);
1248
+ });
1249
+ });
1250
+ }
1251
+ // 重置用户PIN码,空锁不能重置
1252
+ armResetUserPIN(e, t = this.ArmHandle) {
1253
+ if (this.AtlCtrl)
1254
+ return new Promise((a, i) => {
1255
+ this.AtlCtrl.Arm_ResetUserPIN({ Handle: t, AdminPIN: e }, (r, o) => {
1256
+ r && o == 0 ? a(o) : i(o);
1257
+ });
1258
+ });
1259
+ }
1260
+ // 设置用户ID
1261
+ armSetUserID(e, t = this.ArmHandle) {
1262
+ if (this.AtlCtrl)
1263
+ return new Promise((a, i) => {
1264
+ this.AtlCtrl.Arm_SetUserID({ Handle: t, UserID: e }, (r, o) => {
1265
+ r && o == 0 ? a(o) : i(o);
1266
+ });
1267
+ });
1268
+ }
1269
+ // 设置加密锁到期时间
1270
+ armSetDeadline(e, t = this.ArmHandle) {
1271
+ if (this.AtlCtrl)
1272
+ return new Promise((a, i) => {
1273
+ this.AtlCtrl.Arm_SetDeadline({ Handle: t, SetDeadTime: e }, (r, o) => {
1274
+ r && o == 0 ? a(o) : i(o);
1275
+ });
1276
+ });
1277
+ }
1278
+ // 切换通讯协议
1279
+ armSwitchProtocol(e = wn.HID, t = this.ArmHandle) {
1280
+ if (this.AtlCtrl)
1281
+ return new Promise((a, i) => {
1282
+ this.AtlCtrl.Arm_SwitchProtocol({ Handle: t, ProtocolFlag: e }, (r, o) => {
1283
+ r && o == 0 ? a(o) : i(o);
1284
+ });
1285
+ });
1286
+ }
1287
+ // 验证加密锁PIN码
1288
+ armVerifyPIN(e, t = lt.USER, a = this.ArmHandle) {
1289
+ if (this.AtlCtrl)
1290
+ return new Promise((i, r) => {
1291
+ this.AtlCtrl.Arm_VerifyPIN({ Handle: a, UserPin: e, UserType: t }, (o, l) => {
1292
+ o && l == 0 ? (this.ArmPin = e, i(l)) : r(l);
1293
+ });
1294
+ });
1295
+ }
1296
+ // 读取锁内数据区数据
1297
+ armReadData(e = 0, t = 128, a = this.ArmHandle) {
1298
+ if (this.AtlCtrl)
1299
+ return new Promise((i, r) => {
1300
+ this.AtlCtrl.Arm_ReadData({ Handle: a, Offset: e, ReadLength: t }, (o, l) => {
1301
+ o ? (this.ArmData = l, i(l)) : r(l);
1302
+ });
1303
+ });
1304
+ }
1305
+ // 写入锁内数据区数据
1306
+ armWriteData(e, t = 0, a = this.ArmHandle) {
1307
+ if (this.AtlCtrl)
1308
+ return new Promise((i, r) => {
1309
+ this.AtlCtrl.Arm_WriteData({ Handle: a, Offset: t, DataInput: e }, (o, l) => {
1310
+ o && l == 0 ? i(l) : r(l);
1311
+ });
1312
+ });
1313
+ }
1314
+ // 读取共享内存数据
1315
+ armReadShareMemory(e = this.ArmHandle) {
1316
+ if (this.AtlCtrl)
1317
+ return new Promise((t, a) => {
1318
+ this.AtlCtrl.Arm_ReadShareMemory({ Handle: e }, (i, r) => {
1319
+ i ? (this.ArmData = r, t(r)) : a(r);
1320
+ });
1321
+ });
1322
+ }
1323
+ // 设置共享内存数据
1324
+ armWriteShareMemory(e, t = this.ArmHandle) {
1325
+ if (this.AtlCtrl)
1326
+ return new Promise((a, i) => {
1327
+ this.AtlCtrl.Arm_WriteShareMemory({ Handle: t, DataInput: e }, (r, o) => {
1328
+ r && o == 0 ? a(o) : i(o);
1329
+ });
1330
+ });
1331
+ }
1332
+ }
1333
+ const Ut = "0123456789abcdeffedcba9876543210", Gt = "4b0de988570c3a0f", vn = window.ENCRYPT;
1334
+ let ve = vn && new Ft();
1335
+ function Ht(n = 16, e = "0123456789abcdefghijklmnopqrstuvwxyz") {
1336
+ let t = "", a = e.length;
1337
+ for (; n > 0; )
1338
+ t += e[Math.floor(Math.random() * a)], n--;
1339
+ return t;
1340
+ }
1341
+ function Vt() {
1342
+ return q(this, null, function* () {
1343
+ return ve || (ve = new Ft()), new Promise((n, e) => {
1344
+ ve.armEnum().then((t) => {
1345
+ n(+t);
1346
+ }).catch((t) => {
1347
+ J({
1348
+ type: "warning",
1349
+ ElMessage: "未找到U盘锁,请检查U盘锁!"
1350
+ }), e(t);
1351
+ });
1352
+ });
1353
+ });
1354
+ }
1355
+ Ot(
1356
+ () => q(void 0, null, function* () {
1357
+ const n = yield Vt(), e = {};
1358
+ if (typeof n != "number" || n <= 0)
1359
+ J({
1360
+ type: "warning",
1361
+ ElMessage: "未找到U盘锁,请检查U盘锁!"
1362
+ }), e.resetToken();
1363
+ else {
1364
+ const t = yield En();
1365
+ if (!e.token) return;
1366
+ t.length ? t.includes(e.ukeyHid) || (J({
1367
+ type: "error",
1368
+ ElMessage: "U盘锁不匹配,请检查U盘锁!"
1369
+ }), e.resetToken()) : (J({
1370
+ type: "warning",
1371
+ ElMessage: "未找到U盘锁,请检查U盘锁!"
1372
+ }), e.resetToken());
1373
+ }
1374
+ }),
1375
+ 5e3,
1376
+ { trailing: !1 }
1377
+ );
1378
+ function yn(n = 0) {
1379
+ return q(this, null, function* () {
1380
+ return ve ? new Promise((e, t) => {
1381
+ ve.armGetDongleInfo(n).then((a) => {
1382
+ a ? e(a) : (J({
1383
+ type: "warning",
1384
+ ElMessage: "U盘锁信息为空,请检查U盘锁!"
1385
+ }), t(a));
1386
+ }).catch((a) => {
1387
+ t(a);
1388
+ });
1389
+ }) : J({
1390
+ type: "warning",
1391
+ ElMessage: "未找到U盘锁程序,请检查后台程序!"
1392
+ });
1393
+ });
1394
+ }
1395
+ function En() {
1396
+ return q(this, null, function* () {
1397
+ if (!ve)
1398
+ return J({
1399
+ type: "warning",
1400
+ ElMessage: "未找到U盘锁程序,请检查后台程序!"
1401
+ });
1402
+ const n = yield Vt();
1403
+ let e = [];
1404
+ for (let t = 0; t < n; t++) {
1405
+ const a = yield yn(t);
1406
+ e.push(a);
1407
+ }
1408
+ return e;
1409
+ });
1410
+ }
1411
+ Ht(16);
1412
+ Ht(16);
1413
+ const Bt = window.meta.app.inspect ? ye.constants.CBC : ye.constants.ECB, { publicKey: Si, privateKey: bi } = ha.generateKeyPair();
1414
+ function In(n, e, t = {}) {
1415
+ const a = Wt(Gt), i = t.mode || Bt;
1416
+ t = i === ye.constants.ECB ? c({
1417
+ mode: i,
1418
+ // ECB
1419
+ inputEncoding: "utf8",
1420
+ outputEncoding: "hex"
1421
+ }, t) : c({
1422
+ iv: Ut,
1423
+ mode: i,
1424
+ // ECB
1425
+ inputEncoding: "utf8",
1426
+ outputEncoding: "hex"
1427
+ }, t);
1428
+ let r = "";
1429
+ try {
1430
+ r = ye.encrypt(n, a, t);
1431
+ } catch (o) {
1432
+ console.log("err: ", o);
1433
+ }
1434
+ return r;
1435
+ }
1436
+ function Tn(n, e, t = {}) {
1437
+ const a = Wt(Gt), i = t.mode || Bt;
1438
+ return t = i === ye.constants.ECB ? c({
1439
+ mode: i,
1440
+ inputEncoding: "hex",
1441
+ outputEncoding: "utf8"
1442
+ }, t) : c({
1443
+ iv: Ut,
1444
+ mode: i,
1445
+ inputEncoding: "hex",
1446
+ outputEncoding: "utf8"
1447
+ }, t), ye.decrypt(n, a, t);
1448
+ }
1449
+ function Wt(n) {
1450
+ return [...n].map((e) => e.charCodeAt().toString(16)).join("");
1451
+ }
1452
+ function De(n) {
1453
+ return n = Mt && Ze(n) ? Tn(n) : n, Ze(n) ? JSON.parse(n) : n;
1454
+ }
1455
+ function ct(n) {
1456
+ return n = Mt && Ze(n) ? In(n) : n, JSON.stringify(n);
1457
+ }
1458
+ function ge(n, e, t, a) {
1459
+ const i = new StorageEvent("storage", {
1460
+ url: window.location.href,
1461
+ key: n,
1462
+ oldValue: e,
1463
+ newValue: t,
1464
+ storageArea: a
1465
+ });
1466
+ window.dispatchEvent(i);
1467
+ }
1468
+ const dt = {
1469
+ getLocal: (n) => {
1470
+ try {
1471
+ const e = window.localStorage.getItem(n);
1472
+ return De(e);
1473
+ } catch (e) {
1474
+ console.error(e);
1475
+ }
1476
+ },
1477
+ setLocal: (n, e) => {
1478
+ try {
1479
+ const t = window.localStorage.getItem(n), a = ct(e);
1480
+ window.localStorage.setItem(n, a), ge(n, t, a, window.localStorage);
1481
+ } catch (t) {
1482
+ console.error(t);
1483
+ }
1484
+ },
1485
+ eachLocal: (n) => {
1486
+ if (!n || Xe(n) !== "Function")
1487
+ return console.error("传递参数非函数类型!");
1488
+ for (let e = 0, t = window.localStorage.length; e < t; e++) {
1489
+ const a = window.localStorage.key(e);
1490
+ n((void 0).getLocal(a), a);
1491
+ }
1492
+ },
1493
+ clearLocal: () => {
1494
+ window.localStorage.clear(), ge(null, null, null, window.localStorage);
1495
+ },
1496
+ removeLocal: (n) => {
1497
+ const e = window.localStorage.getItem(n);
1498
+ window.localStorage.removeItem(n), ge(n, e, null, window.localStorage);
1499
+ },
1500
+ getSession: (n) => {
1501
+ try {
1502
+ const e = window.sessionStorage.getItem(n);
1503
+ return De(e);
1504
+ } catch (e) {
1505
+ console.error(e);
1506
+ }
1507
+ },
1508
+ setSession: (n, e) => {
1509
+ try {
1510
+ const t = window.sessionStorage.getItem(n), a = ct(e);
1511
+ window.sessionStorage.setItem(n, a), ge(n, t, a, window.sessionStorage);
1512
+ } catch (t) {
1513
+ console.error(t);
1514
+ }
1515
+ },
1516
+ eachSession: (n) => {
1517
+ if (!n || Xe(n) !== "Function")
1518
+ return console.error("传递参数非函数类型!");
1519
+ for (let e = 0, t = window.sessionStorage.length; e < t; e++) {
1520
+ const a = window.sessionStorage.key(e);
1521
+ n((void 0).getSession(a), a);
1522
+ }
1523
+ },
1524
+ clearSession: () => {
1525
+ window.sessionStorage.clear(), ge(null, null, null, window.sessionStorage);
1526
+ },
1527
+ removeSession: (n) => {
1528
+ const e = window.sessionStorage.getItem(n);
1529
+ window.sessionStorage.removeItem(n), ge(n, e, null, window.sessionStorage);
1530
+ },
1531
+ // 监听storage变化
1532
+ onStorageChange: (n) => {
1533
+ if (!n || Xe(n) !== "Function")
1534
+ return console.error("传递参数非函数类型!");
1535
+ const e = (t) => {
1536
+ n({
1537
+ url: t.url,
1538
+ key: t.key,
1539
+ newValue: t.newValue ? De(t.newValue) : null,
1540
+ oldValue: t.oldValue ? De(t.oldValue) : null,
1541
+ storageArea: t.storageArea
1542
+ });
1543
+ };
1544
+ return window.addEventListener("storage", e), () => {
1545
+ window.removeEventListener("storage", e);
1546
+ };
1547
+ }
1548
+ }, ut = (n) => {
1549
+ const { quality: e, value: t, function_id: a } = n;
1550
+ return (e >> 7 & 1) === 1 || e === 0 && a === 2 && t === 1;
1551
+ }, ht = "USER_TOKEN", mt = "STATION_ID", Sn = [
1552
+ { key: 0, value: "离线" },
1553
+ { key: 1, value: "在线" }
1554
+ ], bn = [
1555
+ { key: 0, value: "反向" },
1556
+ { key: 1, value: "正向" },
1557
+ { key: 2, value: "停止" }
1558
+ ], Cn = [
1559
+ { key: 1, value: 1 },
1560
+ { key: 2, value: 2 },
1561
+ { key: 3, value: 3 },
1562
+ { key: 4, value: 4 },
1563
+ { key: 5, value: 5 }
1564
+ ], xn = "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", he = window.meta.graph.penFormMap ? window.meta.graph.penFormMap : {
1565
+ NORMAL: [
1566
+ {
1567
+ name: "颜色",
1568
+ key: "color",
1569
+ type: "color",
1570
+ dataIds: {}
1571
+ }
1572
+ ],
1573
+ TEXT: [
1574
+ {
1575
+ name: "显示内容",
1576
+ key: "text",
1577
+ type: "text",
1578
+ dataIds: {}
1579
+ }
1580
+ ],
1581
+ AUDIO: [
1582
+ {
1583
+ name: "颜色",
1584
+ key: "color",
1585
+ type: "color",
1586
+ dataIds: {}
1587
+ }
1588
+ ],
1589
+ MP4: [
1590
+ {
1591
+ name: "颜色",
1592
+ key: "color",
1593
+ type: "color",
1594
+ dataIds: {}
1595
+ }
1596
+ ],
1597
+ CAMERA: [
1598
+ {
1599
+ name: "颜色",
1600
+ key: "color",
1601
+ type: "color",
1602
+ dataIds: {}
1603
+ }
1604
+ ],
1605
+ VIDEO_STREAM: [
1606
+ {
1607
+ name: "颜色",
1608
+ key: "color",
1609
+ type: "color",
1610
+ dataIds: {}
1611
+ }
1612
+ ],
1613
+ LIGHT_PLATE: [
1614
+ {
1615
+ name: "光字牌",
1616
+ key: "light_plate",
1617
+ type: "select",
1618
+ dataIds: {},
1619
+ options: [
1620
+ {
1621
+ label: "离线",
1622
+ value: -1
1623
+ // mock时设置为-1时代表离线,实际以辅控alarm_value 和quality_value 来判断
1624
+ },
1625
+ {
1626
+ label: "正常",
1627
+ value: 0
1628
+ },
1629
+ {
1630
+ label: "预警",
1631
+ value: 1
1632
+ },
1633
+ {
1634
+ label: "一般",
1635
+ value: 2
1636
+ },
1637
+ {
1638
+ label: "严重",
1639
+ value: 3
1640
+ },
1641
+ {
1642
+ label: "危急",
1643
+ value: 4
1644
+ }
1645
+ ]
1646
+ }
1647
+ ]
1648
+ }, Kt = window.meta.graph.lightPlateColorMap ? window.meta.graph.lightPlateColorMap : {
1649
+ 0: "#00d200",
1650
+ // 正常
1651
+ 1: "#e2ac06",
1652
+ // 预警
1653
+ 2: "#fa800a",
1654
+ // 一般
1655
+ 3: "#f04155",
1656
+ // 严重
1657
+ 4: "#ff0000"
1658
+ // 危急
1659
+ }, Yt = window.meta.graph.lightPlateTextMap ? window.meta.graph.lightPlateTextMap : {
1660
+ 0: "#fff",
1661
+ // 正常
1662
+ 1: "#fff",
1663
+ // 预警
1664
+ 2: "#fff",
1665
+ // 一般
1666
+ 3: "#fff",
1667
+ // 严重
1668
+ 4: "#fff"
1669
+ // 危急
1670
+ }, F = {
1671
+ form: [
1672
+ {
1673
+ name: "带电状态",
1674
+ key: "charged_state",
1675
+ type: "select",
1676
+ dataIds: {},
1677
+ options: Sn.map((n) => ({
1678
+ label: n.value,
1679
+ value: n.key
1680
+ }))
1681
+ },
1682
+ {
1683
+ name: "潮流方向",
1684
+ key: "electric_direction",
1685
+ type: "select",
1686
+ dataIds: {},
1687
+ options: bn.map((n) => ({
1688
+ label: n.value,
1689
+ value: n.key
1690
+ }))
1691
+ },
1692
+ {
1693
+ name: "电荷大小",
1694
+ key: "electric_size",
1695
+ type: "select",
1696
+ dataIds: {},
1697
+ options: Cn.map((n) => ({
1698
+ label: n.value,
1699
+ value: n.key
1700
+ }))
1701
+ }
1702
+ ],
1703
+ anchors: [
1704
+ { x: 0, y: 0.5, id: "0" },
1705
+ { x: 0.5, y: 0, id: "1" },
1706
+ { x: 1, y: 0.5, id: "2" },
1707
+ { x: 0.5, y: 1, id: "3" }
1708
+ ],
1709
+ dataType: window.dataType,
1710
+ // 默认数据类型为设备层级
1711
+ dataProp: window.dataProp,
1712
+ // 默认按照名称批量匹配
1713
+ visibleLevel: window.visibleLevel
1714
+ // 默认显示数据类型为设备层级
1715
+ }, m = x(c({
1716
+ penType: T.NORMAL
1717
+ }, F), {
1718
+ form: [...he[T.NORMAL], ...F.form]
1719
+ });
1720
+ L.YX, L.YX, L.YX, T.POINT_VALUE, F.anchors, window.visibleLevel, F.form, F.form, window.dataType, window.dataProp, window.visibleLevel, F.form, window.dataType, window.dataProp, window.visibleLevel, F.form, window.dataType, window.dataProp, window.visibleLevel, Yt[0], T.LIGHT_PLATE, Kt[0], F.anchors, window.visibleLevel, [...he[T.LIGHT_PLATE], ...F.form], Le + "", T.SENSOR, F.anchors, window.visibleLevel, [...he[T.LIGHT_PLATE], ...F.form], x(c({
1721
+ width: 100,
1722
+ height: 30,
1723
+ name: "text",
1724
+ penName: "文本",
1725
+ text: "文本",
1726
+ disableAnchor: !0,
1727
+ penType: T.TEXT
1728
+ }, F), {
1729
+ form: [...he[T.TEXT], ...F.form]
1730
+ }), c({
1731
+ width: 100,
1732
+ height: 100,
1733
+ name: "square",
1734
+ penName: "正方形"
1735
+ }, m), x(c({
1736
+ type: 1,
1737
+ name: "line",
1738
+ width: 100,
1739
+ height: 5,
1740
+ lineWidth: 2,
1741
+ lineName: "line",
1742
+ penName: "line",
1743
+ background: "#FFF000",
1744
+ color: "#FFF000"
1745
+ }, m), {
1746
+ lineAnimateType: 1,
1747
+ // 定义动画效果,用作展示潮流
1748
+ anchors: [
1749
+ { x: 0, y: 0.5, id: "0" },
1750
+ { x: 1, y: 0.5, id: "1" }
1751
+ ]
1752
+ }), c({
1753
+ width: 200,
1754
+ height: 50,
1755
+ borderRadius: 0,
1756
+ name: "rectangle",
1757
+ penName: "矩形"
1758
+ }, m), c({
1759
+ width: 100,
1760
+ height: 100,
1761
+ name: "circle",
1762
+ penName: "圆"
1763
+ }, m), c({
1764
+ width: 100,
1765
+ height: 100,
1766
+ name: "triangle",
1767
+ penName: "三角形"
1768
+ }, m), c({
1769
+ width: 100,
1770
+ height: 100,
1771
+ name: "diamond",
1772
+ penName: "菱形"
1773
+ }, m), c({
1774
+ width: 100,
1775
+ height: 100,
1776
+ name: "pentagon",
1777
+ penName: "五边形"
1778
+ }, m), c({
1779
+ width: 100,
1780
+ height: 100,
1781
+ name: "hexagon",
1782
+ penName: "六边形"
1783
+ }, m), c({
1784
+ width: 100,
1785
+ height: 100,
1786
+ name: "pentagram",
1787
+ penName: "五角星"
1788
+ }, m), c({
1789
+ width: 120,
1790
+ height: 60,
1791
+ name: "leftArrow",
1792
+ penName: "左箭头"
1793
+ }, m), c({
1794
+ width: 120,
1795
+ height: 60,
1796
+ penName: "右箭头",
1797
+ name: "rightArrow"
1798
+ }, m), c({
1799
+ width: 150,
1800
+ height: 60,
1801
+ name: "twowayArrow",
1802
+ penName: "双向箭头"
1803
+ }, m), c({
1804
+ width: 100,
1805
+ height: 100,
1806
+ name: "cloud",
1807
+ penName: "云"
1808
+ }, m), c({
1809
+ textTop: -0.1,
1810
+ width: 100,
1811
+ height: 100,
1812
+ name: "message",
1813
+ penName: "消息框"
1814
+ }, m), c({
1815
+ width: 80,
1816
+ height: 100,
1817
+ name: "file",
1818
+ penName: "文件"
1819
+ }, m), x(c({
1820
+ width: 60,
1821
+ height: 100,
1822
+ name: "cube",
1823
+ penName: "立方体",
1824
+ z: 0.25
1825
+ }, m), {
1826
+ props: {
1827
+ custom: [
1828
+ {
1829
+ key: "z",
1830
+ label: "Z",
1831
+ type: "number",
1832
+ min: 0,
1833
+ placeholder: "<= 1 即宽度的比例"
1834
+ },
1835
+ {
1836
+ key: "backgroundFront",
1837
+ label: "前背景色",
1838
+ type: "color"
1839
+ },
1840
+ {
1841
+ key: "backgroundUp",
1842
+ label: "顶背景色",
1843
+ type: "color"
1844
+ },
1845
+ {
1846
+ key: "backgroundRight",
1847
+ label: "右背景色",
1848
+ type: "color"
1849
+ }
1850
+ ]
1851
+ }
1852
+ }), c({
1853
+ width: 70,
1854
+ height: 100,
1855
+ name: "people",
1856
+ penName: "人"
1857
+ }, m), x(c({
1858
+ name: "rectangle",
1859
+ penName: "按钮",
1860
+ width: 80,
1861
+ height: 30,
1862
+ borderRadius: 0.2,
1863
+ text: "按钮",
1864
+ background: "#1890ff",
1865
+ color: "#1890ff",
1866
+ textColor: "#fff",
1867
+ activeBackground: "#40a9ff",
1868
+ //选中
1869
+ activeColor: "#40a9ff",
1870
+ activeTextColor: "#fff",
1871
+ hoverBackground: "#40a9ff",
1872
+ //鼠标经过
1873
+ hoverColor: "#40a9ff",
1874
+ hoverTextColor: "#fff"
1875
+ }, m), {
1876
+ penType: T.BUTTON
1877
+ }), x(c({
1878
+ name: "rectangle",
1879
+ penName: "输入框",
1880
+ height: 50,
1881
+ width: 200,
1882
+ input: !0,
1883
+ borderRadius: 0.05,
1884
+ ellipsis: !0,
1885
+ text: "输入数据",
1886
+ textAlign: "left",
1887
+ color: "#D9D9D9FF",
1888
+ textColor: "#000000FF",
1889
+ hoverTextColor: "#000000FF",
1890
+ activeTextColor: "#000000FF",
1891
+ textLeft: 10
1892
+ }, m), {
1893
+ penType: T.INPUT
1894
+ }), x(c({
1895
+ name: "rectangle",
1896
+ penName: "选择器",
1897
+ height: 50,
1898
+ width: 200,
1899
+ borderRadius: 0.05,
1900
+ ellipsis: !0,
1901
+ text: "选项1",
1902
+ textAlign: "left",
1903
+ color: "#D9D9D9FF",
1904
+ textColor: "#000000FF",
1905
+ hoverTextColor: "#000000FF",
1906
+ activeTextColor: "#000000FF",
1907
+ textLeft: 10,
1908
+ dropdownList: [
1909
+ {
1910
+ text: "选项1"
1911
+ },
1912
+ {
1913
+ text: "选项2"
1914
+ },
1915
+ {
1916
+ text: "选项3"
1917
+ }
1918
+ ]
1919
+ }, m), {
1920
+ penType: T.SELECT
1921
+ }), x(c({
1922
+ name: "slider",
1923
+ penName: "进度条",
1924
+ width: 300,
1925
+ height: 30,
1926
+ value: 10,
1927
+ textWidth: 50,
1928
+ barHeight: 4,
1929
+ fontSize: 20,
1930
+ min: 0,
1931
+ max: 100,
1932
+ color: "#1890ff",
1933
+ background: "#D4D6D9",
1934
+ textColor: "#222",
1935
+ unit: "%"
1936
+ }, m), {
1937
+ penType: T.SLIDER
1938
+ }), x(c({
1939
+ name: "time",
1940
+ penName: "时间",
1941
+ width: 300,
1942
+ height: 40,
1943
+ text: `${ua().format("YYYY-MM-DD HH:mm:ss")}`,
1944
+ lineWidth: 0,
1945
+ fontSize: 20,
1946
+ // 绘画帧时长
1947
+ interval: 67,
1948
+ fillZero: !0
1949
+ }, m), {
1950
+ penType: T.TIME,
1951
+ form: [
1952
+ {
1953
+ key: "timeFormat",
1954
+ name: "显示格式",
1955
+ type: "text"
1956
+ },
1957
+ {
1958
+ key: "fillZero",
1959
+ name: "是否补0",
1960
+ type: "switch"
1961
+ },
1962
+ ...m.form
1963
+ ],
1964
+ timeFormat: "`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"
1965
+ }), x(c({
1966
+ name: "switch",
1967
+ penName: "开关",
1968
+ height: 30,
1969
+ width: 60,
1970
+ checked: !1,
1971
+ offColor: "#BFBFBF",
1972
+ onColor: "#1890ff",
1973
+ disableOffColor: "#E5E5E5",
1974
+ disableOnColor: "#A3D3FF",
1975
+ locked: 0
1976
+ }, m), {
1977
+ penType: T.SWITCH
1978
+ //disable: true,
1979
+ }), x(c({
1980
+ name: "radio",
1981
+ penName: "单选框",
1982
+ direction: "horizontal",
1983
+ width: 150,
1984
+ height: 30,
1985
+ checked: "",
1986
+ options: [{ text: "选项一" }, { text: "选项二" }, { text: "选项三", isForbidden: !0 }]
1987
+ }, m), {
1988
+ penType: T.RADIO
1989
+ }), x(c({
1990
+ name: "checkbox",
1991
+ penName: "多选框",
1992
+ width: 30,
1993
+ height: 30,
1994
+ checked: !0,
1995
+ // isForbidden: true,
1996
+ value: "选项一"
1997
+ }, m), {
1998
+ penType: T.CHECKBOX
1999
+ }), x(c({
2000
+ name: "table2",
2001
+ penName: "表格",
2002
+ width: 80,
2003
+ height: 30,
2004
+ datable: !0,
2005
+ disableAnchor: !0,
2006
+ colWidth: 90,
2007
+ rowHeight: 32,
2008
+ bordered: !0,
2009
+ vLine: !0,
2010
+ hLine: !0,
2011
+ stripe: !1,
2012
+ hasHeader: !0,
2013
+ color: "#333",
2014
+ textColor: "#444"
2015
+ }, m), {
2016
+ penType: T.TABLE,
2017
+ replaceMode: 2,
2018
+ data: [
2019
+ ["设备 ID", "设备名称", "数据协议", "级别"],
2020
+ [
2021
+ "1",
2022
+ "200",
2023
+ "MQTT",
2024
+ {
2025
+ text: "一级告警",
2026
+ background: "#650b09",
2027
+ textColor: "#FF5D3CFF"
2028
+ }
2029
+ ],
2030
+ [
2031
+ "2",
2032
+ "湿度传感器",
2033
+ "MQTT",
2034
+ {
2035
+ text: "二级告警",
2036
+ background: "#4d2a02",
2037
+ textColor: "#E6A82EFF"
2038
+ }
2039
+ ],
2040
+ [
2041
+ "3",
2042
+ "物联网设备",
2043
+ "MQTT",
2044
+ {
2045
+ text: "一级告警",
2046
+ background: "#650b09",
2047
+ textColor: "#FF5D3CFF"
2048
+ }
2049
+ ],
2050
+ [
2051
+ "4",
2052
+ "物联网设备/智能家居/智慧城市",
2053
+ "MQTT",
2054
+ {
2055
+ text: "三级告警",
2056
+ textColor: "#58CC84FF",
2057
+ background: "#042617;"
2058
+ }
2059
+ ]
2060
+ ],
2061
+ styles: [
2062
+ {
2063
+ row: 0,
2064
+ textColor: "#000"
2065
+ }
2066
+ ]
2067
+ }), x(c({
2068
+ name: "table2",
2069
+ penName: "斑马纹表格",
2070
+ width: 80,
2071
+ height: 30,
2072
+ datable: !0,
2073
+ disableAnchor: !0,
2074
+ colWidth: 90,
2075
+ rowHeight: 32,
2076
+ bordered: !0,
2077
+ vLine: !0,
2078
+ hLine: !0,
2079
+ stripe: !0,
2080
+ hasHeader: !0,
2081
+ color: "#333",
2082
+ textColor: "#444"
2083
+ }, m), {
2084
+ penType: T.TABLE,
2085
+ replaceMode: 2,
2086
+ data: [
2087
+ ["设备 ID", "设备名称", "数据协议", "级别"],
2088
+ [
2089
+ "1",
2090
+ "200",
2091
+ "MQTT",
2092
+ {
2093
+ text: "一级告警",
2094
+ background: "#650b09",
2095
+ textColor: "#FF5D3CFF"
2096
+ }
2097
+ ],
2098
+ [
2099
+ "2",
2100
+ "湿度传感器",
2101
+ "MQTT",
2102
+ {
2103
+ text: "二级告警",
2104
+ background: "#4d2a02",
2105
+ textColor: "#E6A82EFF"
2106
+ }
2107
+ ],
2108
+ [
2109
+ "3",
2110
+ "物联网设备",
2111
+ "MQTT",
2112
+ {
2113
+ text: "一级告警",
2114
+ background: "#650b09",
2115
+ textColor: "#FF5D3CFF"
2116
+ }
2117
+ ],
2118
+ [
2119
+ "4",
2120
+ "物联网设备/智能家居/智慧城市",
2121
+ "MQTT",
2122
+ {
2123
+ text: "三级告警",
2124
+ textColor: "#58CC84FF",
2125
+ background: "#042617;"
2126
+ }
2127
+ ]
2128
+ ],
2129
+ styles: [
2130
+ {
2131
+ row: 0,
2132
+ textColor: "#000"
2133
+ }
2134
+ ]
2135
+ }), x(c({
2136
+ name: "table2",
2137
+ penName: "滚动表格",
2138
+ width: 80,
2139
+ height: 30,
2140
+ datable: !0,
2141
+ disableAnchor: !0,
2142
+ colWidth: 90,
2143
+ rowHeight: 32,
2144
+ bordered: !0,
2145
+ vLine: !0,
2146
+ hLine: !0,
2147
+ stripe: !1,
2148
+ swiper: !0,
2149
+ maxNum: 5,
2150
+ hasHeader: !0,
2151
+ color: "#333",
2152
+ textColor: "#444"
2153
+ }, m), {
2154
+ penType: T.TABLE,
2155
+ replaceMode: 2,
2156
+ data: [
2157
+ ["设备 ID", "设备名称", "数据协议", "级别"],
2158
+ [
2159
+ "1",
2160
+ "200",
2161
+ "MQTT",
2162
+ {
2163
+ text: "一级告警",
2164
+ background: "#650b09",
2165
+ textColor: "#FF5D3CFF"
2166
+ }
2167
+ ],
2168
+ [
2169
+ "2",
2170
+ "湿度传感器",
2171
+ "MQTT",
2172
+ {
2173
+ text: "二级告警",
2174
+ background: "#4d2a02",
2175
+ textColor: "#E6A82EFF"
2176
+ }
2177
+ ],
2178
+ [
2179
+ "3",
2180
+ "物联网设备",
2181
+ "MQTT",
2182
+ {
2183
+ text: "一级告警",
2184
+ background: "#650b09",
2185
+ textColor: "#FF5D3CFF"
2186
+ }
2187
+ ],
2188
+ [
2189
+ "4",
2190
+ "智慧城市",
2191
+ "MQTT",
2192
+ {
2193
+ text: "三级告警",
2194
+ textColor: "#58CC84FF",
2195
+ background: "#042617;"
2196
+ }
2197
+ ],
2198
+ [
2199
+ "5",
2200
+ "智能家居",
2201
+ "MQTT",
2202
+ {
2203
+ text: "三级告警",
2204
+ textColor: "#58CC84FF",
2205
+ background: "#042617;"
2206
+ }
2207
+ ]
2208
+ ],
2209
+ styles: [
2210
+ {
2211
+ row: 0,
2212
+ textColor: "#000"
2213
+ }
2214
+ ]
2215
+ }), x(c({
2216
+ name: "svg",
2217
+ width: 100,
2218
+ height: 100,
2219
+ image: Le + "/icon/audio.svg",
2220
+ audioId: "",
2221
+ penName: "音频",
2222
+ datable: !0,
2223
+ penType: T.AUDIO
2224
+ }, F), {
2225
+ form: [...he[T.AUDIO], ...F.form],
2226
+ events: [
2227
+ {
2228
+ name: "enter",
2229
+ action: Re.Emit,
2230
+ value: Q.OPEN_AUDIO,
2231
+ where: {
2232
+ type: ""
2233
+ },
2234
+ params: JSON.stringify({
2235
+ action: Q.OPEN_AUDIO,
2236
+ data: ""
2237
+ // 音频id
2238
+ })
2239
+ },
2240
+ {
2241
+ name: "leave",
2242
+ action: Re.Emit,
2243
+ value: Q.CLOSE_AUDIO,
2244
+ where: {
2245
+ type: ""
2246
+ },
2247
+ params: JSON.stringify({
2248
+ action: Q.CLOSE_AUDIO,
2249
+ data: ""
2250
+ // 音频id
2251
+ })
2252
+ }
2253
+ ]
2254
+ }), x(c({
2255
+ name: "svg",
2256
+ width: 100,
2257
+ height: 100,
2258
+ image: Le + "/icon/camera.svg",
2259
+ cameraId: "",
2260
+ penName: "摄像机",
2261
+ datable: !0,
2262
+ events: [
2263
+ {
2264
+ name: "enter",
2265
+ action: Re.Emit,
2266
+ value: Q.OPEN_CAMERA,
2267
+ where: {
2268
+ type: ""
2269
+ },
2270
+ params: JSON.stringify({
2271
+ action: Q.OPEN_CAMERA,
2272
+ data: ""
2273
+ // 摄像机id
2274
+ })
2275
+ },
2276
+ {
2277
+ name: "leave",
2278
+ action: Re.Emit,
2279
+ value: Q.CLOSE_CAMERA,
2280
+ where: {
2281
+ type: ""
2282
+ },
2283
+ params: JSON.stringify({
2284
+ action: Q.CLOSE_CAMERA,
2285
+ data: ""
2286
+ // 摄像机id
2287
+ })
2288
+ }
2289
+ ],
2290
+ penType: T.CAMERA
2291
+ }, F), {
2292
+ form: [...he[T.CAMERA], ...F.form]
2293
+ }), x(c({
2294
+ name: "video",
2295
+ width: 100,
2296
+ height: 100,
2297
+ video: "https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",
2298
+ autoPlay: !0,
2299
+ penName: "MP4",
2300
+ penType: T.MP4
2301
+ }, F), {
2302
+ form: [...he[T.MP4], ...F.form]
2303
+ }), x(c({
2304
+ name: "video",
2305
+ width: 100,
2306
+ height: 100,
2307
+ penName: "视频流",
2308
+ datable: !0,
2309
+ video: "https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",
2310
+ autoPlay: !0,
2311
+ penType: T.VIDEO_STREAM
2312
+ }, F), {
2313
+ form: [...he[T.VIDEO_STREAM], ...F.form]
2314
+ }), c({
2315
+ text: "开始/结束",
2316
+ width: 120,
2317
+ height: 40,
2318
+ borderRadius: 0.5,
2319
+ name: "rectangle",
2320
+ penName: "开始/结束"
2321
+ }, m), c({
2322
+ text: "流程",
2323
+ width: 120,
2324
+ height: 40,
2325
+ name: "rectangle",
2326
+ penName: "流程"
2327
+ }, m), c({
2328
+ text: "判定",
2329
+ width: 120,
2330
+ height: 60,
2331
+ name: "diamond",
2332
+ penName: "判定"
2333
+ }, m), c({
2334
+ text: "数据",
2335
+ width: 120,
2336
+ height: 50,
2337
+ name: "flowData",
2338
+ penName: "数据",
2339
+ offsetX: 0.14
2340
+ }, m), c({
2341
+ text: "准备",
2342
+ width: 120,
2343
+ height: 50,
2344
+ name: "hexagon",
2345
+ penName: "准备"
2346
+ }, m), c({
2347
+ text: "子流程",
2348
+ width: 120,
2349
+ height: 50,
2350
+ name: "flowSubprocess",
2351
+ penName: "子流程"
2352
+ }, m), c({
2353
+ text: "数据库",
2354
+ width: 80,
2355
+ height: 120,
2356
+ name: "flowDb",
2357
+ penName: "数据库"
2358
+ }, m), c({
2359
+ text: "文档",
2360
+ width: 120,
2361
+ height: 100,
2362
+ name: "flowDocument",
2363
+ penName: "文档"
2364
+ }, m), c({
2365
+ text: "内部存储",
2366
+ width: 120,
2367
+ height: 80,
2368
+ name: "flowInternalStorage",
2369
+ penName: "内部存储"
2370
+ }, m), c({
2371
+ text: "外部存储",
2372
+ width: 120,
2373
+ height: 80,
2374
+ name: "flowExternStorage",
2375
+ penName: "外部存储"
2376
+ }, m), c({
2377
+ text: "队列",
2378
+ width: 100,
2379
+ height: 100,
2380
+ name: "flowQueue",
2381
+ penName: "队列"
2382
+ }, m), c({
2383
+ text: "手动输入",
2384
+ width: 120,
2385
+ height: 80,
2386
+ name: "flowManually",
2387
+ penName: "手动输入"
2388
+ }, m), c({
2389
+ text: "展示",
2390
+ width: 120,
2391
+ height: 80,
2392
+ name: "flowDisplay",
2393
+ penName: "展示"
2394
+ }, m), c({
2395
+ text: "并行模式",
2396
+ width: 120,
2397
+ height: 50,
2398
+ name: "flowParallel",
2399
+ penName: "并行模式"
2400
+ }, m), c({
2401
+ text: "注释",
2402
+ width: 100,
2403
+ height: 100,
2404
+ name: "flowComment",
2405
+ penName: "注释"
2406
+ }, m), c({
2407
+ text: "",
2408
+ width: 30,
2409
+ height: 30,
2410
+ name: "circle",
2411
+ penName: "开始",
2412
+ background: "#555",
2413
+ lineWidth: 0
2414
+ }, m), c({
2415
+ width: 30,
2416
+ height: 30,
2417
+ name: "activityFinal",
2418
+ penName: "结束"
2419
+ }, m), c({
2420
+ text: "活动",
2421
+ width: 120,
2422
+ height: 50,
2423
+ borderRadius: 0.25,
2424
+ name: "rectangle",
2425
+ penName: "活动"
2426
+ }, m), c({
2427
+ text: "决策/合并",
2428
+ width: 120,
2429
+ height: 50,
2430
+ name: "diamond",
2431
+ penName: "决策/合并"
2432
+ }, m), c({
2433
+ text: "垂直泳道",
2434
+ width: 200,
2435
+ height: 500,
2436
+ name: "swimlaneV",
2437
+ penName: "垂直泳道",
2438
+ textBaseline: "top",
2439
+ textTop: 20,
2440
+ // textHeight: ,
2441
+ lineTop: 0.08
2442
+ }, m), c({
2443
+ text: "水平泳道",
2444
+ width: 500,
2445
+ height: 200,
2446
+ name: "swimlaneH",
2447
+ penName: "水平泳道",
2448
+ textWidth: 0.01,
2449
+ textLeft: 0.04,
2450
+ textAlign: "left",
2451
+ lineLeft: 0.08
2452
+ }, m), c({
2453
+ text: "垂直分岔/汇合",
2454
+ width: 10,
2455
+ height: 150,
2456
+ name: "forkV",
2457
+ penName: "垂直分岔/汇合",
2458
+ fillStyle: "#555",
2459
+ strokeStyle: "transparent"
2460
+ }, m), c({
2461
+ text: "水平分岔/汇合",
2462
+ width: 150,
2463
+ height: 10,
2464
+ name: "forkH",
2465
+ penName: "水平分岔/汇合",
2466
+ fillStyle: "#555",
2467
+ strokeStyle: "transparent"
2468
+ }, m), c({
2469
+ name: "andGate",
2470
+ penName: "与门",
2471
+ width: 100,
2472
+ height: 150
2473
+ }, m), c({
2474
+ name: "basicEvent",
2475
+ penName: "基本事件",
2476
+ width: 100,
2477
+ height: 150
2478
+ }, m), c({
2479
+ name: "unexpandedEvent",
2480
+ penName: "未展开事件",
2481
+ width: 100,
2482
+ height: 150
2483
+ }, m), c({
2484
+ name: "priorityAndGate",
2485
+ penName: "优先AND门",
2486
+ width: 100,
2487
+ height: 150
2488
+ }, m), c({
2489
+ name: "forbiddenGate",
2490
+ penName: "禁止门",
2491
+ width: 100,
2492
+ height: 150
2493
+ }, m), c({
2494
+ name: "event",
2495
+ penName: "事件",
2496
+ width: 100,
2497
+ height: 150
2498
+ }, m), c({
2499
+ name: "switchEvent",
2500
+ penName: "开关事件",
2501
+ width: 100,
2502
+ height: 150
2503
+ }, m), c({
2504
+ name: "conditionalEvent",
2505
+ penName: "条件事件",
2506
+ width: 150,
2507
+ height: 100
2508
+ }, m), c({
2509
+ name: "transferSymbol",
2510
+ penName: "转移符号",
2511
+ width: 100,
2512
+ height: 150
2513
+ }, m), c({
2514
+ name: "orGate",
2515
+ penName: "或门",
2516
+ width: 100,
2517
+ height: 150
2518
+ }, m), c({
2519
+ name: "xorGate",
2520
+ penName: "异或门",
2521
+ width: 100,
2522
+ height: 150
2523
+ }, m), c({
2524
+ name: "votingGate",
2525
+ penName: "表决门",
2526
+ width: 100,
2527
+ height: 150
2528
+ }, m);
2529
+ const Pn = (n, e = { isDev: !1, devServerUrl: "", devServerPort: 8443 }) => (n = n.replace(
2530
+ /(https?:\/\/)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(:(\d+))?/,
2531
+ `$1${e.isDev ? e.devServerUrl : Va}:${e.isDev ? e.devServerPort : Wa}`
2532
+ ), e.isDev ? n : n.replace("/baseUrl", "")), Ve = (n, e) => {
2533
+ const t = n.__vccOpts || n;
2534
+ for (const [a, i] of e)
2535
+ t[a] = i;
2536
+ return t;
2537
+ }, Rn = { class: "props-panel__title" }, Nn = { class: "props-panel__value" }, kn = { class: "value-left" }, On = { class: "props-panel__value-num" }, Dn = { class: "value-right" }, Ln = /* @__PURE__ */ Object.assign({ name: "PropsPanle" }, {
2538
+ __name: "PropsPanle",
2539
+ props: {
2540
+ data: {
2541
+ type: Object,
2542
+ default: null
2543
+ }
2544
+ },
2545
+ emits: ["close", "enter", "view-history"],
2546
+ setup(n, { emit: e }) {
2547
+ const t = n, a = e;
2548
+ function i(f) {
2549
+ return f == null || f === "—" ? "—" : typeof f == "number" ? f.toFixed(2) : f;
2550
+ }
2551
+ const r = () => {
2552
+ a("close");
2553
+ }, o = () => {
2554
+ a("enter");
2555
+ }, l = () => {
2556
+ a("view-history", t.data);
2557
+ };
2558
+ return (f, g) => {
2559
+ var H, Y;
2560
+ return ie(), pe("div", {
2561
+ class: "props-panel",
2562
+ onMouseleave: r,
2563
+ onMouseover: o
2564
+ }, [
2565
+ se("div", Rn, qe(((H = t == null ? void 0 : t.data) == null ? void 0 : H.name) || "—"), 1),
2566
+ g[2] || (g[2] = se("div", { class: "props-panel__label" }, "脉冲峰值", -1)),
2567
+ se("div", Nn, [
2568
+ se("div", kn, [
2569
+ se("span", On, qe(i((Y = t == null ? void 0 : t.data) == null ? void 0 : Y.value)), 1),
2570
+ g[0] || (g[0] = se("span", { class: "props-panel__unit" }, "dBm", -1))
2571
+ ]),
2572
+ se("div", Dn, [
2573
+ Me(xe(Dt), {
2574
+ type: "primary",
2575
+ onClick: l
2576
+ }, {
2577
+ default: et(() => [...g[1] || (g[1] = [
2578
+ Pt("查看历史", -1)
2579
+ ])]),
2580
+ _: 1
2581
+ })
2582
+ ])
2583
+ ])
2584
+ ], 32);
2585
+ };
2586
+ }
2587
+ }), Mn = /* @__PURE__ */ Ve(Ln, [["__scopeId", "data-v-629e8a65"]]);
2588
+ class Fn {
2589
+ constructor(e) {
2590
+ ue(this, "editor");
2591
+ this.editor = e;
2592
+ }
2593
+ /**
2594
+ * 初始化插件
2595
+ * @param {*} meta2d
2596
+ * @param {*} target 目标组件
2597
+ * @param {*} options 配置信息
2598
+ */
2599
+ initPlugin(e, t, a = {}) {
2600
+ e.installPenPlugins({ name: t }, [
2601
+ {
2602
+ plugin: va,
2603
+ options: a
2604
+ },
2605
+ {
2606
+ plugin: ya,
2607
+ options: a
2608
+ }
2609
+ ]);
2610
+ }
2611
+ }
2612
+ function Un(n, e) {
2613
+ var ae, $;
2614
+ const t = e || new Path2D(), { x: a, y: i, width: r, height: o } = n.calculative.worldRect, l = a + r / 2, f = i + o / 2, g = r / 2, H = (ae = n.startAngle) != null ? ae : 0, Y = ($ = n.endAngle) != null ? $ : 2 * Math.PI;
2615
+ if (t.arc(l, f, g, H, Y, !0), t instanceof Path2D) return t;
2616
+ }
2617
+ function Gn(n, e) {
2618
+ const t = e || new Path2D(), { x: a, y: i, width: r, height: o } = n.calculative.worldRect;
2619
+ if (t.rect(a, i, r, o), t instanceof Path2D) return t;
2620
+ }
2621
+ function Hn(n, e) {
2622
+ const t = n || new Path2D(), a = e.dimensionData;
2623
+ if (!a) return t;
2624
+ const i = e.calculative.worldRect, r = (p) => ({
2625
+ x: i.x + p.x * i.width,
2626
+ y: i.y + p.y * i.height
2627
+ }), o = r(a.tp1), l = r(a.tp2), f = r(a.dimStart), g = r(a.dimEnd), H = e.calculative.fontSize || 12;
2628
+ n && n.beginPath && (n.save(), n.beginPath(), n.strokeStyle = e.color || "#000", n.lineWidth = e.calculative.lineWidth || 1);
2629
+ const Y = Math.max(5, H * 0.4), le = f.x - o.x, ae = f.y - o.y, $ = Math.hypot(le, ae) || 1, Z = f.x + le / $ * Y, R = f.y + ae / $ * Y, re = g.x - l.x, ne = g.y - l.y, oe = Math.hypot(re, ne) || 1, _ = g.x + re / oe * Y, C = g.y + ne / oe * Y;
2630
+ t.moveTo(o.x, o.y), t.lineTo(Z, R), t.moveTo(l.x, l.y), t.lineTo(_, C), t.moveTo(f.x, f.y), t.lineTo(g.x, g.y);
2631
+ const V = Math.hypot(g.x - f.x, g.y - f.y), U = Math.min(10, V / 2.1), G = (p, P) => {
2632
+ if (U < 1) return;
2633
+ const O = Math.atan2(P.y - p.y, P.x - p.x), z = Math.PI / 6, D = P.x - U * Math.cos(O - z), M = P.y - U * Math.sin(O - z), j = P.x - U * Math.cos(O + z), ce = P.y - U * Math.sin(O + z);
2634
+ t.moveTo(P.x, P.y), t.lineTo(D, M), t.lineTo(j, ce), t.closePath();
2635
+ };
2636
+ if (G(g, f), G(f, g), n && n.stroke && (n.stroke(), n.restore()), n && n.fillText && a.text) {
2637
+ n.save(), n.fillStyle = e.textColor || e.color || "#000", n.textAlign = "center", n.textBaseline = "bottom";
2638
+ let p = H;
2639
+ n.font = `${e.fontStyle || ""} ${e.fontWeight || ""} ${p}px ${e.fontFamily || "Arial"}`;
2640
+ const P = n.measureText(a.text), O = V * 0.9;
2641
+ if (P.width > O && O > 0) {
2642
+ const j = O / P.width;
2643
+ p = p * j, n.font = `${e.fontStyle || ""} ${e.fontWeight || ""} ${p}px ${e.fontFamily || "Arial"}`;
2644
+ }
2645
+ const z = (f.x + g.x) / 2, D = (f.y + g.y) / 2;
2646
+ let M = Math.atan2(g.y - f.y, g.x - f.x);
2647
+ (M > Math.PI / 2 || M < -Math.PI / 2) && (M += Math.PI), n.translate(z, D), n.rotate(M), n.fillText(a.text, 0, -p * 0.2), n.restore();
2648
+ }
2649
+ if (t instanceof Path2D) return t;
2650
+ }
2651
+ function Vn() {
2652
+ return q(this, null, function* () {
2653
+ yield meta2d.register({ arc: Un, mtext: Gn }), yield meta2d.registerCanvasDraw({ dimension: Hn });
2654
+ });
2655
+ }
2656
+ const Bn = "original_meta2d";
2657
+ function Wn() {
2658
+ return localStorage.removeItem(Bn);
2659
+ }
2660
+ let Ce = {};
2661
+ const Kn = (n) => {
2662
+ const e = document.querySelectorAll("video");
2663
+ let t = null;
2664
+ if (e.forEach((i) => {
2665
+ i.getAttribute("src") === n.video && (t = i);
2666
+ }), !t) return;
2667
+ 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";
2668
+ const a = new JessibucaPro({
2669
+ container: t.parentElement,
2670
+ background: "",
2671
+ // 背景图片
2672
+ hasControl: !1,
2673
+ controlAutoHide: !0,
2674
+ // 控制栏自动隐藏
2675
+ checkFirstIFrame: !0,
2676
+ // 检查首帧视频
2677
+ debug: !1,
2678
+ // this.debug, // 控制台调试打印
2679
+ decoder: "./wasm/decoder-pro.js",
2680
+ forceNoOffscreen: !0,
2681
+ // 禁用离屏模式(提升渲染能力)
2682
+ hotKey: !1,
2683
+ // 键盘快捷键
2684
+ hasAudio: !1,
2685
+ // 是否有音频,不解码可提升性能
2686
+ hasVideo: !0,
2687
+ // 是否有视频
2688
+ hiddenAutoPause: !1,
2689
+ // 监听'visibilityState'自动暂停播放
2690
+ isFlv: !0,
2691
+ // 是否解析WS-FLV协议
2692
+ isResize: !1,
2693
+ // 拉伸填充画面
2694
+ isNotMute: !0,
2695
+ // 是否开启声音
2696
+ loadingIcon: !0,
2697
+ // 加载提示图标
2698
+ loadingText: "加载中...",
2699
+ // 加载提示文字
2700
+ networkDelayTimeoutReplay: !1,
2701
+ // 网络超时重试
2702
+ playbackForwardMaxRateDecodeIFrame: 8,
2703
+ // 回放最大倍率
2704
+ showBandwidth: !1,
2705
+ // 是否显示网速
2706
+ showPerformance: !1,
2707
+ // 显示性能面板
2708
+ syncAudioAndVideo: !0,
2709
+ // 同步音视频画面
2710
+ supportDblclickFullscreen: !1,
2711
+ // 双击切换全屏
2712
+ timeout: 10,
2713
+ // 连接超时时长
2714
+ useMSE: !0,
2715
+ // MSE硬解码
2716
+ useWCS: !1,
2717
+ // WCS硬解码
2718
+ useSIMD: !0,
2719
+ // SIMD软解码
2720
+ useVideoRender: !0,
2721
+ // 使用video渲染画面
2722
+ useCanvasRender: !1,
2723
+ // 使用canvas渲染画面
2724
+ videoBuffer: 0.2,
2725
+ // 缓存时长
2726
+ videoBufferDelay: 1
2727
+ // 缓存延迟(延迟超过会触发丢帧)
2728
+ });
2729
+ return n.autoPlay && n.streamUrl && a.play(n.streamUrl), Ce[n.id] = a, a;
2730
+ }, Yn = () => {
2731
+ Object.keys(Ce).forEach((n) => {
2732
+ Ce[n].destroy(), Ce[n] = null;
2733
+ }), Ce = {};
2734
+ }, $n = { class: "sy-empty" }, zn = {
2735
+ key: 1,
2736
+ class: "sy-empty-picture"
2737
+ }, jn = { class: "sy-empty-description" }, Xn = /* @__PURE__ */ Object.assign({
2738
+ name: "SyEmpty"
2739
+ }, {
2740
+ __name: "index",
2741
+ props: {
2742
+ image: {
2743
+ type: String,
2744
+ default: "empty"
2745
+ },
2746
+ imageSize: {
2747
+ type: Number,
2748
+ default: 80
2749
+ },
2750
+ description: {
2751
+ type: String,
2752
+ default: "暂无数据"
2753
+ },
2754
+ onlyText: {
2755
+ type: Boolean,
2756
+ default: !1
2757
+ }
2758
+ },
2759
+ setup(n) {
2760
+ ia((i) => ({
2761
+ a7383bac: a.value.width,
2762
+ v736d2d7a: a.value.height
2763
+ }));
2764
+ const e = n, t = we(() => ({
2765
+ "font-size": e.imageSize ? `${e.imageSize}px` : "80px"
2766
+ })), a = we(() => e.imageSize ? {
2767
+ width: e.imageSize * 1.2 + "px",
2768
+ height: e.imageSize + "px"
2769
+ } : {
2770
+ width: "187px",
2771
+ height: "144px"
2772
+ });
2773
+ return (i, r) => {
2774
+ const o = it("SyIcon"), l = it("el-icon");
2775
+ return ie(), pe("div", $n, [
2776
+ n.image !== "empty" ? (ie(), pe("span", {
2777
+ key: 0,
2778
+ class: "sy-empty-image",
2779
+ style: Rt(t.value)
2780
+ }, [
2781
+ n.image !== "loading" ? (ie(), Fe(o, {
2782
+ key: 0,
2783
+ name: n.image,
2784
+ gradient: ""
2785
+ }, null, 8, ["name"])) : (ie(), Fe(l, {
2786
+ key: 1,
2787
+ class: "is-loading",
2788
+ style: { color: "#1671d4" }
2789
+ }, {
2790
+ default: et(() => [
2791
+ Me(xe(Da))
2792
+ ]),
2793
+ _: 1
2794
+ }))
2795
+ ], 4)) : n.onlyText ? Ue("", !0) : (ie(), pe("span", zn)),
2796
+ se("div", jn, [
2797
+ se("p", null, qe(n.description), 1)
2798
+ ])
2799
+ ]);
2800
+ };
2801
+ }
2802
+ }), qn = /* @__PURE__ */ Ve(Xn, [["__scopeId", "data-v-247a0fc9"]]), Qn = /* @__PURE__ */ Object.assign({
2803
+ name: "Meta2dEditor"
2804
+ }, {
2805
+ __name: "index",
2806
+ props: {
2807
+ url: {
2808
+ type: String,
2809
+ default: ""
2810
+ },
2811
+ data: {
2812
+ type: Object,
2813
+ default: () => {
2814
+ }
2815
+ },
2816
+ local: {
2817
+ type: Boolean,
2818
+ default: !1
2819
+ },
2820
+ preview: {
2821
+ type: Boolean,
2822
+ default: !1
2823
+ },
2824
+ devConfig: {
2825
+ type: Object,
2826
+ default: () => ({
2827
+ isDev: !1,
2828
+ devServerUrl: "",
2829
+ devServerPort: 8443
2830
+ })
2831
+ }
2832
+ },
2833
+ emits: ["loaded", "load-error"],
2834
+ setup(n, { expose: e, emit: t }) {
2835
+ const a = t, i = n, r = ra("isComponent"), o = K(null), l = oa(), f = we(() => !!(i.data || i.url));
2836
+ Qe(
2837
+ () => [i.data, i.url],
2838
+ () => {
2839
+ f.value && H();
2840
+ }
2841
+ );
2842
+ let g = K(!0);
2843
+ function H() {
2844
+ return q(this, null, function* () {
2845
+ try {
2846
+ if (g.value = !0, yield sa(), !o.value) {
2847
+ console.error("未找到meta2d元素!");
2848
+ return;
2849
+ }
2850
+ let _ = null;
2851
+ if (i.data ? _ = i.data : i.url && (_ = yield ne()), !_ || !_.data) {
2852
+ g.value = !1, console.log("图纸数据为空"), a("load-error");
2853
+ return;
2854
+ }
2855
+ const C = _.options || {
2856
+ background: "#eee",
2857
+ disableAnchor: (r == null ? void 0 : r.value) || !1
2858
+ };
2859
+ if (l.value && (l.value.destroy(!0), l.value = null), !o.value) {
2860
+ console.error("Meta2D 容器元素不可用");
2861
+ return;
2862
+ }
2863
+ l.value = new _a(o.value, x(c({}, C), {
2864
+ disableAnchor: (r == null ? void 0 : r.value) || !1,
2865
+ rotateCursor: "rotate.cur"
2866
+ })), C.visibleLevel && l.value.scale(C.visibleLevel), Y(), le(), yield ae(_.data), l.value.render(), Z(), setTimeout(() => {
2867
+ window.meta2dTools && window.registerToolsNew();
2868
+ }, 1e3), a("loaded", l.value);
2869
+ } catch (_) {
2870
+ console.error("初始化编辑器失败:", _);
2871
+ }
2872
+ });
2873
+ }
2874
+ function Y() {
2875
+ if (!l.value) return;
2876
+ new Fn({}).initPlugin(l.value, "mindNode", {});
2877
+ }
2878
+ function le() {
2879
+ Vn(), Te(Ia()), Te(Sa()), rt(ba()), Te(Ra()), Se(Na()), Te(ka()), Se(Oa()), Se(Ea()), Se(Ta()), Te(Ca()), rt(xa()), Se(Pa());
2880
+ }
2881
+ function ae(_) {
2882
+ var C;
2883
+ if (l.value) {
2884
+ if (typeof _.locked == "undefined" && (_.locked = 0), _.bkImage && l.value.setBackgroundImage(_.bkImage), _.pens && _.pens.length > 0) {
2885
+ const V = [];
2886
+ _.pens.forEach((p) => {
2887
+ p.name === "video" && p.streamUrl ? V.push(p) : p.name === "image" && p.image ? p.image = Pn(p.image, i.devConfig) : p.lineType === "gisLine" ? p.visible = !i.preview : p.penType === T.TABLE && p.dataType ? $(p) : p.penType === T.GIS_SENSOR_WRAPPER && i.preview && (p.title = "");
2888
+ }), V.length > 0 && setTimeout(() => {
2889
+ V.forEach((p) => {
2890
+ Kn(p);
2891
+ });
2892
+ }, 500);
2893
+ const U = window.meta.graph.penCountThreshold || 2e3;
2894
+ _.pens.length > U && _.scale && _.pens.forEach((p) => {
2895
+ const P = p.visibleLevel;
2896
+ P !== void 0 ? (p.visible = _.scale >= P, p.visible || (p.disabled = !0, p.locked = be.Disable)) : (p.visible = !0, p.disabled = !1, p.locked = be.None);
2897
+ });
2898
+ }
2899
+ l.value.open(x(c({}, _), { disableAnchor: (r == null ? void 0 : r.value) || !1 })), !i.preview && ((C = _.networks) != null && C.length) && l.value.closeNetwork();
2900
+ }
2901
+ }
2902
+ const $ = (_) => q(this, null, function* () {
2903
+ var V;
2904
+ const C = yield me.getCommonApi(Ua[_.dataType], {
2905
+ offset: 0,
2906
+ limit: _.tableSize || 10
2907
+ });
2908
+ if ((V = C.data) != null && V.length) {
2909
+ const U = _.tableHeader || [
2910
+ { prop: "id", label: "ID" },
2911
+ { prop: "guid", label: "标识" },
2912
+ { prop: "name", label: "名称" }
2913
+ ], G = C.data.map((p) => U.filter((P) => P.isShow).map((P) => {
2914
+ const O = p[P.prop];
2915
+ return P.choices ? P.choices[O] || O : ma(O) ? O.name : O;
2916
+ }));
2917
+ l.value.setValue({
2918
+ id: _.id,
2919
+ dataY: G
2920
+ });
2921
+ } else
2922
+ l.value.setValue({
2923
+ id: _.id,
2924
+ dataY: []
2925
+ });
2926
+ }), Z = () => {
2927
+ l.value && (l.value.on("scale", R), i.preview || l.value.on("connectLine", re));
2928
+ }, R = fa((_) => {
2929
+ var C, V, U, G;
2930
+ try {
2931
+ if (!l.value) return;
2932
+ Je.emit("graph-scale", _);
2933
+ let p = l.value.store.data.pens;
2934
+ const P = window.meta.graph.penCountThreshold || 2e3, O = p.length > P;
2935
+ for (let z = 0; z < p.length; z++) {
2936
+ const D = p[z];
2937
+ if ([T.VIDEO_STREAM, T.MP4].includes(D.penType)) {
2938
+ if (((V = (C = Ae[D.id]) == null ? void 0 : C.children) == null ? void 0 : V.length) === 3) {
2939
+ let M = Ae[D.id].children[0], j = Ae[D.id].children[2];
2940
+ M.style.width = j.currentTime / j.duration * D.calculative.worldRect.width + "px";
2941
+ } else if (((G = (U = Ae[D.id]) == null ? void 0 : U.children) == null ? void 0 : G.length) === 2) {
2942
+ let M = Ae[D.id].children[0], j = Ae[D.id].children[1];
2943
+ M.style.width = j.currentTime / j.duration * D.calculative.worldRect.width + "px";
2944
+ }
2945
+ }
2946
+ if (O) {
2947
+ const M = D.visibleLevel !== void 0 ? _ >= D.visibleLevel : !0;
2948
+ l.value._setValue({
2949
+ id: D.id,
2950
+ visible: M,
2951
+ disabled: !M,
2952
+ locked: M ? be.None : be.Disable
2953
+ });
2954
+ }
2955
+ }
2956
+ l.value.render();
2957
+ } catch (p) {
2958
+ console.error("处理缩放失败:", p);
2959
+ }
2960
+ }, 500), re = (U) => q(this, [U], function* ({ line: _, lineAnchor: C, pen: V }) {
2961
+ var de;
2962
+ if (C != null && C.start || (V == null ? void 0 : V.penType) !== T.GIS_SENSOR)
2963
+ return;
2964
+ const G = (de = _ == null ? void 0 : _.calculative) == null ? void 0 : de.worldAnchors;
2965
+ if (G.length !== 2 || G != null && G.some((ee) => !ee.connectTo))
2966
+ return;
2967
+ const [p, P] = G;
2968
+ if (p.connectTo === P.connectTo)
2969
+ return;
2970
+ const O = window.meta2d.findOne(p.connectTo), z = window.meta2d.findOne(P.connectTo);
2971
+ let D = O == null ? void 0 : O.bindData, M = z == null ? void 0 : z.bindData;
2972
+ if (!D || !M)
2973
+ return;
2974
+ const j = yield me.postPDApi("setchannelpaired/", {
2975
+ data: [
2976
+ {
2977
+ channel1: D.guid,
2978
+ channel2: M.guid
2979
+ }
2980
+ ]
2981
+ }), ce = yield me.postCommonApi("sgpoint", {
2982
+ ln__in: `${D.guid},${M.guid}`,
2983
+ group_number__in: 6
2984
+ // 一次接线图配对时确认组号
2985
+ });
2986
+ j.success && ce.success ? (l.value.setValue({
2987
+ id: _.id,
2988
+ color: "#00d200",
2989
+ lineDash: [3, 3],
2990
+ lineWidth: 2,
2991
+ lineType: "gisLine"
2992
+ }), J.success("配对成功")) : J.error("配对失败", j.detail || ce.detail);
2993
+ });
2994
+ function ne() {
2995
+ return q(this, null, function* () {
2996
+ if (!i.url)
2997
+ return J.error("图纸路径为空!"), null;
2998
+ try {
2999
+ return (yield me.getGraphApi(i.url, {
3000
+ local: i.local
3001
+ })) || null;
3002
+ } catch (_) {
3003
+ return null;
3004
+ }
3005
+ });
3006
+ }
3007
+ const oe = () => {
3008
+ l.value && (l.value.resize(), l.value.fitView(!0, 10));
3009
+ };
3010
+ return Nt(() => {
3011
+ var _, C;
3012
+ f.value && (_ = o.value) != null && _.clientHeight && (C = o.value) != null && C.clientWidth && H(), window.addEventListener("resize", oe);
3013
+ }), kt(() => {
3014
+ Yn(), Wn(), l.value && (i.preview ? (Aa(), l.value.destroy(!0)) : l.value.off("scale", R)), window.removeEventListener("resize", oe);
3015
+ }), e({
3016
+ stage: l
3017
+ }), (_, C) => (ie(), pe("div", {
3018
+ ref_key: "meta2dRef",
3019
+ ref: o,
3020
+ class: "meta2d-editor"
3021
+ }, [
3022
+ xe(g) ? Ue("", !0) : (ie(), Fe(qn, {
3023
+ key: 0,
3024
+ class: "meta2d-empty",
3025
+ description: "图纸不存在"
3026
+ }))
3027
+ ], 512));
3028
+ }
3029
+ }), Jn = /* @__PURE__ */ Ve(Qn, [["__scopeId", "data-v-7576c5c8"]]), Zn = {
3030
+ key: 0,
3031
+ class: "back-btn"
3032
+ };
3033
+ var Ct, xt;
3034
+ const ei = /* @__PURE__ */ Object.assign({
3035
+ name: "Meta2dPreview"
3036
+ }, {
3037
+ __name: "index",
3038
+ props: {
3039
+ url: {
3040
+ type: String,
3041
+ default: ""
3042
+ },
3043
+ gid: {
3044
+ type: String,
3045
+ default: ""
3046
+ },
3047
+ data: {
3048
+ type: Object,
3049
+ default: null
3050
+ },
3051
+ local: {
3052
+ type: Boolean,
3053
+ default: !1
3054
+ },
3055
+ // 图纸语言
3056
+ lang: {
3057
+ type: String,
3058
+ default: ((xt = (Ct = window.meta) == null ? void 0 : Ct.app) == null ? void 0 : xt.lang) || "zh-cn"
3059
+ },
3060
+ // 配置选项
3061
+ config: {
3062
+ type: Object,
3063
+ default: () => ({
3064
+ socketUrl: st,
3065
+ stationIdKey: mt,
3066
+ enableToken: !0,
3067
+ userTokenKey: ht,
3068
+ userToken: void 0,
3069
+ messageDelay: 200,
3070
+ debounceDelay: 100,
3071
+ enableAutoFit: !0,
3072
+ enableWebSocket: !0,
3073
+ graphSocket: ot.GRAPH.SOCKET
3074
+ })
3075
+ },
3076
+ showMap: {
3077
+ type: Boolean,
3078
+ default: !1
3079
+ },
3080
+ isFactory: {
3081
+ type: Boolean,
3082
+ default: !1
3083
+ },
3084
+ isInitData: {
3085
+ type: Boolean,
3086
+ default: !0
3087
+ },
3088
+ // 外部依赖注入
3089
+ apiInstance: {
3090
+ type: Object,
3091
+ default: () => me
3092
+ },
3093
+ mittInstance: {
3094
+ type: Object,
3095
+ default: () => Je
3096
+ },
3097
+ // 自定义回调
3098
+ customCallbacks: {
3099
+ type: Object,
3100
+ default: () => ({})
3101
+ },
3102
+ // 错误处理配置
3103
+ errorHandler: {
3104
+ type: Object,
3105
+ default: () => ({
3106
+ callback: null,
3107
+ showMessage: !0
3108
+ })
3109
+ },
3110
+ // 打包后开发环境配置
3111
+ devConfig: {
3112
+ type: Object,
3113
+ default: () => ({
3114
+ isDev: !1,
3115
+ devServerUrl: "",
3116
+ devServerPort: 8443
3117
+ })
3118
+ }
3119
+ },
3120
+ emits: ["error", "loaded", "custom-msg", "socket-msg", "view-history"],
3121
+ setup(n, { expose: e, emit: t }) {
3122
+ const a = t, i = n;
3123
+ let r = K(!1), o = K(""), l = K(""), f = K(!1);
3124
+ const g = K(!1);
3125
+ provide("isComponent", g);
3126
+ const H = K(null), Y = K(null), le = K(null), ae = K(""), $ = K(""), Z = K(!1), R = we(() => {
3127
+ var s;
3128
+ return (s = le.value) == null ? void 0 : s.stage;
3129
+ }), re = we(() => {
3130
+ var s;
3131
+ return (s = R.value) == null ? void 0 : s.store;
3132
+ }), ne = we(() => c({
3133
+ socketUrl: st,
3134
+ stationIdKey: mt,
3135
+ enableToken: !0,
3136
+ userTokenKey: ht,
3137
+ userToken: void 0,
3138
+ messageDelay: 200,
3139
+ debounceDelay: 100,
3140
+ enableAutoFit: !0,
3141
+ fitPadding: 10,
3142
+ enableWebSocket: !0,
3143
+ graphSocket: ot.GRAPH.SOCKET
3144
+ }, i.config)), oe = () => i.apiInstance || me, _ = () => i.mittInstance || Je, C = (s, d = "") => {
3145
+ const w = {
3146
+ error: s,
3147
+ message: d,
3148
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
3149
+ };
3150
+ a("error", w), i.errorHandler.callback ? i.errorHandler.callback(w) : i.errorHandler.showMessage && J && J.error(`${d}: ${s.message || s}`);
3151
+ }, V = () => {
3152
+ o.value ? ($.value = o.value, Z.value = f.value) : l.value && (ae.value = l.value, Ie(ae.value)), r.value = !1;
3153
+ }, U = {}, G = K(!1), p = K({ left: 0, top: 0 }), P = K(!1), O = () => {
3154
+ P.value = !1, G.value = !1, p.value = { left: 0, top: 0 }, de.value = {};
3155
+ }, z = () => {
3156
+ P.value = !0;
3157
+ }, D = (s) => {
3158
+ a("view-history", s);
3159
+ }, M = (s, d) => {
3160
+ if (!H.value)
3161
+ return {
3162
+ left: s + 20,
3163
+ top: d + 20
3164
+ };
3165
+ const w = H.value.getBoundingClientRect(), b = s - w.left, N = d - w.top;
3166
+ let I = 300, E = 150;
3167
+ if (Y.value) {
3168
+ const v = Y.value.$el || Y.value;
3169
+ v && v.offsetWidth && (I = v.offsetWidth, E = v.offsetHeight);
3170
+ }
3171
+ let h = b + 20, y = N + 20;
3172
+ return h + I > w.width && (h = b - I - 20), y + E > w.height && (y = N - E - 20), {
3173
+ left: Math.max(0, Math.min(h, w.width - I)),
3174
+ top: Math.max(0, Math.min(y, w.height - E))
3175
+ };
3176
+ }, j = (s) => {
3177
+ G.value && (p.value.left || (p.value = M(s.clientX, s.clientY)));
3178
+ }, ce = (s) => {
3179
+ var d, w, b, N, I, E;
3180
+ try {
3181
+ if (!s) return;
3182
+ if ((d = s == null ? void 0 : s.includes) != null && d.call(s, "token 必传"))
3183
+ return J.warning(s);
3184
+ const h = typeof s == "string" ? JSON.parse(s) : s;
3185
+ if ((h == null ? void 0 : h.data) === "服务错误" || (b = (w = h == null ? void 0 : h.data) == null ? void 0 : w.includes) != null && b.call(w, "token is expired"))
3186
+ return J.warning(h.data);
3187
+ switch (a("socket-msg", h), h.action) {
3188
+ case Ye.ACPOINT.YCVALUE:
3189
+ case Ye.ACPOINT.YXVALUE:
3190
+ if ((N = h == null ? void 0 : h.data) != null && N.point_id) {
3191
+ const y = R.value.find(h.data.point_id);
3192
+ y && (U[h.data.point_id] = h.action === Ye.ACPOINT.YXVALUE ? ke(h.data.value) ? h.data.value : 0 : ke(h.data.value_disp || h.data.value) ? h.data.value_disp || h.data.value : 0, Pe(y, h.data));
3193
+ }
3194
+ break;
3195
+ default:
3196
+ if (((I = h.data) == null ? void 0 : I.length) > 0) {
3197
+ const y = setTimeout(() => {
3198
+ clearTimeout(y), R.value && (h.data.forEach((v) => {
3199
+ U[v.dataId || v.point_id] = v.value_disp || v.value;
3200
+ }), h.data.forEach((v) => {
3201
+ const S = R.value.find(v.dataId || v.point_id);
3202
+ Pe(S, v);
3203
+ }));
3204
+ }, ne.value.messageDelay);
3205
+ i.customCallbacks.onWebSocketMessage && i.customCallbacks.onWebSocketMessage(h), (E = window.customSocketFn) == null || E.call(window, s);
3206
+ }
3207
+ break;
3208
+ }
3209
+ return !0;
3210
+ } catch (h) {
3211
+ return C(h, "WebSocket消息处理"), !0;
3212
+ }
3213
+ }, de = K({});
3214
+ let ee = {}, Ee = null;
3215
+ const __$t__ = (s) => q(this, null, function* () {
3216
+ try {
3217
+ if (s.msgName)
3218
+ switch (s.msgName) {
3219
+ case Q.CHANGE_GRAPH:
3220
+ case Q.NOTIFY_DIALOG:
3221
+ case Q.GIS_PROPS_PANEL:
3222
+ tt(s);
3223
+ break;
3224
+ }
3225
+ else
3226
+ tt(s);
3227
+ a("custom-msg", s), i.customCallbacks.onCustomMessage && i.customCallbacks.onCustomMessage(s);
3228
+ } catch (d) {
3229
+ C(d, "自定义消息处理");
3230
+ }
3231
+ }), tt = (s) => {
3232
+ var b, N;
3233
+ let d;
3234
+ if (s.params)
3235
+ try {
3236
+ d = JSON.parse(s.params);
3237
+ } catch (I) {
3238
+ d = s.params;
3239
+ }
3240
+ switch (s.msgName) {
3241
+ case Q.CHANGE_GRAPH:
3242
+ (d == null ? void 0 : d.data) !== "图纸id" && (d != null && d.data) ? (o.value = $.value, f.value = Z.value, r.value = d.isBack, (b = d == null ? void 0 : d.data) != null && b.startsWith("/") ? ($.value = d == null ? void 0 : d.data, Z.value = !0) : (Z.value = !1, l.value = Ie(d.data))) : d ? (Z.value = !1, l.value = ae.value, r.value = !0, Ie(d)) : console.warn("切换图纸信息为空");
3243
+ break;
3244
+ case Q.NOTIFY_DIALOG:
3245
+ d.msg !== "通知内容" ? pa(c({
3246
+ message: d.msg
3247
+ }, d)) : console.warn("通知内容为空");
3248
+ break;
3249
+ case Q.GIS_PROPS_PANEL:
3250
+ s.eventName === "enter" ? (G.value = !0, s.pen.penType === T.GIS_SENSOR ? de.value = ((N = s == null ? void 0 : s.pen) == null ? void 0 : N.bindData) || {} : s.pen.penType === T.GIS_SENSOR_WRAPPER && s.pen.children.forEach((I) => {
3251
+ const E = R.value.findOne(I);
3252
+ E && E.penType === T.GIS_SENSOR && (de.value = E.bindData || {});
3253
+ }), s.e && (p.value = M(s.e.clientX, s.e.clientY))) : setTimeout(() => {
3254
+ P.value || (G.value = !1, p.value = { left: 0, top: 0 }, de.value = {});
3255
+ }, 200);
3256
+ break;
3257
+ }
3258
+ }, zt = (s) => {
3259
+ var d, w, b, N, I, E, h, y, v;
3260
+ try {
3261
+ a("loaded", s);
3262
+ const S = je(), u = ne.value, A = dt.getSession(u.stationIdKey), W = dt.getSession(u.userTokenKey);
3263
+ u.enableWebSocket && A && W && ((b = (w = (d = s.store) == null ? void 0 : d.data) == null ? void 0 : w.networks) != null && b.length ? (E = (I = (N = s.store) == null ? void 0 : N.data) == null ? void 0 : I.networks) == null || E.forEach((X) => {
3264
+ var fe;
3265
+ X.protocol === "websocket" && ((fe = X.url) != null && fe.includes("station_id") || (X.url = `${X.url}?station_id=${A}`), u.enableToken ? X.protocols = u.userToken || W : X.protocols = void 0);
3266
+ }) : (y = (h = s.store) == null ? void 0 : h.data) != null && y.websocket ? ((v = s.store.data.websocket) != null && v.includes("station_id") || (s.store.data.websocket = `${s.store.data.websocket}?station_id=${A}`), u.enableToken ? s.store.data.websocketProtocols = u.userToken || W : s.store.data.websocketProtocols = void 0, s.closeSocket(), s.connectSocket()) : (s.store.data.websocket = `${u.socketUrl}?station_id=${A}`, u.enableToken ? s.store.data.websocketProtocols = W : s.store.data.websocketProtocols = void 0, s.connectWebsocket())), (i.showMap || S.showMap === "true") && s.showMap(), s.setRule({ rule: !1 }), s.setOptions({ disableRuleLine: !0 }), s.setGrid({ grid: !1 }), s.lock(be.DisableEdit), We().forEach((X) => {
3267
+ var fe;
3268
+ (fe = X == null ? void 0 : X.events) != null && fe.length ? B({ id: X.id, locked: 1 }, !1) : B({ id: X.id, locked: 10 }, !1);
3269
+ }), s.render(), u.enableAutoFit && s.fitView(!0, u.fitPadding), Object.values(Q).forEach((X) => {
3270
+ s.on(
3271
+ X,
3272
+ (fe) => __$t__(x(c({}, fe), {
3273
+ msgName: X
3274
+ }))
3275
+ );
3276
+ }), s && (s.socketFn = ce), i.customCallbacks.onStageLoaded && i.customCallbacks.onStageLoaded(s), i.isInitData && jt(s), window.addEventListener("mousemove", j);
3277
+ } catch (S) {
3278
+ C(S, "图纸加载完成处理");
3279
+ }
3280
+ }, Ie = Ot((s) => q(this, null, function* () {
3281
+ var d;
3282
+ try {
3283
+ if (window.isFactory = i.isFactory, i.url) {
3284
+ Z.value = i.local, yield Be(i.url);
3285
+ return;
3286
+ }
3287
+ const w = je();
3288
+ if (s = s || i.gid || w.id, w.local === "true" && (Z.value = !0), s) {
3289
+ const b = oe();
3290
+ if (b && b.getCommonApi) {
3291
+ const N = yield b.getCommonApi(i.isFactory ? "graph" : "floorplan", { guid: s });
3292
+ if ((d = N.data) != null && d.length)
3293
+ yield Be(N.data[0].path);
3294
+ else {
3295
+ const I = "未找到图纸!";
3296
+ C(new Error(I), "获取图纸数据");
3297
+ }
3298
+ } else
3299
+ C(new Error("API实例不可用"), "初始化图纸数据!");
3300
+ } else
3301
+ Z.value = i.local, yield Be(i.url);
3302
+ i.customCallbacks.onGraphLoaded && i.customCallbacks.onGraphLoaded($.value);
3303
+ } catch (w) {
3304
+ C(w, "获取图纸数据失败");
3305
+ }
3306
+ })), Be = (s) => q(this, null, function* () {
3307
+ const d = s.split(".");
3308
+ if (s.includes(i.lang) || d.length !== 3) {
3309
+ $.value = s;
3310
+ return;
3311
+ }
3312
+ const w = `${d[0]}.${i.lang}.${d[2]}`;
3313
+ try {
3314
+ const b = yield me.getGraphApi(w, { local: i.local }).catch(() => {
3315
+ console.warn("多语言图纸不存在,使用默认图纸");
3316
+ });
3317
+ $.value = b ? w : s;
3318
+ } catch (b) {
3319
+ $.value = s;
3320
+ }
3321
+ }), jt = (s) => q(this, null, function* () {
3322
+ var d, w, b, N;
3323
+ if (s) {
3324
+ let I = [], E = [], h = [];
3325
+ ee = {};
3326
+ const y = s.store.data.pens;
3327
+ for (let S = 0; S < y.length; S++) {
3328
+ const u = y[S];
3329
+ u.bindDataId ? (d = u.form) != null && d.length ? u.form.forEach((A) => {
3330
+ if (A.dataIds.dataId)
3331
+ switch (A.dataIds.dataType) {
3332
+ case L.YC:
3333
+ I.push(x(c({}, A), {
3334
+ nodeName: A.dataIds.name,
3335
+ penId: u.id,
3336
+ penName: u.penName
3337
+ }));
3338
+ break;
3339
+ case L.YX:
3340
+ E.push(x(c({}, A), {
3341
+ nodeName: A.dataIds.name,
3342
+ penId: u.id,
3343
+ penName: u.penName
3344
+ }));
3345
+ break;
3346
+ case L.SG:
3347
+ E.push(x(c({}, A), {
3348
+ nodeName: A.dataIds.name,
3349
+ penId: u.id,
3350
+ penName: u.penName
3351
+ }));
3352
+ break;
3353
+ case L.POINT:
3354
+ h.push(x(c({}, A), {
3355
+ nodeName: A.dataIds.name,
3356
+ penId: u.id,
3357
+ penName: u.penName
3358
+ }));
3359
+ break;
3360
+ }
3361
+ }) : (u.penType === T.GIS_SENSOR || u.penType === T.GIS_DB_VALUE) && u.bindData && (ee[u.bindData.ied_id] || (ee[u.bindData.ied_id] = []), B({
3362
+ id: u.id,
3363
+ title: void 0
3364
+ }), ee[u.bindData.ied_id].push(c({
3365
+ penId: u.id,
3366
+ penType: u.penType
3367
+ }, u.bindData))) : (w = u.statusBindData) != null && w.length && u.statusBindData.forEach((A) => {
3368
+ if (A.dataId)
3369
+ switch (A.dataType) {
3370
+ case L.YX:
3371
+ E.push({
3372
+ showChild: 0,
3373
+ value: 0,
3374
+ nodeName: A.dataName,
3375
+ penId: u.id,
3376
+ penName: u.penName,
3377
+ dataId: A.dataId
3378
+ });
3379
+ break;
3380
+ case L.SG:
3381
+ E.push({
3382
+ showChild: 0,
3383
+ value: 0,
3384
+ nodeName: A.dataName,
3385
+ penId: u.id,
3386
+ penName: u.penName,
3387
+ dataId: A.dataId
3388
+ });
3389
+ break;
3390
+ }
3391
+ });
3392
+ }
3393
+ let v = [];
3394
+ if (I.length) {
3395
+ const S = oe();
3396
+ if (S && S.postCommonApi) {
3397
+ const u = yield S.postCommonApi("queryrealtimepoint", {
3398
+ point_id: I.map((A) => {
3399
+ var W;
3400
+ return ((W = A == null ? void 0 : A.dataIds) == null ? void 0 : W.dataId) || A.dataId;
3401
+ }).join(",")
3402
+ });
3403
+ (b = u == null ? void 0 : u.data) != null && b.length && (u.data.forEach((A) => {
3404
+ U[A.guid] = A.value_disp || A.value;
3405
+ }), v = [...v, ...u.data]);
3406
+ }
3407
+ }
3408
+ if (E.length) {
3409
+ const S = oe();
3410
+ if (S && S.postCommonApi) {
3411
+ const u = yield S.postCommonApi("queryrealtimepoint", {
3412
+ point_id: E.map((A) => {
3413
+ var W;
3414
+ return ((W = A == null ? void 0 : A.dataIds) == null ? void 0 : W.dataId) || A.dataId;
3415
+ }).join(",")
3416
+ });
3417
+ (N = u == null ? void 0 : u.data) != null && N.length && (u.data.forEach((A) => {
3418
+ U[A.guid] = ze(A.value) ? Number(A.value) : A.value;
3419
+ }), v = [...v, ...u.data]);
3420
+ }
3421
+ }
3422
+ v.length && v.forEach((S) => {
3423
+ const u = s.find(S.guid);
3424
+ Pe(u, x(c({}, S), {
3425
+ value: ze(S.value) ? ke(Number(S.value)) ? Number(S.value) : 0 : S.value,
3426
+ value_disp: S.value_disp,
3427
+ alarm_value: S.alarm_value,
3428
+ point_id: S.guid
3429
+ }));
3430
+ }), ee && Object.keys(ee).length ? (Ee && clearInterval(Ee), at(), Ee = setInterval(() => {
3431
+ at();
3432
+ }, 3e3)) : Ee && clearInterval(Ee);
3433
+ }
3434
+ }), at = () => q(this, null, function* () {
3435
+ var s;
3436
+ if (ee) {
3437
+ const d = Object.keys(ee);
3438
+ if (d.length) {
3439
+ const w = yield me.postPDApi("querychannelstatus/", {
3440
+ data: d.map((b) => ({
3441
+ ied_id: b,
3442
+ ln_list: ee[b].map((N) => N.ln_id)
3443
+ }))
3444
+ });
3445
+ (s = w == null ? void 0 : w.data) != null && s.length && (d.forEach((b) => {
3446
+ const N = w.data.find((E) => E.ied_id === b), I = ee[b];
3447
+ I != null && I.length && I.forEach((E) => {
3448
+ const h = N.result.find((y) => y.ln_id === E.ln_id);
3449
+ if (h) {
3450
+ const y = ze(h.amp_peak) ? ke(Number(h.amp_peak)) ? Number(h.amp_peak) : 0 : h.amp_peak;
3451
+ E.penType === T.GIS_SENSOR ? B(
3452
+ {
3453
+ id: E.penId,
3454
+ showChild: h.status === "告警" ? 2 : h.status === "正常" ? 1 : 0,
3455
+ bindData: x(c({}, E), {
3456
+ status: h.status,
3457
+ value: y
3458
+ })
3459
+ },
3460
+ !1
3461
+ ) : B(
3462
+ {
3463
+ id: E.penId,
3464
+ text: `${y} dBm`
3465
+ },
3466
+ !1
3467
+ );
3468
+ }
3469
+ });
3470
+ }), R.value.render());
3471
+ }
3472
+ }
3473
+ }), B = (s, d = !0) => {
3474
+ if (R.value)
3475
+ return R.value.setValue(s, { render: d });
3476
+ }, Xt = () => R.value, We = () => {
3477
+ var s, d;
3478
+ return ((d = (s = re.value) == null ? void 0 : s.data) == null ? void 0 : d.pens) || [];
3479
+ }, qt = () => T, Pe = /* @__PURE__ */ (() => {
3480
+ let s = null;
3481
+ const d = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), b = (I) => {
3482
+ var h;
3483
+ if (!((h = I.children) != null && h.length)) return [];
3484
+ const E = I.id || "";
3485
+ if (!E) return [];
3486
+ if (!w.has(E) && re.value) {
3487
+ const y = wa(I, re.value);
3488
+ w.set(E, y);
3489
+ }
3490
+ return w.get(E) || [];
3491
+ }, N = () => {
3492
+ if (d.size === 0 || !R.value || !re.value) return;
3493
+ const I = [], E = [], h = re.value.animates;
3494
+ d.forEach(({ pen: y, dataItem: v, formKey: S }) => {
3495
+ switch (S) {
3496
+ case "showChild":
3497
+ B({ id: y.id, showChild: +v.value }, !1);
3498
+ break;
3499
+ case "text":
3500
+ B({ id: y.id, text: v.value_disp || v.value }, !1);
3501
+ break;
3502
+ case "light_plate":
3503
+ {
3504
+ const u = v.value === -1 || ut(v) ? "#999999" : Yt[v.value !== void 0 ? v.value : v.alarm_value], A = v.value === -1 || ut(v) ? "#cccccc" : Kt[v.value !== void 0 ? v.value : v.alarm_value];
3505
+ B({ id: y.id, textColor: u, background: A }, !1);
3506
+ }
3507
+ break;
3508
+ case "point_value":
3509
+ y.penType === T.POINT_VALUE && b(y).forEach((A) => {
3510
+ A.name === "text" && B({ id: A.id, text: v.value }, !1);
3511
+ });
3512
+ break;
3513
+ case "online_state":
3514
+ {
3515
+ let u = v.value ? void 0 : "contrast(0%)";
3516
+ B({ id: y.id, filter: u }, !1), b(y).forEach((W) => {
3517
+ B({ id: W.id, filter: u }, !1);
3518
+ });
3519
+ }
3520
+ break;
3521
+ case "charged_state":
3522
+ {
3523
+ const u = v.value === La.OFFLINE ? "contrast(0%)" : void 0;
3524
+ u !== y.filter && (B({ id: y.id, filter: u }, !1), b(y).forEach((W) => {
3525
+ B({ id: W.id, filter: u }, !1);
3526
+ }));
3527
+ }
3528
+ break;
3529
+ case "electric_direction":
3530
+ v.value === Ma.STOP ? h != null && h.has(y) && E.push(y) : !!v.value !== y.animateReverse && (B(
3531
+ {
3532
+ id: y.id,
3533
+ animateReverse: !!v.value
3534
+ },
3535
+ !1
3536
+ ), h != null && h.has(y) || I.push(y));
3537
+ break;
3538
+ case "electric_size":
3539
+ {
3540
+ const u = Fa[v.value];
3541
+ u !== void 0 && u !== y.lineWidth && B(
3542
+ {
3543
+ id: y.id,
3544
+ lineWidth: u
3545
+ },
3546
+ !1
3547
+ );
3548
+ }
3549
+ break;
3550
+ default:
3551
+ B(
3552
+ {
3553
+ id: y.id,
3554
+ [S]: v.value
3555
+ },
3556
+ !1
3557
+ );
3558
+ break;
3559
+ }
3560
+ }), E.length > 0 && R.value.stopAnimate(E), I.length > 0 && R.value.startAnimate(I), d.clear(), R.value.render();
3561
+ };
3562
+ return (I, E) => {
3563
+ I != null && I.length && (I.forEach((h) => {
3564
+ var v;
3565
+ const y = h.form;
3566
+ if ((v = h.statusBindData) != null && v.length) {
3567
+ if (!U[E.guid]) return;
3568
+ const S = [...h.statusBindData], u = S.findIndex((A) => A.dataId === E.guid);
3569
+ if (u !== -1) {
3570
+ const A = S[u];
3571
+ S.find(
3572
+ (te) => A.sort < te.sort && U[te.dataId]
3573
+ ) || d.set(h.id, {
3574
+ pen: h,
3575
+ formKey: "showChild",
3576
+ dataItem: x(c({}, E), { value: u })
3577
+ });
3578
+ }
3579
+ } else y != null && y.length && y.forEach((S) => {
3580
+ if (!(Array.isArray(S.dataIds) ? S.dataIds : [S.dataIds]).some(
3581
+ (te) => (te == null ? void 0 : te.dataId) && ((te == null ? void 0 : te.dataId) === E.dataId || (te == null ? void 0 : te.dataId) === E.point_id)
3582
+ )) return;
3583
+ const W = `${h.id}-${S.key}`;
3584
+ d.set(W, {
3585
+ pen: h,
3586
+ dataItem: E,
3587
+ formKey: S.key
3588
+ });
3589
+ });
3590
+ }), s && clearTimeout(s), s = setTimeout(() => {
3591
+ N(), s = null;
3592
+ }, ne.value.debounceDelay));
3593
+ };
3594
+ })(), Qt = (s) => {
3595
+ if (R.value) {
3596
+ for (let d = 0; d < s.length; d++) {
3597
+ const w = s[d];
3598
+ U[w.dataId || w.point_id] = w.value_disp || w.value;
3599
+ const b = R.value.find(w.dataId);
3600
+ setTimeout(() => {
3601
+ Pe(b, w);
3602
+ }, ne.value.messageDelay);
3603
+ }
3604
+ R.value.render(), i.customCallbacks.onBatchUpdate && i.customCallbacks.onBatchUpdate(s);
3605
+ }
3606
+ }, Jt = (s, d = !1) => {
3607
+ if (!R.value) return;
3608
+ const w = We();
3609
+ for (let b = 0; b < w.length; b++) {
3610
+ const N = w[b];
3611
+ let I = !1;
3612
+ d ? I = s === N.dataProp : I = s === 5 ? !0 : N.dataProp <= s, B({ id: N.id, visible: I }, !1);
3613
+ }
3614
+ R.value.fitView(), R.value.render(), i.customCallbacks.onLevelChange && i.customCallbacks.onLevelChange(s, d);
3615
+ };
3616
+ return Qe(
3617
+ () => [i.gid, i.url, i.data, i.lang, i.local, i.isFactory],
3618
+ () => {
3619
+ Ie();
3620
+ }
3621
+ ), Qe(
3622
+ () => i.showMap,
3623
+ (s) => {
3624
+ R.value && (s ? R.value.showMap() : R.value.hideMap());
3625
+ }
3626
+ ), Nt(() => {
3627
+ const s = _();
3628
+ s && s.on && s.on(ne.value.graphSocket, ce);
3629
+ const d = je();
3630
+ ae.value = i.gid || d.id, Ie();
3631
+ }), kt(() => {
3632
+ ee = null;
3633
+ const s = _();
3634
+ s && s.off && s.off(ne.value.graphSocket, ce), window.removeEventListener("mousemove", j);
3635
+ }), e({
3636
+ setValue: B,
3637
+ getStage: Xt,
3638
+ getAllPens: We,
3639
+ getCustomPenType: qt,
3640
+ batchUpdatePen: Qt,
3641
+ handleLineCross: ga,
3642
+ changeVisibleByLevel: Jt
3643
+ }), (s, d) => (ie(), pe("div", {
3644
+ ref_key: "previewRef",
3645
+ ref: H,
3646
+ class: "meta2d-preview"
3647
+ }, [
3648
+ Me(Jn, {
3649
+ ref_key: "graphRef",
3650
+ ref: le,
3651
+ url: $.value,
3652
+ local: Z.value,
3653
+ data: i.data,
3654
+ "dev-config": i.devConfig,
3655
+ preview: "",
3656
+ onLoaded: zt
3657
+ }, null, 8, ["url", "local", "data", "dev-config"]),
3658
+ xe(r) ? (ie(), pe("div", Zn, [
3659
+ Me(xe(Dt), {
3660
+ type: "primary",
3661
+ onClick: V
3662
+ }, {
3663
+ default: et(() => [...d[0] || (d[0] = [
3664
+ Pt("返回", -1)
3665
+ ])]),
3666
+ _: 1
3667
+ })
3668
+ ])) : Ue("", !0),
3669
+ G.value ? (ie(), Fe(Mn, {
3670
+ key: 1,
3671
+ ref_key: "panelRef",
3672
+ ref: Y,
3673
+ data: de.value,
3674
+ style: Rt({
3675
+ top: p.value.top + "px",
3676
+ left: p.value.left + "px",
3677
+ position: "absolute"
3678
+ }),
3679
+ onClose: O,
3680
+ onEnter: z,
3681
+ onViewHistory: D
3682
+ }, null, 8, ["data", "style"])) : Ue("", !0)
3683
+ ], 512));
3684
+ }
3685
+ }), Ge = /* @__PURE__ */ Ve(ei, [["__scopeId", "data-v-659ed0ed"]]);
3686
+ Ge.name || (Ge.name = "SyGraph");
3687
+ const ti = (n) => {
3688
+ n.component(Ge.name || "SyGraph", Ge);
3689
+ }, Ci = { install: ti };
3690
+ export {
3691
+ Ge as SyGraph,
3692
+ Ci as default
3693
+ };