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