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