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

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/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # @syhr/sy-graph
1
+ # @syhr/sy-threed-graph
2
2
 
3
- 一个基于 Meta2D 的平面图形配置工具 Vue 3 组件库。
3
+ 一个基于 ThreeJs 的三维图形展示工具。
4
4
 
5
5
  ## 特性
6
6
 
7
- - 🎨 基于 Meta2D 的强大图形编辑能力
8
- - 🔧 支持多种图形类型和图表
7
+ - 🎨 基于 ThreeJs 的强大三维图形展示能力
8
+ - 🔧 支持多种三维模型
9
9
  - 📱 响应式设计,支持移动端
10
10
  - 🎯 完整的 TypeScript 支持
11
11
  - 📦 多种模块格式支持(ES、UMD、CommonJS)
@@ -20,7 +20,7 @@
20
20
  ## 安装
21
21
 
22
22
  ```bash
23
- npm install @syhr/sy-graph
23
+ npm install @syhr/sy-threed-graph
24
24
  ```
25
25
 
26
26
  ### Peer Dependencies
@@ -29,7 +29,7 @@ npm install @syhr/sy-graph
29
29
 
30
30
  ```bash
31
31
  # 必需依赖
32
- npm install vue@^3.0.0 element-plus@^2.0.0 @meta2d/core@^1.0.0 @meta2d/svg@^1.0.0 @meta2d/utils@^1.0.0 lodash-es@^4.17.0
32
+ npm install vue@^3.0.0 element-plus@^2.0.0 lodash-es@^4.17.0 three@^0.184.0 three-edit-cores@^0.0.15
33
33
 
34
34
  # 可选依赖(根据需要安装)
35
35
  npm install pinia@^2.0.0 vue-router@^4.0.0
@@ -41,8 +41,8 @@ npm install pinia@^2.0.0 vue-router@^4.0.0
41
41
 
42
42
  ```javascript
43
43
  import { createApp } from 'vue';
44
- import SyGraph from '@syhr/sy-graph';
45
- import '@syhr/sy-graph/style';
44
+ import SyGraph from '@syhr/sy-threed-graph';
45
+ import '@syhr/sy-threed-graph/style';
46
46
 
47
47
  const app = createApp(App);
48
48
  app.use(SyGraph);
@@ -52,11 +52,11 @@ app.mount('#app');
52
52
  ### 局部使用
53
53
 
54
54
  ```javascript
55
- import { SyGraph } from '@syhr/sy-graph';
55
+ import { SyThreedGraph } from '@syhr/sy-threed-graph';
56
56
 
57
57
  export default {
58
58
  components: {
59
- SyGraph,
59
+ SyThreedGraph,
60
60
  },
61
61
  };
62
62
  ```
@@ -66,16 +66,15 @@ export default {
66
66
  ```vue
67
67
  <template>
68
68
  <div>
69
- <SyGraph
69
+ <SyThreedGraph
70
70
  ref="graphRef"
71
+ :id="sceneId"
72
+ :data="sceneData"
71
73
  :url="graphUrl"
72
- :local="false"
73
- :show-map="true"
74
- :config="graphConfig"
74
+ :token="token"
75
+ :socketUrl="socketUrl"
75
76
  @loaded="handleLoaded"
76
- @error="handleError"
77
- @custom-msg="handleCustomMsg"
78
- @socket-msg="handleSocketMsg"
77
+ @graph-event="handleGraphEvent"
79
78
  />
80
79
  </div>
81
80
  </template>
@@ -83,216 +82,85 @@ export default {
83
82
  <script setup>
84
83
  import { ref } from 'vue';
85
84
  import { SyGraph } from '@syhr/sy-graph';
85
+ const sceneId = ref('');
86
+ const sceneData = ref({});
86
87
  const graphRef = ref();
87
88
  const graphUrl = ref('path/to/your/graph.json');
88
-
89
- // 自定义配置
90
- const graphConfig = ref({
91
- socketUrl: 'ws://localhost:8080',
92
- stationIdKey: 'STATION_ID',
93
- userTokenKey: 'USER_TOKEN',
94
- messageDelay: 200,
95
- debounceDelay: 100,
96
- enableAutoFit: true,
97
- enableWebSocket: true,
98
- });
89
+ const token = ref('');
90
+ const socketUrl = ref('');
99
91
 
100
92
  const handleLoaded = (stage) => {
101
93
  console.log('Graph loaded:', stage);
102
94
  // 可以通过 stage 进行图纸操作
103
95
  };
104
96
 
105
- const handleError = (errorInfo) => {
97
+ // 图纸事件, 点击等
98
+ const handleGraphEvent = (errorInfo) => {
106
99
  console.error('Graph error:', errorInfo);
107
100
  };
108
101
 
109
- const handleCustomMsg = (msg) => {
110
- console.log('Custom message:', msg);
111
- };
112
-
113
- const handleSocketMsg = (msg) => {
114
- console.log('Socket message:', msg);
115
- };
116
-
117
- // 组件方法调用示例
118
- const toggleLevel = () => {
119
- graphRef.value?.changeVisibleByLevel(3, false);
120
- };
121
-
122
- const batchUpdate = (dataList) => {
123
- graphRef.value?.batchUpdatePen(dataList);
102
+ // 获取实例
103
+ const getEditorInstance = () => {
104
+ graphRef.value?.getEditorInstance();
124
105
  };
125
106
  </script>
126
107
  ```
127
108
 
128
109
  ## Props
129
110
 
130
- | 属性 | 类型 | 默认值 | 说明 |
131
- | --------------- | ------- | -------------- | -------------------- |
132
- | url | String | '' | 图纸数据 URL |
133
- | gid | String | '' | 图纸 ID |
134
- | data | Object | null | 直接传入的图纸数据 |
135
- | local | Boolean | false | 是否为本地数据 |
136
- | config | Object | 默认配置对象 | WebSocket 和其他配置 |
137
- | showMap | Boolean | false | 是否显示地图 |
138
- | isFactory | Boolean | false | 是否为工厂模式 |
139
- | apiInstance | Object | 内置 Api | 自定义 API 实例 |
140
- | mittInstance | Object | 内置 mitt | 自定义事件总线实例 |
141
- | customCallbacks | Object | {} | 自定义回调函数集合 |
142
- | errorHandler | Object | 默认错误处理器 | 错误处理配置 |
143
- | devConfig | Object | 默认配置对象 | 打包后开发环境配置 |
111
+ | 属性 | 类型 | 默认值 | 说明 |
112
+ | --------- | ------ | ------ | ------------------------ |
113
+ | data | Object | null | 场景数据,优先级最高 |
114
+ | url | String | '' | 图纸数据 URL,优先级第二 |
115
+ | id | String | '' | 图纸 ID,优先级第三 |
116
+ | token | String | '' | socket token |
117
+ | socketUrl | String | '' | socket 地址 |
144
118
 
145
119
  ## Events
146
120
 
147
- | 事件名 | 说明 | 参数 |
148
- | ---------- | -------------- | ----------------------- |
149
- | error | 错误事件 | errorInfo: 错误信息对象 |
150
- | loaded | 图纸加载完成 | stage: Meta2D 实例 |
151
- | custom-msg | 自定义消息事件 | msg: 消息对象 |
152
- | socket-msg | WebSocket 消息 | msg: WebSocket 消息 |
121
+ | 事件名 | 说明 | 参数 |
122
+ | ----------- | ---------------- | ------------------ |
123
+ | loaded | 图纸加载完成 | stage: Meta2D 实例 |
124
+ | graph-event | 图纸事件,点击等 | msg: 消息对象 |
153
125
 
154
126
  ## 方法
155
127
 
156
128
  通过 ref 获取组件实例后可调用以下方法:
157
129
 
158
- - `setValue(pen, render = true)` - 设置图元属性
159
- - `getStage()` - 获取 Meta2D 实例
160
- - `getAllPens()` - 获取所有图元
161
- - `getCustomPenType()` - 获取所有图元类型
162
- - `batchUpdatePen(dataList)` - 批量更新图元
163
- - `handleLineCross()` - 处理线条交叉
164
- - `changeVisibleByLevel(level, isStrict = false)` - 切换显示层级
165
-
166
- ## TypeScript 支持
167
-
168
- 本包提供完整的 TypeScript 类型声明:
169
-
170
- ```typescript
171
- import { ref } from 'vue';
172
- import type {
173
- SyGraphProps,
174
- SyGraphInstance,
175
- GraphConfig,
176
- CustomCallbacks,
177
- ErrorHandler,
178
- DataItem,
179
- } from '@syhr/sy-graph';
180
-
181
- // 组件 ref 类型
182
- const graphRef = ref<SyGraphInstance>();
183
-
184
- // Props 类型
185
- const props: SyGraphProps = {
186
- url: 'path/to/graph.json',
187
- showMap: true,
188
- config: {
189
- socketUrl: 'ws://localhost:8080',
190
- enableAutoFit: true,
191
- enableWebSocket: true,
192
- } as GraphConfig,
193
- customCallbacks: {
194
- onStageLoaded: (stage) => console.log('Stage loaded:', stage),
195
- onBatchUpdate: (dataList: DataItem[]) => console.log('Batch update:', dataList),
196
- } as CustomCallbacks,
197
- errorHandler: {
198
- showMessage: true,
199
- callback: (errorInfo) => console.error('Custom error handler:', errorInfo),
200
- } as ErrorHandler,
201
- };
202
-
203
- // 方法调用示例
204
- const toggleLevel = (level: number, isStrict: boolean = false) => {
205
- graphRef.value?.changeVisibleByLevel(level, isStrict);
206
- };
207
-
208
- const updateData = (dataList: DataItem[]) => {
209
- graphRef.value?.batchUpdatePen(dataList);
210
- };
211
- ```
212
-
213
- ## 配置选项详解
214
-
215
- ### GraphConfig 配置
216
-
217
- ```typescript
218
- const config = {
219
- socketUrl: 'ws://localhost:8080', // WebSocket服务器地址
220
- stationIdKey: 'STATION_ID', // 站点ID存储键名
221
- userTokenKey: 'USER_TOKEN', // 用户令牌存储键名
222
- messageDelay: 200, // 消息处理延迟(毫秒)
223
- debounceDelay: 100, // 防抖延迟(毫秒)
224
- enableAutoFit: true, // 是否自动适应视图
225
- enableWebSocket: true, // 是否启用WebSocket
226
- graphSocket: 'graph:socket', // 图纸Socket事件名
227
- };
228
- ```
229
-
230
- ### CustomCallbacks 回调
231
-
232
- ```typescript
233
- const callbacks = {
234
- onWebSocketMessage: (message) => {
235
- // 处理WebSocket消息
236
- },
237
- onCustomMessage: (msg) => {
238
- // 处理自定义消息
239
- },
240
- onStageLoaded: (stage) => {
241
- // 图纸加载完成后的处理
242
- },
243
- onGraphLoaded: (url) => {
244
- // 图纸URL加载完成
245
- },
246
- onBatchUpdate: (dataList) => {
247
- // 批量数据更新后的处理
248
- },
249
- onLevelChange: (level, isStrict) => {
250
- // 显示层级变更后的处理
251
- },
252
- };
253
- ```
254
-
255
- ### CustomCallbacks 回调
256
-
257
- ```typescript
258
- const devConfig = {
259
- isDev: false, // 打包后是否是开发环境
260
- devServerUrl: '', // 打包后的开发环境地址
261
- devServerPort: 8443, // 打包后的开发环境端口
262
- }
263
- ```
130
+ - `getEditorInstance()` - 获取编辑器实例
264
131
 
265
132
  ## 使用场景
266
133
 
267
- ### 1. 基础图纸展示
134
+ ### 1. 基础三维图纸展示
268
135
 
269
136
  ```vue
270
- <SyGraph :url="'/api/graph/123'" />
137
+ <SyThreedGraph :data="graphData" />
271
138
  ```
272
139
 
273
- ### 2. 本地图纸文件
140
+ ### 2. 图纸id
274
141
 
275
142
  ```vue
276
- <SyGraph :url="'/assets/graph.json'" :local="true" />
143
+ <SyThreedGraph :url="'https://ip:port/cockpit/threed/xxx.json'" />
277
144
  ```
278
145
 
279
146
  ### 3. 直接传入数据
280
147
 
281
148
  ```vue
282
- <SyGraph :data="graphData" />
149
+ <SyThreedGraph :id="'111111111'" />
283
150
  ```
284
151
 
285
152
  ### 4. 完整配置示例
286
153
 
287
154
  ```vue
288
- <SyGraph
289
- :gid="graphId"
290
- :config="graphConfig"
291
- :custom-callbacks="callbacks"
292
- :error-handler="errorHandler"
293
- :show-map="true"
294
- @loaded="onGraphLoaded"
295
- @error="onGraphError"
155
+ <SyThreedGraph
156
+ ref="graphRef"
157
+ :id="sceneId"
158
+ :data="sceneData"
159
+ :url="graphUrl"
160
+ :token="token"
161
+ :socketUrl="socketUrl"
162
+ @loaded="handleLoaded"
163
+ @graph-event="handleGraphEvent"
296
164
  />
297
165
  ```
298
166
 
@@ -342,6 +210,7 @@ npm run lint
342
210
 
343
211
  ## 相关链接
344
212
 
345
- - [Meta2D 官方文档](https://meta2d.com)
213
+ - [ThreeJs 官方文档](https://threejs.org)
214
+ - [ThreeEditor 官方文档](https://z2586300277.github.io/editor-docs/)
346
215
  - [Vue 3 文档](https://vuejs.org)
347
216
  - [Element Plus 文档](https://element-plus.org)
@@ -0,0 +1,6 @@
1
+ "use strict";require('./sy-graph.css');var Tt=Object.defineProperty,St=Object.defineProperties;var bt=Object.getOwnPropertyDescriptors;var De=Object.getOwnPropertySymbols;var Ct=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable;var be=(r,e,t)=>e in r?Tt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e)=>{for(var t in e||(e={}))Ct.call(e,t)&&be(r,t,e[t]);if(De)for(var t of De(e))Nt.call(e,t)&&be(r,t,e[t]);return r},N=(r,e)=>St(r,bt(e));var ee=(r,e,t)=>be(r,typeof e!="symbol"?e+"":e,t);var q=(r,e,t)=>new Promise((a,n)=>{var o=v=>{try{h(t.next(v))}catch(y){n(y)}},i=v=>{try{h(t.throw(v))}catch(y){n(y)}},h=v=>v.done?a(v.value):Promise.resolve(v.value).then(o,i);h((t=t.apply(r,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),kt=require("qs"),xt=require("axios"),Pt=require("mitt"),Rt=require("dayjs");require("crypto-js");const re=require("gm-crypto"),Ee=require("lodash-es"),Y=require("element-plus"),lt=require("@meta2d/utils"),M=require("@meta2d/core"),Dt=require("@meta2d/plugin-mind-core"),Ot=require("@meta2d/plugin-mind-collapse"),Lt=require("@meta2d/form-diagram"),Mt=require("@meta2d/class-diagram"),Ft=require("@meta2d/le5le-charts"),ie=require("@meta2d/core/src/diagrams"),Oe=require("@meta2d/flow-diagram"),Ce=require("@meta2d/fta-diagram"),Le=require("@meta2d/sequence-diagram"),Me=require("@meta2d/activity-diagram"),Ut=require("@element-plus/icons-vue"),Gt={OFFLINE:0},Bt={STOP:2},Ht={1:1,2:2,3:3,4:4,5:5},O={AREA:1,BAY:2,DEVICE:3,COMPONENT:4,POINT:5,YX:6,YC:7,YK:8,AUX_DEVICE:9,LD:10,LN:11,SG:12},Vt={[O.AREA]:"area",[O.BAY]:"bay",[O.DEVICE]:"device",[O.COMPONENT]:"component",[O.POINT]:"patrolpoint",[O.YX]:"yxpoint",[O.YC]:"ycpoint",[O.YK]:"ykpoint",[O.AUX_DEVICE]:"acdevice",[O.LD]:"ld",[O.LN]:"ln",[O.SG]:"sgpoint"},H={CUSTOM_MSG:"CUSTOM_MSG",OPEN_CAMERA:"OPEN_CAMERA",CLOSE_CAMERA:"CLOSE_CAMERA",OPEN_AUDIO:"OPEN_AUDIO",CLOSE_AUDIO:"CLOSE_AUDIO",CHANGE_GRAPH:"CHANGE_GRAPH",NOTIFY_DIALOG:"NOTIFY_DIALOG",GIS_PROPS_PANEL:"GIS_PROPS_PANEL"},Ae={Emit:7},ge={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},b={TEXT:"TEXT",NORMAL:"NORMAL",MP4:"MP4",TIME:"TIME",AUDIO:"AUDIO",RADIO:"RADIO",TABLE:"TABLE",INPUT:"INPUT",BUTTON:"BUTTON",CAMERA:"CAMERA",SELECT:"SELECT",SENSOR:"SENSOR",GIS_SENSOR:"GIS_SENSOR",SLIDER:"SLIDER",SWITCH:"SWITCH",CHECKBOX:"CHECKBOX",POINT_VALUE:"POINT_VALUE",LIGHT_PLATE:"LIGHT_PLATE",VIDEO_STREAM:"VIDEO_STREAM"},Fe={GRAPH:{SOCKET:"GRAPH_SOCKET"}},Ne={AC:{ALARM:"ac.channel.alarm",CONDITION:"ac.channel.gk",OPERATION:"ac.channel.op"},AUDIT:{MSG:"audit.msg",ALARM:"audit.alarm"},DATA:{TASK_STATUS:"data.patroldevice.taskstatus",TASK_RESULT:"data.patroldevice.taskresult"},HOST:{STATUS:"status.platform.hoststatus"},NEST:{BATTERY:"status.platform.nestbattery",HUMIDITY:"status.platform.nesthumidity",TEMPERATURE:"status.platform.nesttemperature",AIR_STATE:"status.platform.nestairstate",DOOR_STATE:"status.platform.nestdoorstate",CHARGE_STATE:"status.platform.nestchargestate",RUNNING_STATE:"status.platform.nestrunningstate",BATTERY_STATE:"status.platform.nestbatterystate",BATTERY_ENABLE:"status.platform.nestbatteryenable",BATTERY_VOLTAGE:"status.platform.nestbatteryvoltage",PLATFORM_STATE:"status.platform.nestsysstate"},MEDIA:{NVR_INFO:"status.platform.nvrinfo",NVR_STATUS:"status.platform.nvrstatus",CAMERA_STATUS:"status.platform.camerastatus"},DRONE:{STATUS:"status.platform.dronestatus",ELECTRICITY:"status.platform.droneelectricity",FLIGHT_TIME:"status.platform.flighttime",FLIGHT_HEIGHT:"status.platform.flightheight",FLIGHT_STATUS:"status.platform.flightstatus",FLIGHT_DISTANCE:"status.platform.flightdistance",PTZ_ELEVATION:"status.platform.ptzelevation",PTZ_YAW_ANGLE:"status.platform.ptzyawangle",PTZ_ROLL_ANGLE:"status.platform.ptzrollangle",LOW_BATTERY:"status.platform.lowbattery",COMM_ABNORMAL:"status.platform.commabnormal",DRIVE_EXCEPTION:"status.platform.driveexception",FAULT_ALARM:"status.platform.faultalarm",CONTROL_STATUS:"status.platform.controlstatus",MILEAGE:"status.platform.mileage",CONTROL_MODE:"status.platform.controlmode"},ROBOT:{SPEED:"status.platform.robotspeed",STATUS:"status.platform.robotstatus",BATTERY:"status.platform.robotbattery",MILEAGE:"status.platform.robotmileage",HUMIDITY:"status.platform.robothumidity",WINDSPEED:"status.platform.robotwindspeed",COORDINATE:"status.platform.robotcoordinate",COORDINATES:"status.platform.robotcoordinates",FAULT_ALARM:"status.platform.robotfaultalarm",LOW_BATTERY:"status.platform.robotlowbattery",TEMPERATURE:"status.platform.robottemperature",CONTROL_MODE:"status.platform.robotcontrolmode",COMM_ABNORMAL:"status.platform.robotcommabnormal",RUNNING_STATE:"status.platform.robotrunningstate",CONTROL_STATUS:"status.platform.robotcontrolstatus",DRIVE_EXCEPTION:"status.platform.robotdriveexception",TRANSPORT_STATUS:"status.platform.robottransportstatus",ULTRASONIC_STOPPING:"status.platform.robotultrasonicstopping"},VOICE:{STATUS:"voiceprint.status",DATA:"voice.data",VOICEPRINT:"voiceprint.data",TIME_DOMAIN:"voiceprint.time.domain",FREQ_DOMAIN:"voiceprint.freq.domain"},PATROL:{ALARM:"patrol.alarm",TASK_ITEM:"patrol.task.item",TASK_INDEX:"patrol.task.index",SINGLE_RESULT:"patrol.single.result",CAMERA_ITEM:"patrol.camera.item",PATROLDEVICE_TASKSTATUS:"data.patroldevice.taskstatus",PATROLDEVICE_TASKRESULT:"data.patroldevice.taskresult",MASTER_ALARM:"patrol.master.alarm",MASTER_SILENCE:"patrol.task.master.silence",MASTER_TASK_ITEM:"patrol.task.master.item",MASTER_TASK_INDEX:"patrol.task.master.index"},REPORT:{ALARM:"report.alarm.message",EXCEL:"report.excel.message",PATROL:"report.patrol.message",PICTURE:"report.picture.message"},ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"},ALARM:{VOICE:"alarm.platform.alarm"},LINKAGE:{TASK:"linkage.record.task",CAMERA:"linkage.record.camera",PRESET:"linkage.record.preset",CONTROL:"linkage.record.control",PATROLPOINT:"linkage.record.patrolpoint"},METRICS:{SERVER:"metrics.metrics.server",CONTAINER:"metrics.metrics.container"},STATION:{SF6:"status.platform.stationsf6",OXYGEN:"status.platform.stationoxygen",HUMIDITY:"status.platform.stationhumidity",PRESSURE:"status.platform.stationpressure",RAINFALL:"status.platform.stationrainfall",WINDSPEED:"status.platform.stationwindspeed",TEMPERATURE:"status.platform.stationtemperature",WINDDIRECTION:"status.platform.stationwinddirection"},INTERFACE:{ANALYSIS:"analyse.pic.result",ALGORITHM:"algorithm.update.result"},PATROL_DEVICE:{BATTERY:"status.platform.battery",MILEAGE:"status.platform.mileage",GEOGRAPHY:"status.platform.coordinate_geography",COORDINATE:"status.platform.coordinate",COORDINATES:"status.platform.coordinates",ELECTRICITY:"status.platform.electricity",PTZYAWANGLE:"status.platform.ptzyawangle",PTZELEVATION:"status.platform.ptzelevation",PTZROLLANGLE:"status.platform.ptzrollangle",VERTICAL_SPEED:"status.platform.verticalspeed",HORIZONTAL_SPEED:"status.platform.horizontalspeed",FAULT_ALARM:"status.platform.faultalarm",LOW_BATTERY:"status.platform.lowbattery",CONTROL_MODE:"status.platform.controlmode",COMM_ABNORMAL:"status.platform.commabnormal",RUNNING_STATE:"status.platform.runningstate",CONTROL_STATUS:"status.platform.controlstatus",DRIVE_EXCEPTION:"status.platform.driveexception",TRANSPORT_STATUS:"status.platform.transportstatus",ULTRASONIC_STOPPING:"status.platform.ultrasonicstopping"}};var ye={};/*!
2
+ * vite-plugin-qiankun.js v1.0.14
3
+ * (c) 2021-2022 Teng Mao Qing
4
+ * Released under the MIT License.
5
+ */Object.defineProperty(ye,"__esModule",{value:!0});var oe=typeof window!="undefined"?window.proxy||window:{},ct=function(r){oe!=null&&oe.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),oe.qiankunName&&(window.moudleQiankunAppLifeCycles[oe.qiankunName]=r))};ye.default=ct;var ke=ye.qiankunWindow=oe;ye.renderWithQiankun=ct;function Kt(){return window.__POWERED_BY_WUJIE__||window.$wujie?ge.WUJIE:window.__POWERED_BY_QIANKUN__||ke!=null&&ke.__POWERED_BY_QIANKUN__?ge.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?ge.MICROAPP:ge.NONE}const ve="/";Kt();const Yt=location.protocol==="https:",Wt=location.hostname,__$t__=Yt?"wss:":"ws:",qt=location.port,jt=location.origin,Ue=`${__$t__}//${location.host}/ws`;var je,ze,Xe,Qe,Je,Ze,et,tt,at,nt,rt,it;(ze=(je=window.meta)==null?void 0:je.graph)!=null&&ze.savePath,(Qe=(Xe=window.meta)==null?void 0:Xe.graph)!=null&&Qe.graphPenPath,(Ze=(Je=window.meta)==null?void 0:Je.graph)!=null&&Ze.templatePath,(tt=(et=window.meta)==null?void 0:et.graph)!=null&&tt.graphImgUploadPath,(nt=(at=window.meta)==null?void 0:at.graph)!=null&&nt.threeSavePath,(it=(rt=window.meta)==null?void 0:rt.graph)!=null&&it.threeModelPath;const k=xt.create({baseURL:jt,timeout:window.meta.axios.timeout||12e4,withCredentials:!1,paramsSerializer:r=>kt.stringify(r)});k.interceptors.request.use(r=>(r.headers["x-token"]="ewoglCJhbGcilDogpc3",r),r=>Promise.reject(r));k.interceptors.response.use(r=>{const{data:e}=r;return Promise.resolve(e)},r=>Promise.reject(r));function zt(r,e={},t={}){return new Promise(a=>{k.get(r,l({params:e},t)).then(n=>a({res:n,err:null})).catch(n=>a({res:null,err:n}))})}function Xt(r,e={},t={}){return new Promise(a=>{k.post(r,e,t).then(n=>a({res:n,err:null})).catch(n=>a({res:null,err:n}))})}function Qt(r,e={},t={}){return k.get(r,l({params:e},t))}function Jt(r,e={},t={}){return k.post(r,e,t)}function Zt(r,e={}){return k.get(`/filehandle/${r}`,{params:e})}function ea(r,e={},t={}){return k.post(`/filehandle/${r}`,e,t)}function ta(r,e={}){return k.get(`/user/${r}`,{params:e})}function aa(r,e={},t={}){return k.post(`/user/${r}`,e,t)}function na(r,e={}){return k.get(`${r}`,e.local?{params:e,baseURL:ve}:{params:e})}function ra(r,e={}){return k.get(`/media/${r}/`,{params:e})}function ia(r,e={},t={}){return k.post(`/media/${r}/`,e,t)}function oa(r,e={}){return k.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,{params:e})}function sa(r,e={},t={}){return k.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,e,t)}function la(r,e={}){return k.get(`/history/${r}`,{params:e})}function ca(r,e={},t={}){return k.post(`/history/${r}`,e,t)}function da(r,e={}){return k.get(`/scada/${r}`,{params:e})}function ua(r,e={},t={}){return k.post(`/scada/${r}`,e,t)}function ma(r,e={}){return k.get(`/common/factory/${r}`,{params:e})}function ha(r,e={},t={}){return k.post(`/common/factory/${r}`,e,t)}function pa(r,e={}){return k.get(`/factory/${r}`,{params:e})}function fa(r,e={},t={}){return k.post(`/factory/${r}`,e,t)}function Aa(r,e={}){return k.get(`/pd/${r}`,{params:e})}function ga(r,e={},t={}){return k.post(`/pd/${r}`,e,t)}const se={getApi:zt,postApi:Xt,getFileApi:Zt,postFileApi:ea,getBaseApi:Qt,postBaseApi:Jt,getUserApi:ta,postUserApi:aa,getGraphApi:na,getMediaApi:ra,postMediaApi:ia,getScadaApi:da,postScadaApi:ua,getCommonApi:oa,postCommonApi:sa,getHistoryApi:la,postHistoryApi:ca,getFactoryApi:pa,postFactoryApi:fa,getCommonFactoryApi:ma,postCommonFactoryApi:ha,getPDApi:Aa,postPDApi:ga},Pe=Pt(),_a=[65535,-99999];function xe(r){if(typeof r!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return r.trim()!==""&&e.test(r.trim())}function _e(r){return typeof r=="number"&&!_a.includes(r)}const Ge=()=>{var a;const r={},e=((a=window.location.href.split("?"))==null?void 0:a[1])||"",t=new URLSearchParams(e);for(const[n,o]of t.entries())r[n]=o;return r};function Be(r){return Object.prototype.toString.call(r).slice(8,-1)}(function(){if(typeof Object.id=="undefined"){var r=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++r,enumerable:!1,writable:!1}),e.__uniqueid}}})();function wa(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];this.encode=function(t){var a,n,o,i,h,v;for(o=t.length,n=0,a="";n<o;){if(i=t.charCodeAt(n++)&255,n==o){a+=r.charAt(i>>2),a+=r.charAt((i&3)<<4),a+="==";break}if(h=t.charCodeAt(n++),n==o){a+=r.charAt(i>>2),a+=r.charAt((i&3)<<4|(h&240)>>4),a+=r.charAt((h&15)<<2),a+="=";break}v=t.charCodeAt(n++),a+=r.charAt(i>>2),a+=r.charAt((i&3)<<4|(h&240)>>4),a+=r.charAt((h&15)<<2|(v&192)>>6),a+=r.charAt(v&63)}return a},this.decode=function(t){var a,n,o,i,h,v,y;for(v=t.length,h=0,y="";h<v;){do a=e[t.charCodeAt(h++)&255];while(h<v&&a==-1);if(a==-1)break;do n=e[t.charCodeAt(h++)&255];while(h<v&&n==-1);if(n==-1)break;y+=String.fromCharCode(a<<2|(n&48)>>4);do{if(o=t.charCodeAt(h++)&255,o==61)return y;o=e[o]}while(h<v&&o==-1);if(o==-1)break;y+=String.fromCharCode((n&15)<<4|(o&60)>>2);do{if(i=t.charCodeAt(h++)&255,i==61)return y;i=e[i]}while(h<v&&i==-1);if(i==-1)break;y+=String.fromCharCode((o&3)<<6|i)}return y},this.utf16to8=function(t){var a,n,o,i;for(a="",o=t.length,n=0;n<o;n++)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));return a},this.utf8to16=function(t){var a,n,o,i,h,v;for(a="",o=t.length,n=0;n<o;)switch(i=t.charCodeAt(n++),i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=t.charAt(n-1);break;case 12:case 13:h=t.charCodeAt(n++),a+=String.fromCharCode((i&31)<<6|h&63);break;case 14:h=t.charCodeAt(n++),v=t.charCodeAt(n++),a+=String.fromCharCode((i&15)<<12|(h&63)<<6|(v&63)<<0);break}return a},this.charToHex=function(t){var a,n,o;for(a="",n=0;n<t.length;)o=t.charCodeAt(n++).toString(16),a+="\\0x"+o,a+=n>0&&n%8==0?`\r
6
+ `:", ";return a}}function va(){var r=0,e=new Object;this.add=function(t,a){this.containsKey(t)||r++,e[t]=a},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&r--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var a in e)if(e[a]==t)return!0;return!1},this.getValues=function(){var t=[];for(var a in e)t.push(e[a]);return t},this.getKeys=function(){var t=[];for(var a in e)t.push(a);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function Ea(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new va,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,a){var n=Object.id(a).toString();this.callbacks_.add(n,a);var o={MsgId:n,Method:e+"|"+r};t&&(o.Param=JSON.stringify(t));var i=JSON.stringify(o);this.connect&&this.ws.send(i)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),a=t.MsgId;if(this.callbacks_.containsKey(a)){var n=this.callbacks_.getValue(a);n(t.Result,t.Response),this.callbacks_.remove(a)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},a){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],a)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:a},n){this.exec("Arm_VerifyPIN",[parseInt(e),a,t],n)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},a){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],a)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},a){this.exec("Arm_LEDControl",[parseInt(e),t],a)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},a){this.exec("Arm_SwitchProtocol",[parseInt(e),t],a)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:a,AttrBuffer:n},o){this.exec("Arm_CreateFile",[parseInt(e),a,parseInt(t),n],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:a,FileOffset:n,DataInput:o},i){this.exec("Arm_WriteFile",[parseInt(e),a,parseInt(t),parseInt(n),o],i)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:a},n){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),a],n)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:a,DataLen:n},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),a,a.length,parseInt(n)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:a},n){this.exec("Arm_DeleteFile",[parseInt(e),a,parseInt(t)],n)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:a},n){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),a],n)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:a},n){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),a],n)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},a){this.exec("Arm_WriteShareMemory",[parseInt(e),t],a)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},a){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],a)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:a,TryCount:n,PinFlag:o},i){this.exec("Arm_ChangePIN",[parseInt(e),o,a,t,parseInt(n)],i)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},a){this.exec("Arm_ResetUserPIN",[parseInt(e),t],a)},this.Arm_SetUserID=function({Handle:e,UserID:t},a){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],a)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},a){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],a)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},a){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},a){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},a){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:a,RsaPriFileID:n,RsaPriFileSize:o},i){this.exec("Arm_RsaPri",[parseInt(e),parseInt(n),parseInt(o),t,a],i)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:a,RsaPubInData:n,RsaPubFileSize:o},i){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),a,t,t.length,n],i)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:a},n){this.exec("Arm_EccSign",[parseInt(e),parseInt(a),t],n)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:a,EccSignData:n},o){this.exec("Arm_EccVerify",[parseInt(e),a,a.length,t,n],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:a},n){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(a),t],n)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:a,Sm2SignData:n},o){this.exec("Arm_Sm2Verify",[parseInt(e),a,a.length,t,n],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:a,TdesInData:n},o){this.exec("Arm_TDES",[parseInt(e),parseInt(a),t,n],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:a,Sm4InData:n},o){this.exec("Arm_SM4",[parseInt(e),parseInt(a),t,n],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:a},n){this.exec("Arm_HASH",[parseInt(e),t,a],n)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:a},n){this.exec("Arm_Seed",[parseInt(e),a,t],n)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},a){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],a)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:a,SonCount:n,StartUserID:o,AdminTryCount:i,UserPin:h,UserTryCount:v,UpdateRSAPriKey:y},V){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),a,h,parseInt(v),parseInt(i),y,parseInt(o),parseInt(n)],V)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},a){this.exec("Arm_InitSon",[parseInt(e),t],a)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},a){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],a)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:a,FileID:n,FileType:o,Offset:i,DataLen:h,DataBuffer:v,UpRSAPubKey:y},V){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,a,o,parseInt(n),parseInt(i),v,y,parseInt(h)],V)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:a,FileID:n,FileType:o,Offset:i,DataLen:h,DataBuffer:v},y){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,a,o,parseInt(n),parseInt(i),v,parseInt(h)],y)},this.Arm_Update=function({Handle:e,UpdateData:t},a){this.exec("Arm_Update",[parseInt(e),t],a)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:a},n){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(a)],n)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:a,Priv:n,IsReset:o,IsDecOnRAM:i},h){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[a,parseInt(t),parseInt(e),parseInt(n),parseInt(i),parseInt(o)],h)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},a){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},a){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},a){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],a)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:a,IsDecOnRAM:n},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(n),parseInt(a)],o)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:a,InBuffer:n,CallLimit:o},i){this.exec("Arm_Set_EXE_FILE_INFO",[n,parseInt(a),parseInt(e),parseInt(o),t,t.length],i)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const ya={HID:0},we={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},He={USER:0};class dt{constructor(){ee(this,"Base64",new wa);ee(this,"AtlCtrl",null);ee(this,"ArmCount",0);ee(this,"ArmIndex",0);ee(this,"ArmHandle",0);ee(this,"ArmRandom","");try{this.AtlCtrl=new Ea("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((a,n)=>{a?(this.ArmCount=+n,e(n)):t(n)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,a)=>{this.AtlCtrl.Arm_Open({Index:e},(n,o)=>{n?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,a(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_Close({Handle:e},(n,o)=>{n?t(o):a(o)})})}armChangePIN(e,t,a=255,n=He.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,h)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:a,PinFlag:n},(v,y)=>{v&&y==0?(this.ArmPin=e,i(y)):h(y)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,i)=>{o?(this.ArmRandom=i,a(i)):n(i)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(n,o)=>{n?(this.ArmDeadline=o,t(o)):a(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,i)=>{o?(this.ArmUKey=i,a(i)):n(i)})})}armGetDongleInfo(e=0,t=we.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((a,n)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,i)=>{if(o){switch(t){case we.USER_ID:this.ArmUid=i;break;case we.PRODUCT_ID:this.ArmPid=i;break;case we.HARDWARE_ID:this.ArmHid=i;break}a(i)}else n(i)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_RFS({Handle:e},(n,o)=>{n&&o==0?t(o):a(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,i)=>{if(o&&i.length>0)try{i=this.Base64.decode(i),a(i)}catch(h){console.error(h),a(i)}else n(i)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(n,o)=>{n&&o==0?t(o):a(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSwitchProtocol(e=ya.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armVerifyPIN(e,t=He.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:a,UserPin:e,UserType:t},(i,h)=>{i&&h==0?(this.ArmPin=e,n(h)):o(h)})})}armReadData(e=0,t=128,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_ReadData({Handle:a,Offset:e,ReadLength:t},(i,h)=>{i?(this.ArmData=h,n(h)):o(h)})})}armWriteData(e,t=0,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_WriteData({Handle:a,Offset:t,DataInput:e},(i,h)=>{i&&h==0?n(h):o(h)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(n,o)=>{n?(this.ArmData=o,t(o)):a(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,i)=>{o&&i==0?a(i):n(i)})})}}const ut="0123456789abcdeffedcba9876543210",mt="4b0de988570c3a0f",Ia=window.ENCRYPT;let le=Ia&&new dt;function ht(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",a=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*a)],r--;return t}function pt(){return q(this,null,function*(){return le||(le=new dt),new Promise((r,e)=>{le.armEnum().then(t=>{r(+t)}).catch(t=>{Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Ee.throttle(()=>q(exports,null,function*(){const r=yield pt(),e={};if(typeof r!="number"||r<=0)Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Sa();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(Y.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Ta(r=0){return q(this,null,function*(){return le?new Promise((e,t)=>{le.armGetDongleInfo(r).then(a=>{a?e(a):(Y.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(a))}).catch(a=>{t(a)})}):Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Sa(){return q(this,null,function*(){if(!le)return Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield pt();let e=[];for(let t=0;t<r;t++){const a=yield Ta(t);e.push(a)}return e})}ht(16);ht(16);const ft=window.meta.app.inspect?re.SM4.constants.CBC:re.SM4.constants.ECB,{publicKey:en,privateKey:tn}=re.SM2.generateKeyPair();function Ve(r,e,t={}){const a=At(mt),n=t.mode||ft;t=n===re.SM4.constants.ECB?l({mode:n,inputEncoding:"utf8",outputEncoding:"hex"},t):l({iv:ut,mode:n,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=re.SM4.encrypt(r,a,t)}catch(i){console.log("err: ",i)}return o}function Ke(r,e,t={}){const a=At(mt),n=t.mode||ft;return t=n===re.SM4.constants.ECB?l({mode:n,inputEncoding:"hex",outputEncoding:"utf8"},t):l({iv:ut,mode:n,inputEncoding:"hex",outputEncoding:"utf8"},t),re.SM4.decrypt(r,a,t)}function At(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}const Ye={getLocal:r=>{try{let e=window.localStorage.getItem(r);return e=e!==null?Ke(e):e,JSON.parse(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Ve(t):t,window.localStorage.setItem(r,t)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||Be(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const a=window.localStorage.key(e);r((void 0).getLocal(a),a)}},clearLocal:()=>{window.localStorage.clear()},removeLocal:r=>{window.localStorage.removeItem(r)},getSession:r=>{try{let e=window.sessionStorage.getItem(r);return e=e!==null?Ke(e):e,JSON.parse(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Ve(t):t,window.sessionStorage.setItem(r,t)}catch(t){console.error(t)}},eachSession:r=>{if(!r||Be(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const a=window.sessionStorage.key(e);r((void 0).getSession(a),a)}},clearSession:()=>{window.sessionStorage.clear()},removeSession:r=>{window.sessionStorage.removeItem(r)}},We=r=>{const{quality:e,value:t,function_id:a}=r;return(e>>7&1)===1||e===0&&a===2&&t===1},$e="USER_TOKEN",qe="STATION_ID",ba=[{key:0,value:"离线"},{key:1,value:"在线"}],Ca=[{key:0,value:"反向"},{key:1,value:"正向"},{key:2,value:"停止"}],Na=[{key:1,value:1},{key:2,value:2},{key:3,value:3},{key:4,value:4},{key:5,value:5}],ka="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:{NORMAL:[{name:"颜色",key:"color",type:"color",dataIds:{}}],TEXT:[{name:"显示内容",key:"text",type:"text",dataIds:{}}],AUDIO:[{name:"颜色",key:"color",type:"color",dataIds:{}}],MP4:[{name:"颜色",key:"color",type:"color",dataIds:{}}],CAMERA:[{name:"颜色",key:"color",type:"color",dataIds:{}}],VIDEO_STREAM:[{name:"颜色",key:"color",type:"color",dataIds:{}}],LIGHT_PLATE:[{name:"光字牌",key:"light_plate",type:"select",dataIds:{},options:[{label:"离线",value:-1},{label:"正常",value:0},{label:"预警",value:1},{label:"一般",value:2},{label:"严重",value:3},{label:"危急",value:4}]}]},gt=window.meta.graph.lightPlateColorMap?window.meta.graph.lightPlateColorMap:{0:"#00d200",1:"#e2ac06",2:"#fa800a",3:"#f04155",4:"#ff0000"},_t=window.meta.graph.lightPlateTextMap?window.meta.graph.lightPlateTextMap:{0:"#fff",1:"#fff",2:"#fff",3:"#fff",4:"#fff"},D={form:[{name:"带电状态",key:"charged_state",type:"select",dataIds:{},options:ba.map(r=>({label:r.value,value:r.key}))},{name:"潮流方向",key:"electric_direction",type:"select",dataIds:{},options:Ca.map(r=>({label:r.value,value:r.key}))},{name:"电荷大小",key:"electric_size",type:"select",dataIds:{},options:Na.map(r=>({label:r.value,value:r.key}))}],anchors:[{x:0,y:.5,id:"0"},{x:.5,y:0,id:"1"},{x:1,y:.5,id:"2"},{x:.5,y:1,id:"3"}],dataType:window.dataType,dataProp:window.dataProp,visibleLevel:window.visibleLevel},m=N(l({penType:b.NORMAL},D),{form:[...te[b.NORMAL],...D.form]});O.YX,O.YX,O.YX,b.POINT_VALUE,D.anchors,window.visibleLevel,D.form,D.form,window.dataType,window.dataProp,window.visibleLevel,D.form,window.dataType,window.dataProp,window.visibleLevel,D.form,window.dataType,window.dataProp,window.visibleLevel,_t[0],b.LIGHT_PLATE,gt[0],D.anchors,window.visibleLevel,[...te[b.LIGHT_PLATE],...D.form],ve+"",b.SENSOR,D.anchors,window.visibleLevel,[...te[b.LIGHT_PLATE],...D.form],N(l({width:100,height:30,name:"text",penName:"文本",text:"文本",disableAnchor:!0,penType:b.TEXT},D),{form:[...te[b.TEXT],...D.form]}),l({width:100,height:100,name:"square",penName:"正方形"},m),N(l({type:1,name:"line",width:100,height:5,lineWidth:2,lineName:"line",penName:"line",background:"#FFF000",color:"#FFF000"},m),{lineAnimateType:1,anchors:[{x:0,y:.5,id:"0"},{x:1,y:.5,id:"1"}]}),l({width:200,height:50,borderRadius:0,name:"rectangle",penName:"矩形"},m),l({width:100,height:100,name:"circle",penName:"圆"},m),l({width:100,height:100,name:"triangle",penName:"三角形"},m),l({width:100,height:100,name:"diamond",penName:"菱形"},m),l({width:100,height:100,name:"pentagon",penName:"五边形"},m),l({width:100,height:100,name:"hexagon",penName:"六边形"},m),l({width:100,height:100,name:"pentagram",penName:"五角星"},m),l({width:120,height:60,name:"leftArrow",penName:"左箭头"},m),l({width:120,height:60,penName:"右箭头",name:"rightArrow"},m),l({width:150,height:60,name:"twowayArrow",penName:"双向箭头"},m),l({width:100,height:100,name:"cloud",penName:"云"},m),l({textTop:-.1,width:100,height:100,name:"message",penName:"消息框"},m),l({width:80,height:100,name:"file",penName:"文件"},m),N(l({width:60,height:100,name:"cube",penName:"立方体",z:.25},m),{props:{custom:[{key:"z",label:"Z",type:"number",min:0,placeholder:"<= 1 即宽度的比例"},{key:"backgroundFront",label:"前背景色",type:"color"},{key:"backgroundUp",label:"顶背景色",type:"color"},{key:"backgroundRight",label:"右背景色",type:"color"}]}}),l({width:70,height:100,name:"people",penName:"人"},m),N(l({name:"rectangle",penName:"按钮",width:80,height:30,borderRadius:.2,text:"按钮",background:"#1890ff",color:"#1890ff",textColor:"#fff",activeBackground:"#40a9ff",activeColor:"#40a9ff",activeTextColor:"#fff",hoverBackground:"#40a9ff",hoverColor:"#40a9ff",hoverTextColor:"#fff"},m),{penType:b.BUTTON}),N(l({name:"rectangle",penName:"输入框",height:50,width:200,input:!0,borderRadius:.05,ellipsis:!0,text:"输入数据",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10},m),{penType:b.INPUT}),N(l({name:"rectangle",penName:"选择器",height:50,width:200,borderRadius:.05,ellipsis:!0,text:"选项1",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10,dropdownList:[{text:"选项1"},{text:"选项2"},{text:"选项3"}]},m),{penType:b.SELECT}),N(l({name:"slider",penName:"进度条",width:300,height:30,value:10,textWidth:50,barHeight:4,fontSize:20,min:0,max:100,color:"#1890ff",background:"#D4D6D9",textColor:"#222",unit:"%"},m),{penType:b.SLIDER}),N(l({name:"time",penName:"时间",width:300,height:40,text:`${Rt().format("YYYY-MM-DD HH:mm:ss")}`,lineWidth:0,fontSize:20,interval:67,fillZero:!0},m),{penType:b.TIME,form:[{key:"timeFormat",name:"显示格式",type:"text"},{key:"fillZero",name:"是否补0",type:"switch"},...m.form],timeFormat:"`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"}),N(l({name:"switch",penName:"开关",height:30,width:60,checked:!1,offColor:"#BFBFBF",onColor:"#1890ff",disableOffColor:"#E5E5E5",disableOnColor:"#A3D3FF",locked:0},m),{penType:b.SWITCH}),N(l({name:"radio",penName:"单选框",direction:"horizontal",width:150,height:30,checked:"",options:[{text:"选项一"},{text:"选项二"},{text:"选项三",isForbidden:!0}]},m),{penType:b.RADIO}),N(l({name:"checkbox",penName:"多选框",width:30,height:30,checked:!0,value:"选项一"},m),{penType:b.CHECKBOX}),N(l({name:"table2",penName:"表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,hasHeader:!0,color:"#333",textColor:"#444"},m),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","物联网设备/智能家居/智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),N(l({name:"table2",penName:"斑马纹表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!0,hasHeader:!0,color:"#333",textColor:"#444"},m),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","物联网设备/智能家居/智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),N(l({name:"table2",penName:"滚动表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,swiper:!0,maxNum:5,hasHeader:!0,color:"#333",textColor:"#444"},m),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}],["5","智能家居","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),N(l({name:"svg",width:100,height:100,image:ve+"/icon/audio.svg",audioId:"",penName:"音频",datable:!0,penType:b.AUDIO},D),{form:[...te[b.AUDIO],...D.form],events:[{name:"enter",action:Ae.Emit,value:H.OPEN_AUDIO,where:{type:""},params:JSON.stringify({action:H.OPEN_AUDIO,data:""})},{name:"leave",action:Ae.Emit,value:H.CLOSE_AUDIO,where:{type:""},params:JSON.stringify({action:H.CLOSE_AUDIO,data:""})}]}),N(l({name:"svg",width:100,height:100,image:ve+"/icon/camera.svg",cameraId:"",penName:"摄像机",datable:!0,events:[{name:"enter",action:Ae.Emit,value:H.OPEN_CAMERA,where:{type:""},params:JSON.stringify({action:H.OPEN_CAMERA,data:""})},{name:"leave",action:Ae.Emit,value:H.CLOSE_CAMERA,where:{type:""},params:JSON.stringify({action:H.CLOSE_CAMERA,data:""})}],penType:b.CAMERA},D),{form:[...te[b.CAMERA],...D.form]}),N(l({name:"video",width:100,height:100,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penName:"MP4",penType:b.MP4},D),{form:[...te[b.MP4],...D.form]}),N(l({name:"video",width:100,height:100,penName:"视频流",datable:!0,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penType:b.VIDEO_STREAM},D),{form:[...te[b.VIDEO_STREAM],...D.form]}),l({text:"开始/结束",width:120,height:40,borderRadius:.5,name:"rectangle",penName:"开始/结束"},m),l({text:"流程",width:120,height:40,name:"rectangle",penName:"流程"},m),l({text:"判定",width:120,height:60,name:"diamond",penName:"判定"},m),l({text:"数据",width:120,height:50,name:"flowData",penName:"数据",offsetX:.14},m),l({text:"准备",width:120,height:50,name:"hexagon",penName:"准备"},m),l({text:"子流程",width:120,height:50,name:"flowSubprocess",penName:"子流程"},m),l({text:"数据库",width:80,height:120,name:"flowDb",penName:"数据库"},m),l({text:"文档",width:120,height:100,name:"flowDocument",penName:"文档"},m),l({text:"内部存储",width:120,height:80,name:"flowInternalStorage",penName:"内部存储"},m),l({text:"外部存储",width:120,height:80,name:"flowExternStorage",penName:"外部存储"},m),l({text:"队列",width:100,height:100,name:"flowQueue",penName:"队列"},m),l({text:"手动输入",width:120,height:80,name:"flowManually",penName:"手动输入"},m),l({text:"展示",width:120,height:80,name:"flowDisplay",penName:"展示"},m),l({text:"并行模式",width:120,height:50,name:"flowParallel",penName:"并行模式"},m),l({text:"注释",width:100,height:100,name:"flowComment",penName:"注释"},m),l({text:"",width:30,height:30,name:"circle",penName:"开始",background:"#555",lineWidth:0},m),l({width:30,height:30,name:"activityFinal",penName:"结束"},m),l({text:"活动",width:120,height:50,borderRadius:.25,name:"rectangle",penName:"活动"},m),l({text:"决策/合并",width:120,height:50,name:"diamond",penName:"决策/合并"},m),l({text:"垂直泳道",width:200,height:500,name:"swimlaneV",penName:"垂直泳道",textBaseline:"top",textTop:20,lineTop:.08},m),l({text:"水平泳道",width:500,height:200,name:"swimlaneH",penName:"水平泳道",textWidth:.01,textLeft:.04,textAlign:"left",lineLeft:.08},m),l({text:"垂直分岔/汇合",width:10,height:150,name:"forkV",penName:"垂直分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},m),l({text:"水平分岔/汇合",width:150,height:10,name:"forkH",penName:"水平分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},m),l({name:"andGate",penName:"与门",width:100,height:150},m),l({name:"basicEvent",penName:"基本事件",width:100,height:150},m),l({name:"unexpandedEvent",penName:"未展开事件",width:100,height:150},m),l({name:"priorityAndGate",penName:"优先AND门",width:100,height:150},m),l({name:"forbiddenGate",penName:"禁止门",width:100,height:150},m),l({name:"event",penName:"事件",width:100,height:150},m),l({name:"switchEvent",penName:"开关事件",width:100,height:150},m),l({name:"conditionalEvent",penName:"条件事件",width:150,height:100},m),l({name:"transferSymbol",penName:"转移符号",width:100,height:150},m),l({name:"orGate",penName:"或门",width:100,height:150},m),l({name:"xorGate",penName:"异或门",width:100,height:150},m),l({name:"votingGate",penName:"表决门",width:100,height:150},m);const xa=(r,e={isDev:!1,devServerUrl:"",devServerPort:8443})=>r.replace(/(https?:\/\/)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(:(\d+))?/,`$1${e.isDev?e.devServerUrl:Wt}:${e.isDev?e.devServerPort:qt}`),Ie=(r,e)=>{const t=r.__vccOpts||r;for(const[a,n]of e)t[a]=n;return t},Pa={class:"props-panel__title"},Ra={class:"props-panel__value"},Da={class:"props-panel__value-num"},Oa=Object.assign({name:"PropsPanle"},{__name:"PropsPanle",props:{data:{type:Object,default:null}},emits:["close"],setup(r,{emit:e}){const t=r,a=e;function n(i){return i==null||i==="—"?"—":typeof i=="number"?i.toFixed(2):i}const o=()=>{a("close")};return(i,h)=>{var v,y;return c.openBlock(),c.createElementBlock("div",{class:"props-panel",onMouseleave:o},[c.createElementVNode("div",Pa,c.toDisplayString(((v=t==null?void 0:t.data)==null?void 0:v.name)||"—"),1),h[1]||(h[1]=c.createElementVNode("div",{class:"props-panel__label"},"脉冲峰值",-1)),c.createElementVNode("div",Ra,[c.createElementVNode("span",Da,c.toDisplayString(n((y=t==null?void 0:t.data)==null?void 0:y.value)),1),h[0]||(h[0]=c.createElementVNode("span",{class:"props-panel__unit"},"dBm",-1))])],32)}}}),La=Ie(Oa,[["__scopeId","data-v-46666be8"]]);class Ma{constructor(e){ee(this,"editor");this.editor=e}initPlugin(e,t,a={}){e.installPenPlugins({name:t},[{plugin:Dt.mindBoxPlugin,options:a},{plugin:Ot.collapseChildPlugin,options:a}])}}const Fa="original_meta2d";function Ua(){return localStorage.removeItem(Fa)}let me={};const Ga=r=>{const e=document.querySelectorAll("video");let t=null;if(e.forEach(n=>{n.getAttribute("src")===r.video&&(t=n)}),!t)return;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";const a=new JessibucaPro({container:t.parentElement,background:"",hasControl:!1,controlAutoHide:!0,checkFirstIFrame:!0,debug:!1,decoder:"./wasm/decoder-pro.js",forceNoOffscreen:!0,hotKey:!1,hasAudio:!1,hasVideo:!0,hiddenAutoPause:!1,isFlv:!0,isResize:!1,isNotMute:!0,loadingIcon:!0,loadingText:"加载中...",networkDelayTimeoutReplay:!1,playbackForwardMaxRateDecodeIFrame:8,showBandwidth:!1,showPerformance:!1,syncAudioAndVideo:!0,supportDblclickFullscreen:!1,timeout:10,useMSE:!0,useWCS:!1,useSIMD:!0,useVideoRender:!0,useCanvasRender:!1,videoBuffer:.2,videoBufferDelay:1});return r.autoPlay&&r.streamUrl&&a.play(r.streamUrl),me[r.id]=a,a},Ba=()=>{Object.keys(me).forEach(r=>{me[r].destroy(),me[r]=null}),me={}},Ha={class:"sy-empty"},Va={key:1,class:"sy-empty-picture"},Ka={class:"sy-empty-description"},Ya=Object.assign({name:"SyEmpty"},{__name:"index",props:{image:{type:String,default:"empty"},imageSize:{type:Number,default:80},description:{type:String,default:"暂无数据"},onlyText:{type:Boolean,default:!1}},setup(r){c.useCssVars(n=>({v23b02794:a.value.width,v85f2be92:a.value.height}));const e=r,t=c.computed(()=>({"font-size":e.imageSize?`${e.imageSize}px`:"80px"})),a=c.computed(()=>e.imageSize?{width:e.imageSize*1.2+"px",height:e.imageSize+"px"}:{width:"187px",height:"144px"});return(n,o)=>{const i=c.resolveComponent("SyIcon"),h=c.resolveComponent("el-icon");return c.openBlock(),c.createElementBlock("div",Ha,[r.image!=="empty"?(c.openBlock(),c.createElementBlock("span",{key:0,class:"sy-empty-image",style:c.normalizeStyle(t.value)},[r.image!=="loading"?(c.openBlock(),c.createBlock(i,{key:0,name:r.image,gradient:""},null,8,["name"])):(c.openBlock(),c.createBlock(h,{key:1,class:"is-loading",style:{color:"#1671d4"}},{default:c.withCtx(()=>[c.createVNode(c.unref(Ut.Loading))]),_:1}))],4)):r.onlyText?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",Va)),c.createElementVNode("div",Ka,[c.createElementVNode("p",null,c.toDisplayString(r.description),1)])])}}}),Wa=Ie(Ya,[["__scopeId","data-v-86abaa6c"]]),$a=Object.assign({name:"Meta2dEditor"},{__name:"index",props:{url:{type:String,default:""},data:{type:Object,default:()=>{}},local:{type:Boolean,default:!1},preview:{type:Boolean,default:!1},devConfig:{type:Object,default:()=>({isDev:!1,devServerUrl:"",devServerPort:8443})}},emits:["loaded","load-error"],setup(r,{expose:e,emit:t}){const a=t,n=r,o=c.ref(null),i=c.shallowRef(),h=c.computed(()=>!!(n.data||n.url));c.watch(()=>[n.data,n.url],()=>{h.value&&y()});let v=c.ref(!0);function y(){return q(this,null,function*(){try{if(v.value=!0,yield c.nextTick(),!o.value){console.error("未找到meta2d元素!");return}let A=null;if(n.data?A=n.data:n.url&&(A=yield Z()),!A||!A.data){v.value=!1,console.log("图纸数据为空"),a("load-error");return}const L=A.options||{background:"#eee",disableAnchor:!1};if(i.value&&(i.value.destroy(!0),i.value=null),!o.value){console.error("Meta2D 容器元素不可用");return}i.value=new M.Meta2d(o.value,l({},L)),L.visibleLevel&&i.value.scale(L.visibleLevel),V(),x(),yield ae(A.data),i.value.render(),ce(),setTimeout(()=>{window.meta2dTools&&window.registerToolsNew()},1e3),a("loaded",i.value)}catch(A){console.error("初始化编辑器失败:",A)}})}function V(){if(!i.value)return;new Ma({}).initPlugin(i.value,"mindNode",{})}function x(){M.register(Mt.classPens()),M.register(Oe.flowPens()),M.registerAnchors(Oe.flowAnchors()),M.register(Le.sequencePens()),M.registerCanvasDraw(Le.sequencePensbyCtx()),M.register(Me.activityDiagram()),M.registerCanvasDraw(Me.activityDiagramByCtx()),M.registerCanvasDraw(Lt.formPens()),M.registerCanvasDraw(Ft.chartsPens()),M.register(Ce.ftaPens()),M.registerAnchors(Ce.ftaAnchors()),M.registerCanvasDraw(Ce.ftaPensbyCtx())}function ae(A){var L;if(i.value){if(typeof A.locked=="undefined"&&(A.locked=0),A.bkImage&&i.value.setBackgroundImage(A.bkImage),A.pens&&A.pens.length>0){const K=[];A.pens.forEach(C=>{C.name==="video"&&C.streamUrl?K.push(C):C.name==="image"&&C.image?C.image=xa(C.image,n.devConfig):C.penType===b.TABLE&&C.dataType&&J(C)}),K.length>0&&setTimeout(()=>{K.forEach(C=>{Ga(C)})},500);const j=window.meta.graph.penCountThreshold||2e3;A.pens.length>j&&A.scale&&A.pens.forEach(C=>{const P=C.visibleLevel;P!==void 0?(C.visible=A.scale>=P,C.visible||(C.disabled=!0,C.locked=M.LockState.Disable)):(C.visible=!0,C.disabled=!1,C.locked=M.LockState.None)})}i.value.open(A),!n.preview&&((L=A.networks)!=null&&L.length)&&i.value.closeNetwork()}}const J=A=>q(this,null,function*(){var K;const L=yield se.getCommonApi(Vt[A.dataType],{offset:0,limit:A.tableSize||10});if((K=L.data)!=null&&K.length){const j=A.tableHeader||[{prop:"id",label:"ID"},{prop:"guid",label:"标识"},{prop:"name",label:"名称"}],z=L.data.map(C=>j.filter(P=>P.isShow).map(P=>{const W=C[P.prop];return P.choices?P.choices[W]||W:Ee.isObject(W)?W.name:W}));i.value.setValue({id:A.id,dataY:z})}else i.value.setValue({id:A.id,dataY:[]})}),ce=()=>{i.value&&i.value.on("scale",de)},de=Ee.debounce(A=>{var L,K,j,z;try{if(!i.value)return;Pe.emit("graph-scale",A);let C=i.value.store.data.pens;const P=window.meta.graph.penCountThreshold||2e3,W=C.length>P;for(let ue=0;ue<C.length;ue++){const G=C[ue];if([b.VIDEO_STREAM,b.MP4].includes(G.penType)){if(((K=(L=ie.videos[G.id])==null?void 0:L.children)==null?void 0:K.length)===3){let X=ie.videos[G.id].children[0],Q=ie.videos[G.id].children[2];X.style.width=Q.currentTime/Q.duration*G.calculative.worldRect.width+"px"}else if(((z=(j=ie.videos[G.id])==null?void 0:j.children)==null?void 0:z.length)===2){let X=ie.videos[G.id].children[0],Q=ie.videos[G.id].children[1];X.style.width=Q.currentTime/Q.duration*G.calculative.worldRect.width+"px"}}if(W){const X=G.visibleLevel!==void 0?A>=G.visibleLevel:!0;i.value._setValue({id:G.id,visible:X,disabled:!X,locked:X?M.LockState.None:M.LockState.Disable})}}i.value.render()}catch(C){console.error("处理缩放失败:",C)}},500);function Z(){return q(this,null,function*(){if(!n.url)return Y.ElMessage.error("图纸路径为空!"),null;try{return(yield se.getGraphApi(n.url,{local:n.local}))||null}catch(A){return null}})}const pe=()=>{i.value&&i.value.resize()};return c.onMounted(()=>{h.value&&y(),window.addEventListener("resize",pe)}),c.onUnmounted(()=>{Ba(),Ua(),i.value&&(n.preview?(lt.clearLineCross(),i.value.destroy(!0)):i.value.off("scale",de)),window.removeEventListener("resize",pe)}),e({stage:i}),(A,L)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"meta2dRef",ref:o,class:"meta2d-editor"},[c.unref(v)?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(Wa,{key:0,class:"meta2d-empty",description:"图纸不存在"}))],512))}}),qa=Ie($a,[["__scopeId","data-v-99f5416f"]]),ja={class:"meta2d-preview"},za={key:0,class:"back-btn"};var ot,st;const Xa=Object.assign({name:"Meta2dPreview"},{__name:"index",props:{url:{type:String,default:""},gid:{type:String,default:""},data:{type:Object,default:null},local:{type:Boolean,default:!1},lang:{type:String,default:((st=(ot=window.meta)==null?void 0:ot.app)==null?void 0:st.lang)||"zh-cn"},config:{type:Object,default:()=>({socketUrl:Ue,stationIdKey:qe,enableToken:!0,userTokenKey:$e,useToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,enableWebSocket:!0,graphSocket:Fe.GRAPH.SOCKET})},showMap:{type:Boolean,default:!1},isFactory:{type:Boolean,default:!1},isInitData:{type:Boolean,default:!0},apiInstance:{type:Object,default:()=>se},mittInstance:{type:Object,default:()=>Pe},customCallbacks:{type:Object,default:()=>({})},errorHandler:{type:Object,default:()=>({callback:null,showMessage:!0})},devConfig:{type:Object,default:()=>({isDev:!1,devServerUrl:"",devServerPort:8443})}},emits:["error","loaded","custom-msg","socket-msg"],setup(r,{expose:e,emit:t}){const a=t,n=r;let o=c.ref(!1),i=c.ref(""),h=c.ref(!1);const v=c.ref(null),y=c.ref(""),V=c.ref(!1),x=c.computed(()=>{var s;return(s=v.value)==null?void 0:s.stage}),ae=c.computed(()=>{var s;return(s=x.value)==null?void 0:s.store}),J=c.computed(()=>l({socketUrl:Ue,stationIdKey:qe,enableToken:!0,userTokenKey:$e,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,fitPadding:10,enableWebSocket:!0,graphSocket:Fe.GRAPH.SOCKET},n.config)),ce=()=>n.apiInstance||se,de=()=>n.mittInstance||Pe,Z=(s,u="")=>{const _={error:s,message:u,timestamp:new Date().toISOString()};a("error",_),n.errorHandler.callback?n.errorHandler.callback(_):n.errorHandler.showMessage&&Y.ElMessage&&Y.ElMessage.error(`${u}: ${s.message||s}`)},pe=()=>{i.value&&(y.value=i.value,V.value=h.value)},A={},L=c.ref(!1),K=c.ref({left:0,top:0}),j=s=>{L.value&&(K.value={left:s.clientX+20,top:s.clientY+20})},z=s=>{var u,_,I,R,T,S;try{if(!s)return;if((u=s==null?void 0:s.includes)!=null&&u.call(s,"token 必传"))return Y.ElMessage.warning(s);const p=typeof s=="string"?JSON.parse(s):s;if((p==null?void 0:p.data)==="服务错误"||(I=(_=p==null?void 0:p.data)==null?void 0:_.includes)!=null&&I.call(_,"token is expired"))return Y.ElMessage.warning(p.data);switch(a("socket-msg",p),p.action){case Ne.ACPOINT.YCVALUE:case Ne.ACPOINT.YXVALUE:if((R=p==null?void 0:p.data)!=null&&R.point_id){const E=x.value.find(p.data.point_id);E&&(A[p.data.point_id]=p.action===Ne.ACPOINT.YXVALUE?_e(p.data.value)?p.data.value:0:_e(p.data.value_disp||p.data.value)?p.data.value_disp||p.data.value:0,fe(E,p.data))}break;default:if(((T=p.data)==null?void 0:T.length)>0){const E=setTimeout(()=>{clearTimeout(E),x.value&&(p.data.forEach(g=>{A[g.dataId||g.point_id]=g.value_disp||g.value}),p.data.forEach(g=>{const w=x.value.find(g.dataId||g.point_id);fe(w,g)}))},J.value.messageDelay);n.customCallbacks.onWebSocketMessage&&n.customCallbacks.onWebSocketMessage(p),(S=window.customSocketFn)==null||S.call(window,s)}break}return!0}catch(p){return Z(p,"WebSocket消息处理"),!0}},C=c.ref({});let P={},W=null;const ue=s=>q(this,null,function*(){try{if(s.msgName)switch(s.msgName){case H.CHANGE_GRAPH:case H.NOTIFY_DIALOG:case H.GIS_PROPS_PANEL:G(s);break}else G(s);a("custom-msg",s),n.customCallbacks.onCustomMessage&&n.customCallbacks.onCustomMessage(s)}catch(u){Z(u,"自定义消息处理")}}),G=s=>{var I,R;let u;if(s.params)try{u=JSON.parse(s.params)}catch(T){u=s.params}switch(s.msgName){case H.CHANGE_GRAPH:(u==null?void 0:u.data)!=="图纸id"?(i.value=y.value,h.value=V.value,o.value=u.isBack,(I=u==null?void 0:u.data)!=null&&I.startsWith("/")?(y.value=u==null?void 0:u.data,V.value=!0):(V.value=!1,Q(u.data))):console.warn("切换图纸信息为空");break;case H.NOTIFY_DIALOG:u.msg!=="通知内容"?Y.ElNotification(l({message:u.msg},u)):console.warn("通知内容为空");break;case H.GIS_PROPS_PANEL:s.eventName==="enter"?(L.value=!0,C.value=((R=s==null?void 0:s.pen)==null?void 0:R.bindData)||{},s.e&&(K.value={left:s.e.clientX+20,top:s.e.clientY+20})):(L.value=!1,C.value={});break}},X=s=>{var u,_,I,R,T,S,p,E,g;try{a("loaded",s);const w=Ge(),d=J.value,f=Ye.getSession(d.stationIdKey),U=Ye.getSession(d.userTokenKey);d.enableWebSocket&&f&&U&&((I=(_=(u=s.store)==null?void 0:u.data)==null?void 0:_.networks)!=null&&I.length?(S=(T=(R=s.store)==null?void 0:R.data)==null?void 0:T.networks)==null||S.forEach(B=>{var ne;B.protocol==="websocket"&&((ne=B.url)!=null&&ne.includes("station_id")||(B.url=`${B.url}?station_id=${f}`),d.enableToken?B.protocols=d.userToken||U:B.protocols=void 0)}):(E=(p=s.store)==null?void 0:p.data)!=null&&E.websocket?((g=s.store.data.websocket)!=null&&g.includes("station_id")||(s.store.data.websocket=`${s.store.data.websocket}?station_id=${f}`),d.enableToken?s.store.data.websocketProtocols=d.userToken||U:s.store.data.websocketProtocols=void 0,s.closeSocket(),s.connectSocket()):(s.store.data.websocket=`${d.socketUrl}?station_id=${f}`,d.enableToken?s.store.data.websocketProtocols=U:s.store.data.websocketProtocols=void 0,s.connectWebsocket())),(n.showMap||w.showMap==="true")&&s.showMap(),s.setRule({rule:!1}),s.setOptions({disableRuleLine:!0}),s.setGrid({grid:!1}),s.lock(M.LockState.DisableEdit),Se().forEach(B=>{var ne;(ne=B==null?void 0:B.events)!=null&&ne.length?F({id:B.id,locked:1},!1):F({id:B.id,locked:10},!1)}),s.render(),d.enableAutoFit&&s.fitView(!0,d.fitPadding),Object.values(H).forEach(B=>{s.on(B,ne=>ue(N(l({},ne),{msgName:B})))}),s&&(s.socketFn=z),n.customCallbacks.onStageLoaded&&n.customCallbacks.onStageLoaded(s),n.isInitData&&wt(s),window.addEventListener("mousemove",j)}catch(w){Z(w,"图纸加载完成处理")}},Q=Ee.throttle(s=>q(this,null,function*(){var u;try{if(n.url){V.value=n.local,yield Te(n.url);return}const _=Ge();if(s=s||n.gid||_.id,_.local==="true"&&(V.value=!0),s){const I=ce();if(I&&I.getCommonApi){const R=yield I.getCommonApi(n.isFactory?"graph":"floorplan",{guid:s});if((u=R.data)!=null&&u.length)yield Te(R.data[0].path);else{const T="未找到图纸!";Z(new Error(T),"获取图纸数据")}}else Z(new Error("API实例不可用"),"初始化图纸数据!")}else V.value=n.local,yield Te(n.url);n.customCallbacks.onGraphLoaded&&n.customCallbacks.onGraphLoaded(y.value)}catch(_){Z(_,"获取图纸数据失败")}})),Te=s=>q(this,null,function*(){const u=s.split(".");if(s.includes(n.lang)||u.length!==3){y.value=s;return}const _=`${u[0]}.${n.lang}.${u[2]}`;try{const I=yield se.getGraphApi(_,{local:n.local}).catch(()=>{console.warn("多语言图纸不存在,使用默认图纸")});y.value=I?_:s}catch(I){y.value=s}}),wt=s=>q(this,null,function*(){var u,_,I,R;if(s){let T=[],S=[],p=[];P={};const E=s.store.data.pens;for(let w=0;w<E.length;w++){const d=E[w];d.bindDataId?(u=d.form)!=null&&u.length?d.form.forEach(f=>{if(f.dataIds.dataId)switch(f.dataIds.dataType){case O.YC:T.push(N(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break;case O.YX:S.push(N(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break;case O.SG:S.push(N(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break;case O.POINT:p.push(N(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break}}):d.penType===b.GIS_SENSOR&&d.bindData&&(P[d.bindData.ied_id]||(P[d.bindData.ied_id]=[]),F({id:d.id,title:void 0}),P[d.bindData.ied_id].push(l({penId:d.id},d.bindData))):(_=d.statusBindData)!=null&&_.length&&d.statusBindData.forEach(f=>{if(f.dataId)switch(f.dataType){case O.YX:S.push({showChild:0,value:0,nodeName:f.dataName,penId:d.id,penName:d.penName,dataId:f.dataId});break;case O.SG:S.push({showChild:0,value:0,nodeName:f.dataName,penId:d.id,penName:d.penName,dataId:f.dataId});break}})}let g=[];if(T.length){const w=ce();if(w&&w.postCommonApi){const d=yield w.postCommonApi("queryrealtimepoint",{point_id:T.map(f=>{var U;return((U=f==null?void 0:f.dataIds)==null?void 0:U.dataId)||f.dataId}).join(",")});(I=d==null?void 0:d.data)!=null&&I.length&&(d.data.forEach(f=>{A[f.guid]=f.value_disp||f.value}),g=[...g,...d.data])}}if(S.length){const w=ce();if(w&&w.postCommonApi){const d=yield w.postCommonApi("queryrealtimepoint",{point_id:S.map(f=>{var U;return((U=f==null?void 0:f.dataIds)==null?void 0:U.dataId)||f.dataId}).join(",")});(R=d==null?void 0:d.data)!=null&&R.length&&(d.data.forEach(f=>{A[f.guid]=xe(f.value)?Number(f.value):f.value}),g=[...g,...d.data])}}g.length&&g.forEach(w=>{const d=s.find(w.guid);fe(d,N(l({},w),{value:xe(w.value)?_e(Number(w.value))?Number(w.value):0:w.value,value_disp:w.value_disp,alarm_value:w.alarm_value,point_id:w.guid}))}),P&&Object.keys(P).length?(W&&clearInterval(W),Re(),W=setInterval(()=>{Re()},3e3)):W&&clearInterval(W)}}),Re=()=>q(this,null,function*(){var s;if(P){const u=Object.keys(P);if(u.length){const _=yield se.postPDApi("querychannelstatus/",u.map(I=>({ied_id:I,ln_list:P[I]})));(s=_==null?void 0:_.data)!=null&&s.length&&u.forEach(I=>{const R=_.data.find(S=>S.ied_id===I),T=P[I];T!=null&&T.length&&T.forEach(S=>{const p=R.result.find(E=>E.ln_id===S.ln_id);p&&F({id:S.penId,showChild:p.status==="告警"?2:p.status==="正常"?1:0,bindData:N(l({},S),{status:p.status,value:xe(p.amp_peak)?_e(Number(p.amp_peak))?Number(p.amp_peak):0:p.amp_peak})},!1)})})}}}),F=(s,u=!0)=>{if(x.value)return x.value.setValue(s,{render:u})},vt=()=>x.value,Se=()=>{var s,u;return((u=(s=ae.value)==null?void 0:s.data)==null?void 0:u.pens)||[]},Et=()=>b,fe=(()=>{let s=null;const u=new Map,_=new Map,I=T=>{var p;if(!((p=T.children)!=null&&p.length))return[];const S=T.id||"";if(!S)return[];if(!_.has(S)&&ae.value){const E=M.getAllChildren(T,ae.value);_.set(S,E)}return _.get(S)||[]},R=()=>{if(u.size===0||!x.value||!ae.value)return;const T=[],S=[],p=ae.value.animates;u.forEach(({pen:E,dataItem:g,formKey:w})=>{switch(w){case"showChild":F({id:E.id,showChild:+g.value},!1);break;case"text":F({id:E.id,text:g.value_disp||g.value},!1);break;case"light_plate":{const d=g.value===-1||We(g)?"#999999":_t[g.value!==void 0?g.value:g.alarm_value],f=g.value===-1||We(g)?"#cccccc":gt[g.value!==void 0?g.value:g.alarm_value];F({id:E.id,textColor:d,background:f},!1)}break;case"point_value":E.penType===b.POINT_VALUE&&I(E).forEach(f=>{f.name==="text"&&F({id:f.id,text:g.value},!1)});break;case"online_state":{let d=g.value?void 0:"contrast(0%)";F({id:E.id,filter:d},!1),I(E).forEach(U=>{F({id:U.id,filter:d},!1)})}break;case"charged_state":{const d=g.value===Gt.OFFLINE?"contrast(0%)":void 0;d!==E.filter&&(F({id:E.id,filter:d},!1),I(E).forEach(U=>{F({id:U.id,filter:d},!1)}))}break;case"electric_direction":g.value===Bt.STOP?p!=null&&p.has(E)&&S.push(E):!!g.value!==E.animateReverse&&(F({id:E.id,animateReverse:!!g.value},!1),p!=null&&p.has(E)||T.push(E));break;case"electric_size":{const d=Ht[g.value];d!==void 0&&d!==E.lineWidth&&F({id:E.id,lineWidth:d},!1)}break;default:F({id:E.id,[w]:g.value},!1);break}}),S.length>0&&x.value.stopAnimate(S),T.length>0&&x.value.startAnimate(T),u.clear(),x.value.render()};return(T,S)=>{T!=null&&T.length&&(T.forEach(p=>{var g;const E=p.form;if((g=p.statusBindData)!=null&&g.length){if(!A[S.guid])return;const w=[...p.statusBindData],d=w.findIndex(f=>f.dataId===S.guid);if(d!==-1){const f=w[d];w.find($=>f.sort<$.sort&&A[$.dataId])||u.set(p.id,{pen:p,formKey:"showChild",dataItem:N(l({},S),{value:d})})}}else E!=null&&E.length&&E.forEach(w=>{if(!(Array.isArray(w.dataIds)?w.dataIds:[w.dataIds]).some($=>($==null?void 0:$.dataId)&&(($==null?void 0:$.dataId)===S.dataId||($==null?void 0:$.dataId)===S.point_id)))return;const U=`${p.id}-${w.key}`;u.set(U,{pen:p,dataItem:S,formKey:w.key})})}),s&&clearTimeout(s),s=setTimeout(()=>{R(),s=null},J.value.debounceDelay))}})(),yt=s=>{if(x.value){for(let u=0;u<s.length;u++){const _=s[u];A[_.dataId||_.point_id]=_.value_disp||_.value;const I=x.value.find(_.dataId);setTimeout(()=>{fe(I,_)},J.value.messageDelay)}x.value.render(),n.customCallbacks.onBatchUpdate&&n.customCallbacks.onBatchUpdate(s)}},It=(s,u=!1)=>{if(!x.value)return;const _=Se();for(let I=0;I<_.length;I++){const R=_[I];let T=!1;u?T=s===R.dataProp:T=s===5?!0:R.dataProp<=s,F({id:R.id,visible:T},!1)}x.value.fitView(),x.value.render(),n.customCallbacks.onLevelChange&&n.customCallbacks.onLevelChange(s,u)};return c.watch(()=>[n.gid,n.url,n.data,n.lang,n.local,n.isFactory],()=>{Q()}),c.watch(()=>n.showMap,s=>{x.value&&(s?x.value.showMap():x.value.hideMap())}),c.onMounted(()=>{const s=de();s&&s.on&&s.on(J.value.graphSocket,z),Q()}),c.onUnmounted(()=>{P=null;const s=de();s&&s.off&&s.off(J.value.graphSocket,z),window.removeEventListener("mousemove",j)}),e({setValue:F,getStage:vt,getAllPens:Se,getCustomPenType:Et,batchUpdatePen:yt,handleLineCross:lt.handleLineCross,changeVisibleByLevel:It}),(s,u)=>(c.openBlock(),c.createElementBlock("div",ja,[c.createVNode(qa,{ref_key:"graphRef",ref:v,url:y.value,local:V.value,data:n.data,"dev-config":n.devConfig,preview:"",onLoaded:X},null,8,["url","local","data","dev-config"]),c.unref(o)?(c.openBlock(),c.createElementBlock("div",za,[c.createVNode(c.unref(Y.ElButton),{type:"primary",onClick:pe},{default:c.withCtx(()=>[...u[1]||(u[1]=[c.createTextVNode("返回",-1)])]),_:1})])):c.createCommentVNode("",!0),L.value?(c.openBlock(),c.createBlock(La,{key:1,data:C.value,style:c.normalizeStyle({top:K.value.top+"px",left:K.value.left+"px",position:"fixed",pointerEvents:"none"}),onClose:u[0]||(u[0]=_=>L.value=!1)},null,8,["data","style"])):c.createCommentVNode("",!0)]))}}),he=Ie(Xa,[["__scopeId","data-v-cff2d696"]]);he.name||(he.name="SyGraph");const Qa=r=>{r.component(he.name||"SyGraph",he)},Ja={install:Qa};exports.SyGraph=he;exports.default=Ja;