@syhr/sy-graph 1.1.0-rc.13 → 1.1.0-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-graph/sy-graph.cjs +3 -3
- package/dist-graph/sy-graph.css +1 -1
- package/dist-graph/sy-graph.mjs +1586 -1453
- package/dist-graph/sy-graph.umd.js +4 -4
- package/package.json +30 -17
package/dist-graph/sy-graph.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";require('./sy-graph.css');var
|
|
1
|
+
"use strict";require('./sy-graph.css');var oa=Object.defineProperty,ia=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var st=Object.getOwnPropertySymbols;var la=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable;var Qe=(a,e,t)=>e in a?oa(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,u=(a,e)=>{for(var t in e||(e={}))la.call(e,t)&&Qe(a,t,e[t]);if(st)for(var t of st(e))ca.call(e,t)&&Qe(a,t,e[t]);return a},L=(a,e)=>ia(a,sa(e));var Se=(a,e,t)=>Qe(a,typeof e!="symbol"?e+"":e,t);var ne=(a,e,t)=>new Promise((n,r)=>{var o=p=>{try{c(t.next(p))}catch(v){r(v)}},s=p=>{try{c(t.throw(p))}catch(v){r(v)}},c=p=>p.done?n(p.value):Promise.resolve(p.value).then(o,s);c((t=t.apply(a,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue"),Wt=require("qs"),Yt=require("axios"),da=require("mitt"),ua=require("dayjs");require("crypto-js");const Ce=require("gm-crypto"),Ge=require("lodash-es"),oe=require("element-plus"),__$t__=require("@meta2d/utils"),D=require("@meta2d/core"),ha=require("@meta2d/plugin-mind-core"),ma=require("@meta2d/plugin-mind-collapse"),fa=require("@meta2d/form-diagram"),pa=require("@meta2d/class-diagram"),Aa=require("@meta2d/le5le-charts"),Re=require("@meta2d/core/src/diagrams"),lt=require("@meta2d/flow-diagram"),Je=require("@meta2d/fta-diagram"),ct=require("@meta2d/sequence-diagram"),dt=require("@meta2d/activity-diagram"),ga=require("@element-plus/icons-vue"),va={OFFLINE:0},wa={STOP:2},ya={1:1,2:2,3:3,4:4,5:5},z={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,GIS_SENSOR:13},_a={[z.AREA]:"area",[z.BAY]:"bay",[z.DEVICE]:"device",[z.COMPONENT]:"component",[z.POINT]:"patrolpoint",[z.YX]:"yxpoint",[z.YC]:"ycpoint",[z.YK]:"ykpoint",[z.AUX_DEVICE]:"acdevice",[z.LD]:"ld",[z.LN]:"ln",[z.SG]:"sgpoint",[z.GIS_SENSOR]:"gisuhfsensor"},re={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"},Ve={Emit:7},Be={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},N={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",GIS_SENSOR_WRAPPER:"GIS_SENSOR_WRAPPER",GIS_DB_VALUE:"GIS_DB_VALUE",SLIDER:"SLIDER",SWITCH:"SWITCH",CHECKBOX:"CHECKBOX",POINT_VALUE:"POINT_VALUE",LIGHT_PLATE:"LIGHT_PLATE",VIDEO_STREAM:"VIDEO_STREAM"},ut={GRAPH:{SOCKET:"GRAPH_SOCKET"}},Ze={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 qe={};/*!
|
|
2
2
|
* vite-plugin-qiankun.js v1.0.14
|
|
3
3
|
* (c) 2021-2022 Teng Mao Qing
|
|
4
4
|
* Released under the MIT License.
|
|
5
|
-
*/Object.defineProperty(
|
|
6
|
-
`:", ";return a}}function Va(){var n=0,e=new Object;this.add=function(t,a){this.containsKey(t)||n++,e[t]=a},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&n--},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 n},this.clear=function(){n=0,e=new Object}}function Ha(n){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 r=Object.id(a).toString();this.callbacks_.add(r,a);var i={MsgId:r,Method:e+"|"+n};t&&(i.Param=JSON.stringify(t));var o=JSON.stringify(i);this.connect&&this.ws.send(o)},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 r=this.callbacks_.getValue(a);r(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},r){this.exec("Arm_VerifyPIN",[parseInt(e),a,t],r)},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:r},i){this.exec("Arm_CreateFile",[parseInt(e),a,parseInt(t),r],i)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:a,FileOffset:r,DataInput:i},o){this.exec("Arm_WriteFile",[parseInt(e),a,parseInt(t),parseInt(r),i],o)},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},r){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),a],r)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:a,DataLen:r},i){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),a,a.length,parseInt(r)],i)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:a},r){this.exec("Arm_DeleteFile",[parseInt(e),a,parseInt(t)],r)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:a},r){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),a],r)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:a},r){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),a],r)},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:r,PinFlag:i},o){this.exec("Arm_ChangePIN",[parseInt(e),i,a,t,parseInt(r)],o)},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:r,RsaPriFileSize:i},o){this.exec("Arm_RsaPri",[parseInt(e),parseInt(r),parseInt(i),t,a],o)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:a,RsaPubInData:r,RsaPubFileSize:i},o){this.exec("Arm_RsaPub",[parseInt(e),parseInt(i),a,t,t.length,r],o)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:a},r){this.exec("Arm_EccSign",[parseInt(e),parseInt(a),t],r)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:a,EccSignData:r},i){this.exec("Arm_EccVerify",[parseInt(e),a,a.length,t,r],i)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:a},r){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(a),t],r)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:a,Sm2SignData:r},i){this.exec("Arm_Sm2Verify",[parseInt(e),a,a.length,t,r],i)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:a,TdesInData:r},i){this.exec("Arm_TDES",[parseInt(e),parseInt(a),t,r],i)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:a,Sm4InData:r},i){this.exec("Arm_SM4",[parseInt(e),parseInt(a),t,r],i)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:a},r){this.exec("Arm_HASH",[parseInt(e),t,a],r)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:a},r){this.exec("Arm_Seed",[parseInt(e),a,t],r)},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:r,StartUserID:i,AdminTryCount:o,UserPin:l,UserTryCount:f,UpdateRSAPriKey:w},U){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),a,l,parseInt(f),parseInt(o),w,parseInt(i),parseInt(r)],U)},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:r,FileType:i,Offset:o,DataLen:l,DataBuffer:f,UpRSAPubKey:w},U){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,a,i,parseInt(r),parseInt(o),f,w,parseInt(l)],U)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:a,FileID:r,FileType:i,Offset:o,DataLen:l,DataBuffer:f},w){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,a,i,parseInt(r),parseInt(o),f,parseInt(l)],w)},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},r){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(a)],r)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:a,Priv:r,IsReset:i,IsDecOnRAM:o},l){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[a,parseInt(t),parseInt(e),parseInt(r),parseInt(o),parseInt(i)],l)},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:r},i){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(r),parseInt(a)],i)},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:r,CallLimit:i},o){this.exec("Arm_Set_EXE_FILE_INFO",[r,parseInt(a),parseInt(e),parseInt(i),t,t.length],o)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const Ba={HID:0},Le={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},nt={USER:0};class kt{constructor(){ve(this,"Base64",new Ga);ve(this,"AtlCtrl",null);ve(this,"ArmCount",0);ve(this,"ArmIndex",0);ve(this,"ArmHandle",0);ve(this,"ArmRandom","");try{this.AtlCtrl=new Ha("{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,r)=>{a?(this.ArmCount=+r,e(r)):t(r)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,a)=>{this.AtlCtrl.Arm_Open({Index:e},(r,i)=>{r?(this.ArmHandle=+i,t(i)):(this.ArmHandle=i,a(i))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_Close({Handle:e},(r,i)=>{r?t(i):a(i)})})}armChangePIN(e,t,a=255,r=nt.USER,i=this.ArmHandle){if(this.AtlCtrl)return new Promise((o,l)=>{this.AtlCtrl.Arm_ChangePIN({Handle:i,NewPIN:e,OldPIN:t,TryCount:a,PinFlag:r},(f,w)=>{f&&w==0?(this.ArmPin=e,o(w)):l(w)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(i,o)=>{i?(this.ArmRandom=o,a(o)):r(o)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(r,i)=>{r?(this.ArmDeadline=i,t(i)):a(i)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(i,o)=>{i?(this.ArmUKey=o,a(o)):r(o)})})}armGetDongleInfo(e=0,t=Le.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((a,r)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(i,o)=>{if(i){switch(t){case Le.USER_ID:this.ArmUid=o;break;case Le.PRODUCT_ID:this.ArmPid=o;break;case Le.HARDWARE_ID:this.ArmHid=o;break}a(o)}else r(o)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(i,o)=>{i&&o==0?a(o):r(o)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_RFS({Handle:e},(r,i)=>{r&&i==0?t(i):a(i)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(i,o)=>{if(i&&o.length>0)try{o=this.Base64.decode(o),a(o)}catch(l){console.error(l),a(o)}else r(o)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(r,i)=>{r&&i==0?t(i):a(i)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(i,o)=>{i&&o==0?a(o):r(o)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(i,o)=>{i&&o==0?a(o):r(o)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(i,o)=>{i&&o==0?a(o):r(o)})})}armSwitchProtocol(e=Ba.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(i,o)=>{i&&o==0?a(o):r(o)})})}armVerifyPIN(e,t=nt.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,i)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:a,UserPin:e,UserType:t},(o,l)=>{o&&l==0?(this.ArmPin=e,r(l)):i(l)})})}armReadData(e=0,t=128,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,i)=>{this.AtlCtrl.Arm_ReadData({Handle:a,Offset:e,ReadLength:t},(o,l)=>{o?(this.ArmData=l,r(l)):i(l)})})}armWriteData(e,t=0,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,i)=>{this.AtlCtrl.Arm_WriteData({Handle:a,Offset:t,DataInput:e},(o,l)=>{o&&l==0?r(l):i(l)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(r,i)=>{r?(this.ArmData=i,t(i)):a(i)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(i,o)=>{i&&o==0?a(o):r(o)})})}}const Rt="0123456789abcdeffedcba9876543210",Dt="4b0de988570c3a0f",Wa=window.ENCRYPT;let xe=Wa&&new kt;function Mt(n=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",a=e.length;for(;n>0;)t+=e[Math.floor(Math.random()*a)],n--;return t}function Ot(){return ne(this,null,function*(){return xe||(xe=new kt),new Promise((n,e)=>{xe.armEnum().then(t=>{n(+t)}).catch(t=>{X.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Ge.throttle(()=>ne(exports,null,function*(){const n=yield Ot(),e={};if(typeof n!="number"||n<=0)X.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Ya();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(X.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(X.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Ka(n=0){return ne(this,null,function*(){return xe?new Promise((e,t)=>{xe.armGetDongleInfo(n).then(a=>{a?e(a):(X.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(a))}).catch(a=>{t(a)})}):X.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Ya(){return ne(this,null,function*(){if(!xe)return X.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const n=yield Ot();let e=[];for(let t=0;t<n;t++){const a=yield Ka(t);e.push(a)}return e})}Mt(16);Mt(16);const Lt=window.meta.app.inspect?Ie.SM4.constants.CBC:Ie.SM4.constants.ECB,{publicKey:kn,privateKey:Rn}=Ie.SM2.generateKeyPair();function $a(n,e,t={}){const a=Ft(Dt),r=t.mode||Lt;t=r===Ie.SM4.constants.ECB?d({mode:r,inputEncoding:"utf8",outputEncoding:"hex"},t):d({iv:Rt,mode:r,inputEncoding:"utf8",outputEncoding:"hex"},t);let i="";try{i=Ie.SM4.encrypt(n,a,t)}catch(o){console.log("err: ",o)}return i}function qa(n,e,t={}){const a=Ft(Dt),r=t.mode||Lt;return t=r===Ie.SM4.constants.ECB?d({mode:r,inputEncoding:"hex",outputEncoding:"utf8"},t):d({iv:Rt,mode:r,inputEncoding:"hex",outputEncoding:"utf8"},t),Ie.SM4.decrypt(n,a,t)}function Ft(n){return[...n].map(e=>e.charCodeAt().toString(16)).join("")}function Fe(n){return n=Nt&&Xe(n)?qa(n):n,Xe(n)?JSON.parse(n):n}function rt(n){return n=Nt&&Xe(n)?$a(n):n,JSON.stringify(n)}function be(n,e,t,a){const r=new StorageEvent("storage",{url:window.location.href,key:n,oldValue:e,newValue:t,storageArea:a});window.dispatchEvent(r)}const it={getLocal:n=>{try{const e=window.localStorage.getItem(n);return Fe(e)}catch(e){console.error(e)}},setLocal:(n,e)=>{try{const t=window.localStorage.getItem(n),a=rt(e);window.localStorage.setItem(n,a),be(n,t,a,window.localStorage)}catch(t){console.error(t)}},eachLocal:n=>{if(!n||ze(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const a=window.localStorage.key(e);n((void 0).getLocal(a),a)}},clearLocal:()=>{window.localStorage.clear(),be(null,null,null,window.localStorage)},removeLocal:n=>{const e=window.localStorage.getItem(n);window.localStorage.removeItem(n),be(n,e,null,window.localStorage)},getSession:n=>{try{const e=window.sessionStorage.getItem(n);return Fe(e)}catch(e){console.error(e)}},setSession:(n,e)=>{try{const t=window.sessionStorage.getItem(n),a=rt(e);window.sessionStorage.setItem(n,a),be(n,t,a,window.sessionStorage)}catch(t){console.error(t)}},eachSession:n=>{if(!n||ze(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const a=window.sessionStorage.key(e);n((void 0).getSession(a),a)}},clearSession:()=>{window.sessionStorage.clear(),be(null,null,null,window.sessionStorage)},removeSession:n=>{const e=window.sessionStorage.getItem(n);window.sessionStorage.removeItem(n),be(n,e,null,window.sessionStorage)},onStorageChange:n=>{if(!n||ze(n)!=="Function")return console.error("传递参数非函数类型!");const e=t=>{n({url:t.url,key:t.key,newValue:t.newValue?Fe(t.newValue):null,oldValue:t.oldValue?Fe(t.oldValue):null,storageArea:t.storageArea})};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},ot=n=>{const{quality:e,value:t,function_id:a}=n;return(e>>7&1)===1||e===0&&a===2&&t===1},st="USER_TOKEN",lt="STATION_ID",za=[{key:0,value:"离线"},{key:1,value:"在线"}],ja=[{key:0,value:"反向"},{key:1,value:"正向"},{key:2,value:"停止"}],Xa=[{key:1,value:1},{key:2,value:2},{key:3,value:3},{key:4,value:4},{key:5,value:5}],Qa="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",we=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}]}]},Ut=window.meta.graph.lightPlateColorMap?window.meta.graph.lightPlateColorMap:{0:"#00d200",1:"#e2ac06",2:"#fa800a",3:"#f04155",4:"#ff0000"},Gt=window.meta.graph.lightPlateTextMap?window.meta.graph.lightPlateTextMap:{0:"#fff",1:"#fff",2:"#fff",3:"#fff",4:"#fff"},Y={form:[{name:"带电状态",key:"charged_state",type:"select",dataIds:{},options:za.map(n=>({label:n.value,value:n.key}))},{name:"潮流方向",key:"electric_direction",type:"select",dataIds:{},options:ja.map(n=>({label:n.value,value:n.key}))},{name:"电荷大小",key:"electric_size",type:"select",dataIds:{},options:Xa.map(n=>({label:n.value,value:n.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},g=D(d({penType:C.NORMAL},Y),{form:[...we[C.NORMAL],...Y.form]});B.YX,B.YX,B.YX,C.POINT_VALUE,Y.anchors,window.visibleLevel,Y.form,Y.form,window.dataType,window.dataProp,window.visibleLevel,Y.form,window.dataType,window.dataProp,window.visibleLevel,Y.form,window.dataType,window.dataProp,window.visibleLevel,Gt[0],C.LIGHT_PLATE,Ut[0],Y.anchors,window.visibleLevel,[...we[C.LIGHT_PLATE],...Y.form],Ue+"",C.SENSOR,Y.anchors,window.visibleLevel,[...we[C.LIGHT_PLATE],...Y.form],D(d({width:100,height:30,name:"text",penName:"文本",text:"文本",disableAnchor:!0,penType:C.TEXT},Y),{form:[...we[C.TEXT],...Y.form]}),d({width:100,height:100,name:"square",penName:"正方形"},g),D(d({type:1,name:"line",width:100,height:5,lineWidth:2,lineName:"line",penName:"line",background:"#FFF000",color:"#FFF000"},g),{lineAnimateType:1,anchors:[{x:0,y:.5,id:"0"},{x:1,y:.5,id:"1"}]}),d({width:200,height:50,borderRadius:0,name:"rectangle",penName:"矩形"},g),d({width:100,height:100,name:"circle",penName:"圆"},g),d({width:100,height:100,name:"triangle",penName:"三角形"},g),d({width:100,height:100,name:"diamond",penName:"菱形"},g),d({width:100,height:100,name:"pentagon",penName:"五边形"},g),d({width:100,height:100,name:"hexagon",penName:"六边形"},g),d({width:100,height:100,name:"pentagram",penName:"五角星"},g),d({width:120,height:60,name:"leftArrow",penName:"左箭头"},g),d({width:120,height:60,penName:"右箭头",name:"rightArrow"},g),d({width:150,height:60,name:"twowayArrow",penName:"双向箭头"},g),d({width:100,height:100,name:"cloud",penName:"云"},g),d({textTop:-.1,width:100,height:100,name:"message",penName:"消息框"},g),d({width:80,height:100,name:"file",penName:"文件"},g),D(d({width:60,height:100,name:"cube",penName:"立方体",z:.25},g),{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"}]}}),d({width:70,height:100,name:"people",penName:"人"},g),D(d({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"},g),{penType:C.BUTTON}),D(d({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},g),{penType:C.INPUT}),D(d({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"}]},g),{penType:C.SELECT}),D(d({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:"%"},g),{penType:C.SLIDER}),D(d({name:"time",penName:"时间",width:300,height:40,text:`${Xt().format("YYYY-MM-DD HH:mm:ss")}`,lineWidth:0,fontSize:20,interval:67,fillZero:!0},g),{penType:C.TIME,form:[{key:"timeFormat",name:"显示格式",type:"text"},{key:"fillZero",name:"是否补0",type:"switch"},...g.form],timeFormat:"`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"}),D(d({name:"switch",penName:"开关",height:30,width:60,checked:!1,offColor:"#BFBFBF",onColor:"#1890ff",disableOffColor:"#E5E5E5",disableOnColor:"#A3D3FF",locked:0},g),{penType:C.SWITCH}),D(d({name:"radio",penName:"单选框",direction:"horizontal",width:150,height:30,checked:"",options:[{text:"选项一"},{text:"选项二"},{text:"选项三",isForbidden:!0}]},g),{penType:C.RADIO}),D(d({name:"checkbox",penName:"多选框",width:30,height:30,checked:!0,value:"选项一"},g),{penType:C.CHECKBOX}),D(d({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"},g),{penType:C.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"}]}),D(d({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"},g),{penType:C.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"}]}),D(d({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"},g),{penType:C.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"}]}),D(d({name:"svg",width:100,height:100,image:Ue+"/icon/audio.svg",audioId:"",penName:"音频",datable:!0,penType:C.AUDIO},Y),{form:[...we[C.AUDIO],...Y.form],events:[{name:"enter",action:De.Emit,value:re.OPEN_AUDIO,where:{type:""},params:JSON.stringify({action:re.OPEN_AUDIO,data:""})},{name:"leave",action:De.Emit,value:re.CLOSE_AUDIO,where:{type:""},params:JSON.stringify({action:re.CLOSE_AUDIO,data:""})}]}),D(d({name:"svg",width:100,height:100,image:Ue+"/icon/camera.svg",cameraId:"",penName:"摄像机",datable:!0,events:[{name:"enter",action:De.Emit,value:re.OPEN_CAMERA,where:{type:""},params:JSON.stringify({action:re.OPEN_CAMERA,data:""})},{name:"leave",action:De.Emit,value:re.CLOSE_CAMERA,where:{type:""},params:JSON.stringify({action:re.CLOSE_CAMERA,data:""})}],penType:C.CAMERA},Y),{form:[...we[C.CAMERA],...Y.form]}),D(d({name:"video",width:100,height:100,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penName:"MP4",penType:C.MP4},Y),{form:[...we[C.MP4],...Y.form]}),D(d({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:C.VIDEO_STREAM},Y),{form:[...we[C.VIDEO_STREAM],...Y.form]}),d({text:"开始/结束",width:120,height:40,borderRadius:.5,name:"rectangle",penName:"开始/结束"},g),d({text:"流程",width:120,height:40,name:"rectangle",penName:"流程"},g),d({text:"判定",width:120,height:60,name:"diamond",penName:"判定"},g),d({text:"数据",width:120,height:50,name:"flowData",penName:"数据",offsetX:.14},g),d({text:"准备",width:120,height:50,name:"hexagon",penName:"准备"},g),d({text:"子流程",width:120,height:50,name:"flowSubprocess",penName:"子流程"},g),d({text:"数据库",width:80,height:120,name:"flowDb",penName:"数据库"},g),d({text:"文档",width:120,height:100,name:"flowDocument",penName:"文档"},g),d({text:"内部存储",width:120,height:80,name:"flowInternalStorage",penName:"内部存储"},g),d({text:"外部存储",width:120,height:80,name:"flowExternStorage",penName:"外部存储"},g),d({text:"队列",width:100,height:100,name:"flowQueue",penName:"队列"},g),d({text:"手动输入",width:120,height:80,name:"flowManually",penName:"手动输入"},g),d({text:"展示",width:120,height:80,name:"flowDisplay",penName:"展示"},g),d({text:"并行模式",width:120,height:50,name:"flowParallel",penName:"并行模式"},g),d({text:"注释",width:100,height:100,name:"flowComment",penName:"注释"},g),d({text:"",width:30,height:30,name:"circle",penName:"开始",background:"#555",lineWidth:0},g),d({width:30,height:30,name:"activityFinal",penName:"结束"},g),d({text:"活动",width:120,height:50,borderRadius:.25,name:"rectangle",penName:"活动"},g),d({text:"决策/合并",width:120,height:50,name:"diamond",penName:"决策/合并"},g),d({text:"垂直泳道",width:200,height:500,name:"swimlaneV",penName:"垂直泳道",textBaseline:"top",textTop:20,lineTop:.08},g),d({text:"水平泳道",width:500,height:200,name:"swimlaneH",penName:"水平泳道",textWidth:.01,textLeft:.04,textAlign:"left",lineLeft:.08},g),d({text:"垂直分岔/汇合",width:10,height:150,name:"forkV",penName:"垂直分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},g),d({text:"水平分岔/汇合",width:150,height:10,name:"forkH",penName:"水平分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},g),d({name:"andGate",penName:"与门",width:100,height:150},g),d({name:"basicEvent",penName:"基本事件",width:100,height:150},g),d({name:"unexpandedEvent",penName:"未展开事件",width:100,height:150},g),d({name:"priorityAndGate",penName:"优先AND门",width:100,height:150},g),d({name:"forbiddenGate",penName:"禁止门",width:100,height:150},g),d({name:"event",penName:"事件",width:100,height:150},g),d({name:"switchEvent",penName:"开关事件",width:100,height:150},g),d({name:"conditionalEvent",penName:"条件事件",width:150,height:100},g),d({name:"transferSymbol",penName:"转移符号",width:100,height:150},g),d({name:"orGate",penName:"或门",width:100,height:150},g),d({name:"xorGate",penName:"异或门",width:100,height:150},g),d({name:"votingGate",penName:"表决门",width:100,height:150},g);const Ja=(n,e={isDev:!1,devServerUrl:"",devServerPort:8443})=>(n=n.replace(/(https?:\/\/)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(:(\d+))?/,`$1${e.isDev?e.devServerUrl:ua}:${e.isDev?e.devServerPort:ma}`),e.isDev?n:n.replace("/baseUrl","")),He=(n,e)=>{const t=n.__vccOpts||n;for(const[a,r]of e)t[a]=r;return t},Za={class:"props-panel__title"},en={class:"props-panel__value"},tn={class:"value-left"},an={class:"props-panel__value-num"},nn={class:"value-right"},rn=Object.assign({name:"PropsPanle"},{__name:"PropsPanle",props:{data:{type:Object,default:null}},emits:["close","enter","view-history"],setup(n,{emit:e}){const t=n,a=e;function r(f){return f==null||f==="—"?"—":typeof f=="number"?f.toFixed(2):f}const i=()=>{a("close")},o=()=>{a("enter")},l=()=>{a("view-history",t.data)};return(f,w)=>{var U,G;return c.openBlock(),c.createElementBlock("div",{class:"props-panel",onMouseleave:i,onMouseover:o},[c.createElementVNode("div",Za,c.toDisplayString(((U=t==null?void 0:t.data)==null?void 0:U.name)||"—"),1),w[2]||(w[2]=c.createElementVNode("div",{class:"props-panel__label"},"脉冲峰值",-1)),c.createElementVNode("div",en,[c.createElementVNode("div",tn,[c.createElementVNode("span",an,c.toDisplayString(r((G=t==null?void 0:t.data)==null?void 0:G.value)),1),w[0]||(w[0]=c.createElementVNode("span",{class:"props-panel__unit"},"dBm",-1))]),c.createElementVNode("div",nn,[c.createVNode(c.unref(X.ElButton),{type:"primary",onClick:l},{default:c.withCtx(()=>[...w[1]||(w[1]=[c.createTextVNode("查看历史",-1)])]),_:1})])])],32)}}}),on=He(rn,[["__scopeId","data-v-937ebfaa"]]);class sn{constructor(e){ve(this,"editor");this.editor=e}initPlugin(e,t,a={}){e.installPenPlugins({name:t},[{plugin:Qt.mindBoxPlugin,options:a},{plugin:Jt.collapseChildPlugin,options:a}])}}function ln(n,e){var oe,J;const t=e||new Path2D,{x:a,y:r,width:i,height:o}=n.calculative.worldRect,l=a+i/2,f=r+o/2,w=i/2,U=(oe=n.startAngle)!=null?oe:0,G=(J=n.endAngle)!=null?J:2*Math.PI;if(t.arc(l,f,w,U,G,n.anticlockwise),t instanceof Path2D)return t}function cn(n,e){const t=e||new Path2D,{x:a,y:r,width:i,height:o}=n.calculative.worldRect;if(t.rect(a,r,i,o),t instanceof Path2D)return t}function dn(n,e){const t=n||new Path2D,a=e.dimensionData;if(!a)return t;const r=e.calculative.worldRect,i=V=>({x:r.x+V.x*r.width,y:r.y+V.y*r.height}),o=i(a.tp1),l=i(a.tp2),f=i(a.dimStart),w=i(a.dimEnd),U=e.calculative.fontSize||12;n&&n.beginPath&&(n.save(),n.beginPath(),n.strokeStyle=e.color||"#000",n.lineWidth=e.calculative.lineWidth||1);const G=Math.max(5,U*.4),oe=f.x-o.x,J=f.y-o.y,q=Math.hypot(oe,J)||1,se=f.x+oe/q*G,L=f.y+J/q*G,me=w.x-l.x,de=w.y-l.y,pe=Math.hypot(me,de)||1,ye=w.x+me/pe*G,ie=w.y+de/pe*G;t.moveTo(o.x,o.y),t.lineTo(se,L),t.moveTo(l.x,l.y),t.lineTo(ye,ie),t.moveTo(f.x,f.y),t.lineTo(w.x,w.y);const Te=Math.hypot(w.x-f.x,w.y-f.y),Z=Math.min(10,Te/2.1),fe=(V,z)=>{if(Z<1)return;const ue=Math.atan2(z.y-V.y,z.x-V.x),he=Math.PI/6,u=z.x-Z*Math.cos(ue-he),p=z.y-Z*Math.sin(ue-he),I=z.x-Z*Math.cos(ue+he),k=z.y-Z*Math.sin(ue+he);t.moveTo(z.x,z.y),t.lineTo(u,p),t.lineTo(I,k),t.closePath()};if(fe(w,f),fe(f,w),n&&n.stroke&&(n.stroke(),n.restore()),n&&n.fillText&&a.text){n.save(),n.fillStyle=e.textColor||e.color||"#000",n.textAlign="center",n.textBaseline="bottom";let V=U;n.font=`${e.fontStyle||""} ${e.fontWeight||""} ${V}px ${e.fontFamily||"Arial"}`;const z=n.measureText(a.text),ue=Te*.9;if(z.width>ue&&ue>0){const I=ue/z.width;V=V*I,n.font=`${e.fontStyle||""} ${e.fontWeight||""} ${V}px ${e.fontFamily||"Arial"}`}const he=(f.x+w.x)/2,u=(f.y+w.y)/2;let p=Math.atan2(w.y-f.y,w.x-f.x);(p>Math.PI/2||p<-Math.PI/2)&&(p+=Math.PI),n.translate(he,u),n.rotate(p),n.fillText(a.text,0,-V*.2),n.restore()}if(t instanceof Path2D)return t}function un(n,e){const t=e||new Path2D,{x:a,y:r,width:i,height:o}=n.calculative.worldRect;if((n.anchors&&n.anchors.length>=3?n.anchors.slice(0,3):[{x:0,y:1},{x:1,y:1},{x:.5,y:0}]).forEach((f,w)=>{const U=a+f.x*i,G=r+f.y*o;w===0?t.moveTo(U,G):t.lineTo(U,G)}),t.closePath(),t instanceof Path2D)return t}function hn(n,e){var J,q;const t=e||new Path2D,{x:a,y:r,width:i,height:o}=n.calculative.worldRect,l=a+i/2,f=r+o/2,w=i/2,U=o/2,G=(J=n.startAngle)!=null?J:0,oe=(q=n.endAngle)!=null?q:2*Math.PI;if(t.ellipse(l,f,w,U,0,G,oe,n.anticlockwise),t instanceof Path2D)return t}function mn(){return ne(this,null,function*(){yield meta2d.register({arc:ln,mtext:cn,arrow:un,ellipse:hn}),yield meta2d.registerCanvasDraw({dimension:dn})})}const fn="original_meta2d";function pn(){return localStorage.removeItem(fn)}let Pe={};const An=n=>{const e=document.querySelectorAll("video");let t=null;if(e.forEach(r=>{r.getAttribute("src")===n.video&&(t=r)}),!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 n.autoPlay&&n.streamUrl&&a.play(n.streamUrl),Pe[n.id]=a,a},gn=()=>{Object.keys(Pe).forEach(n=>{Pe[n].destroy(),Pe[n]=null}),Pe={}},vn={class:"sy-empty"},wn={key:1,class:"sy-empty-picture"},_n={class:"sy-empty-description"},yn=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(n){c.useCssVars(r=>({v7ddea5d8:a.value.width,v4735fb99:a.value.height}));const e=n,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(r,i)=>{const o=c.resolveComponent("SyIcon"),l=c.resolveComponent("el-icon");return c.openBlock(),c.createElementBlock("div",vn,[n.image!=="empty"?(c.openBlock(),c.createElementBlock("span",{key:0,class:"sy-empty-image",style:c.normalizeStyle(t.value)},[n.image!=="loading"?(c.openBlock(),c.createBlock(o,{key:0,name:n.image,gradient:""},null,8,["name"])):(c.openBlock(),c.createBlock(l,{key:1,class:"is-loading",style:{color:"#1671d4"}},{default:c.withCtx(()=>[c.createVNode(c.unref(aa.Loading))]),_:1}))],4)):n.onlyText?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",wn)),c.createElementVNode("div",_n,[c.createElementVNode("p",null,c.toDisplayString(n.description),1)])])}}}),En=He(yn,[["__scopeId","data-v-97343c87"]]),In={key:1,class:"move-step-panel"},Tn=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(n,{expose:e,emit:t}){const a=t,r=n,i=c.inject("isComponent"),o=c.ref(null),l=c.shallowRef(),f=c.ref(1),w=c.ref(!1),U=c.computed(()=>!!(r.data||r.url));c.watch(()=>[r.data,r.url],()=>{U.value&&oe()});let G=c.ref(!0);function oe(){return ne(this,null,function*(){var u;try{if(G.value=!0,yield c.nextTick(),!o.value){console.error("未找到meta2d元素!");return}let p=null;if(r.data?p=r.data:r.url&&(p=yield ue()),!p||!p.data){G.value=!1,console.log("图纸数据为空"),a("load-error");return}const I=p.options||{background:"#eee",disableAnchor:(i==null?void 0:i.value)||!1};if(l.value&&(l.value.destroy(!0),l.value=null),!o.value){console.error("Meta2D 容器元素不可用");return}l.value=new M.Meta2d(o.value,D(d({},I),{disableAnchor:(i==null?void 0:i.value)||!1,rotateCursor:"rotate.cur",measureTextWidth:!1,interval:Math.max((u=I.interval)!=null?u:30,40),autoFPS:!0})),I.visibleLevel&&l.value.scale(I.visibleLevel),J(),q(),yield se(p.data),l.value.render(),me(),setTimeout(()=>{window.meta2dTools&&window.registerToolsNew()},1e3),a("loaded",l.value)}catch(p){console.error("初始化编辑器失败:",p)}})}function J(){if(!l.value)return;new sn({}).initPlugin(l.value,"mindNode",{})}function q(){mn(),M.register(ea.classPens()),M.register(Je.flowPens()),M.registerAnchors(Je.flowAnchors()),M.register(Ze.sequencePens()),M.registerCanvasDraw(Ze.sequencePensbyCtx()),M.register(et.activityDiagram()),M.registerCanvasDraw(et.activityDiagramByCtx()),M.registerCanvasDraw(Zt.formPens()),M.registerCanvasDraw(ta.chartsPens()),M.register(We.ftaPens()),M.registerAnchors(We.ftaAnchors()),M.registerCanvasDraw(We.ftaPensbyCtx())}function se(u){var p;if(l.value){if(typeof u.locked=="undefined"&&(u.locked=0),u.bkImage&&l.value.setBackgroundImage(u.bkImage),u.pens&&u.pens.length>0){const I=[];u.pens.forEach(v=>{v.name==="video"&&v.streamUrl?I.push(v):v.name==="image"&&v.image?v.image=Ja(v.image,r.devConfig):v.lineType==="gisLine"?v.visible=!r.preview:v.penType===C.TABLE&&v.dataType?L(v):v.penType===C.GIS_SENSOR_WRAPPER&&r.preview&&(v.title="")}),I.length>0&&setTimeout(()=>{I.forEach(v=>{An(v)})},500);const k=window.meta.graph.penCountThreshold||2e3;u.pens.length>k&&u.scale&&u.pens.forEach(v=>{const W=v.visibleLevel;W!==void 0?(v.visible=u.scale>=W,v.visible||(v.disabled=!0,v.locked=M.LockState.Disable)):(v.visible=!0,v.disabled=!1,v.locked=M.LockState.None)})}l.value.open(D(d({},u),{disableAnchor:(i==null?void 0:i.value)||!1})),!r.preview&&((p=u.networks)!=null&&p.length)&&l.value.closeNetwork()}}const L=u=>ne(this,null,function*(){var I;const p=yield _e.getCommonApi(oa[u.dataType],{offset:0,limit:u.tableSize||10});if((I=p.data)!=null&&I.length){const k=u.tableHeader||[{prop:"id",label:"ID"},{prop:"guid",label:"标识"},{prop:"name",label:"名称"}],P=p.data.map(v=>k.filter(W=>W.isShow).map(W=>{const Q=v[W.prop];return W.choices?W.choices[Q]||Q:Ge.isObject(Q)?Q.name:Q}));l.value.setValue({id:u.id,dataY:P})}else l.value.setValue({id:u.id,dataY:[]})}),me=()=>{var u,p;l.value&&((p=(u=l.value.canvas)==null?void 0:u.tooltip)!=null&&p.box&&(l.value.canvas.tooltip.box.style.pointerEvents="none"),l.value.on("scale",V),r.preview||(l.value.on("connectLine",z),l.value.on("active",de),l.value.on("inactive",pe),document.addEventListener("keydown",ye,!0)),Te())},de=u=>{w.value=(u==null?void 0:u.length)>0},pe=()=>{w.value=!1},ye=u=>{var v;if(f.value<=0||!l.value)return;const p=(v=l.value.store)==null?void 0:v.active;if(!(p!=null&&p.length))return;const I=f.value*(l.value.store.data.scale||1);let k=0,P=0;switch(u.key){case"ArrowLeft":k=-I;break;case"ArrowRight":k=I;break;case"ArrowUp":P=-I;break;case"ArrowDown":P=I;break;default:return}u.preventDefault(),u.stopPropagation(),l.value.translatePens(p,k,P)};let ie=null;const Te=()=>{const u=l.value.canvas;u&&(ie=u.getHover.bind(u),u.getHover=p=>{var P;if(ie(p),u.hoverType!==M.HoverType.Node&&u.hoverType!==M.HoverType.Line||!u.store.hover)return;const I=fe(p,u.store.data.pens,u.store.data.scale||1);if(!I||I.id===u.store.hover.id)return;const k=u.store.hover;k.calculative.hover=!1,M.setHover(M.getParent(k,!0)||k,!1),u.store.hover=I,I.calculative.hover=!0,M.setHover(M.getParent(I,!0)||I),u.store.lastHover=I,u.patchFlags=!0,(P=u.initTemplateCanvas)==null||P.call(u,[I])})},Z=(u,p,I)=>{const k=I.x-p.x,P=I.y-p.y;if(k===0&&P===0)return Math.hypot(u.x-p.x,u.y-p.y);const v=Math.max(0,Math.min(1,((u.x-p.x)*k+(u.y-p.y)*P)/(k*k+P*P)));return Math.hypot(u.x-(p.x+v*k),u.y-(p.y+v*P))},fe=(u,p,I)=>{var Q,le,K,$;let k=null,P=1/0,v=1/0;const W=5/I;for(let ee=0;ee<p.length;ee++){const te=p[ee];if(!(te.visible===!1||te.calculative.inView===!1)&&te.locked!==M.LockState.Disable&&!te.parentId)if(te.type===M.PenType.Line){const H=te.calculative.worldAnchors;if(!H||H.length<2)continue;let R=1/0;for(let Ae=0;Ae<H.length-1;Ae++){const ge=Z(u,H[Ae],H[Ae+1]);ge<R&&(R=ge)}if(R>W)continue;(0<P||P===0&&R<v)&&(k=te,P=0,v=R)}else{if(te.type)continue;const H=te.calculative.worldRect;if(!H||!M.pointInRect(u,H))continue;const R=H.width*H.height,Ae=u.x-((le=(Q=H.center)==null?void 0:Q.x)!=null?le:H.x+H.width/2),ge=u.y-(($=(K=H.center)==null?void 0:K.y)!=null?$:H.y+H.height/2),ke=Ae*Ae+ge*ge;(R<P||R===P&&ke<v)&&(k=te,P=R,v=ke)}}return k},V=Ge.debounce(u=>{var p,I,k,P;try{if(!l.value)return;je.emit("graph-scale",u);let v=l.value.store.data.pens;const W=window.meta.graph.penCountThreshold||2e3,Q=v.length>W;for(let le=0;le<v.length;le++){const K=v[le];if([C.VIDEO_STREAM,C.MP4].includes(K.penType)){if(((I=(p=Se.videos[K.id])==null?void 0:p.children)==null?void 0:I.length)===3){let $=Se.videos[K.id].children[0],ee=Se.videos[K.id].children[2];$.style.width=ee.currentTime/ee.duration*K.calculative.worldRect.width+"px"}else if(((P=(k=Se.videos[K.id])==null?void 0:k.children)==null?void 0:P.length)===2){let $=Se.videos[K.id].children[0],ee=Se.videos[K.id].children[1];$.style.width=ee.currentTime/ee.duration*K.calculative.worldRect.width+"px"}}if(Q){const $=K.visibleLevel!==void 0?u>=K.visibleLevel:!0;l.value._setValue({id:K.id,visible:$,disabled:!$,locked:$?M.LockState.None:M.LockState.Disable})}}l.value.render()}catch(v){console.error("处理缩放失败:",v)}},500),z=k=>ne(this,[k],function*({line:u,lineAnchor:p,pen:I}){var H;if(p!=null&&p.start||(I==null?void 0:I.penType)!==C.GIS_SENSOR)return;const P=(H=u==null?void 0:u.calculative)==null?void 0:H.worldAnchors;if(P.length!==2||P!=null&&P.some(R=>!R.connectTo))return;const[v,W]=P;if(v.connectTo===W.connectTo)return;const Q=window.meta2d.findOne(v.connectTo),le=window.meta2d.findOne(W.connectTo);let K=Q==null?void 0:Q.bindData,$=le==null?void 0:le.bindData;if(!K||!$)return;const ee=yield _e.postPDApi("setchannelpaired/",{data:[{channel1:K.guid,channel2:$.guid}]}),te=yield _e.postCommonApi("sgpoint",{ln__in:`${K.guid},${$.guid}`,group_number__in:6});ee.success&&te.success?(l.value.setValue({id:u.id,color:"#00d200",lineDash:[3,3],lineWidth:2,lineType:"gisLine"}),X.ElMessage.success("配对成功")):X.ElMessage.error("配对失败",ee.detail||te.detail)});function ue(){return ne(this,null,function*(){if(!r.url)return X.ElMessage.error("图纸路径为空!"),null;try{return(yield _e.getGraphApi(r.url,{local:r.local}))||null}catch(u){return null}})}const he=()=>{l.value&&(l.value.resize(),l.value.fitView(!0,10))};return c.onMounted(()=>{var u,p;U.value&&(u=o.value)!=null&&u.clientHeight&&(p=o.value)!=null&&p.clientWidth&&oe(),window.addEventListener("resize",he)}),c.onUnmounted(()=>{var u;gn(),pn(),ie&&((u=l.value)!=null&&u.canvas)&&(l.value.canvas.getHover=ie,ie=null),document.removeEventListener("keydown",ye,!0),l.value&&(r.preview?(xt.clearLineCross(),l.value.destroy(!0)):(l.value.off("scale",V),l.value.off("active",de),l.value.off("inactive",pe))),window.removeEventListener("resize",he)}),e({stage:l}),(u,p)=>{const I=c.resolveComponent("el-input-number");return c.openBlock(),c.createElementBlock("div",{ref_key:"meta2dRef",ref:o,class:"meta2d-editor"},[c.unref(G)?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(En,{key:0,class:"meta2d-empty",description:"图纸不存在"})),w.value&&!r.preview?(c.openBlock(),c.createElementBlock("div",In,[p[1]||(p[1]=c.createElementVNode("span",{class:"move-step-label"},"移动步长",-1)),c.createVNode(I,{modelValue:f.value,"onUpdate:modelValue":p[0]||(p[0]=k=>f.value=k),min:.1,max:200,step:.5,precision:1,size:"small","controls-position":"right",class:"move-step-input"},null,8,["modelValue"]),p[2]||(p[2]=c.createElementVNode("span",{class:"move-step-tip"},"方向键按步长移动",-1))])):c.createCommentVNode("",!0)],512)}}}),Sn=He(Tn,[["__scopeId","data-v-bb512c48"]]),bn={key:0,class:"back-btn"};var bt,Ct;const Cn=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:((Ct=(bt=window.meta)==null?void 0:bt.app)==null?void 0:Ct.lang)||"zh-cn"},config:{type:Object,default:()=>({socketUrl:at,stationIdKey:lt,enableToken:!0,userTokenKey:st,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,enableWebSocket:!0,graphSocket:tt.GRAPH.SOCKET})},showMap:{type:Boolean,default:!1},isFactory:{type:Boolean,default:!1},isInitData:{type:Boolean,default:!0},apiInstance:{type:Object,default:()=>_e},mittInstance:{type:Object,default:()=>je},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","view-history"],setup(n,{expose:e,emit:t}){const a=t,r=n;let i=c.ref(!1),o=c.ref(""),l=c.ref(""),f=c.ref(!1);const w=c.ref(!1);c.provide("isComponent",w);const U=c.ref(null),G=c.ref(null),oe=c.ref(null),J=c.ref(""),q=c.ref(""),se=c.ref(!1),L=c.computed(()=>{var s;return(s=oe.value)==null?void 0:s.stage}),me=c.computed(()=>{var s;return(s=L.value)==null?void 0:s.store}),de=c.computed(()=>d({socketUrl:at,stationIdKey:lt,enableToken:!0,userTokenKey:st,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,fitPadding:10,enableWebSocket:!0,graphSocket:tt.GRAPH.SOCKET},r.config)),pe=()=>r.apiInstance||_e,ye=()=>r.mittInstance||je,ie=(s,h="")=>{const y={error:s,message:h,timestamp:new Date().toISOString()};a("error",y),r.errorHandler.callback?r.errorHandler.callback(y):r.errorHandler.showMessage&&X.ElMessage&&X.ElMessage.error(`${h}: ${s.message||s}`)},Te=()=>{o.value?(q.value=o.value,se.value=f.value):l.value&&(J.value=l.value,$(J.value)),i.value=!1},Z={},fe=c.ref(!1),V=c.ref({left:0,top:0}),z=c.ref(!1),ue=()=>{z.value=!1,fe.value=!1,V.value={left:0,top:0},P.value={}},he=()=>{z.value=!0},u=s=>{a("view-history",s)},p=(s,h)=>{if(!U.value)return{left:s+20,top:h+20};const y=U.value.getBoundingClientRect(),N=s-y.left,O=h-y.top;let b=300,T=150;if(G.value){const E=G.value.$el||G.value;E&&E.offsetWidth&&(b=E.offsetWidth,T=E.offsetHeight)}let A=N+20,S=O+20;return A+b>y.width&&(A=N-b-20),S+T>y.height&&(S=O-T-20),{left:Math.max(0,Math.min(A,y.width-b)),top:Math.max(0,Math.min(S,y.height-T))}},I=s=>{fe.value&&(V.value.left||(V.value=p(s.clientX,s.clientY)))},k=s=>{var h,y,N,O,b,T;try{if(!s)return;if((h=s==null?void 0:s.includes)!=null&&h.call(s,"token 必传"))return X.ElMessage.warning(s);const A=typeof s=="string"?JSON.parse(s):s;if((A==null?void 0:A.data)==="服务错误"||(N=(y=A==null?void 0:A.data)==null?void 0:y.includes)!=null&&N.call(y,"token is expired"))return X.ElMessage.warning(A.data);switch(a("socket-msg",A),A.action){case Ke.ACPOINT.YCVALUE:case Ke.ACPOINT.YXVALUE:if((O=A==null?void 0:A.data)!=null&&O.point_id){const S=L.value.find(A.data.point_id);S&&(Z[A.data.point_id]=A.action===Ke.ACPOINT.YXVALUE?Oe(A.data.value)?A.data.value:0:Oe(A.data.value_disp||A.data.value)?A.data.value_disp||A.data.value:0,Re(S,A.data))}break;default:if(((b=A.data)==null?void 0:b.length)>0){const S=setTimeout(()=>{clearTimeout(S),L.value&&(A.data.forEach(E=>{Z[E.dataId||E.point_id]=E.value_disp||E.value}),A.data.forEach(E=>{const x=L.value.find(E.dataId||E.point_id);Re(x,E)}))},de.value.messageDelay);r.customCallbacks.onWebSocketMessage&&r.customCallbacks.onWebSocketMessage(A),(T=window.customSocketFn)==null||T.call(window,s)}break}return!0}catch(A){return ie(A,"WebSocket消息处理"),!0}},P=c.ref({});let v={},W=null;const Q=s=>ne(this,null,function*(){try{if(s.msgName)switch(s.msgName){case re.CHANGE_GRAPH:case re.NOTIFY_DIALOG:case re.GIS_PROPS_PANEL:le(s);break}else le(s);a("custom-msg",s),r.customCallbacks.onCustomMessage&&r.customCallbacks.onCustomMessage(s)}catch(h){ie(h,"自定义消息处理")}}),le=s=>{var N,O;let h;if(s.params)try{h=JSON.parse(s.params)}catch(b){h=s.params}switch(s.msgName){case re.CHANGE_GRAPH:(h==null?void 0:h.data)!=="图纸id"&&(h!=null&&h.data)?(o.value=q.value,f.value=se.value,i.value=h.isBack,(N=h==null?void 0:h.data)!=null&&N.startsWith("/")?(q.value=h==null?void 0:h.data,se.value=!0):(se.value=!1,l.value=$(h.data))):h?(se.value=!1,l.value=J.value,i.value=!0,$(h)):console.warn("切换图纸信息为空");break;case re.NOTIFY_DIALOG:h.msg!=="通知内容"?X.ElNotification(d({message:h.msg},h)):console.warn("通知内容为空");break;case re.GIS_PROPS_PANEL:s.eventName==="enter"?(fe.value=!0,s.pen.penType===C.GIS_SENSOR?P.value=((O=s==null?void 0:s.pen)==null?void 0:O.bindData)||{}:s.pen.penType===C.GIS_SENSOR_WRAPPER&&s.pen.children.forEach(b=>{const T=L.value.findOne(b);T&&T.penType===C.GIS_SENSOR&&(P.value=T.bindData||{})}),s.e&&(V.value=p(s.e.clientX,s.e.clientY))):setTimeout(()=>{z.value||(fe.value=!1,V.value={left:0,top:0},P.value={})},200);break}},K=s=>{var h,y,N,O,b,T,A,S,E;try{a("loaded",s);const x=qe(),m=de.value,_=it.getSession(m.stationIdKey),j=it.getSession(m.userTokenKey);m.enableWebSocket&&_&&j&&((N=(y=(h=s.store)==null?void 0:h.data)==null?void 0:y.networks)!=null&&N.length?(T=(b=(O=s.store)==null?void 0:O.data)==null?void 0:b.networks)==null||T.forEach(ae=>{var Ee;ae.protocol==="websocket"&&((Ee=ae.url)!=null&&Ee.includes("station_id")||(ae.url=`${ae.url}?station_id=${_}`),m.enableToken?ae.protocols=m.userToken||j:ae.protocols=void 0)}):(S=(A=s.store)==null?void 0:A.data)!=null&&S.websocket?((E=s.store.data.websocket)!=null&&E.includes("station_id")||(s.store.data.websocket=`${s.store.data.websocket}?station_id=${_}`),m.enableToken?s.store.data.websocketProtocols=m.userToken||j:s.store.data.websocketProtocols=void 0,s.closeSocket(),s.connectSocket()):(s.store.data.websocket=`${m.socketUrl}?station_id=${_}`,m.enableToken?s.store.data.websocketProtocols=j:s.store.data.websocketProtocols=void 0,s.connectWebsocket())),(r.showMap||x.showMap==="true")&&s.showMap(),s.setRule({rule:!1}),s.setOptions({disableRuleLine:!0}),s.setGrid({grid:!1}),s.lock(M.LockState.DisableEdit),ge().forEach(ae=>{var Ee;(Ee=ae==null?void 0:ae.events)!=null&&Ee.length?R({id:ae.id,locked:1},!1):R({id:ae.id,locked:10},!1)}),s.render(),m.enableAutoFit&&s.fitView(!0,m.fitPadding),Object.values(re).forEach(ae=>{s.on(ae,Ee=>Q(D(d({},Ee),{msgName:ae})))}),s&&(s.socketFn=k),r.customCallbacks.onStageLoaded&&r.customCallbacks.onStageLoaded(s),r.isInitData&&te(s),window.addEventListener("mousemove",I)}catch(x){ie(x,"图纸加载完成处理")}},$=Ge.throttle(s=>ne(this,null,function*(){var h;try{if(window.isFactory=r.isFactory,r.url){se.value=r.local,q.value=r.url;return}const y=qe();if(s=s||r.gid||y.id,y.local==="true"&&(se.value=!0),s){const N=pe();if(N&&N.getCommonApi){const O=yield N.getCommonApi(r.isFactory?"graph":"floorplan",{guid:s});if((h=O.data)!=null&&h.length)yield ee(O.data[0].path);else{const b="未找到图纸!";ie(new Error(b),"获取图纸数据")}}else ie(new Error("API实例不可用"),"初始化图纸数据!")}else se.value=r.local,yield ee(r.url);r.customCallbacks.onGraphLoaded&&r.customCallbacks.onGraphLoaded(q.value)}catch(y){ie(y,"获取图纸数据失败")}})),ee=s=>ne(this,null,function*(){const h=s.split(".");if(s.includes(r.lang)||h.length!==3){q.value=s;return}const y=`${h[0]}.${r.lang}.${h[2]}`;try{const N=yield _e.getGraphApi(y,{local:r.local}).catch(()=>{console.warn("多语言图纸不存在,使用默认图纸")});q.value=N?y:s}catch(N){q.value=s}}),te=s=>ne(this,null,function*(){var h,y,N,O;if(s){let b=[],T=[],A=[];v={};const S=s.store.data.pens;for(let x=0;x<S.length;x++){const m=S[x];m.bindDataId?(h=m.form)!=null&&h.length?m.form.forEach(_=>{if(_.dataIds.dataId)switch(_.dataIds.dataType){case B.YC:b.push(D(d({},_),{nodeName:_.dataIds.name,penId:m.id,penName:m.penName}));break;case B.YX:T.push(D(d({},_),{nodeName:_.dataIds.name,penId:m.id,penName:m.penName}));break;case B.SG:T.push(D(d({},_),{nodeName:_.dataIds.name,penId:m.id,penName:m.penName}));break;case B.POINT:A.push(D(d({},_),{nodeName:_.dataIds.name,penId:m.id,penName:m.penName}));break}}):(m.penType===C.GIS_SENSOR||m.penType===C.GIS_DB_VALUE)&&m.bindData&&(v[m.bindData.ied_id]||(v[m.bindData.ied_id]=[]),R({id:m.id,title:void 0}),v[m.bindData.ied_id].push(d({penId:m.id,penType:m.penType},m.bindData))):(y=m.statusBindData)!=null&&y.length&&m.statusBindData.forEach(_=>{if(_.dataId)switch(_.dataType){case B.YX:T.push({showChild:0,value:0,nodeName:_.dataName,penId:m.id,penName:m.penName,dataId:_.dataId});break;case B.SG:T.push({showChild:0,value:0,nodeName:_.dataName,penId:m.id,penName:m.penName,dataId:_.dataId});break}})}let E=[];if(b.length){const x=pe();if(x&&x.postCommonApi){const m=yield x.postCommonApi("queryrealtimepoint",{point_id:b.map(_=>{var j;return((j=_==null?void 0:_.dataIds)==null?void 0:j.dataId)||_.dataId}).join(",")});(N=m==null?void 0:m.data)!=null&&N.length&&(m.data.forEach(_=>{Z[_.guid]=_.value_disp||_.value}),E=[...E,...m.data])}}if(T.length){const x=pe();if(x&&x.postCommonApi){const m=yield x.postCommonApi("queryrealtimepoint",{point_id:T.map(_=>{var j;return((j=_==null?void 0:_.dataIds)==null?void 0:j.dataId)||_.dataId}).join(",")});(O=m==null?void 0:m.data)!=null&&O.length&&(m.data.forEach(_=>{Z[_.guid]=$e(_.value)?Number(_.value):_.value}),E=[...E,...m.data])}}E.length&&E.forEach(x=>{const m=s.find(x.guid);Re(m,D(d({},x),{value:$e(x.value)?Oe(Number(x.value))?Number(x.value):0:x.value,value_disp:x.value_disp,alarm_value:x.alarm_value,point_id:x.guid}))}),v&&Object.keys(v).length?(W&&clearInterval(W),H(),W=setInterval(()=>{H()},3e3)):W&&clearInterval(W)}}),H=()=>ne(this,null,function*(){var s;if(v){const h=Object.keys(v);if(h.length){const y=yield _e.postPDApi("querychannelstatus/",{data:h.map(N=>({ied_id:N,ln_list:v[N].map(O=>O.ln_id)}))});(s=y==null?void 0:y.data)!=null&&s.length&&(h.forEach(N=>{const O=y.data.find(T=>T.ied_id===N),b=v[N];b!=null&&b.length&&b.forEach(T=>{const A=O.result.find(S=>S.ln_id===T.ln_id);if(A){const S=$e(A.amp_peak)?Oe(Number(A.amp_peak))?Number(A.amp_peak):0:A.amp_peak;T.penType===C.GIS_SENSOR?R({id:T.penId,showChild:A.status==="告警"?2:A.status==="正常"?1:0,bindData:D(d({},T),{name:A.name||T.name,status:A.status,value:S})},!1):R({id:T.penId,text:`${S} dBm`},!1)}})}),L.value.render())}}}),R=(s,h=!0)=>{if(L.value)return L.value.setValue(s,{render:h})},Ae=()=>L.value,ge=()=>{var s,h;return((h=(s=me.value)==null?void 0:s.data)==null?void 0:h.pens)||[]},ke=()=>C,Re=(()=>{let s=null;const h=new Map,y=new Map,N=b=>{var A;if(!((A=b.children)!=null&&A.length))return[];const T=b.id||"";if(!T)return[];if(!y.has(T)&&me.value){const S=M.getAllChildren(b,me.value);y.set(T,S)}return y.get(T)||[]},O=()=>{if(h.size===0||!L.value||!me.value)return;const b=[],T=[],A=me.value.animates;h.forEach(({pen:S,dataItem:E,formKey:x})=>{switch(x){case"showChild":R({id:S.id,showChild:+E.value},!1);break;case"text":R({id:S.id,text:E.value_disp||E.value},!1);break;case"light_plate":{const m=E.value===-1||ot(E)?"#999999":Gt[E.value!==void 0?E.value:E.alarm_value],_=E.value===-1||ot(E)?"#cccccc":Ut[E.value!==void 0?E.value:E.alarm_value];R({id:S.id,textColor:m,background:_},!1)}break;case"point_value":S.penType===C.POINT_VALUE&&N(S).forEach(_=>{_.name==="text"&&R({id:_.id,text:E.value},!1)});break;case"online_state":{let m=E.value?void 0:"contrast(0%)";R({id:S.id,filter:m},!1),N(S).forEach(j=>{R({id:j.id,filter:m},!1)})}break;case"charged_state":{const m=E.value===na.OFFLINE?"contrast(0%)":void 0;m!==S.filter&&(R({id:S.id,filter:m},!1),N(S).forEach(j=>{R({id:j.id,filter:m},!1)}))}break;case"electric_direction":E.value===ra.STOP?A!=null&&A.has(S)&&T.push(S):!!E.value!==S.animateReverse&&(R({id:S.id,animateReverse:!!E.value},!1),A!=null&&A.has(S)||b.push(S));break;case"electric_size":{const m=ia[E.value];m!==void 0&&m!==S.lineWidth&&R({id:S.id,lineWidth:m},!1)}break;default:R({id:S.id,[x]:E.value},!1);break}}),T.length>0&&L.value.stopAnimate(T),b.length>0&&L.value.startAnimate(b),h.clear(),L.value.render()};return(b,T)=>{b!=null&&b.length&&(b.forEach(A=>{var E;const S=A.form;if((E=A.statusBindData)!=null&&E.length){if(!Z[T.guid])return;const x=[...A.statusBindData],m=x.findIndex(_=>_.dataId===T.guid);if(m!==-1){const _=x[m];x.find(ce=>_.sort<ce.sort&&Z[ce.dataId])||h.set(A.id,{pen:A,formKey:"showChild",dataItem:D(d({},T),{value:m})})}}else S!=null&&S.length&&S.forEach(x=>{if(!(Array.isArray(x.dataIds)?x.dataIds:[x.dataIds]).some(ce=>(ce==null?void 0:ce.dataId)&&((ce==null?void 0:ce.dataId)===T.dataId||(ce==null?void 0:ce.dataId)===T.point_id)))return;const j=`${A.id}-${x.key}`;h.set(j,{pen:A,dataItem:T,formKey:x.key})})}),s&&clearTimeout(s),s=setTimeout(()=>{O(),s=null},de.value.debounceDelay))}})(),Vt=s=>{if(L.value){for(let h=0;h<s.length;h++){const y=s[h];Z[y.dataId||y.point_id]=y.value_disp||y.value;const N=L.value.find(y.dataId);setTimeout(()=>{Re(N,y)},de.value.messageDelay)}L.value.render(),r.customCallbacks.onBatchUpdate&&r.customCallbacks.onBatchUpdate(s)}},Ht=(s,h=!1)=>{if(!L.value)return;const y=ge();for(let N=0;N<y.length;N++){const O=y[N];let b=!1;h?b=s===O.dataProp:b=s===5?!0:O.dataProp<=s,R({id:O.id,visible:b},!1)}L.value.fitView(),L.value.render(),r.customCallbacks.onLevelChange&&r.customCallbacks.onLevelChange(s,h)};return c.watch(()=>[r.gid,r.url,r.data,r.lang,r.local,r.isFactory],()=>{$()}),c.watch(()=>r.showMap,s=>{L.value&&(s?L.value.showMap():L.value.hideMap())}),c.onMounted(()=>{const s=ye();s&&s.on&&s.on(de.value.graphSocket,k);const h=qe();J.value=r.gid||h.id,$()}),c.onUnmounted(()=>{v=null;const s=ye();s&&s.off&&s.off(de.value.graphSocket,k),window.removeEventListener("mousemove",I)}),e({setValue:R,getStage:Ae,getAllPens:ge,getCustomPenType:ke,batchUpdatePen:Vt,handleLineCross:xt.handleLineCross,changeVisibleByLevel:Ht}),(s,h)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"previewRef",ref:U,class:"meta2d-preview"},[c.createVNode(Sn,{ref_key:"graphRef",ref:oe,url:q.value,local:se.value,data:r.data,"dev-config":r.devConfig,preview:"",onLoaded:K},null,8,["url","local","data","dev-config"]),c.unref(i)?(c.openBlock(),c.createElementBlock("div",bn,[c.createVNode(c.unref(X.ElButton),{type:"primary",onClick:Te},{default:c.withCtx(()=>[...h[0]||(h[0]=[c.createTextVNode("返回",-1)])]),_:1})])):c.createCommentVNode("",!0),fe.value?(c.openBlock(),c.createBlock(on,{key:1,ref_key:"panelRef",ref:G,data:P.value,style:c.normalizeStyle({top:V.value.top+"px",left:V.value.left+"px",position:"absolute"}),onClose:ue,onEnter:he,onViewHistory:u},null,8,["data","style"])):c.createCommentVNode("",!0)],512))}}),Ne=He(Cn,[["__scopeId","data-v-fe1ca54c"]]);Ne.name||(Ne.name="SyGraph");const xn=n=>{n.component(Ne.name||"SyGraph",Ne)},Pn={install:xn};exports.SyGraph=Ne;exports.default=Pn;
|
|
5
|
+
*/Object.defineProperty(qe,"__esModule",{value:!0});var Me=typeof window!="undefined"?window.proxy||window:{},zt=function(a){Me!=null&&Me.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),Me.qiankunName&&(window.moudleQiankunAppLifeCycles[Me.qiankunName]=a))};qe.default=zt;var et=qe.qiankunWindow=Me;qe.renderWithQiankun=zt;function Ea(){return window.__POWERED_BY_WUJIE__||window.$wujie?Be.WUJIE:window.__POWERED_BY_QIANKUN__||et!=null&&et.__POWERED_BY_QIANKUN__?Be.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?Be.MICROAPP:Be.NONE}const Ye="/",qt=window.meta.app.encrypt;var Et,Tt;const $e=((Tt=(Et=window==null?void 0:window.meta)==null?void 0:Et.app)==null?void 0:Tt.proxyUrl)||"";var St,It;const ht=((It=(St=window==null?void 0:window.meta)==null?void 0:St.app)==null?void 0:It.singoPrefixUrl)||"";var bt,Ct;const mt=((Ct=(bt=window==null?void 0:window.meta)==null?void 0:bt.app)==null?void 0:Ct.singoToken)||"";Ea();const Ta=location.protocol==="https:",Sa=location.hostname,Ia=Ta?"wss:":"ws:",ba=location.port,Ca=$e?`${location.origin}/${$e}`:`${location.origin}`,xa=$e?`${location.origin}/${$e}`:ht?`${location.origin}/${ht}`:`${location.origin}`,ft=`${Ia}//${location.host}/ws`;var xt,Pt,Nt,kt,Rt,Dt,Mt,Lt,Ot,Ft,Ut,Gt;(Pt=(xt=window.meta)==null?void 0:xt.graph)!=null&&Pt.savePath,(kt=(Nt=window.meta)==null?void 0:Nt.graph)!=null&&kt.graphPenPath,(Dt=(Rt=window.meta)==null?void 0:Rt.graph)!=null&&Dt.templatePath,(Lt=(Mt=window.meta)==null?void 0:Mt.graph)!=null&&Lt.graphImgUploadPath,(Ft=(Ot=window.meta)==null?void 0:Ot.graph)!=null&&Ft.threeSavePath,(Gt=(Ut=window.meta)==null?void 0:Ut.graph)!=null&&Gt.threeModelPath;var Ht;const W=Yt.create({baseURL:Ca,timeout:((Ht=window.meta.axios)==null?void 0:Ht.timeout)||6e4,withCredentials:!1,paramsSerializer:a=>Wt.stringify(a)});W.interceptors.request.use(a=>(a.headers["x-token"]="ewoglCJhbGcilDogpc3",a),a=>Promise.reject(a));W.interceptors.response.use(a=>{const{data:e}=a;return Promise.resolve(e)},a=>Promise.reject(a));var Vt;const je=Yt.create({baseURL:xa,timeout:((Vt=window.meta.axios)==null?void 0:Vt.timeout)||6e4,withCredentials:!1,paramsSerializer:a=>Wt.stringify(a)});je.interceptors.request.use(a=>(mt&&(a.headers["x-token"]=mt),a),a=>Promise.reject(a));je.interceptors.response.use(a=>{const{data:e}=a;return Promise.resolve(e)},a=>Promise.reject(a));function Pa(a,e={},t={}){return new Promise(n=>{W.get(a,u({params:e},t)).then(r=>n({res:r,err:null})).catch(r=>n({res:null,err:r}))})}function Na(a,e={},t={}){return new Promise(n=>{W.post(a,e,t).then(r=>n({res:r,err:null})).catch(r=>n({res:null,err:r}))})}function ka(a,e={},t={}){return W.get(a,u({params:e},t))}function Ra(a,e={},t={}){return W.post(a,e,t)}function Da(a,e={}){return W.get(`/filehandle/${a}`,{params:e})}function Ma(a,e={},t={}){return W.post(`/filehandle/${a}`,e,t)}function La(a,e={}){return W.get(`/user/${a}`,{params:e})}function Oa(a,e={},t={}){return W.post(`/user/${a}`,e,t)}function Fa(a,e={}){return W.get(`${a}`,e.local?{params:e,baseURL:Ye}:{params:e})}function Ua(a,e={}){return W.get(`/media/${a}/`,{params:e})}function Ga(a,e={},t={}){return W.post(`/media/${a}/`,e,t)}function Ha(a,e={}){return je.get(`/common/${a}/`,{params:e})}function Va(a,e={},t={}){return je.post(`/common/${a}/`,e,t)}function Ba(a,e={}){return W.get(`/history/${a}`,{params:e})}function Ka(a,e={},t={}){return W.post(`/history/${a}`,e,t)}function Wa(a,e={}){return W.get(`/scada/${a}`,{params:e})}function Ya(a,e={},t={}){return W.post(`/scada/${a}`,e,t)}function $a(a,e={}){return W.get(`/common/factory/${a}`,{params:e})}function za(a,e={},t={}){return W.post(`/common/factory/${a}`,e,t)}function qa(a,e={}){return W.get(`/factory/${a}`,{params:e})}function ja(a,e={},t={}){return W.post(`/factory/${a}`,e,t)}function Xa(a,e={}){return W.get(`/pd/${a}`,{params:e})}function Qa(a,e={},t={}){return W.post(`/pd/${a}`,e,t)}const Le={getApi:Pa,postApi:Na,getFileApi:Da,postFileApi:Ma,getBaseApi:ka,postBaseApi:Ra,getUserApi:La,postUserApi:Oa,getGraphApi:Fa,getMediaApi:Ua,postMediaApi:Ga,getScadaApi:Wa,postScadaApi:Ya,getCommonApi:Ha,postCommonApi:Va,getHistoryApi:Ba,postHistoryApi:Ka,getFactoryApi:qa,postFactoryApi:ja,getCommonFactoryApi:$a,postCommonFactoryApi:za,getPDApi:Xa,postPDApi:Qa},ot=da(),Ja=[65535,-99999];function tt(a){if(typeof a!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return a.trim()!==""&&e.test(a.trim())}function it(a){return!["null","undefined"].includes(a)&&a!==void 0&&a!==null&&a!==""}function Ke(a){return typeof a=="number"&&!Ja.includes(a)}const at=()=>{var n;const a={},e=((n=window.location.href.split("?"))==null?void 0:n[1])||"",t=new URLSearchParams(e);for(const[r,o]of t.entries())a[r]=o;return a};function nt(a){return Object.prototype.toString.call(a).slice(8,-1)}(function(){if(typeof Object.id=="undefined"){var a=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++a,enumerable:!1,writable:!1}),e.__uniqueid}}})();function Za(){var a="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 n,r,o,s,c,p;for(o=t.length,r=0,n="";r<o;){if(s=t.charCodeAt(r++)&255,r==o){n+=a.charAt(s>>2),n+=a.charAt((s&3)<<4),n+="==";break}if(c=t.charCodeAt(r++),r==o){n+=a.charAt(s>>2),n+=a.charAt((s&3)<<4|(c&240)>>4),n+=a.charAt((c&15)<<2),n+="=";break}p=t.charCodeAt(r++),n+=a.charAt(s>>2),n+=a.charAt((s&3)<<4|(c&240)>>4),n+=a.charAt((c&15)<<2|(p&192)>>6),n+=a.charAt(p&63)}return n},this.decode=function(t){var n,r,o,s,c,p,v;for(p=t.length,c=0,v="";c<p;){do n=e[t.charCodeAt(c++)&255];while(c<p&&n==-1);if(n==-1)break;do r=e[t.charCodeAt(c++)&255];while(c<p&&r==-1);if(r==-1)break;v+=String.fromCharCode(n<<2|(r&48)>>4);do{if(o=t.charCodeAt(c++)&255,o==61)return v;o=e[o]}while(c<p&&o==-1);if(o==-1)break;v+=String.fromCharCode((r&15)<<4|(o&60)>>2);do{if(s=t.charCodeAt(c++)&255,s==61)return v;s=e[s]}while(c<p&&s==-1);if(s==-1)break;v+=String.fromCharCode((o&3)<<6|s)}return v},this.utf16to8=function(t){var n,r,o,s;for(n="",o=t.length,r=0;r<o;r++)s=t.charCodeAt(r),s>=1&&s<=127?n+=t.charAt(r):s>2047?(n+=String.fromCharCode(224|s>>12&15),n+=String.fromCharCode(128|s>>6&63),n+=String.fromCharCode(128|s>>0&63)):(n+=String.fromCharCode(192|s>>6&31),n+=String.fromCharCode(128|s>>0&63));return n},this.utf8to16=function(t){var n,r,o,s,c,p;for(n="",o=t.length,r=0;r<o;)switch(s=t.charCodeAt(r++),s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=t.charAt(r-1);break;case 12:case 13:c=t.charCodeAt(r++),n+=String.fromCharCode((s&31)<<6|c&63);break;case 14:c=t.charCodeAt(r++),p=t.charCodeAt(r++),n+=String.fromCharCode((s&15)<<12|(c&63)<<6|(p&63)<<0);break}return n},this.charToHex=function(t){var n,r,o;for(n="",r=0;r<t.length;)o=t.charCodeAt(r++).toString(16),n+="\\0x"+o,n+=r>0&&r%8==0?`\r
|
|
6
|
+
`:", ";return n}}function en(){var a=0,e=new Object;this.add=function(t,n){this.containsKey(t)||a++,e[t]=n},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&a--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var n in e)if(e[n]==t)return!0;return!1},this.getValues=function(){var t=[];for(var n in e)t.push(e[n]);return t},this.getKeys=function(){var t=[];for(var n in e)t.push(n);return t},this.getSize=function(){return a},this.clear=function(){a=0,e=new Object}}function tn(a){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new en,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,n){var r=Object.id(n).toString();this.callbacks_.add(r,n);var o={MsgId:r,Method:e+"|"+a};t&&(o.Param=JSON.stringify(t));var s=JSON.stringify(o);this.connect&&this.ws.send(s)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),n=t.MsgId;if(this.callbacks_.containsKey(n)){var r=this.callbacks_.getValue(n);r(t.Result,t.Response),this.callbacks_.remove(n)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},n){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],n)},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:n},r){this.exec("Arm_VerifyPIN",[parseInt(e),n,t],r)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},n){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],n)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},n){this.exec("Arm_LEDControl",[parseInt(e),t],n)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},n){this.exec("Arm_SwitchProtocol",[parseInt(e),t],n)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:n,AttrBuffer:r},o){this.exec("Arm_CreateFile",[parseInt(e),n,parseInt(t),r],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:n,FileOffset:r,DataInput:o},s){this.exec("Arm_WriteFile",[parseInt(e),n,parseInt(t),parseInt(r),o],s)},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:n},r){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),n],r)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:n,DataLen:r},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),n,n.length,parseInt(r)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:n},r){this.exec("Arm_DeleteFile",[parseInt(e),n,parseInt(t)],r)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:n},r){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),n],r)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:n},r){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),n],r)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},n){this.exec("Arm_WriteShareMemory",[parseInt(e),t],n)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},n){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],n)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:n,TryCount:r,PinFlag:o},s){this.exec("Arm_ChangePIN",[parseInt(e),o,n,t,parseInt(r)],s)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},n){this.exec("Arm_ResetUserPIN",[parseInt(e),t],n)},this.Arm_SetUserID=function({Handle:e,UserID:t},n){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],n)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},n){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],n)},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},n){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},n){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},n){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],n)},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:n,RsaPriFileID:r,RsaPriFileSize:o},s){this.exec("Arm_RsaPri",[parseInt(e),parseInt(r),parseInt(o),t,n],s)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:n,RsaPubInData:r,RsaPubFileSize:o},s){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),n,t,t.length,r],s)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:n},r){this.exec("Arm_EccSign",[parseInt(e),parseInt(n),t],r)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:n,EccSignData:r},o){this.exec("Arm_EccVerify",[parseInt(e),n,n.length,t,r],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:n},r){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(n),t],r)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:n,Sm2SignData:r},o){this.exec("Arm_Sm2Verify",[parseInt(e),n,n.length,t,r],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:n,TdesInData:r},o){this.exec("Arm_TDES",[parseInt(e),parseInt(n),t,r],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:n,Sm4InData:r},o){this.exec("Arm_SM4",[parseInt(e),parseInt(n),t,r],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:n},r){this.exec("Arm_HASH",[parseInt(e),t,n],r)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:n},r){this.exec("Arm_Seed",[parseInt(e),n,t],r)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},n){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],n)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:n,SonCount:r,StartUserID:o,AdminTryCount:s,UserPin:c,UserTryCount:p,UpdateRSAPriKey:v},F){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),n,c,parseInt(p),parseInt(s),v,parseInt(o),parseInt(r)],F)},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},n){this.exec("Arm_InitSon",[parseInt(e),t],n)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},n){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],n)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:n,FileID:r,FileType:o,Offset:s,DataLen:c,DataBuffer:p,UpRSAPubKey:v},F){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,n,o,parseInt(r),parseInt(s),p,v,parseInt(c)],F)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:n,FileID:r,FileType:o,Offset:s,DataLen:c,DataBuffer:p},v){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,n,o,parseInt(r),parseInt(s),p,parseInt(c)],v)},this.Arm_Update=function({Handle:e,UpdateData:t},n){this.exec("Arm_Update",[parseInt(e),t],n)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:n},r){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(n)],r)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:n,Priv:r,IsReset:o,IsDecOnRAM:s},c){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[n,parseInt(t),parseInt(e),parseInt(r),parseInt(s),parseInt(o)],c)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},n){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},n){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},n){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],n)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:n,IsDecOnRAM:r},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(r),parseInt(n)],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:n,InBuffer:r,CallLimit:o},s){this.exec("Arm_Set_EXE_FILE_INFO",[r,parseInt(n),parseInt(e),parseInt(o),t,t.length],s)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const an={HID:0},We={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},pt={USER:0};class jt{constructor(){Se(this,"Base64",new Za);Se(this,"AtlCtrl",null);Se(this,"ArmCount",0);Se(this,"ArmIndex",0);Se(this,"ArmHandle",0);Se(this,"ArmRandom","");try{this.AtlCtrl=new tn("{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((n,r)=>{n?(this.ArmCount=+r,e(r)):t(r)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,n)=>{this.AtlCtrl.Arm_Open({Index:e},(r,o)=>{r?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,n(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_Close({Handle:e},(r,o)=>{r?t(o):n(o)})})}armChangePIN(e,t,n=255,r=pt.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,c)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:n,PinFlag:r},(p,v)=>{p&&v==0?(this.ArmPin=e,s(v)):c(v)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,r)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,s)=>{o?(this.ArmRandom=s,n(s)):r(s)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(r,o)=>{r?(this.ArmDeadline=o,t(o)):n(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,r)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,s)=>{o?(this.ArmUKey=s,n(s)):r(s)})})}armGetDongleInfo(e=0,t=We.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((n,r)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,s)=>{if(o){switch(t){case We.USER_ID:this.ArmUid=s;break;case We.PRODUCT_ID:this.ArmPid=s;break;case We.HARDWARE_ID:this.ArmHid=s;break}n(s)}else r(s)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,r)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,s)=>{o&&s==0?n(s):r(s)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_RFS({Handle:e},(r,o)=>{r&&o==0?t(o):n(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,r)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,s)=>{if(o&&s.length>0)try{s=this.Base64.decode(s),n(s)}catch(c){console.error(c),n(s)}else r(s)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(r,o)=>{r&&o==0?t(o):n(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,r)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,s)=>{o&&s==0?n(s):r(s)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,r)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,s)=>{o&&s==0?n(s):r(s)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,r)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,s)=>{o&&s==0?n(s):r(s)})})}armSwitchProtocol(e=an.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,r)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,s)=>{o&&s==0?n(s):r(s)})})}armVerifyPIN(e,t=pt.USER,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:n,UserPin:e,UserType:t},(s,c)=>{s&&c==0?(this.ArmPin=e,r(c)):o(c)})})}armReadData(e=0,t=128,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,o)=>{this.AtlCtrl.Arm_ReadData({Handle:n,Offset:e,ReadLength:t},(s,c)=>{s?(this.ArmData=c,r(c)):o(c)})})}armWriteData(e,t=0,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,o)=>{this.AtlCtrl.Arm_WriteData({Handle:n,Offset:t,DataInput:e},(s,c)=>{s&&c==0?r(c):o(c)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(r,o)=>{r?(this.ArmData=o,t(o)):n(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,r)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,s)=>{o&&s==0?n(s):r(s)})})}}const Xt="0123456789abcdeffedcba9876543210",Qt="4b0de988570c3a0f",nn=window.ENCRYPT;let Oe=nn&&new jt;function Jt(a=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",n=e.length;for(;a>0;)t+=e[Math.floor(Math.random()*n)],a--;return t}function Zt(){return ne(this,null,function*(){return Oe||(Oe=new jt),new Promise((a,e)=>{Oe.armEnum().then(t=>{a(+t)}).catch(t=>{oe.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Ge.throttle(()=>ne(exports,null,function*(){const a=yield Zt(),e={};if(typeof a!="number"||a<=0)oe.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield on();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(oe.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(oe.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function rn(a=0){return ne(this,null,function*(){return Oe?new Promise((e,t)=>{Oe.armGetDongleInfo(a).then(n=>{n?e(n):(oe.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(n))}).catch(n=>{t(n)})}):oe.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function on(){return ne(this,null,function*(){if(!Oe)return oe.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const a=yield Zt();let e=[];for(let t=0;t<a;t++){const n=yield rn(t);e.push(n)}return e})}Jt(16);Jt(16);const ea=window.meta.app.inspect?Ce.SM4.constants.CBC:Ce.SM4.constants.ECB,{publicKey:tr,privateKey:ar}=Ce.SM2.generateKeyPair();function sn(a,e,t={}){const n=ta(Qt),r=t.mode||ea;t=r===Ce.SM4.constants.ECB?u({mode:r,inputEncoding:"utf8",outputEncoding:"hex"},t):u({iv:Xt,mode:r,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=Ce.SM4.encrypt(a,n,t)}catch(s){console.log("err: ",s)}return o}function ln(a,e,t={}){const n=ta(Qt),r=t.mode||ea;return t=r===Ce.SM4.constants.ECB?u({mode:r,inputEncoding:"hex",outputEncoding:"utf8"},t):u({iv:Xt,mode:r,inputEncoding:"hex",outputEncoding:"utf8"},t),Ce.SM4.decrypt(a,n,t)}function ta(a){return[...a].map(e=>e.charCodeAt().toString(16)).join("")}function rt(a){return a=qt&&it(a)?ln(a):a,it(a)?JSON.parse(a):a}function At(a){return a=qt&&it(a)?sn(a):a,JSON.stringify(a)}function De(a,e,t,n){const r=new StorageEvent("storage",{url:window.location.href,key:a,oldValue:e,newValue:t,storageArea:n});window.dispatchEvent(r)}const ze={getLocal:a=>{try{const e=window.localStorage.getItem(a);return rt(e)}catch(e){console.error(e)}},setLocal:(a,e)=>{try{const t=window.localStorage.getItem(a),n=At(e);window.localStorage.setItem(a,n),De(a,t,n,window.localStorage)}catch(t){console.error(t)}},eachLocal:a=>{if(!a||nt(a)!=="Function")return console.error("传递参数非函数类型!");for(let e=0;e<window.localStorage.length;e++){const t=window.localStorage.key(e);a(ze.getLocal(t),t)}},clearLocal:()=>{window.localStorage.clear(),De(null,null,null,window.localStorage)},removeLocal:a=>{const e=window.localStorage.getItem(a);window.localStorage.removeItem(a),De(a,e,null,window.localStorage)},getSession:a=>{try{const e=window.sessionStorage.getItem(a);return rt(e)}catch(e){console.error(e)}},setSession:(a,e)=>{try{const t=window.sessionStorage.getItem(a),n=At(e);window.sessionStorage.setItem(a,n),De(a,t,n,window.sessionStorage)}catch(t){console.error(t)}},eachSession:a=>{if(!a||nt(a)!=="Function")return console.error("传递参数非函数类型!");for(let e=0;e<window.sessionStorage.length;e++){const t=window.sessionStorage.key(e);a(ze.getSession(t),t)}},clearSession:()=>{window.sessionStorage.clear(),De(null,null,null,window.sessionStorage)},removeSession:a=>{const e=window.sessionStorage.getItem(a);window.sessionStorage.removeItem(a),De(a,e,null,window.sessionStorage)},onStorageChange:a=>{if(!a||nt(a)!=="Function")return console.error("传递参数非函数类型!");const e=n=>{try{return rt(n)}catch(r){return console.error(r),n}},t=n=>{a({url:n.url,key:n.key,newValue:n.newValue?e(n.newValue):null,oldValue:n.oldValue?e(n.oldValue):null,storageArea:n.storageArea})};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}}},gt=a=>{const{quality:e,value:t,function_id:n}=a;return(e>>7&1)===1||e===0&&n===2&&t===1},vt="USER_TOKEN",wt="STATION_ID",cn=[{key:0,value:"离线"},{key:1,value:"在线"}],dn=[{key:0,value:"反向"},{key:1,value:"正向"},{key:2,value:"停止"}],un=[{key:1,value:1},{key:2,value:2},{key:3,value:3},{key:4,value:4},{key:5,value:5}],hn="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1753954524851'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1506'%20width='256'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M888.65792%20280.15616a46.80704%2046.80704%200%200%200-46.80704-46.80704H233.34912a46.80704%2046.80704%200%200%200-46.80704%2046.80704v93.61408h702.11584V280.15616zM186.54208%20420.5824v374.46144a46.80704%2046.80704%200%200%200%2046.80704%2046.80704h608.49664a46.80704%2046.80704%200%200%200%2046.80704-46.80704V420.5824H186.54208z%20m442.9056%2084.98688l30.92992%2011.47904c-15.62624%2024.23808-35.39968%2050.38592-50.70848%2067.6096l-25.51296-10.84416c15.31392-17.85856%2034.7648-46.56128%2045.29152-68.24448z%20m-184.64768-1.59744c17.54112%2020.09088%2038.26688%2047.5136%2047.5136%2065.37728l-25.51296%2015.62624c-8.61184-17.85856-28.70272-46.23872-45.92128-67.28704l23.92064-13.71648z%20m199.95136%20267.2384h-45.28128c-32.20992%200-39.86432-8.92928-39.86432-39.86432v-102.36416h-46.23872c-5.73952%2069.8368-21.6832%20121.18528-101.0944%20149.56544-3.5072-7.97184-11.47904-19.456-18.49344-25.51296%2072.07424-22.9632%2083.87072-66.01728%2088.65792-124.05248H399.19616v-28.70272h122.7776V483.88096h30.92992v116.39808h122.46016v28.70272h-85.7856v102.04672c0%2010.5216%201.90976%2012.11904%2013.71136%2012.11904h38.90176c8.92928%200%2010.84416-4.1472%2011.8016-28.38016%206.69696%204.78208%2019.12832%209.56928%2027.42272%2011.47904-3.49696%2035.39968-11.4688%2044.96384-36.66432%2044.96384z'%20fill='%23005CFF'%20p-id='1507'%3e%3c/path%3e%3c/svg%3e",Ie=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}]}]},aa=window.meta.graph.lightPlateColorMap?window.meta.graph.lightPlateColorMap:{0:"#00d200",1:"#e2ac06",2:"#fa800a",3:"#f04155",4:"#ff0000"},na=window.meta.graph.lightPlateTextMap?window.meta.graph.lightPlateTextMap:{0:"#fff",1:"#fff",2:"#fff",3:"#fff",4:"#fff"},X={form:[{name:"带电状态",key:"charged_state",type:"select",dataIds:{},options:cn.map(a=>({label:a.value,value:a.key}))},{name:"潮流方向",key:"electric_direction",type:"select",dataIds:{},options:dn.map(a=>({label:a.value,value:a.key}))},{name:"电荷大小",key:"electric_size",type:"select",dataIds:{},options:un.map(a=>({label:a.value,value:a.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},g=L(u({penType:N.NORMAL},X),{form:[...Ie[N.NORMAL]||[],...X.form]});z.YX,z.YX,z.YX,N.POINT_VALUE,X.anchors,window.visibleLevel,X.form,X.form,window.dataType,window.dataProp,window.visibleLevel,X.form,window.dataType,window.dataProp,window.visibleLevel,X.form,window.dataType,window.dataProp,window.visibleLevel,na[0],N.LIGHT_PLATE,aa[0],X.anchors,window.visibleLevel,[...Ie[N.LIGHT_PLATE],...X.form],Ye+"",N.SENSOR,X.anchors,window.visibleLevel,[...Ie[N.LIGHT_PLATE],...X.form],L(u({width:100,height:30,name:"text",penName:"文本",text:"文本",ellipsis:!1,disableAnchor:!0,penType:N.TEXT},X),{form:[...Ie[N.TEXT],...X.form]}),u({width:100,height:100,name:"square",penName:"正方形"},g),L(u({type:1,name:"line",width:100,height:5,lineWidth:2,lineName:"line",penName:"line",background:"#FFF000",color:"#FFF000"},g),{lineAnimateType:1,anchors:[{x:0,y:.5,id:"0"},{x:1,y:.5,id:"1"}]}),u({width:200,height:50,borderRadius:0,name:"rectangle",penName:"矩形"},g),u({width:100,height:100,name:"circle",penName:"圆"},g),u({width:100,height:100,name:"triangle",penName:"三角形"},g),u({width:100,height:100,name:"diamond",penName:"菱形"},g),u({width:100,height:100,name:"pentagon",penName:"五边形"},g),u({width:100,height:100,name:"hexagon",penName:"六边形"},g),u({width:100,height:100,name:"pentagram",penName:"五角星"},g),u({width:120,height:60,name:"leftArrow",penName:"左箭头"},g),u({width:120,height:60,penName:"右箭头",name:"rightArrow"},g),u({width:150,height:60,name:"twowayArrow",penName:"双向箭头"},g),u({width:100,height:100,name:"cloud",penName:"云"},g),u({textTop:-.1,width:100,height:100,name:"message",penName:"消息框"},g),u({width:80,height:100,name:"file",penName:"文件"},g),L(u({width:60,height:100,name:"cube",penName:"立方体",z:.25},g),{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"}]}}),u({width:70,height:100,name:"people",penName:"人"},g),L(u({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"},g),{penType:N.BUTTON}),L(u({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},g),{penType:N.INPUT}),L(u({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"}]},g),{penType:N.SELECT}),L(u({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:"%"},g),{penType:N.SLIDER}),L(u({name:"time",penName:"时间",width:300,height:40,text:`${ua().format("YYYY-MM-DD HH:mm:ss")}`,lineWidth:0,fontSize:20,interval:67,fillZero:!0},g),{penType:N.TIME,form:[{key:"timeFormat",name:"显示格式",type:"text"},{key:"fillZero",name:"是否补0",type:"switch"},...g.form],timeFormat:"`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"}),L(u({name:"switch",penName:"开关",height:30,width:60,checked:!1,offColor:"#BFBFBF",onColor:"#1890ff",disableOffColor:"#E5E5E5",disableOnColor:"#A3D3FF",locked:0},g),{penType:N.SWITCH}),L(u({name:"radio",penName:"单选框",direction:"horizontal",width:150,height:30,checked:"",options:[{text:"选项一"},{text:"选项二"},{text:"选项三",isForbidden:!0}]},g),{penType:N.RADIO}),L(u({name:"checkbox",penName:"多选框",width:30,height:30,checked:!0,value:"选项一"},g),{penType:N.CHECKBOX}),L(u({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"},g),{penType:N.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"}]}),L(u({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"},g),{penType:N.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"}]}),L(u({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"},g),{penType:N.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"}]}),L(u({name:"svg",width:100,height:100,image:Ye+"/icon/audio.svg",audioId:"",penName:"音频",datable:!0,penType:N.AUDIO},X),{form:[...Ie[N.AUDIO],...X.form],events:[{name:"enter",action:Ve.Emit,value:re.OPEN_AUDIO,where:{type:""},params:JSON.stringify({action:re.OPEN_AUDIO,data:""})},{name:"leave",action:Ve.Emit,value:re.CLOSE_AUDIO,where:{type:""},params:JSON.stringify({action:re.CLOSE_AUDIO,data:""})}]}),L(u({name:"svg",width:100,height:100,image:Ye+"/icon/camera.svg",cameraId:"",penName:"摄像机",datable:!0,events:[{name:"enter",action:Ve.Emit,value:re.OPEN_CAMERA,where:{type:""},params:JSON.stringify({action:re.OPEN_CAMERA,data:""})},{name:"leave",action:Ve.Emit,value:re.CLOSE_CAMERA,where:{type:""},params:JSON.stringify({action:re.CLOSE_CAMERA,data:""})}],penType:N.CAMERA},X),{form:[...Ie[N.CAMERA],...X.form]}),L(u({name:"video",width:100,height:100,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penName:"MP4",penType:N.MP4},X),{form:[...Ie[N.MP4],...X.form]}),L(u({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:N.VIDEO_STREAM},X),{form:[...Ie[N.VIDEO_STREAM],...X.form]}),u({text:"开始/结束",width:120,height:40,borderRadius:.5,name:"rectangle",penName:"开始/结束"},g),u({text:"流程",width:120,height:40,name:"rectangle",penName:"流程"},g),u({text:"判定",width:120,height:60,name:"diamond",penName:"判定"},g),u({text:"数据",width:120,height:50,name:"flowData",penName:"数据",offsetX:.14},g),u({text:"准备",width:120,height:50,name:"hexagon",penName:"准备"},g),u({text:"子流程",width:120,height:50,name:"flowSubprocess",penName:"子流程"},g),u({text:"数据库",width:80,height:120,name:"flowDb",penName:"数据库"},g),u({text:"文档",width:120,height:100,name:"flowDocument",penName:"文档"},g),u({text:"内部存储",width:120,height:80,name:"flowInternalStorage",penName:"内部存储"},g),u({text:"外部存储",width:120,height:80,name:"flowExternStorage",penName:"外部存储"},g),u({text:"队列",width:100,height:100,name:"flowQueue",penName:"队列"},g),u({text:"手动输入",width:120,height:80,name:"flowManually",penName:"手动输入"},g),u({text:"展示",width:120,height:80,name:"flowDisplay",penName:"展示"},g),u({text:"并行模式",width:120,height:50,name:"flowParallel",penName:"并行模式"},g),u({text:"注释",width:100,height:100,name:"flowComment",penName:"注释"},g),u({text:"",width:30,height:30,name:"circle",penName:"开始",background:"#555",lineWidth:0},g),u({width:30,height:30,name:"activityFinal",penName:"结束"},g),u({text:"活动",width:120,height:50,borderRadius:.25,name:"rectangle",penName:"活动"},g),u({text:"决策/合并",width:120,height:50,name:"diamond",penName:"决策/合并"},g),u({text:"垂直泳道",width:200,height:500,name:"swimlaneV",penName:"垂直泳道",textBaseline:"top",textTop:20,lineTop:.08},g),u({text:"水平泳道",width:500,height:200,name:"swimlaneH",penName:"水平泳道",textWidth:.01,textLeft:.04,textAlign:"left",lineLeft:.08},g),u({text:"垂直分岔/汇合",width:10,height:150,name:"forkV",penName:"垂直分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},g),u({text:"水平分岔/汇合",width:150,height:10,name:"forkH",penName:"水平分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},g),u({name:"andGate",penName:"与门",width:100,height:150},g),u({name:"basicEvent",penName:"基本事件",width:100,height:150},g),u({name:"unexpandedEvent",penName:"未展开事件",width:100,height:150},g),u({name:"priorityAndGate",penName:"优先AND门",width:100,height:150},g),u({name:"forbiddenGate",penName:"禁止门",width:100,height:150},g),u({name:"event",penName:"事件",width:100,height:150},g),u({name:"switchEvent",penName:"开关事件",width:100,height:150},g),u({name:"conditionalEvent",penName:"条件事件",width:150,height:100},g),u({name:"transferSymbol",penName:"转移符号",width:100,height:150},g),u({name:"orGate",penName:"或门",width:100,height:150},g),u({name:"xorGate",penName:"异或门",width:100,height:150},g),u({name:"votingGate",penName:"表决门",width:100,height:150},g);const mn=(a,e={isDev:!1,devServerUrl:"",devServerPort:8443})=>(a=a.replace(/(https?:\/\/)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(:(\d+))?/,`$1${e.isDev?e.devServerUrl:Sa}:${e.isDev?e.devServerPort:ba}`),e.isDev?a:a.replace("/baseUrl","")),Xe=(a,e)=>{const t=a.__vccOpts||a;for(const[n,r]of e)t[n]=r;return t},fn={class:"props-panel__title"},pn={class:"props-panel__value"},An={class:"value-left"},gn={class:"props-panel__value-num"},vn={class:"value-right"},wn=Object.assign({name:"PropsPanle"},{__name:"PropsPanle",props:{data:{type:Object,default:null}},emits:["close","enter","view-history"],setup(a,{emit:e}){const t=a,n=e;function r(p){return p==null||p==="—"?"—":typeof p=="number"?p.toFixed(2):p}const o=()=>{n("close")},s=()=>{n("enter")},c=()=>{n("view-history",t.data)};return(p,v)=>{var F,H;return d.openBlock(),d.createElementBlock("div",{class:"props-panel",onMouseleave:o,onMouseover:s},[d.createElementVNode("div",fn,d.toDisplayString(((F=t==null?void 0:t.data)==null?void 0:F.name)||"—"),1),v[2]||(v[2]=d.createElementVNode("div",{class:"props-panel__label"},"脉冲峰值",-1)),d.createElementVNode("div",pn,[d.createElementVNode("div",An,[d.createElementVNode("span",gn,d.toDisplayString(r((H=t==null?void 0:t.data)==null?void 0:H.value)),1),v[0]||(v[0]=d.createElementVNode("span",{class:"props-panel__unit"},"dBm",-1))]),d.createElementVNode("div",vn,[d.createVNode(d.unref(oe.ElButton),{type:"primary",onClick:c},{default:d.withCtx(()=>[...v[1]||(v[1]=[d.createTextVNode("查看历史",-1)])]),_:1})])])],32)}}}),yn=Xe(wn,[["__scopeId","data-v-937ebfaa"]]);class _n{constructor(e){Se(this,"editor");this.editor=e}initPlugin(e,t,n={}){e.installPenPlugins({name:t},[{plugin:ha.mindBoxPlugin,options:n},{plugin:ma.collapseChildPlugin,options:n}])}}function En(a,e){var q,ee;const t=e||new Path2D,{x:n,y:r,width:o,height:s}=a.calculative.worldRect,c=n+o/2,p=r+s/2,v=o/2,F=(q=a.startAngle)!=null?q:0,H=(ee=a.endAngle)!=null?ee:2*Math.PI;if(t.arc(c,p,v,F,H,a.anticlockwise),t instanceof Path2D)return t}function Tn(a,e){const t=e||new Path2D,{x:n,y:r,width:o,height:s}=a.calculative.worldRect;if(t.rect(n,r,o,s),t instanceof Path2D)return t}function Sn(a,e){const t=a||new Path2D,n=e.dimensionData;if(!n)return t;const r=e.calculative.worldRect,o=V=>({x:r.x+V.x*r.width,y:r.y+V.y*r.height}),s=o(n.tp1),c=o(n.tp2),p=o(n.dimStart),v=o(n.dimEnd),F=e.calculative.fontSize||12;a&&a.beginPath&&(a.save(),a.beginPath(),a.strokeStyle=e.color||"#000",a.lineWidth=e.calculative.lineWidth||1);const H=Math.max(5,F*.4),q=p.x-s.x,ee=p.y-s.y,Y=Math.hypot(q,ee)||1,ae=p.x+q/Y*H,O=p.y+ee/Y*H,$=v.x-c.x,me=v.y-c.y,ye=Math.hypot($,me)||1,xe=v.x+$/ye*H,ie=v.y+me/ye*H;t.moveTo(s.x,s.y),t.lineTo(ae,O),t.moveTo(c.x,c.y),t.lineTo(xe,ie),t.moveTo(p.x,p.y),t.lineTo(v.x,v.y);const Pe=Math.hypot(v.x-p.x,v.y-p.y),Z=Math.min(10,Pe/2.1),fe=(V,te)=>{if(Z<1)return;const ce=Math.atan2(te.y-V.y,te.x-V.x),pe=Math.PI/6,_e=te.x-Z*Math.cos(ce-pe),de=te.y-Z*Math.sin(ce-pe),se=te.x-Z*Math.cos(ce+pe),ue=te.y-Z*Math.sin(ce+pe);t.moveTo(te.x,te.y),t.lineTo(_e,de),t.lineTo(se,ue),t.closePath()};if(fe(v,p),fe(p,v),a&&a.stroke&&(a.stroke(),a.restore()),a&&a.fillText&&n.text){a.save(),a.fillStyle=e.textColor||e.color||"#000",a.textAlign="center",a.textBaseline="bottom";let V=F;a.font=`${e.fontStyle||""} ${e.fontWeight||""} ${V}px ${e.fontFamily||"Arial"}`;const te=a.measureText(n.text),ce=Pe*.9;if(te.width>ce&&ce>0){const se=ce/te.width;V=V*se,a.font=`${e.fontStyle||""} ${e.fontWeight||""} ${V}px ${e.fontFamily||"Arial"}`}const pe=(p.x+v.x)/2,_e=(p.y+v.y)/2;let de=Math.atan2(v.y-p.y,v.x-p.x);(de>Math.PI/2||de<-Math.PI/2)&&(de+=Math.PI),a.translate(pe,_e),a.rotate(de),a.fillText(n.text,0,-V*.2),a.restore()}if(t instanceof Path2D)return t}function In(a,e){const t=e||new Path2D,{x:n,y:r,width:o,height:s}=a.calculative.worldRect;if((a.anchors&&a.anchors.length>=3?a.anchors.slice(0,3):[{x:0,y:1},{x:1,y:1},{x:.5,y:0}]).forEach((p,v)=>{const F=n+p.x*o,H=r+p.y*s;v===0?t.moveTo(F,H):t.lineTo(F,H)}),t.closePath(),t instanceof Path2D)return t}function bn(a,e){var ee,Y;const t=e||new Path2D,{x:n,y:r,width:o,height:s}=a.calculative.worldRect,c=n+o/2,p=r+s/2,v=o/2,F=s/2,H=(ee=a.startAngle)!=null?ee:0,q=(Y=a.endAngle)!=null?Y:2*Math.PI;if(t.ellipse(c,p,v,F,0,H,q,a.anticlockwise),t instanceof Path2D)return t}function Cn(){return ne(this,null,function*(){yield meta2d.register({arc:En,mtext:Tn,arrow:In,ellipse:bn}),yield meta2d.registerCanvasDraw({dimension:Sn})})}const ra="meta2d-pen-size:",xn=d.ref(0),Pn=["uhf:"],Nn=a=>Pn.some(e=>a==null?void 0:a.startsWith(e)),yt=a=>Math.round(a*100)/100;function kn(a,e){var n,r;if(!a)return null;if(typeof a.getPenRect=="function")return a.getPenRect(e);const t=((r=(n=a.store)==null?void 0:n.data)==null?void 0:r.scale)||1;return{x:(e.x||0)/t,y:(e.y||0)/t,width:(e.width||0)/t,height:(e.height||0)/t}}function Rn(a){var r,o,s;const e=(s=(o=(r=a==null?void 0:a.calculative)==null?void 0:r.canvas)==null?void 0:o.store)==null?void 0:s.pens,t=[],n=c=>{(c.children||[]).forEach(p=>{const v=e==null?void 0:e[p];v&&(t.push(v),n(v))})};return n(a),t}function Dn(a){const e=Rn(a);if(e.length)return e.map(t=>typeof t.fontSize=="number"?t.fontSize:null)}function Mn(a){if(!a)return null;try{const e=localStorage.getItem(ra+a);return e?JSON.parse(e):null}catch(e){return null}}function Ln(a,e){if(!(!a||!e))try{localStorage.setItem(ra+a,JSON.stringify(e)),xn.value+=1}catch(t){}}function On(a,e){if(!a||!(e!=null&&e.length))return;const t=new Map;e.forEach(n=>{if(!n||n.parentId||!n.libraryKey)return;const r=kn(a,n);if(!r||!(r.width>0)||!(r.height>0))return;const o=t.get(n.libraryKey)||[];o.push({pen:n,rect:r}),t.set(n.libraryKey,o)}),t.forEach((n,r)=>{var H;let o,s;if(n.length===1||Nn(r))({width:o,height:s}=n[0].rect);else{const q=n.map($=>$.rect),ee=Math.min(...q.map($=>$.x)),Y=Math.min(...q.map($=>$.y)),ae=Math.max(...q.map($=>$.x+$.width)),O=Math.max(...q.map($=>$.y+$.height));o=ae-ee,s=O-Y}if(!(o>0)||!(s>0))return;const c=Mn(r)||{},p=L(u({},c),{width:yt(o),height:yt(s)}),v=Dn(n[0].pen);v&&(p.childFontSizes=v);const F=n[0].pen;(H=F.children)!=null&&H.length&&typeof F.fontSize=="number"&&(p.rootFontSize=F.fontSize),Ln(r,p)})}const Fn="original_meta2d";function Un(){return localStorage.removeItem(Fn)}let Ue={};const Gn=a=>{const e=document.querySelectorAll("video");let t=null;if(e.forEach(r=>{r.getAttribute("src")===a.video&&(t=r)}),!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 n=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 a.autoPlay&&a.streamUrl&&n.play(a.streamUrl),Ue[a.id]=n,n},Hn=()=>{Object.keys(Ue).forEach(a=>{Ue[a].destroy(),Ue[a]=null}),Ue={}},Vn={class:"sy-empty"},Bn={key:1,class:"sy-empty-picture"},Kn={class:"sy-empty-description"},Wn=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(a){d.useCssVars(r=>({v7ddea5d8:n.value.width,v4735fb99:n.value.height}));const e=a,t=d.computed(()=>({"font-size":e.imageSize?`${e.imageSize}px`:"80px"})),n=d.computed(()=>e.imageSize?{width:e.imageSize*1.2+"px",height:e.imageSize+"px"}:{width:"187px",height:"144px"});return(r,o)=>{const s=d.resolveComponent("SyIcon"),c=d.resolveComponent("el-icon");return d.openBlock(),d.createElementBlock("div",Vn,[a.image!=="empty"?(d.openBlock(),d.createElementBlock("span",{key:0,class:"sy-empty-image",style:d.normalizeStyle(t.value)},[a.image!=="loading"?(d.openBlock(),d.createBlock(s,{key:0,name:a.image,gradient:""},null,8,["name"])):(d.openBlock(),d.createBlock(c,{key:1,class:"is-loading",style:{color:"#1671d4"}},{default:d.withCtx(()=>[d.createVNode(d.unref(ga.Loading))]),_:1}))],4)):a.onlyText?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",Bn)),d.createElementVNode("div",Kn,[d.createElementVNode("p",null,d.toDisplayString(a.description),1)])])}}}),Yn=Xe(Wn,[["__scopeId","data-v-97343c87"]]),$n={key:1,class:"move-step-panel"},_t=30,zn=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(a,{expose:e,emit:t}){const n=t,r=a,o=d.inject("isComponent"),s=d.ref(null),c=d.shallowRef(),p=d.ref(1),v=d.ref(!1);let F=0,H=null,q=null;const ee=d.computed(()=>!!(r.data||r.url));d.watch(()=>[r.data,r.url],()=>{ee.value&&ae()});let Y=d.ref(!0);function ae(){return ne(this,null,function*(){var m;const l=++F;try{if(Y.value=!0,yield d.nextTick(),l!==F)return;if(!s.value){console.error("未找到meta2d元素!");return}let w=null;if(r.data?w=r.data:r.url&&(w=yield Ne()),l!==F)return;if(!w||!w.data){Y.value=!1,console.log("图纸数据为空"),n("load-error");return}const _=w.options||{background:"#eee",disableAnchor:(o==null?void 0:o.value)||!1};if(O(),!s.value){console.error("Meta2D 容器元素不可用");return}if(c.value=new D.Meta2d(s.value,L(u({},_),{disableAnchor:(o==null?void 0:o.value)||!1,rotateCursor:"/rotate.cur",measureTextWidth:!1,interval:Math.max((m=_.interval)!=null?m:30,40),autoFPS:!0})),_.visibleLevel&&c.value.scale(_.visibleLevel),$(),me(),yield ye(w.data),l!==F)return;c.value.render(),ce(),clearTimeout(H),H=setTimeout(()=>{H=null,window.meta2dTools&&window.registerToolsNew&&window.registerToolsNew()},1e3),n("loaded",c.value)}catch(w){console.error("初始化编辑器失败:",w)}})}const O=()=>{var w,_;if(!c.value)return;const l=c.value,m=l.canvas;Hn(),(w=Z.cancel)==null||w.call(Z),(_=ve.cancel)==null||_.call(ve),clearTimeout(H),H=null,clearTimeout(q),q=null,m&&(se&&m.getHover!==se&&(m.getHover=se),ue&&m.drawline!==ue&&(m.drawline=ue),ie&&m.pushHistory!==ie&&(m.pushHistory=ie),m.__keydownGuarded&&V&&(document.removeEventListener("keydown",m.onkeydown),m.onkeydown=V,m.__keydownGuarded=!1,V=null),m.__hoverOverridden=!1,m.__historyLimited=!1,l.destroy(!0)),window.meta2d===l&&(window.meta2d=null),c.value=null};function $(){if(!c.value)return;new _n({}).initPlugin(c.value,"mindNode",{})}function me(){Cn(),D.register(pa.classPens()),D.register(lt.flowPens()),D.registerAnchors(lt.flowAnchors()),D.register(ct.sequencePens()),D.registerCanvasDraw(ct.sequencePensbyCtx()),D.register(dt.activityDiagram()),D.registerCanvasDraw(dt.activityDiagramByCtx()),D.registerCanvasDraw(fa.formPens()),D.registerCanvasDraw(Aa.chartsPens()),D.register(Je.ftaPens()),D.registerAnchors(Je.ftaAnchors()),D.registerCanvasDraw(Je.ftaPensbyCtx())}function ye(l){var m,w,_;if(c.value){if(typeof l.locked=="undefined"&&(l.locked=0),l.bkImage&&c.value.setBackgroundImage(l.bkImage),l.pens&&l.pens.length>0){const S=[],M=[];l.pens.forEach(R=>{R.name==="video"&&R.streamUrl?S.push(R):R.name==="image"&&R.image?R.image=mn(R.image,r.devConfig):R.lineType==="gisLine"?R.visible=!r.preview:R.penType===N.TABLE&&R.dataType?M.push(xe(R)):R.penType===N.GIS_SENSOR_WRAPPER&&r.preview&&(R.title="")}),M.length>0&&Promise.allSettled(M),S.length>0&&(clearTimeout(q),q=setTimeout(()=>{q=null,S.forEach(R=>{Gn(R)})},500));const j=((w=(m=window.meta)==null?void 0:m.graph)==null?void 0:w.penCountThreshold)||2e3;l.pens.length>j&&l.scale&&l.pens.forEach(R=>{const U=R.visibleLevel;U!==void 0?(R.visible=l.scale>=U,R.visible||(R.disabled=!0,R.locked=D.LockState.Disable)):(R.visible=!0,R.disabled=!1,R.locked=D.LockState.None)})}c.value.open(L(u({},l),{disableAnchor:(o==null?void 0:o.value)||!1})),!r.preview&&((_=l.networks)!=null&&_.length)&&c.value.closeNetwork()}}const xe=l=>ne(this,null,function*(){var w;const m=yield Le.getCommonApi(_a[l.dataType],{offset:0,limit:l.tableSize||10});if((w=m.data)!=null&&w.length){const _=l.tableHeader||[{prop:"id",label:"ID"},{prop:"guid",label:"标识"},{prop:"name",label:"名称"}],S=m.data.map(M=>_.filter(j=>j.isShow).map(j=>{const B=M[j.prop];return j.choices?j.choices[B]||B:Ge.isObject(B)?B.name:B}));c.value.setValue({id:l.id,dataY:S})}else c.value.setValue({id:l.id,dataY:[]})});let ie=null;const Pe=()=>{var w;const l=(w=c.value)==null?void 0:w.canvas;if(!l||l.__historyLimited)return;l.__historyLimited=!0;const m=l.pushHistory.bind(l);ie=m,l.pushHistory=_=>{m(_);const S=l.store;if(S!=null&&S.histories&&S.histories.length>_t){const M=S.histories.length-_t;S.histories.splice(0,M),typeof S.historyIndex=="number"&&(S.historyIndex=Math.max(0,S.historyIndex-M))}}},Z=Ge.debounce(l=>{On(c.value,l)},300),fe=l=>{if(!l||typeof l.closest!="function")return!1;const{tagName:m}=l;return m==="INPUT"||m==="TEXTAREA"||m==="SELECT"||l.isContentEditable?!0:!!l.closest('.el-input, .el-input-number, .el-textarea, .el-select, .el-slider, .el-color-picker, .el-date-editor, [contenteditable="true"]')};let V=null;const te=()=>{var w;const l=(w=c.value)==null?void 0:w.canvas;if(!l||l.__keydownGuarded||typeof l.onkeydown!="function")return;l.__keydownGuarded=!0,V=l.onkeydown;const m=V;l.onkeydown=_=>{fe(_.target)||m(_)},document.removeEventListener("keydown",m),document.addEventListener("keydown",l.onkeydown)},ce=()=>{var l,m;c.value&&((m=(l=c.value.canvas)==null?void 0:l.tooltip)!=null&&m.box&&(c.value.canvas.tooltip.box.style.pointerEvents="none"),c.value.on("scale",ve),r.preview||(c.value.on("connectLine",Ee),c.value.on("active",pe),c.value.on("inactive",_e),c.value.on("resizePens",Z),document.addEventListener("keydown",de,!0)),te(),be(),Pe())},pe=l=>{v.value=(l==null?void 0:l.length)>0},_e=()=>{v.value=!1},de=l=>{var M,j,B,R,U;if(p.value<=0||!c.value||((j=(M=c.value.canvas)==null?void 0:M.inputDiv)==null?void 0:j.contentEditable)==="true"||fe(l.target)||((R=(B=c.value.store)==null?void 0:B.data)==null?void 0:R.locked)>=D.LockState.DisableEdit)return;const m=(U=c.value.store)==null?void 0:U.active;if(!(m!=null&&m.length))return;const w=p.value*(c.value.store.data.scale||1);let _=0,S=0;switch(l.key){case"ArrowLeft":_=-w;break;case"ArrowRight":_=w;break;case"ArrowUp":S=-w;break;case"ArrowDown":S=w;break;default:return}l.preventDefault(),l.stopPropagation(),c.value.translatePens(m,_,S)};let se=null,ue=null;const be=()=>{const l=c.value.canvas;!l||l.__hoverOverridden||(l.__hoverOverridden=!0,se=l.getHover.bind(l),l.getHover=m=>{var S;if(se(m),(l.drawingLineName||l.pencil)&&!l.drawingLine&&(l.hoverType===D.HoverType.Node||l.hoverType===D.HoverType.Line||l.hoverType===D.HoverType.NodeAnchor)){l.store.hover&&(l.store.hover.calculative.hover=!1,D.setHover(D.getParent(l.store.hover,!0)||l.store.hover,!1),l.store.hover=void 0),l.store.hoverAnchor=void 0,l.hoverType=D.HoverType.None,l.externalElements.style.cursor="crosshair";return}if(l.hoverType!==D.HoverType.Node&&l.hoverType!==D.HoverType.Line||!l.store.hover)return;const w=ge(m,l.store.data.pens,l.store.data.scale||1);if(!w||w.id===l.store.hover.id)return;const _=l.store.hover;_.calculative.hover=!1,D.setHover(D.getParent(_,!0)||_,!1),l.store.hover=w,w.calculative.hover=!0,D.setHover(D.getParent(w,!0)||w),l.store.lastHover=w,l.patchFlags=!0,(S=l.initTemplateCanvas)==null||S.call(l,[w])},ue=l.drawline.bind(l),l.drawline=m=>{if(l.drawingLine&&!l.dock&&(l.drawingLineName==="polyline"||l.drawingLineName==="line")){const w=l.drawingLine.calculative.worldAnchors;if(w.length>=2){const _=w[w.length-1],S=w[w.length-2];if(_&&S&&!_.connectTo){const M=8/(l.store.data.scale||1),j=Math.abs(_.x-S.x),B=Math.abs(_.y-S.y);j<M&&B>=M?_.x=S.x:B<M&&j>=M&&(_.y=S.y)}}}ue(m)})},le=(l,m,w)=>{const _=w.x-m.x,S=w.y-m.y;if(_===0&&S===0)return Math.hypot(l.x-m.x,l.y-m.y);const M=Math.max(0,Math.min(1,((l.x-m.x)*_+(l.y-m.y)*S)/(_*_+S*S)));return Math.hypot(l.x-(m.x+M*_),l.y-(m.y+M*S))},ge=(l,m,w)=>{var B,R,U,Te;let _=null,S=1/0,M=1/0;const j=5/w;for(let Q=0;Q<m.length;Q++){const J=m[Q];if(!(J.visible===!1||J.calculative.inView===!1)&&J.locked!==D.LockState.Disable&&!J.parentId)if(J.type===D.PenType.Line){const G=J.calculative.worldAnchors;if(!G||G.length<2)continue;let Ae=1/0;for(let we=0;we<G.length-1;we++){const i=le(l,G[we],G[we+1]);i<Ae&&(Ae=i)}if(Ae>j)continue;(0<S||S===0&&Ae<M)&&(_=J,S=0,M=Ae)}else{if(J.type)continue;const G=J.calculative.worldRect;if(!G||!D.pointInRect(l,G))continue;const Ae=G.width*G.height,we=l.x-((R=(B=G.center)==null?void 0:B.x)!=null?R:G.x+G.width/2),i=l.y-((Te=(U=G.center)==null?void 0:U.y)!=null?Te:G.y+G.height/2),h=we*we+i*i;(Ae<S||Ae===S&&h<M)&&(_=J,S=Ae,M=h)}}return _},ve=Ge.debounce(l=>{var m,w,_,S,M,j;try{if(!c.value)return;ot.emit("graph-scale",l);let B=c.value.store.data.pens;const R=((w=(m=window.meta)==null?void 0:m.graph)==null?void 0:w.penCountThreshold)||2e3,U=B.length>R;for(let Te=0;Te<B.length;Te++){const Q=B[Te];if([N.VIDEO_STREAM,N.MP4].includes(Q.penType)){if(((S=(_=Re.videos[Q.id])==null?void 0:_.children)==null?void 0:S.length)===3){let J=Re.videos[Q.id].children[0],G=Re.videos[Q.id].children[2];J.style.width=(G.duration>0?G.currentTime/G.duration:0)*Q.calculative.worldRect.width+"px"}else if(((j=(M=Re.videos[Q.id])==null?void 0:M.children)==null?void 0:j.length)===2){let J=Re.videos[Q.id].children[0],G=Re.videos[Q.id].children[1];J.style.width=(G.duration>0?G.currentTime/G.duration:0)*Q.calculative.worldRect.width+"px"}}if(U){const J=Q.visibleLevel!==void 0?l>=Q.visibleLevel:!0;c.value._setValue({id:Q.id,visible:J,disabled:!J,locked:J?D.LockState.None:D.LockState.Disable})}}c.value.render()}catch(B){console.error("处理缩放失败:",B)}},500),Ee=_=>ne(this,[_],function*({line:l,lineAnchor:m,pen:w}){console.log("🚀 ~ handleConnectLine ~ line:",l),m!=null&&m.start||(w==null||w.penType,N.GIS_SENSOR)});function Ne(){return ne(this,null,function*(){if(!r.url)return oe.ElMessage.error("图纸路径为空!"),null;try{return(yield Le.getGraphApi(r.url,{local:r.local}))||null}catch(l){return null}})}const ke=()=>{c.value&&(c.value.resize(),c.value.fitView(!0,10))};return d.onMounted(()=>{var l,m;ee.value&&(l=s.value)!=null&&l.clientHeight&&(m=s.value)!=null&&m.clientWidth&&ae(),window.addEventListener("resize",ke)}),d.onUnmounted(()=>{r.preview&&__$t__.clearLineCross(),c.value&&(c.value.off("scale",ve),c.value.off("connectLine",Ee),c.value.off("active",pe),c.value.off("inactive",_e),c.value.off("resizePens",Z)),O(),Un(),document.removeEventListener("keydown",de,!0),window.removeEventListener("resize",ke),se=null,ue=null,ie=null}),e({stage:c}),(l,m)=>{const w=d.resolveComponent("el-input-number");return d.openBlock(),d.createElementBlock("div",{ref_key:"meta2dRef",ref:s,class:"meta2d-editor"},[d.unref(Y)?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(Yn,{key:0,class:"meta2d-empty",description:"图纸不存在"})),v.value&&!r.preview?(d.openBlock(),d.createElementBlock("div",$n,[m[1]||(m[1]=d.createElementVNode("span",{class:"move-step-label"},"移动步长",-1)),d.createVNode(w,{modelValue:p.value,"onUpdate:modelValue":m[0]||(m[0]=_=>p.value=_),min:.1,max:200,step:.5,precision:1,size:"small","controls-position":"right",class:"move-step-input"},null,8,["modelValue"]),m[2]||(m[2]=d.createElementVNode("span",{class:"move-step-tip"},"方向键按步长移动",-1))])):d.createCommentVNode("",!0)],512)}}}),qn=Xe(zn,[["__scopeId","data-v-7453d72e"]]),jn={key:0,class:"back-btn"};var Bt,Kt;const Xn=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:((Kt=(Bt=window.meta)==null?void 0:Bt.app)==null?void 0:Kt.lang)||"zh-cn"},config:{type:Object,default:()=>({socketUrl:ft,stationIdKey:wt,enableToken:!0,userTokenKey:vt,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,enableWebSocket:!0,graphSocket:ut.GRAPH.SOCKET})},showMap:{type:Boolean,default:!1},isFactory:{type:Boolean,default:!1},isInitData:{type:Boolean,default:!0},apiInstance:{type:Object,default:()=>Le},mittInstance:{type:Object,default:()=>ot},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","view-history"],setup(a,{expose:e,emit:t}){const n=t,r=a;let o=d.ref(!1),s=d.ref(""),c=d.ref(""),p=d.ref(!1);const v=d.ref(!1);d.provide("isComponent",v);const F=d.ref(null),H=d.ref(null),q=d.ref(null),ee=d.ref(""),Y=d.ref(""),ae=d.ref(!1),O=d.computed(()=>{var i;return(i=q.value)==null?void 0:i.stage}),$=d.computed(()=>{var i;return(i=O.value)==null?void 0:i.store}),me=d.computed(()=>u({socketUrl:ft,stationIdKey:wt,enableToken:!0,userTokenKey:vt,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,fitPadding:10,enableWebSocket:!0,graphSocket:ut.GRAPH.SOCKET},r.config)),ye=()=>r.apiInstance||Le,xe=()=>r.mittInstance||ot,ie=(i,h="")=>{const y={error:i,message:h,timestamp:new Date().toISOString()};n("error",y),r.errorHandler.callback?r.errorHandler.callback(y):r.errorHandler.showMessage&&oe.ElMessage&&oe.ElMessage.error(`${h}: ${i.message||i}`)},Pe=()=>{s.value?(Y.value=s.value,ae.value=p.value):c.value&&(ee.value=c.value,M(ee.value)),o.value=!1},Z={},fe=d.ref(!1),V=d.ref({left:0,top:0}),te=d.ref(!1),ce=()=>{te.value=!1,fe.value=!1,V.value={left:0,top:0},be.value={}},pe=()=>{te.value=!0},_e=i=>{n("view-history",i)},de=(i,h)=>{if(!F.value)return{left:i+20,top:h+20};const y=F.value.getBoundingClientRect(),k=i-y.left,x=h-y.top;let C=300,T=150;if(H.value){const P=H.value.$el||H.value;P&&P.offsetWidth&&(C=P.offsetWidth,T=P.offsetHeight)}let f=k+20,I=x+20;return f+C>y.width&&(f=k-C-20),I+T>y.height&&(I=x-T-20),{left:Math.max(0,Math.min(f,y.width-C)),top:Math.max(0,Math.min(I,y.height-T))}},se=i=>{fe.value&&(V.value.left||(V.value=de(i.clientX,i.clientY)))},ue=i=>{var h,y,k,x,C,T;try{if(!i)return;if((h=i==null?void 0:i.includes)!=null&&h.call(i,"token 必传"))return oe.ElMessage.warning(i);const f=typeof i=="string"?JSON.parse(i):i;if((f==null?void 0:f.data)==="服务错误"||(k=(y=f==null?void 0:f.data)==null?void 0:y.includes)!=null&&k.call(y,"token is expired"))return oe.ElMessage.warning(f.data);switch(n("socket-msg",f),f.action){case Ze.ACPOINT.YCVALUE:case Ze.ACPOINT.YXVALUE:if((x=f==null?void 0:f.data)!=null&&x.point_id){const I=O.value.find(f.data.point_id);I&&(Z[f.data.point_id]=f.action===Ze.ACPOINT.YXVALUE?Ke(f.data.value)?f.data.value:0:Ke(f.data.value_disp||f.data.value)?f.data.value_disp||f.data.value:0,G(I,f.data))}break;default:if(((C=f.data)==null?void 0:C.length)>0){const I=setTimeout(()=>{clearTimeout(I),O.value&&(f.data.forEach(P=>{Z[P.dataId||P.point_id]=P.value_disp||P.value}),f.data.forEach(P=>{const b=O.value.find(P.dataId||P.point_id);G(b,P)}))},me.value.messageDelay);r.customCallbacks.onWebSocketMessage&&r.customCallbacks.onWebSocketMessage(f),(T=window.customSocketFn)==null||T.call(window,i)}break}return!0}catch(f){return ie(f,"WebSocket消息处理"),!0}},be=d.ref({});let le={},ge=null,ve=null,Ee=null;const Ne=new Set,ke=new Map,l=i=>ne(this,null,function*(){try{if(i.msgName)switch(i.msgName){case re.CHANGE_GRAPH:case re.NOTIFY_DIALOG:case re.GIS_PROPS_PANEL:m(i);break}else m(i);n("custom-msg",i),r.customCallbacks.onCustomMessage&&r.customCallbacks.onCustomMessage(i)}catch(h){ie(h,"自定义消息处理")}}),m=i=>{var k,x,C,T;let h;if(i.params)try{h=JSON.parse(i.params)}catch(f){h=i.params}switch(i.msgName){case re.CHANGE_GRAPH:(h==null?void 0:h.data)!=="图纸id"&&(h!=null&&h.data)?(s.value=Y.value,p.value=ae.value,o.value=h.isBack,(k=h==null?void 0:h.data)!=null&&k.startsWith("/")?(Y.value=h==null?void 0:h.data,ae.value=!0):(ae.value=!1,c.value=M(h.data))):h?(ae.value=!1,c.value=ee.value,o.value=!0,M(h)):console.warn("切换图纸信息为空");break;case re.NOTIFY_DIALOG:h!=null&&h.msg&&h.msg!=="通知内容"?oe.ElNotification(u({message:h.msg},h)):console.warn("通知内容为空");break;case re.GIS_PROPS_PANEL:i.eventName==="enter"?(fe.value=!0,i.pen.penType===N.GIS_SENSOR?be.value=((x=i==null?void 0:i.pen)==null?void 0:x.bindData)||{}:i.pen.penType===N.GIS_SENSOR_WRAPPER&&((T=(C=i.pen)==null?void 0:C.children)==null||T.forEach(f=>{const I=O.value.findOne(f);I&&I.penType===N.GIS_SENSOR&&(be.value=I.bindData||{})})),i.e&&(V.value=de(i.e.clientX,i.e.clientY))):(clearTimeout(ve),ve=setTimeout(()=>{te.value||(fe.value=!1,V.value={left:0,top:0},be.value={})},200));break}},w=i=>{i!=null&&i.on&&(_(i),Object.values(re).forEach(h=>{const y=k=>{l(L(u({},k),{msgName:h}))};ke.set(h,y),i.on(h,y)}))},_=i=>{i!=null&&i.off&&(ke.forEach((h,y)=>{i.off(y,h)}),ke.clear())},S=i=>{var h,y,k,x,C,T,f,I,P;try{n("loaded",i);const b=at(),A=me.value,E=ze.getSession(A.stationIdKey),K=ze.getSession(A.userTokenKey);A.enableWebSocket&&E&&K&&((k=(y=(h=i.store)==null?void 0:h.data)==null?void 0:y.networks)!=null&&k.length?(T=(C=(x=i.store)==null?void 0:x.data)==null?void 0:C.networks)==null||T.forEach(he=>{var Fe;he.protocol==="websocket"&&((Fe=he.url)!=null&&Fe.includes("station_id")||(he.url=`${he.url}?station_id=${E}`),A.enableToken?he.protocols=A.userToken||K:he.protocols=void 0)}):(I=(f=i.store)==null?void 0:f.data)!=null&&I.websocket?((P=i.store.data.websocket)!=null&&P.includes("station_id")||(i.store.data.websocket=`${i.store.data.websocket}?station_id=${E}`),A.enableToken?i.store.data.websocketProtocols=A.userToken||K:i.store.data.websocketProtocols=void 0,i.closeSocket(),i.connectSocket()):(i.store.data.websocket=`${A.socketUrl}?station_id=${E}`,A.enableToken?i.store.data.websocketProtocols=K:i.store.data.websocketProtocols=void 0,i.connectWebsocket())),(r.showMap||b.showMap==="true")&&i.showMap(),i.setRule({rule:!1}),i.setOptions({disableRuleLine:!0}),i.setGrid({grid:!1}),i.lock(D.LockState.DisableEdit),Q().forEach(he=>{var Fe;(Fe=he==null?void 0:he.events)!=null&&Fe.length?U({id:he.id,locked:1},!1):U({id:he.id,locked:10},!1)}),i.render(),A.enableAutoFit&&i.fitView(!0,A.fitPadding),w(i),i&&(i.socketFn=ue),r.customCallbacks.onStageLoaded&&r.customCallbacks.onStageLoaded(i),r.isInitData&&B(i),window.addEventListener("mousemove",se)}catch(b){ie(b,"图纸加载完成处理")}},M=Ge.throttle(i=>ne(this,null,function*(){var h;try{if(window.isFactory=r.isFactory,r.url){ae.value=r.local,Y.value=r.url;return}const y=at();if(i=i||r.gid||y.id,y.local==="true"&&(ae.value=!0),i){const k=ye();if(k&&k.getCommonApi){const x=yield k.getCommonApi(r.isFactory?"graph":"floorplan",{guid:i});if((h=x.data)!=null&&h.length)yield j(x.data[0].path);else{const C="未找到图纸!";ie(new Error(C),"获取图纸数据")}}else ie(new Error("API实例不可用"),"初始化图纸数据!")}else ae.value=r.local,yield j(r.url);r.customCallbacks.onGraphLoaded&&r.customCallbacks.onGraphLoaded(Y.value)}catch(y){ie(y,"获取图纸数据失败")}})),j=i=>ne(this,null,function*(){if(!i){Y.value="";return}const h=i.split(".");if(i.includes(r.lang)||h.length!==3){Y.value=i;return}const y=`${h[0]}.${r.lang}.${h[2]}`;try{const k=yield Le.getGraphApi(y,{local:r.local}).catch(()=>{console.warn("多语言图纸不存在,使用默认图纸")});Y.value=k?y:i}catch(k){Y.value=i}}),B=i=>ne(this,null,function*(){var h,y,k,x;if(i){let C=[],T=[],f=[];le={};const I=i.store.data.pens;for(let b=0;b<I.length;b++){const A=I[b];A.bindDataId?(h=A.form)!=null&&h.length?A.form.forEach(E=>{if(E.dataIds.dataId)switch(E.dataIds.dataType){case z.YC:C.push(L(u({},E),{nodeName:E.dataIds.name,penId:A.id,penName:A.penName}));break;case z.YX:T.push(L(u({},E),{nodeName:E.dataIds.name,penId:A.id,penName:A.penName}));break;case z.SG:T.push(L(u({},E),{nodeName:E.dataIds.name,penId:A.id,penName:A.penName}));break;case z.POINT:f.push(L(u({},E),{nodeName:E.dataIds.name,penId:A.id,penName:A.penName}));break}}):(A.penType===N.GIS_SENSOR||A.penType===N.GIS_DB_VALUE)&&A.bindData&&(le[A.bindData.ied_id]||(le[A.bindData.ied_id]=[]),U({id:A.id,title:void 0}),le[A.bindData.ied_id].push(u({penId:A.id,penType:A.penType},A.bindData))):(y=A.statusBindData)!=null&&y.length&&A.statusBindData.forEach(E=>{if(E.dataId)switch(E.dataType){case z.YX:T.push({showChild:0,value:0,nodeName:E.dataName,penId:A.id,penName:A.penName,dataId:E.dataId});break;case z.SG:T.push({showChild:0,value:0,nodeName:E.dataName,penId:A.id,penName:A.penName,dataId:E.dataId});break}})}let P=[];if(C.length){const b=ye();if(b&&b.postCommonApi){const A=yield b.postCommonApi("queryrealtimepoint",{point_id:C.map(E=>{var K;return((K=E==null?void 0:E.dataIds)==null?void 0:K.dataId)||E.dataId}).join(",")});(k=A==null?void 0:A.data)!=null&&k.length&&(A.data.forEach(E=>{Z[E.guid]=E.value_disp||E.value}),P=[...P,...A.data])}}if(T.length){const b=ye();if(b&&b.postCommonApi){const A=yield b.postCommonApi("queryrealtimepoint",{point_id:T.map(E=>{var K;return((K=E==null?void 0:E.dataIds)==null?void 0:K.dataId)||E.dataId}).join(",")});(x=A==null?void 0:A.data)!=null&&x.length&&(A.data.forEach(E=>{Z[E.guid]=tt(E.value)?Number(E.value):E.value}),P=[...P,...A.data])}}P.length&&P.forEach(b=>{const A=i.find(b.guid);G(A,L(u({},b),{value:tt(b.value)?Ke(Number(b.value))?Number(b.value):0:b.value,value_disp:b.value_disp,alarm_value:b.alarm_value,point_id:b.guid}))}),le&&Object.keys(le).length?(ge&&clearInterval(ge),R(),ge=setInterval(()=>{R()},3e3)):ge&&clearInterval(ge)}}),R=()=>ne(this,null,function*(){var i;try{if(le){const h=Object.keys(le);if(h.length){const y=yield Le.postPDApi("querychannelstatus/",{data:h.map(k=>({ied_id:k,ln_list:le[k].map(x=>x.ln_id)}))});(i=y==null?void 0:y.data)!=null&&i.length&&(h.forEach(k=>{const x=y.data.find(T=>T.ied_id===k),C=le[k];C!=null&&C.length&&C.forEach(T=>{var I;const f=(I=x==null?void 0:x.result)==null?void 0:I.find(P=>P.ln_id===T.ln_id);if(f){const P=tt(f.amp_peak)?Ke(Number(f.amp_peak))?Number(f.amp_peak):0:f.amp_peak;T.penType===N.GIS_SENSOR?U({id:T.penId,showChild:f.status==="告警"?2:f.status==="正常"?1:0,bindData:L(u({},T),{name:f.name||T.name,status:f.status,value:P})},!1):U({id:T.penId,text:`${P} dBm`},!1)}})}),O.value.render())}}}catch(h){console.warn("局放状态获取失败",h)}}),U=(i,h=!0)=>{if(O.value)return O.value.setValue(i,{render:h})},Te=()=>O.value,Q=()=>{var i,h;return((h=(i=$.value)==null?void 0:i.data)==null?void 0:h.pens)||[]},J=()=>N,G=(()=>{const i=new Map,h=new Map,y=x=>{var T;if(!((T=x.children)!=null&&T.length))return[];const C=x.id||"";if(!C)return[];if(!h.has(C)&&$.value){const f=D.getAllChildren(x,$.value);h.set(C,f)}return h.get(C)||[]},k=()=>{if(i.size===0||!O.value||!$.value)return;const x=[],C=[],T=$.value.animates;i.forEach(({pen:f,dataItem:I,formKey:P})=>{switch(P){case"showChild":U({id:f.id,showChild:+I.value},!1);break;case"text":U({id:f.id,text:I.value_disp||I.value},!1);break;case"light_plate":{const b=I.value===-1||gt(I)?"#999999":na[I.value!==void 0?I.value:I.alarm_value],A=I.value===-1||gt(I)?"#cccccc":aa[I.value!==void 0?I.value:I.alarm_value];U({id:f.id,textColor:b,background:A},!1)}break;case"point_value":f.penType===N.POINT_VALUE&&y(f).forEach(A=>{A.name==="text"&&U({id:A.id,text:I.value},!1)});break;case"online_state":{let b=I.value?void 0:"contrast(0%)";U({id:f.id,filter:b},!1),y(f).forEach(E=>{U({id:E.id,filter:b},!1)})}break;case"charged_state":{const b=I.value===va.OFFLINE?"contrast(0%)":void 0;b!==f.filter&&(U({id:f.id,filter:b},!1),y(f).forEach(E=>{U({id:E.id,filter:b},!1)}))}break;case"electric_direction":I.value===wa.STOP?T!=null&&T.has(f)&&C.push(f):!!I.value!==f.animateReverse&&(U({id:f.id,animateReverse:!!I.value},!1),T!=null&&T.has(f)||x.push(f));break;case"electric_size":{const b=ya[I.value];b!==void 0&&b!==f.lineWidth&&U({id:f.id,lineWidth:b},!1)}break;default:U({id:f.id,[P]:I.value},!1);break}}),C.length>0&&O.value.stopAnimate(C),x.length>0&&O.value.startAnimate(x),i.clear(),O.value.render()};return(x,C)=>{x!=null&&x.length&&(x.forEach(T=>{var I;const f=T.form;if((I=T.statusBindData)!=null&&I.length){if(!Z[C.guid])return;const P=[...T.statusBindData],b=P.findIndex(A=>A.dataId===C.guid);if(b!==-1){const A=P[b];P.find(K=>A.sort<K.sort&&Z[K.dataId])||i.set(T.id,{pen:T,formKey:"showChild",dataItem:L(u({},C),{value:b})})}}else f!=null&&f.length&&f.forEach(P=>{if(!(Array.isArray(P.dataIds)?P.dataIds:[P.dataIds]).some(K=>(K==null?void 0:K.dataId)&&((K==null?void 0:K.dataId)===C.dataId||(K==null?void 0:K.dataId)===C.point_id)))return;const E=`${T.id}-${P.key}`;i.set(E,{pen:T,dataItem:C,formKey:P.key})})}),Ee&&clearTimeout(Ee),Ee=setTimeout(()=>{k(),Ee=null},me.value.debounceDelay))}})(),Ae=i=>{if(O.value){for(let h=0;h<i.length;h++){const y=i[h];Z[y.dataId||y.point_id]=y.value_disp||y.value;const k=O.value.find(y.dataId),x=setTimeout(()=>{Ne.delete(x),G(k,y)},me.value.messageDelay);Ne.add(x)}O.value.render(),r.customCallbacks.onBatchUpdate&&r.customCallbacks.onBatchUpdate(i)}},we=(i,h=!1)=>{if(!O.value)return;const y=Q();for(let k=0;k<y.length;k++){const x=y[k];let C=!1;h?C=i===x.dataProp:C=i===5?!0:x.dataProp<=i,U({id:x.id,visible:C},!1)}O.value.fitView(),O.value.render(),r.customCallbacks.onLevelChange&&r.customCallbacks.onLevelChange(i,h)};return d.watch(()=>[r.gid,r.url,r.data,r.lang,r.local,r.isFactory],()=>{M()}),d.watch(()=>r.showMap,i=>{O.value&&(i?O.value.showMap():O.value.hideMap())}),d.onMounted(()=>{const i=xe();i&&i.on&&i.on(me.value.graphSocket,ue);const h=at();ee.value=r.gid||h.id,M()}),d.onUnmounted(()=>{le=null,ge&&clearInterval(ge),ge=null,clearTimeout(ve),clearTimeout(Ee),Ne.forEach(h=>clearTimeout(h)),Ne.clear(),_(O.value);const i=xe();i&&i.off&&i.off(me.value.graphSocket,ue),window.removeEventListener("mousemove",se)}),e({setValue:U,getStage:Te,getAllPens:Q,getCustomPenType:J,batchUpdatePen:Ae,handleLineCross:__$t__.handleLineCross,changeVisibleByLevel:we}),(i,h)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"previewRef",ref:F,class:"meta2d-preview"},[d.createVNode(qn,{ref_key:"graphRef",ref:q,url:Y.value,local:ae.value,data:r.data,"dev-config":r.devConfig,preview:"",onLoaded:S},null,8,["url","local","data","dev-config"]),d.unref(o)?(d.openBlock(),d.createElementBlock("div",jn,[d.createVNode(d.unref(oe.ElButton),{type:"primary",onClick:Pe},{default:d.withCtx(()=>[...h[0]||(h[0]=[d.createTextVNode("返回",-1)])]),_:1})])):d.createCommentVNode("",!0),fe.value?(d.openBlock(),d.createBlock(yn,{key:1,ref_key:"panelRef",ref:H,data:be.value,style:d.normalizeStyle({top:V.value.top+"px",left:V.value.left+"px",position:"absolute"}),onClose:ce,onEnter:pe,onViewHistory:_e},null,8,["data","style"])):d.createCommentVNode("",!0)],512))}}),He=Xe(Xn,[["__scopeId","data-v-2a591df2"]]);He.name||(He.name="SyGraph");const Qn=a=>{a.component(He.name||"SyGraph",He)},Jn={install:Qn};exports.SyGraph=He;exports.default=Jn;
|