@syhr/sy-graph 1.1.0-rc.3 → 1.1.0-rc.5
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 +459 -437
- package/dist-graph/sy-graph.umd.js +4 -4
- package/package.json +1 -1
package/dist-graph/sy-graph.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";require('./sy-graph.css');var Rt=Object.defineProperty,Pt=Object.defineProperties;var Dt=Object.getOwnPropertyDescriptors;var Be=Object.getOwnPropertySymbols;var Ot=Object.prototype.hasOwnProperty,
|
|
1
|
+
"use strict";require('./sy-graph.css');var Rt=Object.defineProperty,Pt=Object.defineProperties;var Dt=Object.getOwnPropertyDescriptors;var Be=Object.getOwnPropertySymbols;var Ot=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable;var Re=(r,e,t)=>e in r?Rt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e)=>{for(var t in e||(e={}))Ot.call(e,t)&&Re(r,t,e[t]);if(Be)for(var t of Be(e))Lt.call(e,t)&&Re(r,t,e[t]);return r},x=(r,e)=>Pt(r,Dt(e));var ne=(r,e,t)=>Re(r,typeof e!="symbol"?e+"":e,t);var q=(r,e,t)=>new Promise((a,n)=>{var o=E=>{try{p(t.next(E))}catch(C){n(C)}},i=E=>{try{p(t.throw(E))}catch(C){n(C)}},p=E=>E.done?a(E.value):Promise.resolve(E.value).then(o,i);p((t=t.apply(r,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),Mt=require("qs"),Ft=require("axios"),Ut=require("mitt"),Gt=require("dayjs");require("crypto-js");const le=require("gm-crypto"),Ce=require("lodash-es"),H=require("element-plus"),pt=require("@meta2d/utils"),U=require("@meta2d/core"),Bt=require("@meta2d/plugin-mind-core"),Vt=require("@meta2d/plugin-mind-collapse"),Ht=require("@meta2d/form-diagram"),Kt=require("@meta2d/class-diagram"),Wt=require("@meta2d/le5le-charts"),de=require("@meta2d/core/src/diagrams"),Ve=require("@meta2d/flow-diagram"),Pe=require("@meta2d/fta-diagram"),He=require("@meta2d/sequence-diagram"),Ke=require("@meta2d/activity-diagram"),Yt=require("@element-plus/icons-vue"),__$t__={OFFLINE:0},qt={STOP:2},jt={1:1,2:2,3:3,4:4,5:5},O={AREA:1,BAY:2,DEVICE:3,COMPONENT:4,POINT:5,YX:6,YC:7,YK:8,AUX_DEVICE:9,LD:10,LN:11,SG:12,GIS_SENSOR:13},zt={[O.AREA]:"area",[O.BAY]:"bay",[O.DEVICE]:"device",[O.COMPONENT]:"component",[O.POINT]:"patrolpoint",[O.YX]:"yxpoint",[O.YC]:"ycpoint",[O.YK]:"ykpoint",[O.AUX_DEVICE]:"acdevice",[O.LD]:"ld",[O.LN]:"ln",[O.SG]:"sgpoint",[O.GIS_SENSOR]:"gisuhfsensor"},Y={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"},Ee={Emit:7},Ie={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},b={TEXT:"TEXT",NORMAL:"NORMAL",MP4:"MP4",TIME:"TIME",AUDIO:"AUDIO",RADIO:"RADIO",TABLE:"TABLE",INPUT:"INPUT",BUTTON:"BUTTON",CAMERA:"CAMERA",SELECT:"SELECT",SENSOR:"SENSOR",GIS_SENSOR:"GIS_SENSOR",GIS_DB_VALUE:"GIS_DB_VALUE",SLIDER:"SLIDER",SWITCH:"SWITCH",CHECKBOX:"CHECKBOX",POINT_VALUE:"POINT_VALUE",LIGHT_PLATE:"LIGHT_PLATE",VIDEO_STREAM:"VIDEO_STREAM"},We={GRAPH:{SOCKET:"GRAPH_SOCKET"}},De={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 Ne={};/*!
|
|
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 ba(){var r=0,e=new Object;this.add=function(t,a){this.containsKey(t)||r++,e[t]=a},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&r--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var a in e)if(e[a]==t)return!0;return!1},this.getValues=function(){var t=[];for(var a in e)t.push(e[a]);return t},this.getKeys=function(){var t=[];for(var a in e)t.push(a);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function Na(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new ba,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,a){var n=Object.id(a).toString();this.callbacks_.add(n,a);var o={MsgId:n,Method:e+"|"+r};t&&(o.Param=JSON.stringify(t));var i=JSON.stringify(o);this.connect&&this.ws.send(i)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),a=t.MsgId;if(this.callbacks_.containsKey(a)){var n=this.callbacks_.getValue(a);n(t.Result,t.Response),this.callbacks_.remove(a)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},a){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],a)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:a},n){this.exec("Arm_VerifyPIN",[parseInt(e),a,t],n)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},a){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],a)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},a){this.exec("Arm_LEDControl",[parseInt(e),t],a)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},a){this.exec("Arm_SwitchProtocol",[parseInt(e),t],a)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:a,AttrBuffer:n},o){this.exec("Arm_CreateFile",[parseInt(e),a,parseInt(t),n],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:a,FileOffset:n,DataInput:o},i){this.exec("Arm_WriteFile",[parseInt(e),a,parseInt(t),parseInt(n),o],i)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:a},n){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),a],n)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:a,DataLen:n},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),a,a.length,parseInt(n)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:a},n){this.exec("Arm_DeleteFile",[parseInt(e),a,parseInt(t)],n)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:a},n){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),a],n)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:a},n){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),a],n)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},a){this.exec("Arm_WriteShareMemory",[parseInt(e),t],a)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},a){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],a)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:a,TryCount:n,PinFlag:o},i){this.exec("Arm_ChangePIN",[parseInt(e),o,a,t,parseInt(n)],i)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},a){this.exec("Arm_ResetUserPIN",[parseInt(e),t],a)},this.Arm_SetUserID=function({Handle:e,UserID:t},a){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],a)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},a){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],a)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},a){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},a){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},a){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:a,RsaPriFileID:n,RsaPriFileSize:o},i){this.exec("Arm_RsaPri",[parseInt(e),parseInt(n),parseInt(o),t,a],i)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:a,RsaPubInData:n,RsaPubFileSize:o},i){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),a,t,t.length,n],i)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:a},n){this.exec("Arm_EccSign",[parseInt(e),parseInt(a),t],n)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:a,EccSignData:n},o){this.exec("Arm_EccVerify",[parseInt(e),a,a.length,t,n],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:a},n){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(a),t],n)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:a,Sm2SignData:n},o){this.exec("Arm_Sm2Verify",[parseInt(e),a,a.length,t,n],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:a,TdesInData:n},o){this.exec("Arm_TDES",[parseInt(e),parseInt(a),t,n],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:a,Sm4InData:n},o){this.exec("Arm_SM4",[parseInt(e),parseInt(a),t,n],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:a},n){this.exec("Arm_HASH",[parseInt(e),t,a],n)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:a},n){this.exec("Arm_Seed",[parseInt(e),a,t],n)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},a){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],a)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:a,SonCount:n,StartUserID:o,AdminTryCount:i,UserPin:f,UserTryCount:v,UpdateRSAPriKey:b},ae){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),a,f,parseInt(v),parseInt(i),b,parseInt(o),parseInt(n)],ae)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},a){this.exec("Arm_InitSon",[parseInt(e),t],a)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},a){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],a)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:a,FileID:n,FileType:o,Offset:i,DataLen:f,DataBuffer:v,UpRSAPubKey:b},ae){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,a,o,parseInt(n),parseInt(i),v,b,parseInt(f)],ae)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:a,FileID:n,FileType:o,Offset:i,DataLen:f,DataBuffer:v},b){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,a,o,parseInt(n),parseInt(i),v,parseInt(f)],b)},this.Arm_Update=function({Handle:e,UpdateData:t},a){this.exec("Arm_Update",[parseInt(e),t],a)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:a},n){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(a)],n)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:a,Priv:n,IsReset:o,IsDecOnRAM:i},f){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[a,parseInt(t),parseInt(e),parseInt(n),parseInt(i),parseInt(o)],f)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},a){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},a){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},a){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],a)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:a,IsDecOnRAM:n},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(n),parseInt(a)],o)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:a,InBuffer:n,CallLimit:o},i){this.exec("Arm_Set_EXE_FILE_INFO",[n,parseInt(a),parseInt(e),parseInt(o),t,t.length],i)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const xa={HID:0},ye={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},qe={USER:0};class gt{constructor(){ne(this,"Base64",new Ca);ne(this,"AtlCtrl",null);ne(this,"ArmCount",0);ne(this,"ArmIndex",0);ne(this,"ArmHandle",0);ne(this,"ArmRandom","");try{this.AtlCtrl=new Na("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((a,n)=>{a?(this.ArmCount=+n,e(n)):t(n)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,a)=>{this.AtlCtrl.Arm_Open({Index:e},(n,o)=>{n?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,a(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_Close({Handle:e},(n,o)=>{n?t(o):a(o)})})}armChangePIN(e,t,a=255,n=qe.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,f)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:a,PinFlag:n},(v,b)=>{v&&b==0?(this.ArmPin=e,i(b)):f(b)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,i)=>{o?(this.ArmRandom=i,a(i)):n(i)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(n,o)=>{n?(this.ArmDeadline=o,t(o)):a(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,i)=>{o?(this.ArmUKey=i,a(i)):n(i)})})}armGetDongleInfo(e=0,t=ye.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((a,n)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,i)=>{if(o){switch(t){case ye.USER_ID:this.ArmUid=i;break;case ye.PRODUCT_ID:this.ArmPid=i;break;case ye.HARDWARE_ID:this.ArmHid=i;break}a(i)}else n(i)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_RFS({Handle:e},(n,o)=>{n&&o==0?t(o):a(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,i)=>{if(o&&i.length>0)try{i=this.Base64.decode(i),a(i)}catch(f){console.error(f),a(i)}else n(i)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(n,o)=>{n&&o==0?t(o):a(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSwitchProtocol(e=xa.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armVerifyPIN(e,t=qe.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:a,UserPin:e,UserType:t},(i,f)=>{i&&f==0?(this.ArmPin=e,n(f)):o(f)})})}armReadData(e=0,t=128,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_ReadData({Handle:a,Offset:e,ReadLength:t},(i,f)=>{i?(this.ArmData=f,n(f)):o(f)})})}armWriteData(e,t=0,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_WriteData({Handle:a,Offset:t,DataInput:e},(i,f)=>{i&&f==0?n(f):o(f)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(n,o)=>{n?(this.ArmData=o,t(o)):a(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,i)=>{o&&i==0?a(i):n(i)})})}}const _t="0123456789abcdeffedcba9876543210",wt="4b0de988570c3a0f",ka=window.ENCRYPT;let me=ka&&new gt;function vt(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",a=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*a)],r--;return t}function Et(){return q(this,null,function*(){return me||(me=new gt),new Promise((r,e)=>{me.armEnum().then(t=>{r(+t)}).catch(t=>{H.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Ce.throttle(()=>q(exports,null,function*(){const r=yield Et(),e={};if(typeof r!="number"||r<=0)H.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Pa();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(H.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(H.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Ra(r=0){return q(this,null,function*(){return me?new Promise((e,t)=>{me.armGetDongleInfo(r).then(a=>{a?e(a):(H.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(a))}).catch(a=>{t(a)})}):H.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Pa(){return q(this,null,function*(){if(!me)return H.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield Et();let e=[];for(let t=0;t<r;t++){const a=yield Ra(t);e.push(a)}return e})}vt(16);vt(16);const It=window.meta.app.inspect?le.SM4.constants.CBC:le.SM4.constants.ECB,{publicKey:cn,privateKey:dn}=le.SM2.generateKeyPair();function Da(r,e,t={}){const a=yt(wt),n=t.mode||It;t=n===le.SM4.constants.ECB?l({mode:n,inputEncoding:"utf8",outputEncoding:"hex"},t):l({iv:_t,mode:n,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=le.SM4.encrypt(r,a,t)}catch(i){console.log("err: ",i)}return o}function Oa(r,e,t={}){const a=yt(wt),n=t.mode||It;return t=n===le.SM4.constants.ECB?l({mode:n,inputEncoding:"hex",outputEncoding:"utf8"},t):l({iv:_t,mode:n,inputEncoding:"hex",outputEncoding:"utf8"},t),le.SM4.decrypt(r,a,t)}function yt(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}function Te(r){return r=At&&Ue(r)?Oa(r):r,Ue(r)?JSON.parse(r):r}function je(r){return r=At&&Ue(r)?Da(r):r,JSON.stringify(r)}function de(r,e,t,a){const n=new StorageEvent("storage",{url:window.location.href,key:r,oldValue:e,newValue:t,storageArea:a});window.dispatchEvent(n)}const ze={getLocal:r=>{try{const e=window.localStorage.getItem(r);return Te(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{const t=window.localStorage.getItem(r),a=je(e);window.localStorage.setItem(r,a),de(r,t,a,window.localStorage)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||Le(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const a=window.localStorage.key(e);r((void 0).getLocal(a),a)}},clearLocal:()=>{window.localStorage.clear(),de(null,null,null,window.localStorage)},removeLocal:r=>{const e=window.localStorage.getItem(r);window.localStorage.removeItem(r),de(r,e,null,window.localStorage)},getSession:r=>{try{const e=window.sessionStorage.getItem(r);return Te(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{const t=window.sessionStorage.getItem(r),a=je(e);window.sessionStorage.setItem(r,a),de(r,t,a,window.sessionStorage)}catch(t){console.error(t)}},eachSession:r=>{if(!r||Le(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const a=window.sessionStorage.key(e);r((void 0).getSession(a),a)}},clearSession:()=>{window.sessionStorage.clear(),de(null,null,null,window.sessionStorage)},removeSession:r=>{const e=window.sessionStorage.getItem(r);window.sessionStorage.removeItem(r),de(r,e,null,window.sessionStorage)},onStorageChange:r=>{if(!r||Le(r)!=="Function")return console.error("传递参数非函数类型!");const e=t=>{r({url:t.url,key:t.key,newValue:t.newValue?Te(t.newValue):null,oldValue:t.oldValue?Te(t.oldValue):null,storageArea:t.storageArea})};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},Xe=r=>{const{quality:e,value:t,function_id:a}=r;return(e>>7&1)===1||e===0&&a===2&&t===1},Qe="USER_TOKEN",Je="STATION_ID",Ma=[{key:0,value:"离线"},{key:1,value:"在线"}],La=[{key:0,value:"反向"},{key:1,value:"正向"},{key:2,value:"停止"}],Fa=[{key:1,value:1},{key:2,value:2},{key:3,value:3},{key:4,value:4},{key:5,value:5}],Ua="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",re=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}]}]},Tt=window.meta.graph.lightPlateColorMap?window.meta.graph.lightPlateColorMap:{0:"#00d200",1:"#e2ac06",2:"#fa800a",3:"#f04155",4:"#ff0000"},St=window.meta.graph.lightPlateTextMap?window.meta.graph.lightPlateTextMap:{0:"#fff",1:"#fff",2:"#fff",3:"#fff",4:"#fff"},M={form:[{name:"带电状态",key:"charged_state",type:"select",dataIds:{},options:Ma.map(r=>({label:r.value,value:r.key}))},{name:"潮流方向",key:"electric_direction",type:"select",dataIds:{},options:La.map(r=>({label:r.value,value:r.key}))},{name:"电荷大小",key:"electric_size",type:"select",dataIds:{},options:Fa.map(r=>({label:r.value,value:r.key}))}],anchors:[{x:0,y:.5,id:"0"},{x:.5,y:0,id:"1"},{x:1,y:.5,id:"2"},{x:.5,y:1,id:"3"}],dataType:window.dataType,dataProp:window.dataProp,visibleLevel:window.visibleLevel},h=x(l({penType:C.NORMAL},M),{form:[...re[C.NORMAL],...M.form]});D.YX,D.YX,D.YX,C.POINT_VALUE,M.anchors,window.visibleLevel,M.form,M.form,window.dataType,window.dataProp,window.visibleLevel,M.form,window.dataType,window.dataProp,window.visibleLevel,M.form,window.dataType,window.dataProp,window.visibleLevel,St[0],C.LIGHT_PLATE,Tt[0],M.anchors,window.visibleLevel,[...re[C.LIGHT_PLATE],...M.form],Se+"",C.SENSOR,M.anchors,window.visibleLevel,[...re[C.LIGHT_PLATE],...M.form],x(l({width:100,height:30,name:"text",penName:"文本",text:"文本",disableAnchor:!0,penType:C.TEXT},M),{form:[...re[C.TEXT],...M.form]}),l({width:100,height:100,name:"square",penName:"正方形"},h),x(l({type:1,name:"line",width:100,height:5,lineWidth:2,lineName:"line",penName:"line",background:"#FFF000",color:"#FFF000"},h),{lineAnimateType:1,anchors:[{x:0,y:.5,id:"0"},{x:1,y:.5,id:"1"}]}),l({width:200,height:50,borderRadius:0,name:"rectangle",penName:"矩形"},h),l({width:100,height:100,name:"circle",penName:"圆"},h),l({width:100,height:100,name:"triangle",penName:"三角形"},h),l({width:100,height:100,name:"diamond",penName:"菱形"},h),l({width:100,height:100,name:"pentagon",penName:"五边形"},h),l({width:100,height:100,name:"hexagon",penName:"六边形"},h),l({width:100,height:100,name:"pentagram",penName:"五角星"},h),l({width:120,height:60,name:"leftArrow",penName:"左箭头"},h),l({width:120,height:60,penName:"右箭头",name:"rightArrow"},h),l({width:150,height:60,name:"twowayArrow",penName:"双向箭头"},h),l({width:100,height:100,name:"cloud",penName:"云"},h),l({textTop:-.1,width:100,height:100,name:"message",penName:"消息框"},h),l({width:80,height:100,name:"file",penName:"文件"},h),x(l({width:60,height:100,name:"cube",penName:"立方体",z:.25},h),{props:{custom:[{key:"z",label:"Z",type:"number",min:0,placeholder:"<= 1 即宽度的比例"},{key:"backgroundFront",label:"前背景色",type:"color"},{key:"backgroundUp",label:"顶背景色",type:"color"},{key:"backgroundRight",label:"右背景色",type:"color"}]}}),l({width:70,height:100,name:"people",penName:"人"},h),x(l({name:"rectangle",penName:"按钮",width:80,height:30,borderRadius:.2,text:"按钮",background:"#1890ff",color:"#1890ff",textColor:"#fff",activeBackground:"#40a9ff",activeColor:"#40a9ff",activeTextColor:"#fff",hoverBackground:"#40a9ff",hoverColor:"#40a9ff",hoverTextColor:"#fff"},h),{penType:C.BUTTON}),x(l({name:"rectangle",penName:"输入框",height:50,width:200,input:!0,borderRadius:.05,ellipsis:!0,text:"输入数据",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10},h),{penType:C.INPUT}),x(l({name:"rectangle",penName:"选择器",height:50,width:200,borderRadius:.05,ellipsis:!0,text:"选项1",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10,dropdownList:[{text:"选项1"},{text:"选项2"},{text:"选项3"}]},h),{penType:C.SELECT}),x(l({name:"slider",penName:"进度条",width:300,height:30,value:10,textWidth:50,barHeight:4,fontSize:20,min:0,max:100,color:"#1890ff",background:"#D4D6D9",textColor:"#222",unit:"%"},h),{penType:C.SLIDER}),x(l({name:"time",penName:"时间",width:300,height:40,text:`${Gt().format("YYYY-MM-DD HH:mm:ss")}`,lineWidth:0,fontSize:20,interval:67,fillZero:!0},h),{penType:C.TIME,form:[{key:"timeFormat",name:"显示格式",type:"text"},{key:"fillZero",name:"是否补0",type:"switch"},...h.form],timeFormat:"`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"}),x(l({name:"switch",penName:"开关",height:30,width:60,checked:!1,offColor:"#BFBFBF",onColor:"#1890ff",disableOffColor:"#E5E5E5",disableOnColor:"#A3D3FF",locked:0},h),{penType:C.SWITCH}),x(l({name:"radio",penName:"单选框",direction:"horizontal",width:150,height:30,checked:"",options:[{text:"选项一"},{text:"选项二"},{text:"选项三",isForbidden:!0}]},h),{penType:C.RADIO}),x(l({name:"checkbox",penName:"多选框",width:30,height:30,checked:!0,value:"选项一"},h),{penType:C.CHECKBOX}),x(l({name:"table2",penName:"表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,hasHeader:!0,color:"#333",textColor:"#444"},h),{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"}]}),x(l({name:"table2",penName:"斑马纹表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!0,hasHeader:!0,color:"#333",textColor:"#444"},h),{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"}]}),x(l({name:"table2",penName:"滚动表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,swiper:!0,maxNum:5,hasHeader:!0,color:"#333",textColor:"#444"},h),{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"}]}),x(l({name:"svg",width:100,height:100,image:Se+"/icon/audio.svg",audioId:"",penName:"音频",datable:!0,penType:C.AUDIO},M),{form:[...re[C.AUDIO],...M.form],events:[{name:"enter",action:ve.Emit,value:W.OPEN_AUDIO,where:{type:""},params:JSON.stringify({action:W.OPEN_AUDIO,data:""})},{name:"leave",action:ve.Emit,value:W.CLOSE_AUDIO,where:{type:""},params:JSON.stringify({action:W.CLOSE_AUDIO,data:""})}]}),x(l({name:"svg",width:100,height:100,image:Se+"/icon/camera.svg",cameraId:"",penName:"摄像机",datable:!0,events:[{name:"enter",action:ve.Emit,value:W.OPEN_CAMERA,where:{type:""},params:JSON.stringify({action:W.OPEN_CAMERA,data:""})},{name:"leave",action:ve.Emit,value:W.CLOSE_CAMERA,where:{type:""},params:JSON.stringify({action:W.CLOSE_CAMERA,data:""})}],penType:C.CAMERA},M),{form:[...re[C.CAMERA],...M.form]}),x(l({name:"video",width:100,height:100,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penName:"MP4",penType:C.MP4},M),{form:[...re[C.MP4],...M.form]}),x(l({name:"video",width:100,height:100,penName:"视频流",datable:!0,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penType:C.VIDEO_STREAM},M),{form:[...re[C.VIDEO_STREAM],...M.form]}),l({text:"开始/结束",width:120,height:40,borderRadius:.5,name:"rectangle",penName:"开始/结束"},h),l({text:"流程",width:120,height:40,name:"rectangle",penName:"流程"},h),l({text:"判定",width:120,height:60,name:"diamond",penName:"判定"},h),l({text:"数据",width:120,height:50,name:"flowData",penName:"数据",offsetX:.14},h),l({text:"准备",width:120,height:50,name:"hexagon",penName:"准备"},h),l({text:"子流程",width:120,height:50,name:"flowSubprocess",penName:"子流程"},h),l({text:"数据库",width:80,height:120,name:"flowDb",penName:"数据库"},h),l({text:"文档",width:120,height:100,name:"flowDocument",penName:"文档"},h),l({text:"内部存储",width:120,height:80,name:"flowInternalStorage",penName:"内部存储"},h),l({text:"外部存储",width:120,height:80,name:"flowExternStorage",penName:"外部存储"},h),l({text:"队列",width:100,height:100,name:"flowQueue",penName:"队列"},h),l({text:"手动输入",width:120,height:80,name:"flowManually",penName:"手动输入"},h),l({text:"展示",width:120,height:80,name:"flowDisplay",penName:"展示"},h),l({text:"并行模式",width:120,height:50,name:"flowParallel",penName:"并行模式"},h),l({text:"注释",width:100,height:100,name:"flowComment",penName:"注释"},h),l({text:"",width:30,height:30,name:"circle",penName:"开始",background:"#555",lineWidth:0},h),l({width:30,height:30,name:"activityFinal",penName:"结束"},h),l({text:"活动",width:120,height:50,borderRadius:.25,name:"rectangle",penName:"活动"},h),l({text:"决策/合并",width:120,height:50,name:"diamond",penName:"决策/合并"},h),l({text:"垂直泳道",width:200,height:500,name:"swimlaneV",penName:"垂直泳道",textBaseline:"top",textTop:20,lineTop:.08},h),l({text:"水平泳道",width:500,height:200,name:"swimlaneH",penName:"水平泳道",textWidth:.01,textLeft:.04,textAlign:"left",lineLeft:.08},h),l({text:"垂直分岔/汇合",width:10,height:150,name:"forkV",penName:"垂直分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({text:"水平分岔/汇合",width:150,height:10,name:"forkH",penName:"水平分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({name:"andGate",penName:"与门",width:100,height:150},h),l({name:"basicEvent",penName:"基本事件",width:100,height:150},h),l({name:"unexpandedEvent",penName:"未展开事件",width:100,height:150},h),l({name:"priorityAndGate",penName:"优先AND门",width:100,height:150},h),l({name:"forbiddenGate",penName:"禁止门",width:100,height:150},h),l({name:"event",penName:"事件",width:100,height:150},h),l({name:"switchEvent",penName:"开关事件",width:100,height:150},h),l({name:"conditionalEvent",penName:"条件事件",width:150,height:100},h),l({name:"transferSymbol",penName:"转移符号",width:100,height:150},h),l({name:"orGate",penName:"或门",width:100,height:150},h),l({name:"xorGate",penName:"异或门",width:100,height:150},h),l({name:"votingGate",penName:"表决门",width:100,height:150},h);const Ga=(r,e={isDev:!1,devServerUrl:"",devServerPort:8443})=>r.replace(/(https?:\/\/)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(:(\d+))?/,`$1${e.isDev?e.devServerUrl:Jt}:${e.isDev?e.devServerPort:ea}`),Ne=(r,e)=>{const t=r.__vccOpts||r;for(const[a,n]of e)t[a]=n;return t},Ba={class:"props-panel__title"},Va={class:"props-panel__value"},Ha={class:"props-panel__value-num"},Ka=Object.assign({name:"PropsPanle"},{__name:"PropsPanle",props:{data:{type:Object,default:null}},emits:["close"],setup(r,{emit:e}){const t=r,a=e;function n(i){return i==null||i==="—"?"—":typeof i=="number"?i.toFixed(2):i}const o=()=>{a("close")};return(i,f)=>{var v,b;return c.openBlock(),c.createElementBlock("div",{class:"props-panel",onMouseleave:o},[c.createElementVNode("div",Ba,c.toDisplayString(((v=t==null?void 0:t.data)==null?void 0:v.name)||"—"),1),f[1]||(f[1]=c.createElementVNode("div",{class:"props-panel__label"},"脉冲峰值",-1)),c.createElementVNode("div",Va,[c.createElementVNode("span",Ha,c.toDisplayString(n((b=t==null?void 0:t.data)==null?void 0:b.value)),1),f[0]||(f[0]=c.createElementVNode("span",{class:"props-panel__unit"},"dBm",-1))])],32)}}}),Ya=Ne(Ka,[["__scopeId","data-v-343ad322"]]);class Wa{constructor(e){ne(this,"editor");this.editor=e}initPlugin(e,t,a={}){e.installPenPlugins({name:t},[{plugin:Bt.mindBoxPlugin,options:a},{plugin:Vt.collapseChildPlugin,options:a}])}}const $a="original_meta2d";function qa(){return localStorage.removeItem($a)}let pe={};const ja=r=>{const e=document.querySelectorAll("video");let t=null;if(e.forEach(n=>{n.getAttribute("src")===r.video&&(t=n)}),!t)return;t.setAttribute("muted","muted"),t.setAttribute("autoplay","autoplay"),t.setAttribute("loop","loop"),t.setAttribute("crossorigin",""),t.setAttribute("controls",""),t.style.display="none",t.parentElement.style.border="2px solid #ffc878";const a=new JessibucaPro({container:t.parentElement,background:"",hasControl:!1,controlAutoHide:!0,checkFirstIFrame:!0,debug:!1,decoder:"./wasm/decoder-pro.js",forceNoOffscreen:!0,hotKey:!1,hasAudio:!1,hasVideo:!0,hiddenAutoPause:!1,isFlv:!0,isResize:!1,isNotMute:!0,loadingIcon:!0,loadingText:"加载中...",networkDelayTimeoutReplay:!1,playbackForwardMaxRateDecodeIFrame:8,showBandwidth:!1,showPerformance:!1,syncAudioAndVideo:!0,supportDblclickFullscreen:!1,timeout:10,useMSE:!0,useWCS:!1,useSIMD:!0,useVideoRender:!0,useCanvasRender:!1,videoBuffer:.2,videoBufferDelay:1});return r.autoPlay&&r.streamUrl&&a.play(r.streamUrl),pe[r.id]=a,a},za=()=>{Object.keys(pe).forEach(r=>{pe[r].destroy(),pe[r]=null}),pe={}},Xa={class:"sy-empty"},Qa={key:1,class:"sy-empty-picture"},Ja={class:"sy-empty-description"},Za=Object.assign({name:"SyEmpty"},{__name:"index",props:{image:{type:String,default:"empty"},imageSize:{type:Number,default:80},description:{type:String,default:"暂无数据"},onlyText:{type:Boolean,default:!1}},setup(r){c.useCssVars(n=>({a7383bac:a.value.width,v736d2d7a:a.value.height}));const e=r,t=c.computed(()=>({"font-size":e.imageSize?`${e.imageSize}px`:"80px"})),a=c.computed(()=>e.imageSize?{width:e.imageSize*1.2+"px",height:e.imageSize+"px"}:{width:"187px",height:"144px"});return(n,o)=>{const i=c.resolveComponent("SyIcon"),f=c.resolveComponent("el-icon");return c.openBlock(),c.createElementBlock("div",Xa,[r.image!=="empty"?(c.openBlock(),c.createElementBlock("span",{key:0,class:"sy-empty-image",style:c.normalizeStyle(t.value)},[r.image!=="loading"?(c.openBlock(),c.createBlock(i,{key:0,name:r.image,gradient:""},null,8,["name"])):(c.openBlock(),c.createBlock(f,{key:1,class:"is-loading",style:{color:"#1671d4"}},{default:c.withCtx(()=>[c.createVNode(c.unref(Wt.Loading))]),_:1}))],4)):r.onlyText?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",Qa)),c.createElementVNode("div",Ja,[c.createElementVNode("p",null,c.toDisplayString(r.description),1)])])}}}),en=Ne(Za,[["__scopeId","data-v-247a0fc9"]]),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(r,{expose:e,emit:t}){const a=t,n=r,o=c.ref(null),i=c.shallowRef(),f=c.computed(()=>!!(n.data||n.url));c.watch(()=>[n.data,n.url],()=>{f.value&&b()});let v=c.ref(!0);function b(){return q(this,null,function*(){try{if(v.value=!0,yield c.nextTick(),!o.value){console.error("未找到meta2d元素!");return}let _=null;if(n.data?_=n.data:n.url&&(_=yield ge()),!_||!_.data){v.value=!1,console.log("图纸数据为空"),a("load-error");return}const N=_.options||{background:"#eee",disableAnchor:!1};if(i.value&&(i.value.destroy(!0),i.value=null),!o.value){console.error("Meta2D 容器元素不可用");return}i.value=new U.Meta2d(o.value,l({},N)),N.visibleLevel&&i.value.scale(N.visibleLevel),ae(),J(),yield Z(_.data),i.value.render(),ie(),setTimeout(()=>{window.meta2dTools&&window.registerToolsNew()},1e3),a("loaded",i.value)}catch(_){console.error("初始化编辑器失败:",_)}})}function ae(){if(!i.value)return;new Wa({}).initPlugin(i.value,"mindNode",{})}function J(){U.register(Kt.classPens()),U.register(Ve.flowPens()),U.registerAnchors(Ve.flowAnchors()),U.register(He.sequencePens()),U.registerCanvasDraw(He.sequencePensbyCtx()),U.register(Ke.activityDiagram()),U.registerCanvasDraw(Ke.activityDiagramByCtx()),U.registerCanvasDraw(Ht.formPens()),U.registerCanvasDraw(Yt.chartsPens()),U.register(Pe.ftaPens()),U.registerAnchors(Pe.ftaAnchors()),U.registerCanvasDraw(Pe.ftaPensbyCtx())}function Z(_){var N;if(i.value){if(typeof _.locked=="undefined"&&(_.locked=0),_.bkImage&&i.value.setBackgroundImage(_.bkImage),_.pens&&_.pens.length>0){const L=[];_.pens.forEach(S=>{S.name==="video"&&S.streamUrl?L.push(S):S.name==="image"&&S.image?S.image=Ga(S.image,n.devConfig):S.penType===C.TABLE&&S.dataType&&P(S)}),L.length>0&&setTimeout(()=>{L.forEach(S=>{ja(S)})},500);const X=window.meta.graph.penCountThreshold||2e3;_.pens.length>X&&_.scale&&_.pens.forEach(S=>{const G=S.visibleLevel;G!==void 0?(S.visible=_.scale>=G,S.visible||(S.disabled=!0,S.locked=U.LockState.Disable)):(S.visible=!0,S.disabled=!1,S.locked=U.LockState.None)})}i.value.open(_),!n.preview&&((N=_.networks)!=null&&N.length)&&i.value.closeNetwork()}}const P=_=>q(this,null,function*(){var L;const N=yield se.getCommonApi(zt[_.dataType],{offset:0,limit:_.tableSize||10});if((L=N.data)!=null&&L.length){const X=_.tableHeader||[{prop:"id",label:"ID"},{prop:"guid",label:"标识"},{prop:"name",label:"名称"}],$=N.data.map(S=>X.filter(G=>G.isShow).map(G=>{const K=S[G.prop];return G.choices?G.choices[K]||K:Ce.isObject(K)?K.name:K}));i.value.setValue({id:_.id,dataY:$})}else i.value.setValue({id:_.id,dataY:[]})}),ie=()=>{i.value&&(i.value.on("scale",ee),n.preview||i.value.on("connectLine",he))},ee=Ce.debounce(_=>{var N,L,X,$;try{if(!i.value)return;Fe.emit("graph-scale",_);let S=i.value.store.data.pens;const G=window.meta.graph.penCountThreshold||2e3,K=S.length>G;for(let F=0;F<S.length;F++){const O=S[F];if([C.VIDEO_STREAM,C.MP4].includes(O.penType)){if(((L=(N=ce.videos[O.id])==null?void 0:N.children)==null?void 0:L.length)===3){let z=ce.videos[O.id].children[0],Q=ce.videos[O.id].children[2];z.style.width=Q.currentTime/Q.duration*O.calculative.worldRect.width+"px"}else if((($=(X=ce.videos[O.id])==null?void 0:X.children)==null?void 0:$.length)===2){let z=ce.videos[O.id].children[0],Q=ce.videos[O.id].children[1];z.style.width=Q.currentTime/Q.duration*O.calculative.worldRect.width+"px"}}if(K){const z=O.visibleLevel!==void 0?_>=O.visibleLevel:!0;i.value._setValue({id:O.id,visible:z,disabled:!z,locked:z?U.LockState.None:U.LockState.Disable})}}i.value.render()}catch(S){console.error("处理缩放失败:",S)}},500),he=X=>q(this,[X],function*({line:_,lineAnchor:N,pen:L}){var _e;if(N!=null&&N.start||(L==null?void 0:L.penType)!==C.GIS_SENSOR)return;const $=(_e=_==null?void 0:_.calculative)==null?void 0:_e.worldAnchors;if($.length!==2||$!=null&&$.some(fe=>!fe.connectTo))return;const[S,G]=$;if(S.connectTo===G.connectTo)return;const K=window.meta2d.findOne(S.connectTo),F=window.meta2d.findOne(G.connectTo);let O=K==null?void 0:K.bindData,z=F==null?void 0:F.bindData;if(!O||!z)return;const Q=yield se.postPDApi("setchannelpaired/",{data:[{channel1:O.guid,channel2:z.guid}]});Q.success?H.ElMessage.success("配对成功"):H.ElMessage.error("配对失败",Q.detail)});function ge(){return q(this,null,function*(){if(!n.url)return H.ElMessage.error("图纸路径为空!"),null;try{return(yield se.getGraphApi(n.url,{local:n.local}))||null}catch(_){return null}})}const te=()=>{i.value&&(i.value.resize(),i.value.fitView(!0,10))};return c.onMounted(()=>{var _,N;f.value&&(_=o.value)!=null&&_.clientHeight&&(N=o.value)!=null&&N.clientWidth&&b(),window.addEventListener("resize",te)}),c.onUnmounted(()=>{za(),qa(),i.value&&(n.preview?(ft.clearLineCross(),i.value.destroy(!0)):i.value.off("scale",ee)),window.removeEventListener("resize",te)}),e({stage:i}),(_,N)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"meta2dRef",ref:o,class:"meta2d-editor"},[c.unref(v)?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(en,{key:0,class:"meta2d-empty",description:"图纸不存在"}))],512))}}),an=Ne(tn,[["__scopeId","data-v-9753d97b"]]),nn={key:0,class:"back-btn"};var mt,ht;const rn=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:((ht=(mt=window.meta)==null?void 0:mt.app)==null?void 0:ht.lang)||"zh-cn"},config:{type:Object,default:()=>({socketUrl:We,stationIdKey:Je,enableToken:!0,userTokenKey:Qe,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,enableWebSocket:!0,graphSocket:Ye.GRAPH.SOCKET})},showMap:{type:Boolean,default:!1},isFactory:{type:Boolean,default:!1},isInitData:{type:Boolean,default:!0},apiInstance:{type:Object,default:()=>se},mittInstance:{type:Object,default:()=>Fe},customCallbacks:{type:Object,default:()=>({})},errorHandler:{type:Object,default:()=>({callback:null,showMessage:!0})},devConfig:{type:Object,default:()=>({isDev:!1,devServerUrl:"",devServerPort:8443})}},emits:["error","loaded","custom-msg","socket-msg"],setup(r,{expose:e,emit:t}){const a=t,n=r;let o=c.ref(!1),i=c.ref(""),f=c.ref(!1);const v=c.ref(null),b=c.ref(null),ae=c.ref(null),J=c.ref(""),Z=c.ref(!1),P=c.computed(()=>{var s;return(s=ae.value)==null?void 0:s.stage}),ie=c.computed(()=>{var s;return(s=P.value)==null?void 0:s.store}),ee=c.computed(()=>l({socketUrl:We,stationIdKey:Je,enableToken:!0,userTokenKey:Qe,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,fitPadding:10,enableWebSocket:!0,graphSocket:Ye.GRAPH.SOCKET},n.config)),he=()=>n.apiInstance||se,ge=()=>n.mittInstance||Fe,te=(s,u="")=>{const A={error:s,message:u,timestamp:new Date().toISOString()};a("error",A),n.errorHandler.callback?n.errorHandler.callback(A):n.errorHandler.showMessage&&H.ElMessage&&H.ElMessage.error(`${u}: ${s.message||s}`)},_=()=>{i.value&&(J.value=i.value,Z.value=f.value)},N={},L=c.ref(!1),X=c.ref({left:0,top:0}),$=(s,u)=>{if(!v.value)return{left:s+20,top:u+20};const A=v.value.getBoundingClientRect(),T=s-A.left,k=u-A.top;let I=300,y=150;if(b.value){const g=b.value.$el||b.value;g&&g.offsetWidth&&(I=g.offsetWidth,y=g.offsetHeight)}let m=T+20,w=k+20;return m+I>A.width&&(m=T-I-20),w+y>A.height&&(w=k-y-20),{left:Math.max(0,Math.min(m,A.width-I)),top:Math.max(0,Math.min(w,A.height-y))}},S=s=>{L.value&&(X.value=$(s.clientX,s.clientY))},G=s=>{var u,A,T,k,I,y;try{if(!s)return;if((u=s==null?void 0:s.includes)!=null&&u.call(s,"token 必传"))return H.ElMessage.warning(s);const m=typeof s=="string"?JSON.parse(s):s;if((m==null?void 0:m.data)==="服务错误"||(T=(A=m==null?void 0:m.data)==null?void 0:A.includes)!=null&&T.call(A,"token is expired"))return H.ElMessage.warning(m.data);switch(a("socket-msg",m),m.action){case De.ACPOINT.YCVALUE:case De.ACPOINT.YXVALUE:if((k=m==null?void 0:m.data)!=null&&k.point_id){const w=P.value.find(m.data.point_id);w&&(N[m.data.point_id]=m.action===De.ACPOINT.YXVALUE?Ie(m.data.value)?m.data.value:0:Ie(m.data.value_disp||m.data.value)?m.data.value_disp||m.data.value:0,we(w,m.data))}break;default:if(((I=m.data)==null?void 0:I.length)>0){const w=setTimeout(()=>{clearTimeout(w),P.value&&(m.data.forEach(g=>{N[g.dataId||g.point_id]=g.value_disp||g.value}),m.data.forEach(g=>{const E=P.value.find(g.dataId||g.point_id);we(E,g)}))},ee.value.messageDelay);n.customCallbacks.onWebSocketMessage&&n.customCallbacks.onWebSocketMessage(m),(y=window.customSocketFn)==null||y.call(window,s)}break}return!0}catch(m){return te(m,"WebSocket消息处理"),!0}},K=c.ref({});let F={},O=null;const z=s=>q(this,null,function*(){try{if(s.msgName)switch(s.msgName){case W.CHANGE_GRAPH:case W.NOTIFY_DIALOG:case W.GIS_PROPS_PANEL:Q(s);break}else Q(s);a("custom-msg",s),n.customCallbacks.onCustomMessage&&n.customCallbacks.onCustomMessage(s)}catch(u){te(u,"自定义消息处理")}}),Q=s=>{var T,k;let u;if(s.params)try{u=JSON.parse(s.params)}catch(I){u=s.params}switch(s.msgName){case W.CHANGE_GRAPH:(u==null?void 0:u.data)!=="图纸id"?(i.value=J.value,f.value=Z.value,o.value=u.isBack,(T=u==null?void 0:u.data)!=null&&T.startsWith("/")?(J.value=u==null?void 0:u.data,Z.value=!0):(Z.value=!1,fe(u.data))):console.warn("切换图纸信息为空");break;case W.NOTIFY_DIALOG:u.msg!=="通知内容"?H.ElNotification(l({message:u.msg},u)):console.warn("通知内容为空");break;case W.GIS_PROPS_PANEL:s.eventName==="enter"?(L.value=!0,K.value=((k=s==null?void 0:s.pen)==null?void 0:k.bindData)||{},s.e&&(X.value=$(s.e.clientX,s.e.clientY))):(L.value=!1,K.value={});break}},_e=s=>{var u,A,T,k,I,y,m,w,g;try{a("loaded",s);const E=$e(),d=ee.value,p=ze.getSession(d.stationIdKey),V=ze.getSession(d.userTokenKey);d.enableWebSocket&&p&&V&&((T=(A=(u=s.store)==null?void 0:u.data)==null?void 0:A.networks)!=null&&T.length?(y=(I=(k=s.store)==null?void 0:k.data)==null?void 0:I.networks)==null||y.forEach(Y=>{var oe;Y.protocol==="websocket"&&((oe=Y.url)!=null&&oe.includes("station_id")||(Y.url=`${Y.url}?station_id=${p}`),d.enableToken?Y.protocols=d.userToken||V:Y.protocols=void 0)}):(w=(m=s.store)==null?void 0:m.data)!=null&&w.websocket?((g=s.store.data.websocket)!=null&&g.includes("station_id")||(s.store.data.websocket=`${s.store.data.websocket}?station_id=${p}`),d.enableToken?s.store.data.websocketProtocols=d.userToken||V:s.store.data.websocketProtocols=void 0,s.closeSocket(),s.connectSocket()):(s.store.data.websocket=`${d.socketUrl}?station_id=${p}`,d.enableToken?s.store.data.websocketProtocols=V:s.store.data.websocketProtocols=void 0,s.connectWebsocket())),(n.showMap||E.showMap==="true")&&s.showMap(),s.setRule({rule:!1}),s.setOptions({disableRuleLine:!0}),s.setGrid({grid:!1}),s.lock(U.LockState.DisableEdit),ke().forEach(Y=>{var oe;(oe=Y==null?void 0:Y.events)!=null&&oe.length?B({id:Y.id,locked:1},!1):B({id:Y.id,locked:10},!1)}),s.render(),d.enableAutoFit&&s.fitView(!0,d.fitPadding),Object.values(W).forEach(Y=>{s.on(Y,oe=>z(x(l({},oe),{msgName:Y})))}),s&&(s.socketFn=G),n.customCallbacks.onStageLoaded&&n.customCallbacks.onStageLoaded(s),n.isInitData&&Ct(s),window.addEventListener("mousemove",S)}catch(E){te(E,"图纸加载完成处理")}},fe=Ce.throttle(s=>q(this,null,function*(){var u;try{if(n.url){Z.value=n.local,yield xe(n.url);return}const A=$e();if(s=s||n.gid||A.id,A.local==="true"&&(Z.value=!0),s){const T=he();if(T&&T.getCommonApi){const k=yield T.getCommonApi(n.isFactory?"graph":"floorplan",{guid:s});if((u=k.data)!=null&&u.length)yield xe(k.data[0].path);else{const I="未找到图纸!";te(new Error(I),"获取图纸数据")}}else te(new Error("API实例不可用"),"初始化图纸数据!")}else Z.value=n.local,yield xe(n.url);n.customCallbacks.onGraphLoaded&&n.customCallbacks.onGraphLoaded(J.value)}catch(A){te(A,"获取图纸数据失败")}})),xe=s=>q(this,null,function*(){const u=s.split(".");if(s.includes(n.lang)||u.length!==3){J.value=s;return}const A=`${u[0]}.${n.lang}.${u[2]}`;try{const T=yield se.getGraphApi(A,{local:n.local}).catch(()=>{console.warn("多语言图纸不存在,使用默认图纸")});J.value=T?A:s}catch(T){J.value=s}}),Ct=s=>q(this,null,function*(){var u,A,T,k;if(s){let I=[],y=[],m=[];F={};const w=s.store.data.pens;for(let E=0;E<w.length;E++){const d=w[E];d.bindDataId?(u=d.form)!=null&&u.length?d.form.forEach(p=>{if(p.dataIds.dataId)switch(p.dataIds.dataType){case D.YC:I.push(x(l({},p),{nodeName:p.dataIds.name,penId:d.id,penName:d.penName}));break;case D.YX:y.push(x(l({},p),{nodeName:p.dataIds.name,penId:d.id,penName:d.penName}));break;case D.SG:y.push(x(l({},p),{nodeName:p.dataIds.name,penId:d.id,penName:d.penName}));break;case D.POINT:m.push(x(l({},p),{nodeName:p.dataIds.name,penId:d.id,penName:d.penName}));break}}):d.penType===C.GIS_SENSOR&&d.bindData&&(F[d.bindData.ied_id]||(F[d.bindData.ied_id]=[]),B({id:d.id,title:void 0}),F[d.bindData.ied_id].push(l({penId:d.id},d.bindData))):(A=d.statusBindData)!=null&&A.length&&d.statusBindData.forEach(p=>{if(p.dataId)switch(p.dataType){case D.YX:y.push({showChild:0,value:0,nodeName:p.dataName,penId:d.id,penName:d.penName,dataId:p.dataId});break;case D.SG:y.push({showChild:0,value:0,nodeName:p.dataName,penId:d.id,penName:d.penName,dataId:p.dataId});break}})}let g=[];if(I.length){const E=he();if(E&&E.postCommonApi){const d=yield E.postCommonApi("queryrealtimepoint",{point_id:I.map(p=>{var V;return((V=p==null?void 0:p.dataIds)==null?void 0:V.dataId)||p.dataId}).join(",")});(T=d==null?void 0:d.data)!=null&&T.length&&(d.data.forEach(p=>{N[p.guid]=p.value_disp||p.value}),g=[...g,...d.data])}}if(y.length){const E=he();if(E&&E.postCommonApi){const d=yield E.postCommonApi("queryrealtimepoint",{point_id:y.map(p=>{var V;return((V=p==null?void 0:p.dataIds)==null?void 0:V.dataId)||p.dataId}).join(",")});(k=d==null?void 0:d.data)!=null&&k.length&&(d.data.forEach(p=>{N[p.guid]=Me(p.value)?Number(p.value):p.value}),g=[...g,...d.data])}}g.length&&g.forEach(E=>{const d=s.find(E.guid);we(d,x(l({},E),{value:Me(E.value)?Ie(Number(E.value))?Number(E.value):0:E.value,value_disp:E.value_disp,alarm_value:E.alarm_value,point_id:E.guid}))}),F&&Object.keys(F).length?(O&&clearInterval(O),Ge(),O=setInterval(()=>{Ge()},3e3)):O&&clearInterval(O)}}),Ge=()=>q(this,null,function*(){var s;if(F){const u=Object.keys(F);if(u.length){const A=yield se.postPDApi("querychannelstatus/",{data:u.map(T=>({ied_id:T,ln_list:F[T].map(k=>k.ln_id)}))});(s=A==null?void 0:A.data)!=null&&s.length&&u.forEach(T=>{const k=A.data.find(y=>y.ied_id===T),I=F[T];I!=null&&I.length&&I.forEach(y=>{const m=k.result.find(w=>w.ln_id===y.ln_id);m&&B({id:y.penId,showChild:m.status==="告警"?2:m.status==="正常"?1:0,bindData:x(l({},y),{status:m.status,value:Me(m.amp_peak)?Ie(Number(m.amp_peak))?Number(m.amp_peak):0:m.amp_peak})},!1)})})}}}),B=(s,u=!0)=>{if(P.value)return P.value.setValue(s,{render:u})},bt=()=>P.value,ke=()=>{var s,u;return((u=(s=ie.value)==null?void 0:s.data)==null?void 0:u.pens)||[]},Nt=()=>C,we=(()=>{let s=null;const u=new Map,A=new Map,T=I=>{var m;if(!((m=I.children)!=null&&m.length))return[];const y=I.id||"";if(!y)return[];if(!A.has(y)&&ie.value){const w=U.getAllChildren(I,ie.value);A.set(y,w)}return A.get(y)||[]},k=()=>{if(u.size===0||!P.value||!ie.value)return;const I=[],y=[],m=ie.value.animates;u.forEach(({pen:w,dataItem:g,formKey:E})=>{switch(E){case"showChild":B({id:w.id,showChild:+g.value},!1);break;case"text":B({id:w.id,text:g.value_disp||g.value},!1);break;case"light_plate":{const d=g.value===-1||Xe(g)?"#999999":St[g.value!==void 0?g.value:g.alarm_value],p=g.value===-1||Xe(g)?"#cccccc":Tt[g.value!==void 0?g.value:g.alarm_value];B({id:w.id,textColor:d,background:p},!1)}break;case"point_value":w.penType===C.POINT_VALUE&&T(w).forEach(p=>{p.name==="text"&&B({id:p.id,text:g.value},!1)});break;case"online_state":{let d=g.value?void 0:"contrast(0%)";B({id:w.id,filter:d},!1),T(w).forEach(V=>{B({id:V.id,filter:d},!1)})}break;case"charged_state":{const d=g.value===__$t__.OFFLINE?"contrast(0%)":void 0;d!==w.filter&&(B({id:w.id,filter:d},!1),T(w).forEach(V=>{B({id:V.id,filter:d},!1)}))}break;case"electric_direction":g.value===qt.STOP?m!=null&&m.has(w)&&y.push(w):!!g.value!==w.animateReverse&&(B({id:w.id,animateReverse:!!g.value},!1),m!=null&&m.has(w)||I.push(w));break;case"electric_size":{const d=jt[g.value];d!==void 0&&d!==w.lineWidth&&B({id:w.id,lineWidth:d},!1)}break;default:B({id:w.id,[E]:g.value},!1);break}}),y.length>0&&P.value.stopAnimate(y),I.length>0&&P.value.startAnimate(I),u.clear(),P.value.render()};return(I,y)=>{I!=null&&I.length&&(I.forEach(m=>{var g;const w=m.form;if((g=m.statusBindData)!=null&&g.length){if(!N[y.guid])return;const E=[...m.statusBindData],d=E.findIndex(p=>p.dataId===y.guid);if(d!==-1){const p=E[d];E.find(j=>p.sort<j.sort&&N[j.dataId])||u.set(m.id,{pen:m,formKey:"showChild",dataItem:x(l({},y),{value:d})})}}else w!=null&&w.length&&w.forEach(E=>{if(!(Array.isArray(E.dataIds)?E.dataIds:[E.dataIds]).some(j=>(j==null?void 0:j.dataId)&&((j==null?void 0:j.dataId)===y.dataId||(j==null?void 0:j.dataId)===y.point_id)))return;const V=`${m.id}-${E.key}`;u.set(V,{pen:m,dataItem:y,formKey:E.key})})}),s&&clearTimeout(s),s=setTimeout(()=>{k(),s=null},ee.value.debounceDelay))}})(),xt=s=>{if(P.value){for(let u=0;u<s.length;u++){const A=s[u];N[A.dataId||A.point_id]=A.value_disp||A.value;const T=P.value.find(A.dataId);setTimeout(()=>{we(T,A)},ee.value.messageDelay)}P.value.render(),n.customCallbacks.onBatchUpdate&&n.customCallbacks.onBatchUpdate(s)}},kt=(s,u=!1)=>{if(!P.value)return;const A=ke();for(let T=0;T<A.length;T++){const k=A[T];let I=!1;u?I=s===k.dataProp:I=s===5?!0:k.dataProp<=s,B({id:k.id,visible:I},!1)}P.value.fitView(),P.value.render(),n.customCallbacks.onLevelChange&&n.customCallbacks.onLevelChange(s,u)};return c.watch(()=>[n.gid,n.url,n.data,n.lang,n.local,n.isFactory],()=>{fe()}),c.watch(()=>n.showMap,s=>{P.value&&(s?P.value.showMap():P.value.hideMap())}),c.onMounted(()=>{const s=ge();s&&s.on&&s.on(ee.value.graphSocket,G),fe()}),c.onUnmounted(()=>{F=null;const s=ge();s&&s.off&&s.off(ee.value.graphSocket,G),window.removeEventListener("mousemove",S)}),e({setValue:B,getStage:bt,getAllPens:ke,getCustomPenType:Nt,batchUpdatePen:xt,handleLineCross:ft.handleLineCross,changeVisibleByLevel:kt}),(s,u)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"previewRef",ref:v,class:"meta2d-preview"},[c.createVNode(an,{ref_key:"graphRef",ref:ae,url:J.value,local:Z.value,data:n.data,"dev-config":n.devConfig,preview:"",onLoaded:_e},null,8,["url","local","data","dev-config"]),c.unref(o)?(c.openBlock(),c.createElementBlock("div",nn,[c.createVNode(c.unref(H.ElButton),{type:"primary",onClick:_},{default:c.withCtx(()=>[...u[1]||(u[1]=[c.createTextVNode("返回",-1)])]),_:1})])):c.createCommentVNode("",!0),L.value?(c.openBlock(),c.createBlock(Ya,{key:1,ref_key:"panelRef",ref:b,data:K.value,style:c.normalizeStyle({top:X.value.top+"px",left:X.value.left+"px",position:"absolute",pointerEvents:"none"}),onClose:u[0]||(u[0]=A=>L.value=!1)},null,8,["data","style"])):c.createCommentVNode("",!0)],512))}}),Ae=Ne(rn,[["__scopeId","data-v-f95a5793"]]);Ae.name||(Ae.name="SyGraph");const on=r=>{r.component(Ae.name||"SyGraph",Ae)},sn={install:on};exports.SyGraph=Ae;exports.default=sn;
|
|
5
|
+
*/Object.defineProperty(Ne,"__esModule",{value:!0});var me=typeof window!="undefined"?window.proxy||window:{},ft=function(r){me!=null&&me.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),me.qiankunName&&(window.moudleQiankunAppLifeCycles[me.qiankunName]=r))};Ne.default=ft;var Oe=Ne.qiankunWindow=me;Ne.renderWithQiankun=ft;function Xt(){return window.__POWERED_BY_WUJIE__||window.$wujie?Ie.WUJIE:window.__POWERED_BY_QIANKUN__||Oe!=null&&Oe.__POWERED_BY_QIANKUN__?Ie.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?Ie.MICROAPP:Ie.NONE}const be="/",At=window.meta.app.encrypt;Xt();const Qt=location.protocol==="https:",Jt=location.hostname,Zt=Qt?"wss:":"ws:",ea=location.port,ta=location.origin,Ye=`${Zt}//${location.host}/ws`;var Ze,et,tt,at,nt,rt,it,ot,st,lt,ct,dt;(et=(Ze=window.meta)==null?void 0:Ze.graph)!=null&&et.savePath,(at=(tt=window.meta)==null?void 0:tt.graph)!=null&&at.graphPenPath,(rt=(nt=window.meta)==null?void 0:nt.graph)!=null&&rt.templatePath,(ot=(it=window.meta)==null?void 0:it.graph)!=null&&ot.graphImgUploadPath,(lt=(st=window.meta)==null?void 0:st.graph)!=null&<.threeSavePath,(dt=(ct=window.meta)==null?void 0:ct.graph)!=null&&dt.threeModelPath;var ut;const R=Ft.create({baseURL:ta,timeout:((ut=window.meta.axios)==null?void 0:ut.timeout)||6e4,withCredentials:!1,paramsSerializer:r=>Mt.stringify(r)});R.interceptors.request.use(r=>(r.headers["x-token"]="ewoglCJhbGcilDogpc3",r),r=>Promise.reject(r));R.interceptors.response.use(r=>{const{data:e}=r;return Promise.resolve(e)},r=>Promise.reject(r));function aa(r,e={},t={}){return new Promise(a=>{R.get(r,l({params:e},t)).then(n=>a({res:n,err:null})).catch(n=>a({res:null,err:n}))})}function na(r,e={},t={}){return new Promise(a=>{R.post(r,e,t).then(n=>a({res:n,err:null})).catch(n=>a({res:null,err:n}))})}function ra(r,e={},t={}){return R.get(r,l({params:e},t))}function ia(r,e={},t={}){return R.post(r,e,t)}function oa(r,e={}){return R.get(`/filehandle/${r}`,{params:e})}function sa(r,e={},t={}){return R.post(`/filehandle/${r}`,e,t)}function la(r,e={}){return R.get(`/user/${r}`,{params:e})}function ca(r,e={},t={}){return R.post(`/user/${r}`,e,t)}function da(r,e={}){return R.get(`${r}`,e.local?{params:e,baseURL:be}:{params:e})}function ua(r,e={}){return R.get(`/media/${r}/`,{params:e})}function ma(r,e={},t={}){return R.post(`/media/${r}/`,e,t)}function ha(r,e={}){return R.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,{params:e})}function pa(r,e={},t={}){return R.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,e,t)}function fa(r,e={}){return R.get(`/history/${r}`,{params:e})}function Aa(r,e={},t={}){return R.post(`/history/${r}`,e,t)}function ga(r,e={}){return R.get(`/scada/${r}`,{params:e})}function _a(r,e={},t={}){return R.post(`/scada/${r}`,e,t)}function wa(r,e={}){return R.get(`/common/factory/${r}`,{params:e})}function va(r,e={},t={}){return R.post(`/common/factory/${r}`,e,t)}function Ea(r,e={}){return R.get(`/factory/${r}`,{params:e})}function Ia(r,e={},t={}){return R.post(`/factory/${r}`,e,t)}function ya(r,e={}){return R.get(`/pd/${r}`,{params:e})}function Ta(r,e={},t={}){return R.post(`/pd/${r}`,e,t)}const ie={getApi:aa,postApi:na,getFileApi:oa,postFileApi:sa,getBaseApi:ra,postBaseApi:ia,getUserApi:la,postUserApi:ca,getGraphApi:da,getMediaApi:ua,postMediaApi:ma,getScadaApi:ga,postScadaApi:_a,getCommonApi:ha,postCommonApi:pa,getHistoryApi:fa,postHistoryApi:Aa,getFactoryApi:Ea,postFactoryApi:Ia,getCommonFactoryApi:wa,postCommonFactoryApi:va,getPDApi:ya,postPDApi:Ta},Fe=Ut(),Sa=[65535,-99999];function Le(r){if(typeof r!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return r.trim()!==""&&e.test(r.trim())}function Ue(r){return!["null","undefined"].includes(r)&&r!==void 0&&r!==null&&r!==""}function ye(r){return typeof r=="number"&&!Sa.includes(r)}const $e=()=>{var a;const r={},e=((a=window.location.href.split("?"))==null?void 0:a[1])||"",t=new URLSearchParams(e);for(const[n,o]of t.entries())r[n]=o;return r};function Me(r){return Object.prototype.toString.call(r).slice(8,-1)}(function(){if(typeof Object.id=="undefined"){var r=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++r,enumerable:!1,writable:!1}),e.__uniqueid}}})();function ba(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];this.encode=function(t){var a,n,o,i,p,E;for(o=t.length,n=0,a="";n<o;){if(i=t.charCodeAt(n++)&255,n==o){a+=r.charAt(i>>2),a+=r.charAt((i&3)<<4),a+="==";break}if(p=t.charCodeAt(n++),n==o){a+=r.charAt(i>>2),a+=r.charAt((i&3)<<4|(p&240)>>4),a+=r.charAt((p&15)<<2),a+="=";break}E=t.charCodeAt(n++),a+=r.charAt(i>>2),a+=r.charAt((i&3)<<4|(p&240)>>4),a+=r.charAt((p&15)<<2|(E&192)>>6),a+=r.charAt(E&63)}return a},this.decode=function(t){var a,n,o,i,p,E,C;for(E=t.length,p=0,C="";p<E;){do a=e[t.charCodeAt(p++)&255];while(p<E&&a==-1);if(a==-1)break;do n=e[t.charCodeAt(p++)&255];while(p<E&&n==-1);if(n==-1)break;C+=String.fromCharCode(a<<2|(n&48)>>4);do{if(o=t.charCodeAt(p++)&255,o==61)return C;o=e[o]}while(p<E&&o==-1);if(o==-1)break;C+=String.fromCharCode((n&15)<<4|(o&60)>>2);do{if(i=t.charCodeAt(p++)&255,i==61)return C;i=e[i]}while(p<E&&i==-1);if(i==-1)break;C+=String.fromCharCode((o&3)<<6|i)}return C},this.utf16to8=function(t){var a,n,o,i;for(a="",o=t.length,n=0;n<o;n++)i=t.charCodeAt(n),i>=1&&i<=127?a+=t.charAt(n):i>2047?(a+=String.fromCharCode(224|i>>12&15),a+=String.fromCharCode(128|i>>6&63),a+=String.fromCharCode(128|i>>0&63)):(a+=String.fromCharCode(192|i>>6&31),a+=String.fromCharCode(128|i>>0&63));return a},this.utf8to16=function(t){var a,n,o,i,p,E;for(a="",o=t.length,n=0;n<o;)switch(i=t.charCodeAt(n++),i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=t.charAt(n-1);break;case 12:case 13:p=t.charCodeAt(n++),a+=String.fromCharCode((i&31)<<6|p&63);break;case 14:p=t.charCodeAt(n++),E=t.charCodeAt(n++),a+=String.fromCharCode((i&15)<<12|(p&63)<<6|(E&63)<<0);break}return a},this.charToHex=function(t){var a,n,o;for(a="",n=0;n<t.length;)o=t.charCodeAt(n++).toString(16),a+="\\0x"+o,a+=n>0&&n%8==0?`\r
|
|
6
|
+
`:", ";return a}}function Ca(){var r=0,e=new Object;this.add=function(t,a){this.containsKey(t)||r++,e[t]=a},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&r--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var a in e)if(e[a]==t)return!0;return!1},this.getValues=function(){var t=[];for(var a in e)t.push(e[a]);return t},this.getKeys=function(){var t=[];for(var a in e)t.push(a);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function Na(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new Ca,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,a){var n=Object.id(a).toString();this.callbacks_.add(n,a);var o={MsgId:n,Method:e+"|"+r};t&&(o.Param=JSON.stringify(t));var i=JSON.stringify(o);this.connect&&this.ws.send(i)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),a=t.MsgId;if(this.callbacks_.containsKey(a)){var n=this.callbacks_.getValue(a);n(t.Result,t.Response),this.callbacks_.remove(a)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},a){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],a)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:a},n){this.exec("Arm_VerifyPIN",[parseInt(e),a,t],n)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},a){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],a)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},a){this.exec("Arm_LEDControl",[parseInt(e),t],a)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},a){this.exec("Arm_SwitchProtocol",[parseInt(e),t],a)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:a,AttrBuffer:n},o){this.exec("Arm_CreateFile",[parseInt(e),a,parseInt(t),n],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:a,FileOffset:n,DataInput:o},i){this.exec("Arm_WriteFile",[parseInt(e),a,parseInt(t),parseInt(n),o],i)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:a},n){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),a],n)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:a,DataLen:n},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),a,a.length,parseInt(n)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:a},n){this.exec("Arm_DeleteFile",[parseInt(e),a,parseInt(t)],n)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:a},n){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),a],n)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:a},n){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),a],n)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},a){this.exec("Arm_WriteShareMemory",[parseInt(e),t],a)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},a){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],a)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:a,TryCount:n,PinFlag:o},i){this.exec("Arm_ChangePIN",[parseInt(e),o,a,t,parseInt(n)],i)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},a){this.exec("Arm_ResetUserPIN",[parseInt(e),t],a)},this.Arm_SetUserID=function({Handle:e,UserID:t},a){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],a)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},a){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],a)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},a){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},a){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},a){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:a,RsaPriFileID:n,RsaPriFileSize:o},i){this.exec("Arm_RsaPri",[parseInt(e),parseInt(n),parseInt(o),t,a],i)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:a,RsaPubInData:n,RsaPubFileSize:o},i){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),a,t,t.length,n],i)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:a},n){this.exec("Arm_EccSign",[parseInt(e),parseInt(a),t],n)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:a,EccSignData:n},o){this.exec("Arm_EccVerify",[parseInt(e),a,a.length,t,n],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:a},n){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(a),t],n)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:a,Sm2SignData:n},o){this.exec("Arm_Sm2Verify",[parseInt(e),a,a.length,t,n],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:a,TdesInData:n},o){this.exec("Arm_TDES",[parseInt(e),parseInt(a),t,n],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:a,Sm4InData:n},o){this.exec("Arm_SM4",[parseInt(e),parseInt(a),t,n],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:a},n){this.exec("Arm_HASH",[parseInt(e),t,a],n)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:a},n){this.exec("Arm_Seed",[parseInt(e),a,t],n)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},a){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],a)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:a,SonCount:n,StartUserID:o,AdminTryCount:i,UserPin:p,UserTryCount:E,UpdateRSAPriKey:C},ae){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),a,p,parseInt(E),parseInt(i),C,parseInt(o),parseInt(n)],ae)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},a){this.exec("Arm_InitSon",[parseInt(e),t],a)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},a){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],a)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:a,FileID:n,FileType:o,Offset:i,DataLen:p,DataBuffer:E,UpRSAPubKey:C},ae){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,a,o,parseInt(n),parseInt(i),E,C,parseInt(p)],ae)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:a,FileID:n,FileType:o,Offset:i,DataLen:p,DataBuffer:E},C){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,a,o,parseInt(n),parseInt(i),E,parseInt(p)],C)},this.Arm_Update=function({Handle:e,UpdateData:t},a){this.exec("Arm_Update",[parseInt(e),t],a)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:a},n){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(a)],n)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:a,Priv:n,IsReset:o,IsDecOnRAM:i},p){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[a,parseInt(t),parseInt(e),parseInt(n),parseInt(i),parseInt(o)],p)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},a){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},a){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},a){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],a)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:a,IsDecOnRAM:n},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(n),parseInt(a)],o)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:a,InBuffer:n,CallLimit:o},i){this.exec("Arm_Set_EXE_FILE_INFO",[n,parseInt(a),parseInt(e),parseInt(o),t,t.length],i)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const xa={HID:0},Te={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},qe={USER:0};class gt{constructor(){ne(this,"Base64",new ba);ne(this,"AtlCtrl",null);ne(this,"ArmCount",0);ne(this,"ArmIndex",0);ne(this,"ArmHandle",0);ne(this,"ArmRandom","");try{this.AtlCtrl=new Na("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((a,n)=>{a?(this.ArmCount=+n,e(n)):t(n)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,a)=>{this.AtlCtrl.Arm_Open({Index:e},(n,o)=>{n?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,a(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_Close({Handle:e},(n,o)=>{n?t(o):a(o)})})}armChangePIN(e,t,a=255,n=qe.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,p)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:a,PinFlag:n},(E,C)=>{E&&C==0?(this.ArmPin=e,i(C)):p(C)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,i)=>{o?(this.ArmRandom=i,a(i)):n(i)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(n,o)=>{n?(this.ArmDeadline=o,t(o)):a(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,i)=>{o?(this.ArmUKey=i,a(i)):n(i)})})}armGetDongleInfo(e=0,t=Te.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((a,n)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,i)=>{if(o){switch(t){case Te.USER_ID:this.ArmUid=i;break;case Te.PRODUCT_ID:this.ArmPid=i;break;case Te.HARDWARE_ID:this.ArmHid=i;break}a(i)}else n(i)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_RFS({Handle:e},(n,o)=>{n&&o==0?t(o):a(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,i)=>{if(o&&i.length>0)try{i=this.Base64.decode(i),a(i)}catch(p){console.error(p),a(i)}else n(i)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(n,o)=>{n&&o==0?t(o):a(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSwitchProtocol(e=xa.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armVerifyPIN(e,t=qe.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:a,UserPin:e,UserType:t},(i,p)=>{i&&p==0?(this.ArmPin=e,n(p)):o(p)})})}armReadData(e=0,t=128,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_ReadData({Handle:a,Offset:e,ReadLength:t},(i,p)=>{i?(this.ArmData=p,n(p)):o(p)})})}armWriteData(e,t=0,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_WriteData({Handle:a,Offset:t,DataInput:e},(i,p)=>{i&&p==0?n(p):o(p)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(n,o)=>{n?(this.ArmData=o,t(o)):a(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,i)=>{o&&i==0?a(i):n(i)})})}}const _t="0123456789abcdeffedcba9876543210",wt="4b0de988570c3a0f",ka=window.ENCRYPT;let he=ka&&new gt;function vt(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",a=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*a)],r--;return t}function Et(){return q(this,null,function*(){return he||(he=new gt),new Promise((r,e)=>{he.armEnum().then(t=>{r(+t)}).catch(t=>{H.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Ce.throttle(()=>q(exports,null,function*(){const r=yield Et(),e={};if(typeof r!="number"||r<=0)H.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Pa();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(H.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(H.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Ra(r=0){return q(this,null,function*(){return he?new Promise((e,t)=>{he.armGetDongleInfo(r).then(a=>{a?e(a):(H.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(a))}).catch(a=>{t(a)})}):H.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Pa(){return q(this,null,function*(){if(!he)return H.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield Et();let e=[];for(let t=0;t<r;t++){const a=yield Ra(t);e.push(a)}return e})}vt(16);vt(16);const It=window.meta.app.inspect?le.SM4.constants.CBC:le.SM4.constants.ECB,{publicKey:cn,privateKey:dn}=le.SM2.generateKeyPair();function Da(r,e,t={}){const a=yt(wt),n=t.mode||It;t=n===le.SM4.constants.ECB?l({mode:n,inputEncoding:"utf8",outputEncoding:"hex"},t):l({iv:_t,mode:n,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=le.SM4.encrypt(r,a,t)}catch(i){console.log("err: ",i)}return o}function Oa(r,e,t={}){const a=yt(wt),n=t.mode||It;return t=n===le.SM4.constants.ECB?l({mode:n,inputEncoding:"hex",outputEncoding:"utf8"},t):l({iv:_t,mode:n,inputEncoding:"hex",outputEncoding:"utf8"},t),le.SM4.decrypt(r,a,t)}function yt(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}function Se(r){return r=At&&Ue(r)?Oa(r):r,Ue(r)?JSON.parse(r):r}function je(r){return r=At&&Ue(r)?Da(r):r,JSON.stringify(r)}function ue(r,e,t,a){const n=new StorageEvent("storage",{url:window.location.href,key:r,oldValue:e,newValue:t,storageArea:a});window.dispatchEvent(n)}const ze={getLocal:r=>{try{const e=window.localStorage.getItem(r);return Se(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{const t=window.localStorage.getItem(r),a=je(e);window.localStorage.setItem(r,a),ue(r,t,a,window.localStorage)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||Me(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const a=window.localStorage.key(e);r((void 0).getLocal(a),a)}},clearLocal:()=>{window.localStorage.clear(),ue(null,null,null,window.localStorage)},removeLocal:r=>{const e=window.localStorage.getItem(r);window.localStorage.removeItem(r),ue(r,e,null,window.localStorage)},getSession:r=>{try{const e=window.sessionStorage.getItem(r);return Se(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{const t=window.sessionStorage.getItem(r),a=je(e);window.sessionStorage.setItem(r,a),ue(r,t,a,window.sessionStorage)}catch(t){console.error(t)}},eachSession:r=>{if(!r||Me(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const a=window.sessionStorage.key(e);r((void 0).getSession(a),a)}},clearSession:()=>{window.sessionStorage.clear(),ue(null,null,null,window.sessionStorage)},removeSession:r=>{const e=window.sessionStorage.getItem(r);window.sessionStorage.removeItem(r),ue(r,e,null,window.sessionStorage)},onStorageChange:r=>{if(!r||Me(r)!=="Function")return console.error("传递参数非函数类型!");const e=t=>{r({url:t.url,key:t.key,newValue:t.newValue?Se(t.newValue):null,oldValue:t.oldValue?Se(t.oldValue):null,storageArea:t.storageArea})};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},Xe=r=>{const{quality:e,value:t,function_id:a}=r;return(e>>7&1)===1||e===0&&a===2&&t===1},Qe="USER_TOKEN",Je="STATION_ID",La=[{key:0,value:"离线"},{key:1,value:"在线"}],Ma=[{key:0,value:"反向"},{key:1,value:"正向"},{key:2,value:"停止"}],Fa=[{key:1,value:1},{key:2,value:2},{key:3,value:3},{key:4,value:4},{key:5,value:5}],Ua="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",re=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}]}]},Tt=window.meta.graph.lightPlateColorMap?window.meta.graph.lightPlateColorMap:{0:"#00d200",1:"#e2ac06",2:"#fa800a",3:"#f04155",4:"#ff0000"},St=window.meta.graph.lightPlateTextMap?window.meta.graph.lightPlateTextMap:{0:"#fff",1:"#fff",2:"#fff",3:"#fff",4:"#fff"},L={form:[{name:"带电状态",key:"charged_state",type:"select",dataIds:{},options:La.map(r=>({label:r.value,value:r.key}))},{name:"潮流方向",key:"electric_direction",type:"select",dataIds:{},options:Ma.map(r=>({label:r.value,value:r.key}))},{name:"电荷大小",key:"electric_size",type:"select",dataIds:{},options:Fa.map(r=>({label:r.value,value:r.key}))}],anchors:[{x:0,y:.5,id:"0"},{x:.5,y:0,id:"1"},{x:1,y:.5,id:"2"},{x:.5,y:1,id:"3"}],dataType:window.dataType,dataProp:window.dataProp,visibleLevel:window.visibleLevel},h=x(l({penType:b.NORMAL},L),{form:[...re[b.NORMAL],...L.form]});O.YX,O.YX,O.YX,b.POINT_VALUE,L.anchors,window.visibleLevel,L.form,L.form,window.dataType,window.dataProp,window.visibleLevel,L.form,window.dataType,window.dataProp,window.visibleLevel,L.form,window.dataType,window.dataProp,window.visibleLevel,St[0],b.LIGHT_PLATE,Tt[0],L.anchors,window.visibleLevel,[...re[b.LIGHT_PLATE],...L.form],be+"",b.SENSOR,L.anchors,window.visibleLevel,[...re[b.LIGHT_PLATE],...L.form],x(l({width:100,height:30,name:"text",penName:"文本",text:"文本",disableAnchor:!0,penType:b.TEXT},L),{form:[...re[b.TEXT],...L.form]}),l({width:100,height:100,name:"square",penName:"正方形"},h),x(l({type:1,name:"line",width:100,height:5,lineWidth:2,lineName:"line",penName:"line",background:"#FFF000",color:"#FFF000"},h),{lineAnimateType:1,anchors:[{x:0,y:.5,id:"0"},{x:1,y:.5,id:"1"}]}),l({width:200,height:50,borderRadius:0,name:"rectangle",penName:"矩形"},h),l({width:100,height:100,name:"circle",penName:"圆"},h),l({width:100,height:100,name:"triangle",penName:"三角形"},h),l({width:100,height:100,name:"diamond",penName:"菱形"},h),l({width:100,height:100,name:"pentagon",penName:"五边形"},h),l({width:100,height:100,name:"hexagon",penName:"六边形"},h),l({width:100,height:100,name:"pentagram",penName:"五角星"},h),l({width:120,height:60,name:"leftArrow",penName:"左箭头"},h),l({width:120,height:60,penName:"右箭头",name:"rightArrow"},h),l({width:150,height:60,name:"twowayArrow",penName:"双向箭头"},h),l({width:100,height:100,name:"cloud",penName:"云"},h),l({textTop:-.1,width:100,height:100,name:"message",penName:"消息框"},h),l({width:80,height:100,name:"file",penName:"文件"},h),x(l({width:60,height:100,name:"cube",penName:"立方体",z:.25},h),{props:{custom:[{key:"z",label:"Z",type:"number",min:0,placeholder:"<= 1 即宽度的比例"},{key:"backgroundFront",label:"前背景色",type:"color"},{key:"backgroundUp",label:"顶背景色",type:"color"},{key:"backgroundRight",label:"右背景色",type:"color"}]}}),l({width:70,height:100,name:"people",penName:"人"},h),x(l({name:"rectangle",penName:"按钮",width:80,height:30,borderRadius:.2,text:"按钮",background:"#1890ff",color:"#1890ff",textColor:"#fff",activeBackground:"#40a9ff",activeColor:"#40a9ff",activeTextColor:"#fff",hoverBackground:"#40a9ff",hoverColor:"#40a9ff",hoverTextColor:"#fff"},h),{penType:b.BUTTON}),x(l({name:"rectangle",penName:"输入框",height:50,width:200,input:!0,borderRadius:.05,ellipsis:!0,text:"输入数据",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10},h),{penType:b.INPUT}),x(l({name:"rectangle",penName:"选择器",height:50,width:200,borderRadius:.05,ellipsis:!0,text:"选项1",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10,dropdownList:[{text:"选项1"},{text:"选项2"},{text:"选项3"}]},h),{penType:b.SELECT}),x(l({name:"slider",penName:"进度条",width:300,height:30,value:10,textWidth:50,barHeight:4,fontSize:20,min:0,max:100,color:"#1890ff",background:"#D4D6D9",textColor:"#222",unit:"%"},h),{penType:b.SLIDER}),x(l({name:"time",penName:"时间",width:300,height:40,text:`${Gt().format("YYYY-MM-DD HH:mm:ss")}`,lineWidth:0,fontSize:20,interval:67,fillZero:!0},h),{penType:b.TIME,form:[{key:"timeFormat",name:"显示格式",type:"text"},{key:"fillZero",name:"是否补0",type:"switch"},...h.form],timeFormat:"`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"}),x(l({name:"switch",penName:"开关",height:30,width:60,checked:!1,offColor:"#BFBFBF",onColor:"#1890ff",disableOffColor:"#E5E5E5",disableOnColor:"#A3D3FF",locked:0},h),{penType:b.SWITCH}),x(l({name:"radio",penName:"单选框",direction:"horizontal",width:150,height:30,checked:"",options:[{text:"选项一"},{text:"选项二"},{text:"选项三",isForbidden:!0}]},h),{penType:b.RADIO}),x(l({name:"checkbox",penName:"多选框",width:30,height:30,checked:!0,value:"选项一"},h),{penType:b.CHECKBOX}),x(l({name:"table2",penName:"表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","物联网设备/智能家居/智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),x(l({name:"table2",penName:"斑马纹表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!0,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","物联网设备/智能家居/智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),x(l({name:"table2",penName:"滚动表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,swiper:!0,maxNum:5,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}],["5","智能家居","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),x(l({name:"svg",width:100,height:100,image:be+"/icon/audio.svg",audioId:"",penName:"音频",datable:!0,penType:b.AUDIO},L),{form:[...re[b.AUDIO],...L.form],events:[{name:"enter",action:Ee.Emit,value:Y.OPEN_AUDIO,where:{type:""},params:JSON.stringify({action:Y.OPEN_AUDIO,data:""})},{name:"leave",action:Ee.Emit,value:Y.CLOSE_AUDIO,where:{type:""},params:JSON.stringify({action:Y.CLOSE_AUDIO,data:""})}]}),x(l({name:"svg",width:100,height:100,image:be+"/icon/camera.svg",cameraId:"",penName:"摄像机",datable:!0,events:[{name:"enter",action:Ee.Emit,value:Y.OPEN_CAMERA,where:{type:""},params:JSON.stringify({action:Y.OPEN_CAMERA,data:""})},{name:"leave",action:Ee.Emit,value:Y.CLOSE_CAMERA,where:{type:""},params:JSON.stringify({action:Y.CLOSE_CAMERA,data:""})}],penType:b.CAMERA},L),{form:[...re[b.CAMERA],...L.form]}),x(l({name:"video",width:100,height:100,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penName:"MP4",penType:b.MP4},L),{form:[...re[b.MP4],...L.form]}),x(l({name:"video",width:100,height:100,penName:"视频流",datable:!0,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penType:b.VIDEO_STREAM},L),{form:[...re[b.VIDEO_STREAM],...L.form]}),l({text:"开始/结束",width:120,height:40,borderRadius:.5,name:"rectangle",penName:"开始/结束"},h),l({text:"流程",width:120,height:40,name:"rectangle",penName:"流程"},h),l({text:"判定",width:120,height:60,name:"diamond",penName:"判定"},h),l({text:"数据",width:120,height:50,name:"flowData",penName:"数据",offsetX:.14},h),l({text:"准备",width:120,height:50,name:"hexagon",penName:"准备"},h),l({text:"子流程",width:120,height:50,name:"flowSubprocess",penName:"子流程"},h),l({text:"数据库",width:80,height:120,name:"flowDb",penName:"数据库"},h),l({text:"文档",width:120,height:100,name:"flowDocument",penName:"文档"},h),l({text:"内部存储",width:120,height:80,name:"flowInternalStorage",penName:"内部存储"},h),l({text:"外部存储",width:120,height:80,name:"flowExternStorage",penName:"外部存储"},h),l({text:"队列",width:100,height:100,name:"flowQueue",penName:"队列"},h),l({text:"手动输入",width:120,height:80,name:"flowManually",penName:"手动输入"},h),l({text:"展示",width:120,height:80,name:"flowDisplay",penName:"展示"},h),l({text:"并行模式",width:120,height:50,name:"flowParallel",penName:"并行模式"},h),l({text:"注释",width:100,height:100,name:"flowComment",penName:"注释"},h),l({text:"",width:30,height:30,name:"circle",penName:"开始",background:"#555",lineWidth:0},h),l({width:30,height:30,name:"activityFinal",penName:"结束"},h),l({text:"活动",width:120,height:50,borderRadius:.25,name:"rectangle",penName:"活动"},h),l({text:"决策/合并",width:120,height:50,name:"diamond",penName:"决策/合并"},h),l({text:"垂直泳道",width:200,height:500,name:"swimlaneV",penName:"垂直泳道",textBaseline:"top",textTop:20,lineTop:.08},h),l({text:"水平泳道",width:500,height:200,name:"swimlaneH",penName:"水平泳道",textWidth:.01,textLeft:.04,textAlign:"left",lineLeft:.08},h),l({text:"垂直分岔/汇合",width:10,height:150,name:"forkV",penName:"垂直分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({text:"水平分岔/汇合",width:150,height:10,name:"forkH",penName:"水平分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({name:"andGate",penName:"与门",width:100,height:150},h),l({name:"basicEvent",penName:"基本事件",width:100,height:150},h),l({name:"unexpandedEvent",penName:"未展开事件",width:100,height:150},h),l({name:"priorityAndGate",penName:"优先AND门",width:100,height:150},h),l({name:"forbiddenGate",penName:"禁止门",width:100,height:150},h),l({name:"event",penName:"事件",width:100,height:150},h),l({name:"switchEvent",penName:"开关事件",width:100,height:150},h),l({name:"conditionalEvent",penName:"条件事件",width:150,height:100},h),l({name:"transferSymbol",penName:"转移符号",width:100,height:150},h),l({name:"orGate",penName:"或门",width:100,height:150},h),l({name:"xorGate",penName:"异或门",width:100,height:150},h),l({name:"votingGate",penName:"表决门",width:100,height:150},h);const Ga=(r,e={isDev:!1,devServerUrl:"",devServerPort:8443})=>r.replace(/(https?:\/\/)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(:(\d+))?/,`$1${e.isDev?e.devServerUrl:Jt}:${e.isDev?e.devServerPort:ea}`),xe=(r,e)=>{const t=r.__vccOpts||r;for(const[a,n]of e)t[a]=n;return t},Ba={class:"props-panel__title"},Va={class:"props-panel__value"},Ha={class:"props-panel__value-num"},Ka=Object.assign({name:"PropsPanle"},{__name:"PropsPanle",props:{data:{type:Object,default:null}},emits:["close"],setup(r,{emit:e}){const t=r,a=e;function n(i){return i==null||i==="—"?"—":typeof i=="number"?i.toFixed(2):i}const o=()=>{a("close")};return(i,p)=>{var E,C;return c.openBlock(),c.createElementBlock("div",{class:"props-panel",onMouseleave:o},[c.createElementVNode("div",Ba,c.toDisplayString(((E=t==null?void 0:t.data)==null?void 0:E.name)||"—"),1),p[1]||(p[1]=c.createElementVNode("div",{class:"props-panel__label"},"脉冲峰值",-1)),c.createElementVNode("div",Va,[c.createElementVNode("span",Ha,c.toDisplayString(n((C=t==null?void 0:t.data)==null?void 0:C.value)),1),p[0]||(p[0]=c.createElementVNode("span",{class:"props-panel__unit"},"dBm",-1))])],32)}}}),Wa=xe(Ka,[["__scopeId","data-v-343ad322"]]);class Ya{constructor(e){ne(this,"editor");this.editor=e}initPlugin(e,t,a={}){e.installPenPlugins({name:t},[{plugin:Bt.mindBoxPlugin,options:a},{plugin:Vt.collapseChildPlugin,options:a}])}}const $a="original_meta2d";function qa(){return localStorage.removeItem($a)}let Ae={};const ja=r=>{const e=document.querySelectorAll("video");let t=null;if(e.forEach(n=>{n.getAttribute("src")===r.video&&(t=n)}),!t)return;t.setAttribute("muted","muted"),t.setAttribute("autoplay","autoplay"),t.setAttribute("loop","loop"),t.setAttribute("crossorigin",""),t.setAttribute("controls",""),t.style.display="none",t.parentElement.style.border="2px solid #ffc878";const a=new JessibucaPro({container:t.parentElement,background:"",hasControl:!1,controlAutoHide:!0,checkFirstIFrame:!0,debug:!1,decoder:"./wasm/decoder-pro.js",forceNoOffscreen:!0,hotKey:!1,hasAudio:!1,hasVideo:!0,hiddenAutoPause:!1,isFlv:!0,isResize:!1,isNotMute:!0,loadingIcon:!0,loadingText:"加载中...",networkDelayTimeoutReplay:!1,playbackForwardMaxRateDecodeIFrame:8,showBandwidth:!1,showPerformance:!1,syncAudioAndVideo:!0,supportDblclickFullscreen:!1,timeout:10,useMSE:!0,useWCS:!1,useSIMD:!0,useVideoRender:!0,useCanvasRender:!1,videoBuffer:.2,videoBufferDelay:1});return r.autoPlay&&r.streamUrl&&a.play(r.streamUrl),Ae[r.id]=a,a},za=()=>{Object.keys(Ae).forEach(r=>{Ae[r].destroy(),Ae[r]=null}),Ae={}},Xa={class:"sy-empty"},Qa={key:1,class:"sy-empty-picture"},Ja={class:"sy-empty-description"},Za=Object.assign({name:"SyEmpty"},{__name:"index",props:{image:{type:String,default:"empty"},imageSize:{type:Number,default:80},description:{type:String,default:"暂无数据"},onlyText:{type:Boolean,default:!1}},setup(r){c.useCssVars(n=>({a7383bac:a.value.width,v736d2d7a:a.value.height}));const e=r,t=c.computed(()=>({"font-size":e.imageSize?`${e.imageSize}px`:"80px"})),a=c.computed(()=>e.imageSize?{width:e.imageSize*1.2+"px",height:e.imageSize+"px"}:{width:"187px",height:"144px"});return(n,o)=>{const i=c.resolveComponent("SyIcon"),p=c.resolveComponent("el-icon");return c.openBlock(),c.createElementBlock("div",Xa,[r.image!=="empty"?(c.openBlock(),c.createElementBlock("span",{key:0,class:"sy-empty-image",style:c.normalizeStyle(t.value)},[r.image!=="loading"?(c.openBlock(),c.createBlock(i,{key:0,name:r.image,gradient:""},null,8,["name"])):(c.openBlock(),c.createBlock(p,{key:1,class:"is-loading",style:{color:"#1671d4"}},{default:c.withCtx(()=>[c.createVNode(c.unref(Yt.Loading))]),_:1}))],4)):r.onlyText?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",Qa)),c.createElementVNode("div",Ja,[c.createElementVNode("p",null,c.toDisplayString(r.description),1)])])}}}),en=xe(Za,[["__scopeId","data-v-247a0fc9"]]),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(r,{expose:e,emit:t}){const a=t,n=r,o=c.ref(null),i=c.shallowRef(),p=c.computed(()=>!!(n.data||n.url));c.watch(()=>[n.data,n.url],()=>{p.value&&C()});let E=c.ref(!0);function C(){return q(this,null,function*(){try{if(E.value=!0,yield c.nextTick(),!o.value){console.error("未找到meta2d元素!");return}let w=null;if(n.data?w=n.data:n.url&&(w=yield _e()),!w||!w.data){E.value=!1,console.log("图纸数据为空"),a("load-error");return}const N=w.options||{background:"#eee",disableAnchor:!1};if(i.value&&(i.value.destroy(!0),i.value=null),!o.value){console.error("Meta2D 容器元素不可用");return}i.value=new U.Meta2d(o.value,l({},N)),N.visibleLevel&&i.value.scale(N.visibleLevel),ae(),J(),yield Z(w.data),i.value.render(),oe(),setTimeout(()=>{window.meta2dTools&&window.registerToolsNew()},1e3),a("loaded",i.value)}catch(w){console.error("初始化编辑器失败:",w)}})}function ae(){if(!i.value)return;new Ya({}).initPlugin(i.value,"mindNode",{})}function J(){U.register(Kt.classPens()),U.register(Ve.flowPens()),U.registerAnchors(Ve.flowAnchors()),U.register(He.sequencePens()),U.registerCanvasDraw(He.sequencePensbyCtx()),U.register(Ke.activityDiagram()),U.registerCanvasDraw(Ke.activityDiagramByCtx()),U.registerCanvasDraw(Ht.formPens()),U.registerCanvasDraw(Wt.chartsPens()),U.register(Pe.ftaPens()),U.registerAnchors(Pe.ftaAnchors()),U.registerCanvasDraw(Pe.ftaPensbyCtx())}function Z(w){var N;if(i.value){if(typeof w.locked=="undefined"&&(w.locked=0),w.bkImage&&i.value.setBackgroundImage(w.bkImage),w.pens&&w.pens.length>0){const M=[];w.pens.forEach(T=>{T.name==="video"&&T.streamUrl?M.push(T):T.name==="image"&&T.image?T.image=Ga(T.image,n.devConfig):T.lineType==="gisLine"?T.visible=!n.preview:T.penType===b.TABLE&&T.dataType&&P(T)}),M.length>0&&setTimeout(()=>{M.forEach(T=>{ja(T)})},500);const X=window.meta.graph.penCountThreshold||2e3;w.pens.length>X&&w.scale&&w.pens.forEach(T=>{const B=T.visibleLevel;B!==void 0?(T.visible=w.scale>=B,T.visible||(T.disabled=!0,T.locked=U.LockState.Disable)):(T.visible=!0,T.disabled=!1,T.locked=U.LockState.None)})}i.value.open(w),!n.preview&&((N=w.networks)!=null&&N.length)&&i.value.closeNetwork()}}const P=w=>q(this,null,function*(){var M;const N=yield ie.getCommonApi(zt[w.dataType],{offset:0,limit:w.tableSize||10});if((M=N.data)!=null&&M.length){const X=w.tableHeader||[{prop:"id",label:"ID"},{prop:"guid",label:"标识"},{prop:"name",label:"名称"}],$=N.data.map(T=>X.filter(B=>B.isShow).map(B=>{const K=T[B.prop];return B.choices?B.choices[K]||K:Ce.isObject(K)?K.name:K}));i.value.setValue({id:w.id,dataY:$})}else i.value.setValue({id:w.id,dataY:[]})}),oe=()=>{i.value&&(i.value.on("scale",ee),n.preview||i.value.on("connectLine",pe))},ee=Ce.debounce(w=>{var N,M,X,$;try{if(!i.value)return;Fe.emit("graph-scale",w);let T=i.value.store.data.pens;const B=window.meta.graph.penCountThreshold||2e3,K=T.length>B;for(let F=0;F<T.length;F++){const D=T[F];if([b.VIDEO_STREAM,b.MP4].includes(D.penType)){if(((M=(N=de.videos[D.id])==null?void 0:N.children)==null?void 0:M.length)===3){let j=de.videos[D.id].children[0],Q=de.videos[D.id].children[2];j.style.width=Q.currentTime/Q.duration*D.calculative.worldRect.width+"px"}else if((($=(X=de.videos[D.id])==null?void 0:X.children)==null?void 0:$.length)===2){let j=de.videos[D.id].children[0],Q=de.videos[D.id].children[1];j.style.width=Q.currentTime/Q.duration*D.calculative.worldRect.width+"px"}}if(K){const j=D.visibleLevel!==void 0?w>=D.visibleLevel:!0;i.value._setValue({id:D.id,visible:j,disabled:!j,locked:j?U.LockState.None:U.LockState.Disable})}}i.value.render()}catch(T){console.error("处理缩放失败:",T)}},500),pe=X=>q(this,[X],function*({line:w,lineAnchor:N,pen:M}){var ce;if(N!=null&&N.start||(M==null?void 0:M.penType)!==b.GIS_SENSOR)return;const $=(ce=w==null?void 0:w.calculative)==null?void 0:ce.worldAnchors;if($.length!==2||$!=null&&$.some(fe=>!fe.connectTo))return;const[T,B]=$;if(T.connectTo===B.connectTo)return;const K=window.meta2d.findOne(T.connectTo),F=window.meta2d.findOne(B.connectTo);let D=K==null?void 0:K.bindData,j=F==null?void 0:F.bindData;if(!D||!j)return;const Q=yield ie.postPDApi("setchannelpaired/",{data:[{channel1:D.guid,channel2:j.guid}]}),we=yield ie.postCommonApi("sgpoint",{ln__in:`${D.guid},${j.guid}`,group_number__in:6});Q.success&&we.success?(i.value.setValue({id:w.id,color:"#00d200",lineDash:[3,3],lineWidth:2,lineType:"gisLine"}),H.ElMessage.success("配对成功")):H.ElMessage.error("配对失败",Q.detail||we.detail)});function _e(){return q(this,null,function*(){if(!n.url)return H.ElMessage.error("图纸路径为空!"),null;try{return(yield ie.getGraphApi(n.url,{local:n.local}))||null}catch(w){return null}})}const te=()=>{i.value&&(i.value.resize(),i.value.fitView(!0,10))};return c.onMounted(()=>{var w,N;p.value&&(w=o.value)!=null&&w.clientHeight&&(N=o.value)!=null&&N.clientWidth&&C(),window.addEventListener("resize",te)}),c.onUnmounted(()=>{za(),qa(),i.value&&(n.preview?(pt.clearLineCross(),i.value.destroy(!0)):i.value.off("scale",ee)),window.removeEventListener("resize",te)}),e({stage:i}),(w,N)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"meta2dRef",ref:o,class:"meta2d-editor"},[c.unref(E)?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(en,{key:0,class:"meta2d-empty",description:"图纸不存在"}))],512))}}),an=xe(tn,[["__scopeId","data-v-5fbd34fd"]]),nn={key:0,class:"back-btn"};var mt,ht;const rn=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:((ht=(mt=window.meta)==null?void 0:mt.app)==null?void 0:ht.lang)||"zh-cn"},config:{type:Object,default:()=>({socketUrl:Ye,stationIdKey:Je,enableToken:!0,userTokenKey:Qe,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,enableWebSocket:!0,graphSocket:We.GRAPH.SOCKET})},showMap:{type:Boolean,default:!1},isFactory:{type:Boolean,default:!1},isInitData:{type:Boolean,default:!0},apiInstance:{type:Object,default:()=>ie},mittInstance:{type:Object,default:()=>Fe},customCallbacks:{type:Object,default:()=>({})},errorHandler:{type:Object,default:()=>({callback:null,showMessage:!0})},devConfig:{type:Object,default:()=>({isDev:!1,devServerUrl:"",devServerPort:8443})}},emits:["error","loaded","custom-msg","socket-msg"],setup(r,{expose:e,emit:t}){const a=t,n=r;let o=c.ref(!1),i=c.ref(""),p=c.ref(!1);const E=c.ref(null),C=c.ref(null),ae=c.ref(null),J=c.ref(""),Z=c.ref(!1),P=c.computed(()=>{var s;return(s=ae.value)==null?void 0:s.stage}),oe=c.computed(()=>{var s;return(s=P.value)==null?void 0:s.store}),ee=c.computed(()=>l({socketUrl:Ye,stationIdKey:Je,enableToken:!0,userTokenKey:Qe,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,fitPadding:10,enableWebSocket:!0,graphSocket:We.GRAPH.SOCKET},n.config)),pe=()=>n.apiInstance||ie,_e=()=>n.mittInstance||Fe,te=(s,u="")=>{const A={error:s,message:u,timestamp:new Date().toISOString()};a("error",A),n.errorHandler.callback?n.errorHandler.callback(A):n.errorHandler.showMessage&&H.ElMessage&&H.ElMessage.error(`${u}: ${s.message||s}`)},w=()=>{i.value&&(J.value=i.value,Z.value=p.value)},N={},M=c.ref(!1),X=c.ref({left:0,top:0}),$=(s,u)=>{if(!E.value)return{left:s+20,top:u+20};const A=E.value.getBoundingClientRect(),S=s-A.left,k=u-A.top;let y=300,v=150;if(C.value){const g=C.value.$el||C.value;g&&g.offsetWidth&&(y=g.offsetWidth,v=g.offsetHeight)}let m=S+20,_=k+20;return m+y>A.width&&(m=S-y-20),_+v>A.height&&(_=k-v-20),{left:Math.max(0,Math.min(m,A.width-y)),top:Math.max(0,Math.min(_,A.height-v))}},T=s=>{M.value&&(X.value=$(s.clientX,s.clientY))},B=s=>{var u,A,S,k,y,v;try{if(!s)return;if((u=s==null?void 0:s.includes)!=null&&u.call(s,"token 必传"))return H.ElMessage.warning(s);const m=typeof s=="string"?JSON.parse(s):s;if((m==null?void 0:m.data)==="服务错误"||(S=(A=m==null?void 0:m.data)==null?void 0:A.includes)!=null&&S.call(A,"token is expired"))return H.ElMessage.warning(m.data);switch(a("socket-msg",m),m.action){case De.ACPOINT.YCVALUE:case De.ACPOINT.YXVALUE:if((k=m==null?void 0:m.data)!=null&&k.point_id){const _=P.value.find(m.data.point_id);_&&(N[m.data.point_id]=m.action===De.ACPOINT.YXVALUE?ye(m.data.value)?m.data.value:0:ye(m.data.value_disp||m.data.value)?m.data.value_disp||m.data.value:0,ve(_,m.data))}break;default:if(((y=m.data)==null?void 0:y.length)>0){const _=setTimeout(()=>{clearTimeout(_),P.value&&(m.data.forEach(g=>{N[g.dataId||g.point_id]=g.value_disp||g.value}),m.data.forEach(g=>{const I=P.value.find(g.dataId||g.point_id);ve(I,g)}))},ee.value.messageDelay);n.customCallbacks.onWebSocketMessage&&n.customCallbacks.onWebSocketMessage(m),(v=window.customSocketFn)==null||v.call(window,s)}break}return!0}catch(m){return te(m,"WebSocket消息处理"),!0}},K=c.ref({});let F={},D=null;const j=s=>q(this,null,function*(){try{if(s.msgName)switch(s.msgName){case Y.CHANGE_GRAPH:case Y.NOTIFY_DIALOG:case Y.GIS_PROPS_PANEL:Q(s);break}else Q(s);a("custom-msg",s),n.customCallbacks.onCustomMessage&&n.customCallbacks.onCustomMessage(s)}catch(u){te(u,"自定义消息处理")}}),Q=s=>{var S,k;let u;if(s.params)try{u=JSON.parse(s.params)}catch(y){u=s.params}switch(s.msgName){case Y.CHANGE_GRAPH:(u==null?void 0:u.data)!=="图纸id"?(i.value=J.value,p.value=Z.value,o.value=u.isBack,(S=u==null?void 0:u.data)!=null&&S.startsWith("/")?(J.value=u==null?void 0:u.data,Z.value=!0):(Z.value=!1,ce(u.data))):console.warn("切换图纸信息为空");break;case Y.NOTIFY_DIALOG:u.msg!=="通知内容"?H.ElNotification(l({message:u.msg},u)):console.warn("通知内容为空");break;case Y.GIS_PROPS_PANEL:s.eventName==="enter"?(M.value=!0,K.value=((k=s==null?void 0:s.pen)==null?void 0:k.bindData)||{},s.e&&(X.value=$(s.e.clientX,s.e.clientY))):(M.value=!1,K.value={});break}},we=s=>{var u,A,S,k,y,v,m,_,g;try{a("loaded",s);const I=$e(),d=ee.value,f=ze.getSession(d.stationIdKey),V=ze.getSession(d.userTokenKey);d.enableWebSocket&&f&&V&&((S=(A=(u=s.store)==null?void 0:u.data)==null?void 0:A.networks)!=null&&S.length?(v=(y=(k=s.store)==null?void 0:k.data)==null?void 0:y.networks)==null||v.forEach(W=>{var se;W.protocol==="websocket"&&((se=W.url)!=null&&se.includes("station_id")||(W.url=`${W.url}?station_id=${f}`),d.enableToken?W.protocols=d.userToken||V:W.protocols=void 0)}):(_=(m=s.store)==null?void 0:m.data)!=null&&_.websocket?((g=s.store.data.websocket)!=null&&g.includes("station_id")||(s.store.data.websocket=`${s.store.data.websocket}?station_id=${f}`),d.enableToken?s.store.data.websocketProtocols=d.userToken||V:s.store.data.websocketProtocols=void 0,s.closeSocket(),s.connectSocket()):(s.store.data.websocket=`${d.socketUrl}?station_id=${f}`,d.enableToken?s.store.data.websocketProtocols=V:s.store.data.websocketProtocols=void 0,s.connectWebsocket())),(n.showMap||I.showMap==="true")&&s.showMap(),s.setRule({rule:!1}),s.setOptions({disableRuleLine:!0}),s.setGrid({grid:!1}),s.lock(U.LockState.DisableEdit),ke().forEach(W=>{var se;(se=W==null?void 0:W.events)!=null&&se.length?G({id:W.id,locked:1},!1):G({id:W.id,locked:10},!1)}),s.render(),d.enableAutoFit&&s.fitView(!0,d.fitPadding),Object.values(Y).forEach(W=>{s.on(W,se=>j(x(l({},se),{msgName:W})))}),s&&(s.socketFn=B),n.customCallbacks.onStageLoaded&&n.customCallbacks.onStageLoaded(s),n.isInitData&&bt(s),window.addEventListener("mousemove",T)}catch(I){te(I,"图纸加载完成处理")}},ce=Ce.throttle(s=>q(this,null,function*(){var u;try{if(n.url){Z.value=n.local,yield fe(n.url);return}const A=$e();if(s=s||n.gid||A.id,A.local==="true"&&(Z.value=!0),s){const S=pe();if(S&&S.getCommonApi){const k=yield S.getCommonApi(n.isFactory?"graph":"floorplan",{guid:s});if((u=k.data)!=null&&u.length)yield fe(k.data[0].path);else{const y="未找到图纸!";te(new Error(y),"获取图纸数据")}}else te(new Error("API实例不可用"),"初始化图纸数据!")}else Z.value=n.local,yield fe(n.url);n.customCallbacks.onGraphLoaded&&n.customCallbacks.onGraphLoaded(J.value)}catch(A){te(A,"获取图纸数据失败")}})),fe=s=>q(this,null,function*(){const u=s.split(".");if(s.includes(n.lang)||u.length!==3){J.value=s;return}const A=`${u[0]}.${n.lang}.${u[2]}`;try{const S=yield ie.getGraphApi(A,{local:n.local}).catch(()=>{console.warn("多语言图纸不存在,使用默认图纸")});J.value=S?A:s}catch(S){J.value=s}}),bt=s=>q(this,null,function*(){var u,A,S,k;if(s){let y=[],v=[],m=[];F={};const _=s.store.data.pens;for(let I=0;I<_.length;I++){const d=_[I];d.bindDataId?(u=d.form)!=null&&u.length?d.form.forEach(f=>{if(f.dataIds.dataId)switch(f.dataIds.dataType){case O.YC:y.push(x(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break;case O.YX:v.push(x(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break;case O.SG:v.push(x(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break;case O.POINT:m.push(x(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break}}):(d.penType===b.GIS_SENSOR||d.penType===b.GIS_DB_VALUE)&&d.bindData&&(F[d.bindData.ied_id]||(F[d.bindData.ied_id]=[]),G({id:d.id,title:void 0}),F[d.bindData.ied_id].push(l({penId:d.id,penType:d.penType},d.bindData))):(A=d.statusBindData)!=null&&A.length&&d.statusBindData.forEach(f=>{if(f.dataId)switch(f.dataType){case O.YX:v.push({showChild:0,value:0,nodeName:f.dataName,penId:d.id,penName:d.penName,dataId:f.dataId});break;case O.SG:v.push({showChild:0,value:0,nodeName:f.dataName,penId:d.id,penName:d.penName,dataId:f.dataId});break}})}let g=[];if(y.length){const I=pe();if(I&&I.postCommonApi){const d=yield I.postCommonApi("queryrealtimepoint",{point_id:y.map(f=>{var V;return((V=f==null?void 0:f.dataIds)==null?void 0:V.dataId)||f.dataId}).join(",")});(S=d==null?void 0:d.data)!=null&&S.length&&(d.data.forEach(f=>{N[f.guid]=f.value_disp||f.value}),g=[...g,...d.data])}}if(v.length){const I=pe();if(I&&I.postCommonApi){const d=yield I.postCommonApi("queryrealtimepoint",{point_id:v.map(f=>{var V;return((V=f==null?void 0:f.dataIds)==null?void 0:V.dataId)||f.dataId}).join(",")});(k=d==null?void 0:d.data)!=null&&k.length&&(d.data.forEach(f=>{N[f.guid]=Le(f.value)?Number(f.value):f.value}),g=[...g,...d.data])}}g.length&&g.forEach(I=>{const d=s.find(I.guid);ve(d,x(l({},I),{value:Le(I.value)?ye(Number(I.value))?Number(I.value):0:I.value,value_disp:I.value_disp,alarm_value:I.alarm_value,point_id:I.guid}))}),F&&Object.keys(F).length?(D&&clearInterval(D),Ge(),D=setInterval(()=>{Ge()},3e3)):D&&clearInterval(D)}}),Ge=()=>q(this,null,function*(){var s;if(F){const u=Object.keys(F);if(u.length){const A=yield ie.postPDApi("querychannelstatus/",{data:u.map(S=>({ied_id:S,ln_list:F[S].map(k=>k.ln_id)}))});(s=A==null?void 0:A.data)!=null&&s.length&&(u.forEach(S=>{const k=A.data.find(v=>v.ied_id===S),y=F[S];y!=null&&y.length&&y.forEach(v=>{const m=k.result.find(_=>_.ln_id===v.ln_id);if(m){const _=Le(m.amp_peak)?ye(Number(m.amp_peak))?Number(m.amp_peak):0:m.amp_peak;v.penType===b.GIS_SENSOR?G({id:v.penId,showChild:m.status==="告警"?2:m.status==="正常"?1:0,bindData:x(l({},v),{status:m.status,value:_})},!1):G({id:v.penId,text:`${_} dB`},!1)}})}),P.value.render())}}}),G=(s,u=!0)=>{if(P.value)return P.value.setValue(s,{render:u})},Ct=()=>P.value,ke=()=>{var s,u;return((u=(s=oe.value)==null?void 0:s.data)==null?void 0:u.pens)||[]},Nt=()=>b,ve=(()=>{let s=null;const u=new Map,A=new Map,S=y=>{var m;if(!((m=y.children)!=null&&m.length))return[];const v=y.id||"";if(!v)return[];if(!A.has(v)&&oe.value){const _=U.getAllChildren(y,oe.value);A.set(v,_)}return A.get(v)||[]},k=()=>{if(u.size===0||!P.value||!oe.value)return;const y=[],v=[],m=oe.value.animates;u.forEach(({pen:_,dataItem:g,formKey:I})=>{switch(I){case"showChild":G({id:_.id,showChild:+g.value},!1);break;case"text":G({id:_.id,text:g.value_disp||g.value},!1);break;case"light_plate":{const d=g.value===-1||Xe(g)?"#999999":St[g.value!==void 0?g.value:g.alarm_value],f=g.value===-1||Xe(g)?"#cccccc":Tt[g.value!==void 0?g.value:g.alarm_value];G({id:_.id,textColor:d,background:f},!1)}break;case"point_value":_.penType===b.POINT_VALUE&&S(_).forEach(f=>{f.name==="text"&&G({id:f.id,text:g.value},!1)});break;case"online_state":{let d=g.value?void 0:"contrast(0%)";G({id:_.id,filter:d},!1),S(_).forEach(V=>{G({id:V.id,filter:d},!1)})}break;case"charged_state":{const d=g.value===__$t__.OFFLINE?"contrast(0%)":void 0;d!==_.filter&&(G({id:_.id,filter:d},!1),S(_).forEach(V=>{G({id:V.id,filter:d},!1)}))}break;case"electric_direction":g.value===qt.STOP?m!=null&&m.has(_)&&v.push(_):!!g.value!==_.animateReverse&&(G({id:_.id,animateReverse:!!g.value},!1),m!=null&&m.has(_)||y.push(_));break;case"electric_size":{const d=jt[g.value];d!==void 0&&d!==_.lineWidth&&G({id:_.id,lineWidth:d},!1)}break;default:G({id:_.id,[I]:g.value},!1);break}}),v.length>0&&P.value.stopAnimate(v),y.length>0&&P.value.startAnimate(y),u.clear(),P.value.render()};return(y,v)=>{y!=null&&y.length&&(y.forEach(m=>{var g;const _=m.form;if((g=m.statusBindData)!=null&&g.length){if(!N[v.guid])return;const I=[...m.statusBindData],d=I.findIndex(f=>f.dataId===v.guid);if(d!==-1){const f=I[d];I.find(z=>f.sort<z.sort&&N[z.dataId])||u.set(m.id,{pen:m,formKey:"showChild",dataItem:x(l({},v),{value:d})})}}else _!=null&&_.length&&_.forEach(I=>{if(!(Array.isArray(I.dataIds)?I.dataIds:[I.dataIds]).some(z=>(z==null?void 0:z.dataId)&&((z==null?void 0:z.dataId)===v.dataId||(z==null?void 0:z.dataId)===v.point_id)))return;const V=`${m.id}-${I.key}`;u.set(V,{pen:m,dataItem:v,formKey:I.key})})}),s&&clearTimeout(s),s=setTimeout(()=>{k(),s=null},ee.value.debounceDelay))}})(),xt=s=>{if(P.value){for(let u=0;u<s.length;u++){const A=s[u];N[A.dataId||A.point_id]=A.value_disp||A.value;const S=P.value.find(A.dataId);setTimeout(()=>{ve(S,A)},ee.value.messageDelay)}P.value.render(),n.customCallbacks.onBatchUpdate&&n.customCallbacks.onBatchUpdate(s)}},kt=(s,u=!1)=>{if(!P.value)return;const A=ke();for(let S=0;S<A.length;S++){const k=A[S];let y=!1;u?y=s===k.dataProp:y=s===5?!0:k.dataProp<=s,G({id:k.id,visible:y},!1)}P.value.fitView(),P.value.render(),n.customCallbacks.onLevelChange&&n.customCallbacks.onLevelChange(s,u)};return c.watch(()=>[n.gid,n.url,n.data,n.lang,n.local,n.isFactory],()=>{ce()}),c.watch(()=>n.showMap,s=>{P.value&&(s?P.value.showMap():P.value.hideMap())}),c.onMounted(()=>{const s=_e();s&&s.on&&s.on(ee.value.graphSocket,B),ce()}),c.onUnmounted(()=>{F=null;const s=_e();s&&s.off&&s.off(ee.value.graphSocket,B),window.removeEventListener("mousemove",T)}),e({setValue:G,getStage:Ct,getAllPens:ke,getCustomPenType:Nt,batchUpdatePen:xt,handleLineCross:pt.handleLineCross,changeVisibleByLevel:kt}),(s,u)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"previewRef",ref:E,class:"meta2d-preview"},[c.createVNode(an,{ref_key:"graphRef",ref:ae,url:J.value,local:Z.value,data:n.data,"dev-config":n.devConfig,preview:"",onLoaded:we},null,8,["url","local","data","dev-config"]),c.unref(o)?(c.openBlock(),c.createElementBlock("div",nn,[c.createVNode(c.unref(H.ElButton),{type:"primary",onClick:w},{default:c.withCtx(()=>[...u[1]||(u[1]=[c.createTextVNode("返回",-1)])]),_:1})])):c.createCommentVNode("",!0),M.value?(c.openBlock(),c.createBlock(Wa,{key:1,ref_key:"panelRef",ref:C,data:K.value,style:c.normalizeStyle({top:X.value.top+"px",left:X.value.left+"px",position:"absolute",pointerEvents:"none"}),onClose:u[0]||(u[0]=A=>M.value=!1)},null,8,["data","style"])):c.createCommentVNode("",!0)],512))}}),ge=xe(rn,[["__scopeId","data-v-a2b0488b"]]);ge.name||(ge.name="SyGraph");const on=r=>{r.component(ge.name||"SyGraph",ge)},sn={install:on};exports.SyGraph=ge;exports.default=sn;
|