@syhr/sy-three 1.0.0-rc.15 → 1.0.0-rc.16
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-three/sy-three.cjs +4 -23
- package/dist-three/sy-three.css +1 -1
- package/dist-three/sy-three.mjs +1070 -1119
- package/dist-three/sy-three.umd.js +5 -24
- package/package.json +133 -182
- package/CHANGELOG.md +0 -717
- package/readme.text +0 -4
package/dist-three/sy-three.cjs
CHANGED
|
@@ -1,28 +1,9 @@
|
|
|
1
|
-
"use strict";require('./sy-three.css');var
|
|
1
|
+
"use strict";require('./sy-three.css');var Yt=Object.defineProperty,Jt=Object.defineProperties;var Qt=Object.getOwnPropertyDescriptors;var Ye=Object.getOwnPropertySymbols;var Zt=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable;var De=(n,e,t)=>e in n?Yt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,l=(n,e)=>{for(var t in e||(e={}))Zt.call(e,t)&&De(n,t,e[t]);if(Ye)for(var t of Ye(e))en.call(e,t)&&De(n,t,e[t]);return n},R=(n,e)=>Jt(n,Qt(e));var ce=(n,e,t)=>De(n,typeof e!="symbol"?e+"":e,t);var p=(n,e,t)=>new Promise((r,a)=>{var o=c=>{try{u(t.next(c))}catch(f){a(f)}},s=c=>{try{u(t.throw(c))}catch(f){a(f)}},u=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,s);u((t=t.apply(n,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("vue"),tn=require("qs"),nn=require("axios"),rn=require("mitt"),an=require("dayjs"),on=require("lodash-es");require("crypto-js");const de=require("gm-crypto"),se=require("element-plus");require("@element-plus/icons-vue");const Ke=require("pinia"),U=require("three-edit-cores"),M=require("localforage"),sn=require("three/addons/environments/RoomEnvironment.js"),be={YX:6},re={OPEN_CAMERA:"OPEN_CAMERA",CLOSE_CAMERA:"CLOSE_CAMERA",OPEN_AUDIO:"OPEN_AUDIO",CLOSE_AUDIO:"CLOSE_AUDIO"},Ie={Emit:7},Ce={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",SLIDER:"SLIDER",SWITCH:"SWITCH",CHECKBOX:"CHECKBOX",POINT_VALUE:"POINT_VALUE",LIGHT_PLATE:"LIGHT_PLATE",VIDEO_STREAM:"VIDEO_STREAM"},Je={ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"}};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(
|
|
6
|
-
`:", ";return r}}function Hn(){var n=0,e=new Object;this.add=function(t,r){this.containsKey(t)||n++,e[t]=r},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 r in e)if(e[r]==t)return!0;return!1},this.getValues=function(){var t=[];for(var r in e)t.push(e[r]);return t},this.getKeys=function(){var t=[];for(var r in e)t.push(r);return t},this.getSize=function(){return n},this.clear=function(){n=0,e=new Object}}function Bn(n){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new Hn,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,r){var a=Object.id(r).toString();this.callbacks_.add(a,r);var s={MsgId:a,Method:e+"|"+n};t&&(s.Param=JSON.stringify(t));var o=JSON.stringify(s);this.connect&&this.ws.send(o)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),r=t.MsgId;if(this.callbacks_.containsKey(r)){var a=this.callbacks_.getValue(r);a(t.Result,t.Response),this.callbacks_.remove(r)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},r){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],r)},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:r},a){this.exec("Arm_VerifyPIN",[parseInt(e),r,t],a)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},r){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],r)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},r){this.exec("Arm_LEDControl",[parseInt(e),t],r)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},r){this.exec("Arm_SwitchProtocol",[parseInt(e),t],r)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:r,AttrBuffer:a},s){this.exec("Arm_CreateFile",[parseInt(e),r,parseInt(t),a],s)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:r,FileOffset:a,DataInput:s},o){this.exec("Arm_WriteFile",[parseInt(e),r,parseInt(t),parseInt(a),s],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:r},a){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),r],a)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:r,DataLen:a},s){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),r,r.length,parseInt(a)],s)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:r},a){this.exec("Arm_DeleteFile",[parseInt(e),r,parseInt(t)],a)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:r},a){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),r],a)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:r},a){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),r],a)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},r){this.exec("Arm_WriteShareMemory",[parseInt(e),t],r)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},r){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],r)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:r,TryCount:a,PinFlag:s},o){this.exec("Arm_ChangePIN",[parseInt(e),s,r,t,parseInt(a)],o)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},r){this.exec("Arm_ResetUserPIN",[parseInt(e),t],r)},this.Arm_SetUserID=function({Handle:e,UserID:t},r){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],r)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},r){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],r)},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},r){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],r)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},r){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],r)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},r){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],r)},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:r,RsaPriFileID:a,RsaPriFileSize:s},o){this.exec("Arm_RsaPri",[parseInt(e),parseInt(a),parseInt(s),t,r],o)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:r,RsaPubInData:a,RsaPubFileSize:s},o){this.exec("Arm_RsaPub",[parseInt(e),parseInt(s),r,t,t.length,a],o)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:r},a){this.exec("Arm_EccSign",[parseInt(e),parseInt(r),t],a)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:r,EccSignData:a},s){this.exec("Arm_EccVerify",[parseInt(e),r,r.length,t,a],s)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:r},a){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(r),t],a)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:r,Sm2SignData:a},s){this.exec("Arm_Sm2Verify",[parseInt(e),r,r.length,t,a],s)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:r,TdesInData:a},s){this.exec("Arm_TDES",[parseInt(e),parseInt(r),t,a],s)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:r,Sm4InData:a},s){this.exec("Arm_SM4",[parseInt(e),parseInt(r),t,a],s)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:r},a){this.exec("Arm_HASH",[parseInt(e),t,r],a)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:r},a){this.exec("Arm_Seed",[parseInt(e),r,t],a)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},r){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],r)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:r,SonCount:a,StartUserID:s,AdminTryCount:o,UserPin:d,UserTryCount:c,UpdateRSAPriKey:p},A){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),r,d,parseInt(c),parseInt(o),p,parseInt(s),parseInt(a)],A)},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},r){this.exec("Arm_InitSon",[parseInt(e),t],r)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},r){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],r)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:r,FileID:a,FileType:s,Offset:o,DataLen:d,DataBuffer:c,UpRSAPubKey:p},A){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,r,s,parseInt(a),parseInt(o),c,p,parseInt(d)],A)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:r,FileID:a,FileType:s,Offset:o,DataLen:d,DataBuffer:c},p){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,r,s,parseInt(a),parseInt(o),c,parseInt(d)],p)},this.Arm_Update=function({Handle:e,UpdateData:t},r){this.exec("Arm_Update",[parseInt(e),t],r)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:r},a){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(r)],a)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:r,Priv:a,IsReset:s,IsDecOnRAM:o},d){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[r,parseInt(t),parseInt(e),parseInt(a),parseInt(o),parseInt(s)],d)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},r){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],r)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},r){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],r)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},r){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],r)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:r,IsDecOnRAM:a},s){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(a),parseInt(r)],s)},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:r,InBuffer:a,CallLimit:s},o){this.exec("Arm_Set_EXE_FILE_INFO",[a,parseInt(r),parseInt(e),parseInt(s),t,t.length],o)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const Gn={HID:0},we={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},qe={USER:0};class ft{constructor(){ae(this,"Base64",new Un);ae(this,"AtlCtrl",null);ae(this,"ArmCount",0);ae(this,"ArmIndex",0);ae(this,"ArmHandle",0);ae(this,"ArmRandom","");try{this.AtlCtrl=new Bn("{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((r,a)=>{r?(this.ArmCount=+a,e(a)):t(a)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,r)=>{this.AtlCtrl.Arm_Open({Index:e},(a,s)=>{a?(this.ArmHandle=+s,t(s)):(this.ArmHandle=s,r(s))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_Close({Handle:e},(a,s)=>{a?t(s):r(s)})})}armChangePIN(e,t,r=255,a=qe.USER,s=this.ArmHandle){if(this.AtlCtrl)return new Promise((o,d)=>{this.AtlCtrl.Arm_ChangePIN({Handle:s,NewPIN:e,OldPIN:t,TryCount:r,PinFlag:a},(c,p)=>{c&&p==0?(this.ArmPin=e,o(p)):d(p)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(s,o)=>{s?(this.ArmRandom=o,r(o)):a(o)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(a,s)=>{a?(this.ArmDeadline=s,t(s)):r(s)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(s,o)=>{s?(this.ArmUKey=o,r(o)):a(o)})})}armGetDongleInfo(e=0,t=we.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((r,a)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(s,o)=>{if(s){switch(t){case we.USER_ID:this.ArmUid=o;break;case we.PRODUCT_ID:this.ArmPid=o;break;case we.HARDWARE_ID:this.ArmHid=o;break}r(o)}else a(o)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(s,o)=>{s&&o==0?r(o):a(o)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_RFS({Handle:e},(a,s)=>{a&&s==0?t(s):r(s)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(s,o)=>{if(s&&o.length>0)try{o=this.Base64.decode(o),r(o)}catch(d){console.error(d),r(o)}else a(o)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(a,s)=>{a&&s==0?t(s):r(s)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(s,o)=>{s&&o==0?r(o):a(o)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(s,o)=>{s&&o==0?r(o):a(o)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(s,o)=>{s&&o==0?r(o):a(o)})})}armSwitchProtocol(e=Gn.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(s,o)=>{s&&o==0?r(o):a(o)})})}armVerifyPIN(e,t=qe.USER,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,s)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:r,UserPin:e,UserType:t},(o,d)=>{o&&d==0?(this.ArmPin=e,a(d)):s(d)})})}armReadData(e=0,t=128,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,s)=>{this.AtlCtrl.Arm_ReadData({Handle:r,Offset:e,ReadLength:t},(o,d)=>{o?(this.ArmData=d,a(d)):s(d)})})}armWriteData(e,t=0,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,s)=>{this.AtlCtrl.Arm_WriteData({Handle:r,Offset:t,DataInput:e},(o,d)=>{o&&d==0?a(d):s(d)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(a,s)=>{a?(this.ArmData=s,t(s)):r(s)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(s,o)=>{s&&o==0?r(o):a(o)})})}}const gt="0123456789abcdeffedcba9876543210",Et="4b0de988570c3a0f",Vn=window.ENCRYPT;let de=Vn&&new ft;function _t(n=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",r=e.length;for(;n>0;)t+=e[Math.floor(Math.random()*r)],n--;return t}function wt(){return f(this,null,function*(){return de||(de=new ft),new Promise((n,e)=>{de.armEnum().then(t=>{n(+t)}).catch(t=>{ne.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}nn.throttle(()=>f(exports,null,function*(){const n=yield wt(),e={};if(typeof n!="number"||n<=0)ne.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Kn();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(ne.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(ne.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function zn(n=0){return f(this,null,function*(){return de?new Promise((e,t)=>{de.armGetDongleInfo(n).then(r=>{r?e(r):(ne.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(r))}).catch(r=>{t(r)})}):ne.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Kn(){return f(this,null,function*(){if(!de)return ne.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const n=yield wt();let e=[];for(let t=0;t<n;t++){const r=yield zn(t);e.push(r)}return e})}_t(16);_t(16);const At=window.meta.app.inspect?ie.SM4.constants.CBC:ie.SM4.constants.ECB,{publicKey:ia,privateKey:oa}=ie.SM2.generateKeyPair();function $n(n,e,t={}){const r=yt(Et),a=t.mode||At;t=a===ie.SM4.constants.ECB?l({mode:a,inputEncoding:"utf8",outputEncoding:"hex"},t):l({iv:gt,mode:a,inputEncoding:"utf8",outputEncoding:"hex"},t);let s="";try{s=ie.SM4.encrypt(n,r,t)}catch(o){console.log("err: ",o)}return s}function Wn(n,e,t={}){const r=yt(Et),a=t.mode||At;return t=a===ie.SM4.constants.ECB?l({mode:a,inputEncoding:"hex",outputEncoding:"utf8"},t):l({iv:gt,mode:a,inputEncoding:"hex",outputEncoding:"utf8"},t),ie.SM4.decrypt(n,r,t)}function yt(n){return[...n].map(e=>e.charCodeAt().toString(16)).join("")}const fe=n=>{const{onClose:e,customClass:t}=n;return ne.ElMessage(v(l({},n),{center:!0,customClass:`sy-message ${t||""}`,onClose:a=>{e&&e(a)}}))};["success","warning","info","error"].forEach(n=>{fe[n]=e=>fe(typeof e=="string"?{type:n,message:e}:v(l({},e),{type:n}))});He.createPinia();function Ae(n){return n=mt&&be(n)?Wn(n):n,be(n)?JSON.parse(n):n}function Xe(n){return n=mt&&be(n)?$n(n):n,JSON.stringify(n)}function le(n,e,t,r){const a=new StorageEvent("storage",{url:window.location.href,key:n,oldValue:e,newValue:t,storageArea:r});window.dispatchEvent(a)}const Be={getLocal:n=>{try{const e=window.localStorage.getItem(n);return Ae(e)}catch(e){console.error(e)}},setLocal:(n,e)=>{try{const t=window.localStorage.getItem(n),r=Xe(e);window.localStorage.setItem(n,r),le(n,t,r,window.localStorage)}catch(t){console.error(t)}},eachLocal:n=>{if(!n||Re(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const r=window.localStorage.key(e);n((void 0).getLocal(r),r)}},clearLocal:()=>{window.localStorage.clear(),le(null,null,null,window.localStorage)},removeLocal:n=>{const e=window.localStorage.getItem(n);window.localStorage.removeItem(n),le(n,e,null,window.localStorage)},getSession:n=>{try{const e=window.sessionStorage.getItem(n);return Ae(e)}catch(e){console.error(e)}},setSession:(n,e)=>{try{const t=window.sessionStorage.getItem(n),r=Xe(e);window.sessionStorage.setItem(n,r),le(n,t,r,window.sessionStorage)}catch(t){console.error(t)}},eachSession:n=>{if(!n||Re(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const r=window.sessionStorage.key(e);n((void 0).getSession(r),r)}},clearSession:()=>{window.sessionStorage.clear(),le(null,null,null,window.sessionStorage)},removeSession:n=>{const e=window.sessionStorage.getItem(n);window.sessionStorage.removeItem(n),le(n,e,null,window.sessionStorage)},onStorageChange:n=>{if(!n||Re(n)!=="Function")return console.error("传递参数非函数类型!");const e=t=>{n({url:t.url,key:t.key,newValue:t.newValue?Ae(t.newValue):null,oldValue:t.oldValue?Ae(t.oldValue):null,storageArea:t.storageArea})};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},jn=(n,e)=>new Promise((t,r)=>{Y.postApi("/filehandle/save",{path:n,data:e}).then(a=>{a.res.success?t(!0):r(!1)})}),qn='<svg class="gis-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#1afa29" p-id="1156"></path></svg>',Ye='<svg class="gis-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1657" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#808080" p-id="1658"></path></svg>',Xn='<svg class="gis-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25776" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M377.083 125.44c74.606-135.314 195.292-135.314 269.897 0l346.332 629.394c74.606 135.315 9.508 245.395-145.189 245.395H175.94c-154.697 0-219.428-109.715-145.188-245.395L377.083 125.44z" fill="#FF2D16" p-id="25777"></path><path d="M567.986 328.046c0-31.086-25.234-55.955-55.954-55.955s-55.954 25.235-55.954 55.955v280.137c0 31.086 25.234 55.954 55.954 55.954s55.954-25.234 55.954-55.954V328.046z m-111.908 448h111.908v111.908H456.078z" fill="#FFFFFF" p-id="25778"></path></svg>',Yn={name:"局放测点",label:"局放测点",create:function(n,e){return f(this,null,function*(){const{transformControls:t}=e,r=document.createElement("div"),a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.gap="10px",a.style.position="relative",a.style.zIndex="1";const s=document.createElement("div");s.innerHTML=`
|
|
7
|
-
<div style="display: flex; align-items: flex-end; gap: 10px; color: #FF716C;">
|
|
8
|
-
<span class="gis-val-${n.valueEleId}" style="font-size: 24px;font-weight: 600;">
|
|
9
|
-
${n.value}
|
|
10
|
-
</span>
|
|
11
|
-
<span style="font-size: 14px;">dBm</span>
|
|
12
|
-
</div>
|
|
13
|
-
`;const o=document.createElement("div");o.style.width="1.3vw",o.style.height="1.3vw",o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.style.cursor="pointer",o.style.pointerEvents="auto",o.style.userSelect="none",o.innerHTML=Ye;const d=document.createElement("style");d.innerHTML=`
|
|
14
|
-
.gis-icon { width: 100%; height: 100%; display: block; }
|
|
15
|
-
`,a.append(d,o,s),r.append(a);const c=document.createElement("div");Object.assign(c.style,{position:"absolute",top:"0",left:"1.8vw",display:"none",flexDirection:"column",gap:"10px",padding:"10px",borderRadius:"4px",border:"1px solid rgba(255, 255, 255, 0.2)",backdropFilter:"blur(12px)",background:"#24262933",minWidth:"12vw",zIndex:999,pointerEvents:"auto"}),n.valueEleId||(n.valueEleId=pe()),n.nameElId||(n.nameElId=pe()),n.btnEleId||(n.btnEleId=pe()),c.innerHTML=`
|
|
16
|
-
<div class="gis-name-${n.nameElId}" style="padding-bottom: 10px; font-size: 16px; color: #ffffff; border-bottom: 1px solid rgba(255, 113, 108, 0.5);white-space: nowrap;">${n.name}</div>
|
|
17
|
-
<div style="font-size: 14px; color: #cae4ff;">幅值峰值</div>
|
|
18
|
-
<div style="display: flex; justify-content: space-between">
|
|
19
|
-
<div style="display: flex; align-items: flex-end; gap: 10px; color: #FF716C;">
|
|
20
|
-
<span class="gis-val-${n.valueEleId}" style="font-size: 24px;font-weight: 600;">${n.value}</span>
|
|
21
|
-
<span style="font-size: 14px;">dBm</span>
|
|
22
|
-
</div>
|
|
23
|
-
<button type="primary" id="${n.btnEleId}" class="el-button el-button--primary">查看历史</button>
|
|
24
|
-
</div>
|
|
25
|
-
`,c.onmouseenter=()=>{o.isFocus=!0},c.onmouseleave=()=>{o.isFocus=!1,c.style.display="none",r.className=""};const p=new rn.CSS2DObject(r);p.name=n.name,p.dataId=n.guid,p.userData.params=n,o.onmouseover=()=>{c.style.display="flex",r.className="top-info";const D=document.getElementById(n.btnEleId);D.onclick=()=>{Ie.emit("three-event",{type:"pd-history-click",data:p})}},o.onmouseleave=()=>{setTimeout(()=>{o.isFocus||(c.style.display="none",r.className="")},500)},o.onclick=()=>{Ie.emit("three-event",{type:"pd-sensor-click",data:p}),n.preview||setTimeout(()=>{t.attach(p)},100)},a.append(c);const A=D=>{D===0?o.innerHTML=Ye:D===1?o.innerHTML=qn:D===2&&(o.innerHTML=Xn)},B=D=>{const g=document.getElementsByClassName(`gis-val-${n.valueEleId}`);if(g.length)for(let N=0;N<g.length;N++)g[N].innerText=D},j=D=>{const g=document.getElementsByClassName(`gis-name-${n.nameElId}`);if(g.length)for(let N=0;N<g.length;N++)g[N].innerText=D};return p.changeState=A,p.changeValue=B,p.changeName=j,setTimeout(()=>{A(n.state),B(n.value),j(n.name)},200),p})},getStorage:function(n){return n.userData.params}};var ut;k.config(l({driver:[k.INDEXEDDB,k.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((ut=window.meta.storage)==null?void 0:ut.config)||{}));function Jn(){return{getKey:g=>f(this,null,function*(){return yield k.key(g)}),getKeys:()=>f(this,null,function*(){return yield k.keys()}),getItem:g=>f(this,null,function*(){if(g)return yield k.getItem(g)}),setItem:(g,N)=>f(this,null,function*(){if(g)return yield k.setItem(g,N)}),removeItem:g=>f(this,null,function*(){if(g)return yield k.removeItem(g)}),clearItems:()=>f(this,null,function*(){return yield k.clear()}),iterateItems:(g,N)=>f(this,null,function*(){if(g)return yield k.iterate(g,N)}),getReady:()=>f(this,null,function*(){return yield k.ready()}),getLength:()=>f(this,null,function*(){return yield k.length()}),getDriver:()=>f(this,null,function*(){return yield k.driver()}),setDriver:g=>f(this,null,function*(){if(g)return yield k.setDriver(g)}),setConfig:g=>f(this,null,function*(){if(g)return yield k.config(g)}),dropInstance:g=>f(this,null,function*(){if(g)return yield k.dropInstance(g)}),createInstance:g=>f(this,null,function*(){if(g)return yield k.createInstance(g)})}}const Qn="THREED_LOG_BUFFER",Zn="THREED_CURRSCENE",er="THREED_ACTIVE_MENU",tr="THREED_PIXEL_RATIO",ye="THREED_MODEL_DBNAME",Pe="THREED_MODEL_DBSTORE",nr="THREED_SCENE_PREVIEW",Le="THREED_MODEL_LOAD_KEY",he="THREED_PREVIEW_URL_KEY",rr="THREED_ADDON_EDITOR_JSON",ar="THREED_SCENE_STORAGE_SUFFIX",Me={step:.1},ir=80,It=30,or=1e3,sr=1200,lr=3e5,cr="三维测试",dr="灯光",ur=1,hr=["环境光","平行光","点光源","聚光灯","半球光","平面光"],St=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),mr=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],Ct=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),vt=new Set(["CSS2DObject","CSS3DObject"]),pr=Object.assign({"/src/views/threed/models/pd-sensor.js":Yn}),fr=Object.assign({}),gr={环境光:()=>new z.THREE.AmbientLight(16777215,1),平行光:()=>new z.THREE.DirectionalLight(16777215,1),点光源:()=>new z.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new z.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new z.THREE.HemisphereLight(16777215,0,1),平面光:()=>new z.THREE.RectAreaLight(16777215,1,100,100)},Er=[{name:"荧光流动",commonUniforms:!0,vertex:"vUv-material",fragment:`
|
|
5
|
+
*/Object.defineProperty(Re,"__esModule",{value:!0});var fe=typeof window!="undefined"?window.proxy||window:{},yt=function(n){fe!=null&&fe.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),fe.qiankunName&&(window.moudleQiankunAppLifeCycles[fe.qiankunName]=n))};Re.default=yt;var Pe=Re.qiankunWindow=fe;Re.renderWithQiankun=yt;function ln(){return window.__POWERED_BY_WUJIE__||window.$wujie?Ce.WUJIE:window.__POWERED_BY_QIANKUN__||Pe!=null&&Pe.__POWERED_BY_QIANKUN__?Ce.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?Ce.MICROAPP:Ce.NONE}const we="/",St=window.meta.app.encrypt;var rt,at;const cn=((at=(rt=window==null?void 0:window.meta)==null?void 0:rt.app)==null?void 0:at.isProxy)||!1;var it,ot;const dn=((ot=(it=window==null?void 0:window.meta)==null?void 0:it.app)==null?void 0:ot.proxyUrl)||"";ln();const un=location.hostname,hn=location.port,mn=cn?`${location.origin}/${dn}`:`${location.origin}`;var st,lt,ct,dt,ut,ht,mt,pt,ft,gt,_t,Et;const It={savePath:((lt=(st=window.meta)==null?void 0:st.graph)==null?void 0:lt.savePath)||"/cockpit/drawing",graphPenPath:((dt=(ct=window.meta)==null?void 0:ct.graph)==null?void 0:dt.graphPenPath)||"/cockpit/graph",templatePath:((ht=(ut=window.meta)==null?void 0:ut.graph)==null?void 0:ht.templatePath)||"/cockpit/template",graphImgUploadPath:((pt=(mt=window.meta)==null?void 0:mt.graph)==null?void 0:pt.graphImgUploadPath)||"/cockpit/upload",threeSavePath:((gt=(ft=window.meta)==null?void 0:ft.graph)==null?void 0:gt.threeSavePath)||"/cockpit/threed",threeModelPath:((Et=(_t=window.meta)==null?void 0:_t.graph)==null?void 0:Et.threeModelPath)||"/cockpit/models"};var wt;const x=nn.create({baseURL:mn,timeout:((wt=window.meta.axios)==null?void 0:wt.timeout)||6e4,withCredentials:!1,paramsSerializer:n=>tn.stringify(n)});x.interceptors.request.use(n=>(n.headers["x-token"]="ewoglCJhbGcilDogpc3",n),n=>Promise.reject(n));x.interceptors.response.use(n=>{const{data:e}=n;return Promise.resolve(e)},n=>Promise.reject(n));function pn(n,e={},t={}){return new Promise(r=>{x.get(n,l({params:e},t)).then(a=>r({res:a,err:null})).catch(a=>r({res:null,err:a}))})}function fn(n,e={},t={}){return new Promise(r=>{x.post(n,e,t).then(a=>r({res:a,err:null})).catch(a=>r({res:null,err:a}))})}function gn(n,e={},t={}){return x.get(n,l({params:e},t))}function _n(n,e={},t={}){return x.post(n,e,t)}function En(n,e={}){return x.get(`/filehandle/${n}`,{params:e})}function wn(n,e={},t={}){return x.post(`/filehandle/${n}`,e,t)}function An(n,e={}){return x.get(`/user/${n}`,{params:e})}function yn(n,e={},t={}){return x.post(`/user/${n}`,e,t)}function Sn(n,e={}){return x.get(`${n}`,e.local?{params:e,baseURL:we}:{params:e})}function In(n,e={}){return x.get(`/media/${n}/`,{params:e})}function Cn(n,e={},t={}){return x.post(`/media/${n}/`,e,t)}function xn(n,e={}){return x.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${n}/`,{params:e})}function Tn(n,e={},t={}){return x.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${n}/`,e,t)}function vn(n,e={}){return x.get(`/history/${n}`,{params:e})}function Rn(n,e={},t={}){return x.post(`/history/${n}`,e,t)}function Dn(n,e={}){return x.get(`/scada/${n}`,{params:e})}function bn(n,e={},t={}){return x.post(`/scada/${n}`,e,t)}function Pn(n,e={}){return x.get(`/common/factory/${n}`,{params:e})}function Ln(n,e={},t={}){return x.post(`/common/factory/${n}`,e,t)}function Nn(n,e={}){return x.get(`/factory/${n}`,{params:e})}function Mn(n,e={},t={}){return x.post(`/factory/${n}`,e,t)}function On(n,e={}){return x.get(`/pd/${n}`,{params:e})}function kn(n,e={},t={}){return x.post(`/pd/${n}`,e,t)}const V={getApi:pn,postApi:fn,getFileApi:En,postFileApi:wn,getBaseApi:gn,postBaseApi:_n,getUserApi:An,postUserApi:yn,getGraphApi:Sn,getMediaApi:In,postMediaApi:Cn,getScadaApi:Dn,postScadaApi:bn,getCommonApi:xn,postCommonApi:Tn,getHistoryApi:vn,postHistoryApi:Rn,getFactoryApi:Nn,postFactoryApi:Mn,getCommonFactoryApi:Pn,postCommonFactoryApi:Ln,getPDApi:On,postPDApi:kn},Qe=rn();class Fn{constructor(e={}){this._options=l({url:e.socketUrl,onOpen:null,onClose:null,onError:null,onMessage:null},e),this._client=null,this._isConnect=!1,this._closeClient=!1,this._retryCount=0,this._retryTimes=10,this._retryInterval=1e4,this._retryIntervalObj=null,this._initSockjs()}_initSockjs(){const{url:e,onOpen:t,onClose:r,onError:a,onMessage:o,token:s}=this._options;WebSocket!==void 0?this._client=new WebSocket(e,[s]):this.$message({type:"error",message:"当前浏览器不支持WebSocket推送!"}),this._client.onopen=u=>{this._client.readyState===WebSocket.OPEN&&(this._retryCount=0,this._isConnect=!0,this._closeClient=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null),t&&t(u)},this._client.onclose=u=>{!this._closeClient&&this.retryIntervalStart(),this._isConnect=!1,r&&r(u)},this._client.onerror=u=>{a&&a(u)},this._client.onmessage=u=>{o&&o(u)}}_reconnect(){if(this._retryCount===this._retryTimes){this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null;return}this._client=null,this._initSockjs(),this._retryCount++}retryIntervalStart(){this._closeClient=!0,this._retryIntervalObj||(this._retryIntervalObj=setInterval(()=>{this._reconnect()},this._retryInterval))}sendMsg(e){this._isConnect&&this._client.send(e)}destroy(){this._client&&(this._isConnect=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null,this._closeClient=!0,this._client.close(),this._client=null)}}const Un=[65535,-99999];function Hn(n){if(typeof n!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return n.trim()!==""&&e.test(n.trim())}function Me(n){return!["null","undefined"].includes(n)&&n!==void 0&&n!==null&&n!==""}function Bn(n){return typeof n=="number"&&!Un.includes(n)}const Gn=()=>{var r;const n={},e=((r=window.location.href.split("?"))==null?void 0:r[1])||"",t=new URLSearchParams(e);for(const[a,o]of t.entries())n[a]=o;return n};function Le(n){return Object.prototype.toString.call(n).slice(8,-1)}function Ze(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}(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 Vn(){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 r,a,o,s,u,c;for(o=t.length,a=0,r="";a<o;){if(s=t.charCodeAt(a++)&255,a==o){r+=n.charAt(s>>2),r+=n.charAt((s&3)<<4),r+="==";break}if(u=t.charCodeAt(a++),a==o){r+=n.charAt(s>>2),r+=n.charAt((s&3)<<4|(u&240)>>4),r+=n.charAt((u&15)<<2),r+="=";break}c=t.charCodeAt(a++),r+=n.charAt(s>>2),r+=n.charAt((s&3)<<4|(u&240)>>4),r+=n.charAt((u&15)<<2|(c&192)>>6),r+=n.charAt(c&63)}return r},this.decode=function(t){var r,a,o,s,u,c,f;for(c=t.length,u=0,f="";u<c;){do r=e[t.charCodeAt(u++)&255];while(u<c&&r==-1);if(r==-1)break;do a=e[t.charCodeAt(u++)&255];while(u<c&&a==-1);if(a==-1)break;f+=String.fromCharCode(r<<2|(a&48)>>4);do{if(o=t.charCodeAt(u++)&255,o==61)return f;o=e[o]}while(u<c&&o==-1);if(o==-1)break;f+=String.fromCharCode((a&15)<<4|(o&60)>>2);do{if(s=t.charCodeAt(u++)&255,s==61)return f;s=e[s]}while(u<c&&s==-1);if(s==-1)break;f+=String.fromCharCode((o&3)<<6|s)}return f},this.utf16to8=function(t){var r,a,o,s;for(r="",o=t.length,a=0;a<o;a++)s=t.charCodeAt(a),s>=1&&s<=127?r+=t.charAt(a):s>2047?(r+=String.fromCharCode(224|s>>12&15),r+=String.fromCharCode(128|s>>6&63),r+=String.fromCharCode(128|s>>0&63)):(r+=String.fromCharCode(192|s>>6&31),r+=String.fromCharCode(128|s>>0&63));return r},this.utf8to16=function(t){var r,a,o,s,u,c;for(r="",o=t.length,a=0;a<o;)switch(s=t.charCodeAt(a++),s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r+=t.charAt(a-1);break;case 12:case 13:u=t.charCodeAt(a++),r+=String.fromCharCode((s&31)<<6|u&63);break;case 14:u=t.charCodeAt(a++),c=t.charCodeAt(a++),r+=String.fromCharCode((s&15)<<12|(u&63)<<6|(c&63)<<0);break}return r},this.charToHex=function(t){var r,a,o;for(r="",a=0;a<t.length;)o=t.charCodeAt(a++).toString(16),r+="\\0x"+o,r+=a>0&&a%8==0?`\r
|
|
6
|
+
`:", ";return r}}function Kn(){var n=0,e=new Object;this.add=function(t,r){this.containsKey(t)||n++,e[t]=r},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 r in e)if(e[r]==t)return!0;return!1},this.getValues=function(){var t=[];for(var r in e)t.push(e[r]);return t},this.getKeys=function(){var t=[];for(var r in e)t.push(r);return t},this.getSize=function(){return n},this.clear=function(){n=0,e=new Object}}function zn(n){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new Kn,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,r){var a=Object.id(r).toString();this.callbacks_.add(a,r);var o={MsgId:a,Method:e+"|"+n};t&&(o.Param=JSON.stringify(t));var s=JSON.stringify(o);this.connect&&this.ws.send(s)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),r=t.MsgId;if(this.callbacks_.containsKey(r)){var a=this.callbacks_.getValue(r);a(t.Result,t.Response),this.callbacks_.remove(r)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},r){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],r)},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:r},a){this.exec("Arm_VerifyPIN",[parseInt(e),r,t],a)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},r){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],r)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},r){this.exec("Arm_LEDControl",[parseInt(e),t],r)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},r){this.exec("Arm_SwitchProtocol",[parseInt(e),t],r)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:r,AttrBuffer:a},o){this.exec("Arm_CreateFile",[parseInt(e),r,parseInt(t),a],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:r,FileOffset:a,DataInput:o},s){this.exec("Arm_WriteFile",[parseInt(e),r,parseInt(t),parseInt(a),o],s)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:r},a){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),r],a)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:r,DataLen:a},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),r,r.length,parseInt(a)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:r},a){this.exec("Arm_DeleteFile",[parseInt(e),r,parseInt(t)],a)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:r},a){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),r],a)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:r},a){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),r],a)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},r){this.exec("Arm_WriteShareMemory",[parseInt(e),t],r)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},r){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],r)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:r,TryCount:a,PinFlag:o},s){this.exec("Arm_ChangePIN",[parseInt(e),o,r,t,parseInt(a)],s)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},r){this.exec("Arm_ResetUserPIN",[parseInt(e),t],r)},this.Arm_SetUserID=function({Handle:e,UserID:t},r){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],r)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},r){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],r)},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},r){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],r)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},r){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],r)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},r){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],r)},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:r,RsaPriFileID:a,RsaPriFileSize:o},s){this.exec("Arm_RsaPri",[parseInt(e),parseInt(a),parseInt(o),t,r],s)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:r,RsaPubInData:a,RsaPubFileSize:o},s){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),r,t,t.length,a],s)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:r},a){this.exec("Arm_EccSign",[parseInt(e),parseInt(r),t],a)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:r,EccSignData:a},o){this.exec("Arm_EccVerify",[parseInt(e),r,r.length,t,a],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:r},a){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(r),t],a)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:r,Sm2SignData:a},o){this.exec("Arm_Sm2Verify",[parseInt(e),r,r.length,t,a],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:r,TdesInData:a},o){this.exec("Arm_TDES",[parseInt(e),parseInt(r),t,a],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:r,Sm4InData:a},o){this.exec("Arm_SM4",[parseInt(e),parseInt(r),t,a],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:r},a){this.exec("Arm_HASH",[parseInt(e),t,r],a)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:r},a){this.exec("Arm_Seed",[parseInt(e),r,t],a)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},r){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],r)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:r,SonCount:a,StartUserID:o,AdminTryCount:s,UserPin:u,UserTryCount:c,UpdateRSAPriKey:f},I){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),r,u,parseInt(c),parseInt(s),f,parseInt(o),parseInt(a)],I)},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},r){this.exec("Arm_InitSon",[parseInt(e),t],r)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},r){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],r)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:r,FileID:a,FileType:o,Offset:s,DataLen:u,DataBuffer:c,UpRSAPubKey:f},I){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,r,o,parseInt(a),parseInt(s),c,f,parseInt(u)],I)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:r,FileID:a,FileType:o,Offset:s,DataLen:u,DataBuffer:c},f){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,r,o,parseInt(a),parseInt(s),c,parseInt(u)],f)},this.Arm_Update=function({Handle:e,UpdateData:t},r){this.exec("Arm_Update",[parseInt(e),t],r)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:r},a){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(r)],a)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:r,Priv:a,IsReset:o,IsDecOnRAM:s},u){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[r,parseInt(t),parseInt(e),parseInt(a),parseInt(s),parseInt(o)],u)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},r){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],r)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},r){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],r)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},r){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],r)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:r,IsDecOnRAM:a},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(a),parseInt(r)],o)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:r,InBuffer:a,CallLimit:o},s){this.exec("Arm_Set_EXE_FILE_INFO",[a,parseInt(r),parseInt(e),parseInt(o),t,t.length],s)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const $n={HID:0},xe={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},et={USER:0};class Ct{constructor(){ce(this,"Base64",new Vn);ce(this,"AtlCtrl",null);ce(this,"ArmCount",0);ce(this,"ArmIndex",0);ce(this,"ArmHandle",0);ce(this,"ArmRandom","");try{this.AtlCtrl=new zn("{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((r,a)=>{r?(this.ArmCount=+a,e(a)):t(a)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,r)=>{this.AtlCtrl.Arm_Open({Index:e},(a,o)=>{a?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,r(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_Close({Handle:e},(a,o)=>{a?t(o):r(o)})})}armChangePIN(e,t,r=255,a=et.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,u)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:r,PinFlag:a},(c,f)=>{c&&f==0?(this.ArmPin=e,s(f)):u(f)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,s)=>{o?(this.ArmRandom=s,r(s)):a(s)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(a,o)=>{a?(this.ArmDeadline=o,t(o)):r(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,s)=>{o?(this.ArmUKey=s,r(s)):a(s)})})}armGetDongleInfo(e=0,t=xe.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((r,a)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,s)=>{if(o){switch(t){case xe.USER_ID:this.ArmUid=s;break;case xe.PRODUCT_ID:this.ArmPid=s;break;case xe.HARDWARE_ID:this.ArmHid=s;break}r(s)}else a(s)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,s)=>{o&&s==0?r(s):a(s)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_RFS({Handle:e},(a,o)=>{a&&o==0?t(o):r(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,s)=>{if(o&&s.length>0)try{s=this.Base64.decode(s),r(s)}catch(u){console.error(u),r(s)}else a(s)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(a,o)=>{a&&o==0?t(o):r(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,s)=>{o&&s==0?r(s):a(s)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,s)=>{o&&s==0?r(s):a(s)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,s)=>{o&&s==0?r(s):a(s)})})}armSwitchProtocol(e=$n.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,s)=>{o&&s==0?r(s):a(s)})})}armVerifyPIN(e,t=et.USER,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:r,UserPin:e,UserType:t},(s,u)=>{s&&u==0?(this.ArmPin=e,a(u)):o(u)})})}armReadData(e=0,t=128,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,o)=>{this.AtlCtrl.Arm_ReadData({Handle:r,Offset:e,ReadLength:t},(s,u)=>{s?(this.ArmData=u,a(u)):o(u)})})}armWriteData(e,t=0,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,o)=>{this.AtlCtrl.Arm_WriteData({Handle:r,Offset:t,DataInput:e},(s,u)=>{s&&u==0?a(u):o(u)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(a,o)=>{a?(this.ArmData=o,t(o)):r(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,a)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,s)=>{o&&s==0?r(s):a(s)})})}}const xt="0123456789abcdeffedcba9876543210",Tt="4b0de988570c3a0f",Wn=window.ENCRYPT;let ge=Wn&&new Ct;function vt(n=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",r=e.length;for(;n>0;)t+=e[Math.floor(Math.random()*r)],n--;return t}function Rt(){return p(this,null,function*(){return ge||(ge=new Ct),new Promise((n,e)=>{ge.armEnum().then(t=>{n(+t)}).catch(t=>{se.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}on.throttle(()=>p(exports,null,function*(){const n=yield Rt(),e={};if(typeof n!="number"||n<=0)se.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Xn();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(se.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(se.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function qn(n=0){return p(this,null,function*(){return ge?new Promise((e,t)=>{ge.armGetDongleInfo(n).then(r=>{r?e(r):(se.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(r))}).catch(r=>{t(r)})}):se.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Xn(){return p(this,null,function*(){if(!ge)return se.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const n=yield Rt();let e=[];for(let t=0;t<n;t++){const r=yield qn(t);e.push(r)}return e})}vt(16);vt(16);const Dt=window.meta.app.inspect?de.SM4.constants.CBC:de.SM4.constants.ECB,{publicKey:la,privateKey:ca}=de.SM2.generateKeyPair();function jn(n,e,t={}){const r=bt(Tt),a=t.mode||Dt;t=a===de.SM4.constants.ECB?l({mode:a,inputEncoding:"utf8",outputEncoding:"hex"},t):l({iv:xt,mode:a,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=de.SM4.encrypt(n,r,t)}catch(s){console.log("err: ",s)}return o}function Yn(n,e,t={}){const r=bt(Tt),a=t.mode||Dt;return t=a===de.SM4.constants.ECB?l({mode:a,inputEncoding:"hex",outputEncoding:"utf8"},t):l({iv:xt,mode:a,inputEncoding:"hex",outputEncoding:"utf8"},t),de.SM4.decrypt(n,r,t)}function bt(n){return[...n].map(e=>e.charCodeAt().toString(16)).join("")}const Ae=n=>{const{onClose:e,customClass:t}=n;return se.ElMessage(R(l({},n),{center:!0,customClass:`sy-message ${t||""}`,onClose:a=>{e&&e(a)}}))};["success","warning","info","error"].forEach(n=>{Ae[n]=e=>Ae(typeof e=="string"?{type:n,message:e}:R(l({},e),{type:n}))});Ke.createPinia();function Te(n){return n=St&&Me(n)?Yn(n):n,Me(n)?JSON.parse(n):n}function tt(n){return n=St&&Me(n)?jn(n):n,JSON.stringify(n)}function pe(n,e,t,r){const a=new StorageEvent("storage",{url:window.location.href,key:n,oldValue:e,newValue:t,storageArea:r});window.dispatchEvent(a)}const ze={getLocal:n=>{try{const e=window.localStorage.getItem(n);return Te(e)}catch(e){console.error(e)}},setLocal:(n,e)=>{try{const t=window.localStorage.getItem(n),r=tt(e);window.localStorage.setItem(n,r),pe(n,t,r,window.localStorage)}catch(t){console.error(t)}},eachLocal:n=>{if(!n||Le(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const r=window.localStorage.key(e);n((void 0).getLocal(r),r)}},clearLocal:()=>{window.localStorage.clear(),pe(null,null,null,window.localStorage)},removeLocal:n=>{const e=window.localStorage.getItem(n);window.localStorage.removeItem(n),pe(n,e,null,window.localStorage)},getSession:n=>{try{const e=window.sessionStorage.getItem(n);return Te(e)}catch(e){console.error(e)}},setSession:(n,e)=>{try{const t=window.sessionStorage.getItem(n),r=tt(e);window.sessionStorage.setItem(n,r),pe(n,t,r,window.sessionStorage)}catch(t){console.error(t)}},eachSession:n=>{if(!n||Le(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const r=window.sessionStorage.key(e);n((void 0).getSession(r),r)}},clearSession:()=>{window.sessionStorage.clear(),pe(null,null,null,window.sessionStorage)},removeSession:n=>{const e=window.sessionStorage.getItem(n);window.sessionStorage.removeItem(n),pe(n,e,null,window.sessionStorage)},onStorageChange:n=>{if(!n||Le(n)!=="Function")return console.error("传递参数非函数类型!");const e=t=>{n({url:t.url,key:t.key,newValue:t.newValue?Te(t.newValue):null,oldValue:t.oldValue?Te(t.oldValue):null,storageArea:t.storageArea})};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},Jn=(n,e)=>new Promise((t,r)=>{V.postApi("/filehandle/save",{path:n,data:e}).then(a=>{a.res.success?t(!0):r(!1)})});var At;M.config(l({driver:[M.INDEXEDDB,M.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((At=window.meta.storage)==null?void 0:At.config)||{}));function Qn(){return{getKey:E=>p(this,null,function*(){return yield M.key(E)}),getKeys:()=>p(this,null,function*(){return yield M.keys()}),getItem:E=>p(this,null,function*(){if(E)return yield M.getItem(E)}),setItem:(E,Y)=>p(this,null,function*(){if(E)return yield M.setItem(E,Y)}),removeItem:E=>p(this,null,function*(){if(E)return yield M.removeItem(E)}),clearItems:()=>p(this,null,function*(){return yield M.clear()}),iterateItems:(E,Y)=>p(this,null,function*(){if(E)return yield M.iterate(E,Y)}),getReady:()=>p(this,null,function*(){return yield M.ready()}),getLength:()=>p(this,null,function*(){return yield M.length()}),getDriver:()=>p(this,null,function*(){return yield M.driver()}),setDriver:E=>p(this,null,function*(){if(E)return yield M.setDriver(E)}),setConfig:E=>p(this,null,function*(){if(E)return yield M.config(E)}),dropInstance:E=>p(this,null,function*(){if(E)return yield M.dropInstance(E)}),createInstance:E=>p(this,null,function*(){if(E)return yield M.createInstance(E)})}}const Zn="THREED_LOG_BUFFER",er="THREED_CURRSCENE",tr="THREED_ACTIVE_MENU",nr="THREED_PIXEL_RATIO",ve="THREED_MODEL_DBNAME",Oe="THREED_MODEL_DBSTORE",rr="THREED_SCENE_PREVIEW",ke="THREED_MODEL_LOAD_KEY",Ee="THREED_PREVIEW_URL_KEY",ar="THREED_ADDON_EDITOR_JSON",ir="THREED_SCENE_STORAGE_SUFFIX",Fe={step:.1},or=80,Pt=30,sr=1e3,lr=1200,cr=3e5,dr="三维测试",ur="灯光",hr=1,mr=["环境光","平行光","点光源","聚光灯","半球光","平面光"],Lt=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),pr=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],Nt=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),Mt=new Set(["CSS2DObject","CSS3DObject"]),fr=Object.assign({}),gr=Object.assign({}),_r={环境光:()=>new U.THREE.AmbientLight(16777215,1),平行光:()=>new U.THREE.DirectionalLight(16777215,1),点光源:()=>new U.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new U.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new U.THREE.HemisphereLight(16777215,0,1),平面光:()=>new U.THREE.RectAreaLight(16777215,1,100,100)},Er=[{name:"荧光流动",commonUniforms:!0,vertex:"vUv-material",fragment:`
|
|
26
7
|
vec4 o = gl_FragColor.rgba;
|
|
27
8
|
vec2 u = gl_FragCoord.xy;
|
|
28
9
|
vec2 v = iResolution.xy;
|
|
@@ -60,4 +41,4 @@
|
|
|
60
41
|
uv *= 2.0 * ( cos(iTime * 2.0) -2.5);
|
|
61
42
|
float anim = sin(iTime * 12.0) * 0.1 + 1.0;
|
|
62
43
|
vec3 col = cheap_star(uv, anim) * vec3(0.35,0.2,0.15);
|
|
63
|
-
`,key:"col",commonFinish:!0,render:"iTime+speed"}];let ue=null,W=null,De=[];const Je=n=>(n==null?void 0:n.name)||(n==null?void 0:n.label)||"",xt=(n={})=>Object.values(n).filter(e=>e&&(e.label||e.name)),_r=xt(pr),wr=xt(fr),Ar=()=>({THREED_GUI_PARAMS:Me,THREED_LOG_BUFFER:Qn,THREED_CURRSCENE:Zn,THREED_ACTIVE_MENU:er,THREED_PIXEL_RATIO:tr,THREED_IMPORT_SIZE:ir,THREED_LIGHT_TYPES:hr,THREED_EXPORT_BATCH:It,THREED_RELOAD_DELAY:or,THREED_MODEL_DBNAME:ye,THREED_MODEL_DBSTORE:Pe,THREED_SCENE_PREVIEW:nr,THREED_USER_DATA_KEYS:St,THREED_MODEL_LOAD_KEY:Le,THREED_PREVIEW_URL_KEY:he,THREED_ADDON_EDITOR_JSON:rr,THREED_EXPORT_NODE_COUNT:sr,THREED_DEFAULT_SCENE_NAME:cr,THREED_DEFAULT_ACTIVE_MENU:dr,THREED_DEFAULT_PIXEL_RATIO:ur,THREED_EXPORT_VERTEX_COUNT:lr,THREED_SCENE_EXCLUDE_TYPES:mr,THREED_EXPORT_EXCLUDE_TYPES:Ct,THREED_EXPORT_RUNTIME_TYPES:vt,THREED_SCENE_STORAGE_SUFFIX:ar});function yr(){const{createInstance:n,dropInstance:e}=Jn(),t="/",r=i=>{const u=URL.createObjectURL(i);return De.push(u),u},a=()=>{De.forEach(i=>URL.revokeObjectURL(i)),De=[]},s=()=>f(this,null,function*(){return yield c(),{clearRequest:o,getAllRequest:g,getRequest:D,status:!0,message:"数据库打开成功",DATABASE:W}}),o=i=>f(this,null,function*(){if(!i)return{status:!1,message:"删除失败"};yield c(),yield W.removeItem(i);const u=yield j();return u.list=u.list.filter(m=>m.name!==i),{status:!0,message:"删除成功"}}),d=(...u)=>f(this,[...u],function*(i=ye){W=null,ue=null,yield e({name:i,storeName:Pe})}),c=()=>f(this,null,function*(){return W||(ue||(ue=n({name:ye,storeName:Pe}).then(i=>(W=i,i))),yield ue)}),p=i=>{if(!i)return!1;const u=String(i.message||"");return i.name==="DataError"||u.includes("in-line keys")},A=()=>f(this,null,function*(){W=null,ue=null,yield e({name:ye}),yield c()});let B=null;const j=()=>f(this,null,function*(){return window.threeEditorDB?window.threeEditorDB:(B||(B=f(this,null,function*(){const i=yield s(),{data:u}=yield i.getAllRequest();return window.threeEditorDB={db:i,list:u},window.threeEditorDB})),yield B)}),D=i=>f(this,null,function*(){if(!i)return{status:!1,message:"获取失败"};yield c();const u=yield W.getItem(i);if(u!=null&&u.blob&&!i)return{status:!0,message:"获取成功",url:r(u.blob)};if(!i)return{status:!1,message:"获取失败"};const m=yield fetch(i).then(O=>O.blob()),E={blob:m};try{yield W.setItem(i,E)}catch(O){if(!p(O))throw O;yield A(),yield W.setItem(i,E)}const C=yield j(),$=l({name:i},E),L=C.list.findIndex(O=>O.name===i);return L>-1?C.list.splice(L,1,$):C.list.push($),{status:!0,message:"文件缓存成功",url:r(m)}}),g=()=>f(this,null,function*(){yield c();const i=[];return W&&(yield W.iterate((u,m)=>{i.push(v(l({},u||{}),{name:m}))})),window.threeEditorDB&&(window.threeEditorDB.list=i),{status:!0,message:"获取成功",data:i}}),N=()=>f(this,null,function*(){var m;const{res:i}=yield Y.getApi("/filehandle/scan",{path:pt.threeModelPath,extension:"glb,gltf"}),u=[];if(((m=i==null?void 0:i.children)==null?void 0:m.length)>0)for(const E of i.children)u.push({name:E.name,path:"/"+E.path});return u}),oe=()=>window.GUI_PARAMS||Me,se=()=>window.threeEditor||null,_=()=>window.editorJsons||[],I=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),b=()=>_r,x=()=>gr||{},U=()=>window[he]||"",q=()=>wr,T=()=>window.devicePixelRatio||1,w=()=>window[he]||"",F=()=>{const i=b(),u=q();return{modelDesigns:i,componentDesigns:u,modelList:i.map(m=>m.label),componentList:u.map(m=>m.label)}},K=(i,u)=>{var m;return(m=i==null?void 0:i.__DESIGNS__)==null?void 0:m.find(E=>E.label===u)},H=(i=0)=>!Number.isFinite(i)||i<=0?"0 B":i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:i<1024*1024*1024?`${(i/1024/1024).toFixed(1)} MB`:`${(i/1024/1024/1024).toFixed(2)} GB`,re=i=>{const u=window[Le];typeof u=="function"&&u(i)},P=i=>!!i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z),G=i=>{var u,m;return!i||!i.visible||(u=i.userData)!=null&&u.excludeFromExport||i.isTransformControls||i.isHelper||i.isLight||i.isPoints||(m=i.type)!=null&&m.includes("Helper")||Ct.has(i.type)||vt.has(i.type)||i.isCSS2DObject||i.isCSS3DObject?!1:i.isMesh||i.isGroup||i.isObject3D||i.isLine},X=(i,u)=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)?i:u,J=i=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)&&Number.isFinite(i.w)?i:{x:0,y:0,z:0,w:1},V=i=>{if(!(i!=null&&i.isObject3D))return;const u=X(i.position,{x:0,y:0,z:0});i.position.set(u.x,u.y,u.z);const m=X(i.scale,{x:1,y:1,z:1});i.scale.set(m.x===0?1:m.x,m.y===0?1:m.y,m.z===0?1:m.z);const E=X(i.up,{x:0,y:1,z:0});i.up.set(E.x,E.y,E.z);const C=J(i.quaternion);i.quaternion.set(C.x,C.y,C.z,C.w),i.pivot&&!P(i.pivot)&&delete i.pivot,i.updateMatrix(),i.updateMatrixWorld(!1)},Mt=(i,u="_blank")=>window.open(i,u),Nt=(i,u="")=>window.prompt(i,u),Ot=()=>window.location.reload(),kt=()=>document.documentElement.classList.remove("dark"),Ft=i=>{if(!Array.isArray(i==null?void 0:i.__DESIGNS__))return F();const u=[...b(),...q()],m=new Set(i.__DESIGNS__.map(E=>Je(E)));return u.forEach(E=>{const C=Je(E);!C||m.has(C)||(m.add(C),i.__DESIGNS__.unshift(E))}),F()},Ut=i=>{if(!Array.isArray(i==null?void 0:i.__GLSLLIB__))return;const u=new Set(i.__GLSLLIB__.map(m=>m==null?void 0:m.name));Er.forEach(m=>{u.has(m.name)||(u.add(m.name),i.__GLSLLIB__.push(m))})},Ce=(i={})=>{const u={};return Object.entries(i||{}).forEach(([m,E])=>{if(!(St.has(m)||typeof E=="function")){if(!E||["string","number","boolean"].includes(typeof E)){u[m]=E;return}if(Array.isArray(E)){try{u[m]=structuredClone(E)}catch(C){return}return}if(!(E.isObject3D||E.isMaterial||E.isTexture||E.nodeType))try{u[m]=structuredClone(E)}catch(C){return}}}),u},Ht=(i=Me)=>{window.GUI_PARAMS=i},Bt=i=>{window.threeEditor=i},Gt=i=>{window.threeEditorDB=i},Vt=i=>{window[Le]=i},zt=(i="")=>{window[he]=i},Kt=(i="")=>{window[he]=i},Ge=i=>{var m;const u=[];return(m=i==null?void 0:i.children)==null||m.forEach(E=>{G(E)&&u.push(E)}),u},Ve=(i=[])=>{const u={rootCount:i.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return i.forEach(m=>{m.traverse(E=>{var C,$,L;if(G(E)){u.nodeCount+=1,E.isMesh&&(u.meshCount+=1,u.vertexCount+=((L=($=(C=E.geometry)==null?void 0:C.attributes)==null?void 0:$.position)==null?void 0:L.count)||0);return}E!==m&&(u.skippedCount+=1)})}),u},ze=()=>new Promise(i=>requestAnimationFrame(()=>setTimeout(i,0))),Ke=()=>new Promise(i=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>i(),{timeout:80});return}setTimeout(i,0)}),__$t__=(i,u)=>f(this,null,function*(){var C;if(!G(i))return null;const m=i.clone(!1);m.userData=Ce(i.userData),P(i.pivot)?m.pivot=new z.THREE.Vector3(i.pivot.x,i.pivot.y,i.pivot.z):"pivot"in m&&delete m.pivot,V(m);const E=[{source:i,clone:m}];for(;E.length;){const $=E.shift();for(const L of $.source.children){if(!G(L)){u.skippedCount+=1;continue}const O=L.clone(!1);O.userData=Ce(L.userData),P(L.pivot)?O.pivot=new z.THREE.Vector3(L.pivot.x,L.pivot.y,L.pivot.z):"pivot"in O&&delete O.pivot,V(O),$.clone.add(O),E.push({source:L,clone:O}),u.processedCount+=1,u.processedCount%It===0&&(yield(C=u.onProgress)==null?void 0:C.call(u,{processedCount:u.processedCount,totalCount:u.totalCount,skippedCount:u.skippedCount,progress:18+Math.min(u.processedCount/Math.max(u.totalCount,1)*54,54)}),yield ze())}}return m});return{baseUrl:t,getModels:N,getRequest:D,reloadPage:Ot,promptInput:Nt,waitForIdle:Ke,waitForPaint:ze,clearRequest:o,getGuiParams:oe,setGuiParams:Ht,getAllRequest:g,getEditorJsons:_,getThreeEditor:se,formatFileSize:H,setThreeEditor:Bt,removeDarkClass:kt,openExternalUrl:Mt,getThreedModels:b,getViewportSize:I,buildExportScene:(m,...E)=>f(this,[m,...E],function*(i,u={}){const C=Ge(i),$=Ve(C),L=new z.THREE.Scene,O={totalCount:$.nodeCount,processedCount:0,skippedCount:0,onProgress:u.onProgress};for(const Wt of C){const $e=yield __$t__(Wt,O);$e&&L.add($e),yield Ke()}return L.updateMatrixWorld(!0),$.skippedCount+=O.skippedCount,{exportScene:L,exportObjects:C,stats:$}}),createModelDbApi:s,getEditorPreviewSceneUrl:w,sanitizeUserData:Ce,setThreeEditorDB:Gt,findThreedDesign:K,getThreedLightMap:x,collectExportStats:Ve,getPreviewSceneUrl:U,setEditorPreviewSceneUrl:Kt,setPreviewSceneUrl:zt,setModelLoadHander:Vt,isExportableObject:G,deleteThreeEditorDB:d,ensureThreeEditorDB:j,getDevicePixelRatio:T,getThreedComponents:q,collectExportObjects:Ge,resetModelDbInstance:A,ensureModelDbInstance:c,getLocalDesignMenuData:F,invokeModelLoadHandler:re,isLegacyInlineKeyError:p,ensureThreedShaderLibrary:Ut,ensureThreedDesignRegistry:Ft,createBlobUrl:r,revokeModelObjectUrls:a}}const{THREED_LOG_BUFFER:Tt,THREED_CURRSCENE:Ne,THREED_ACTIVE_MENU:Rt,THREED_PIXEL_RATIO:Dt,THREED_SCENE_PREVIEW:bt,THREED_ADDON_EDITOR_JSON:Oe,THREED_DEFAULT_SCENE_NAME:Ir,THREED_DEFAULT_ACTIVE_MENU:ke,THREED_DEFAULT_PIXEL_RATIO:Fe,THREED_SCENE_STORAGE_SUFFIX:Sr}=Ar(),te=(n,e)=>{const t=Be.getLocal(n);return t==null?e:t},Z=(n,e)=>{n&&Be.setLocal(n,e)},Cr=n=>{n&&Be.removeLocal(n)},vr=(n,e)=>{var r,a;const t=(r=n==null?void 0:n.trim)==null?void 0:r.call(n);return t&&e.some(s=>s.name===t)?t:((a=e[0])==null?void 0:a.name)||Ir},Ue=(n=[])=>Array.isArray(n)?n.filter(e=>typeof e=="string"&&e):[],xr=()=>{const n=[],e=te(Ne,{name:"",path:""}),t=Number.parseFloat(te(Dt,Fe));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:n,previewScene:!!te(bt,!1),activeMenuTitle:te(Rt,ke)||ke,pixelRatio:Number.isFinite(t)&&t>0?t:Fe,logarithmicDepthBuffer:te(Tt,!0)!==!1,addonEditorJson:Ue(te(Oe,[]))}},Pt=He.defineStore("threed",{state:()=>xr(),actions:{getSceneList(n){return f(this,null,function*(){var t;const e=yield Y.getCommonApi("threedfloorplan",{limit:1e4,ordering:"-create_time"});if((t=e==null?void 0:e.data)!=null&&t.length){if(this.sceneList=e.data,n){const r=this.sceneList.find(a=>a.org_id===n);r?this.setCurrScene(r):this.setCurrScene({name:"",path:""});return}this.currScene.path?this.sceneList.find(a=>a.id===this.currScene.id)||this.setCurrScene({name:"",path:""}):this.setCurrScene(this.sceneList[0])}else this.sceneList=[],this.setCurrScene({name:"",path:""})})},setSceneList(n){this.sceneList=n},setSceneName(n){this.sceneName=vr(n,this.sceneList),Z(Ne,this.sceneName)},createScene(n,e=""){return f(this,null,function*(){var d,c,p;const t=(c=(d=n.name)==null?void 0:d.trim)==null?void 0:c.call(d);if(!t||this.sceneList.some(A=>A.name===t))return!1;const r=pt.threeSavePath+"/"+pe()+".json",a=pe();if(!(yield Y.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:r,guid:a,org_id:n.org_id,org_name:n.org_name}]})).success)return!1;if(yield jn(r,e)){const A=yield Y.postCommonApi("threedfloorplan",{guid:a});if((p=A==null?void 0:A.data)!=null&&p.length)return this.sceneList=[...this.sceneList,A.data[0]],A.data[0]}return!1})},updateScene(n){return f(this,null,function*(){var r,a;const e=(a=(r=n.name)==null?void 0:r.trim)==null?void 0:a.call(r);return!e||this.sceneList.some(s=>s.name===e)?!1:(yield Y.postCommonApi("query/threedfloorplan/update",{data:[{name:e,id:n.id,org_id:n.org_id,org_name:n.org_name}]})).success})},deleteScene(n){return f(this,null,function*(){var r;if(!n)return;if(!(yield Y.postCommonApi("query/threedfloorplan/delete",{data:[n]})).success)return!1;const t=this.sceneList.findIndex(a=>a.id===n);return t===-1?!1:(this.sceneList.splice(t,1),((r=this.currScene)==null?void 0:r.id)===n&&this.setCurrScene(this.sceneList[0]||{name:"",path:""}),!0)})},setCurrScene(n){return f(this,null,function*(){this.currScene=n,Z(Ne,this.currScene)})},setPreviewMode(n){this.previewScene=!!n,Z(bt,this.previewScene)},setActiveMenuTitle(n){this.activeMenuTitle=n||ke,Z(Rt,this.activeMenuTitle)},setPixelRatio(n){const e=Number.parseFloat(n);this.pixelRatio=Number.isFinite(e)&&e>0?e:Fe,Z(Dt,this.pixelRatio)},setLogarithmicDepthBuffer(n){this.logarithmicDepthBuffer=!!n,Z(Tt,this.logarithmicDepthBuffer)},getSceneStorageKey(n){return`${n||this.sceneName}${Sr}`},getSceneStorageParams(n,e=null){return te(this.getSceneStorageKey(n),e)},setSceneStorageParams(n,e){n&&Z(this.getSceneStorageKey(n),e)},removeSceneStorageParams(n){n&&Cr(this.getSceneStorageKey(n))},resetTaskState(){return f(this,null,function*(){yield new Promise(n=>setTimeout(n,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=Ue(te(Oe,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(n){this.addonEditorJson=Ue(n),Z(Oe,this.addonEditorJson)}}}),Tr={backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},Rr={fov:50,near:.1,far:1e5,zoom:1,layers:{mask:1},filmOffset:0,filmGauge:35,position:{x:247.72931803058157,y:715.3890430349733,z:789.6794984861216}},Dr={outputColorSpace:"srgb",toneMapping:0,toneMappingExposure:1,shadowMap:{enabled:!1,type:1},color:0,opacity:0,sortObjects:!0,localClippingEnabled:!1,autoClear:!0,autoClearColor:!0,renderListCompare:[{name:"stats",enabled:!0},{name:"controls",enabled:!0},{name:"scene",enabled:!0},{name:"css3DRender",enabled:!0},{name:"css2DRender",enabled:!0}]},br={autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,minDistance:.01,maxDistance:1e6,maxAzimuthAngle:null,minAzimuthAngle:null,maxPolarAngle:3.141592653589793,minPolarAngle:0,maxTargetRadius:null,minTargetRadius:0,enablePan:!0,panSpeed:1,enableRotate:!0,rotateSpeed:1,enableZoom:!0,zoomSpeed:1,zoomToCursor:!1,target:{x:-38.59603927643809,y:-48.97202695679889,z:-49.19814250541991}},Pr={mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},Lr={renderWay:"effectComposer",fxaaPass:{enabled:!0,order:60,multPixel:1},outlinePass:{enabled:!0,order:40,edgeStrength:3,edgeGlow:0,edgeThickness:1,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16449071,hiddenEdgeColor:16449071,overlayMaterial:{blending:5,blendEquation:100,blendSrc:201,blendDst:205}},outputPass:{enabled:!0,order:50},saoPass:{enabled:!1,order:10,saoBias:.5,saoIntensity:.01,saoScale:100,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},screenMaskPass:{enabled:!1,order:70,intensity:1,maskColor:16777215,R:.2,sr:1.2},ssrPass:{enabled:!1,order:30,maxDistance:.01,distanceAttenuation:!0,opacity:.5,thickness:.018,fresnel:!0,infiniteThick:!1,bouncing:!1},unrealBloomPass:{enabled:!1,order:20,strength:1.5,radius:.4,threshold:.85}},Mr={mode:"transform",openKeyEnable:!0,rightClickMenusEnable:!0,selectChildEnabled:!1,selectChildLevel:1,stats:{showStats:!1,statsMode:0},helpers:{axes:{showAxes:!0,axesLength:1e3},grid:{showGrid:!0,size:1e3,divisions:15,colorCenterLine:4473924,colorGrid:8947848},box3:{useBox3:!0,color:16776960}}},Nr=[],Or=[],kr=[],Fr=[],Ur=[],Hr=[],Br={},Gr=[],Vr={viewAngleList:[],clipping:{size:20,clipList:[]}},zr={scene:Tr,perspectiveCamera:Rr,webglRenderer:Dr,orbitControls:br,transformControls:Pr,effectComposer:Lr,handler:Mr,lightCores:Nr,innerCores:Or,modelCores:kr,drawCores:Fr,textCores:Ur,particleCores:Hr,geoCores:Br,designCores:Gr,other:Vr},Kr=[{key:0,value:"离线"},{key:1,value:"在线"}],$r=[{key:0,value:"反向"},{key:1,value:"正向"},{key:2,value:"停止"}],Wr=[{key:1,value:1},{key:2,value:2},{key:3,value:3},{key:4,value:4},{key:5,value:5}],jr="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",ee=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}]}]},qr=window.meta.graph.lightPlateColorMap?window.meta.graph.lightPlateColorMap:{0:"#00d200"},Xr=window.meta.graph.lightPlateTextMap?window.meta.graph.lightPlateTextMap:{0:"#fff"},R={form:[{name:"带电状态",key:"charged_state",type:"select",dataIds:{},options:Kr.map(n=>({label:n.value,value:n.key}))},{name:"潮流方向",key:"electric_direction",type:"select",dataIds:{},options:$r.map(n=>({label:n.value,value:n.key}))},{name:"电荷大小",key:"electric_size",type:"select",dataIds:{},options:Wr.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},h=v(l({penType:y.NORMAL},R),{form:[...ee[y.NORMAL],...R.form]});xe.YX,xe.YX,xe.YX,y.POINT_VALUE,R.anchors,window.visibleLevel,R.form,R.form,window.dataType,window.dataProp,window.visibleLevel,R.form,window.dataType,window.dataProp,window.visibleLevel,R.form,window.dataType,window.dataProp,window.visibleLevel,Xr[0],y.LIGHT_PLATE,qr[0],R.anchors,window.visibleLevel,[...ee[y.LIGHT_PLATE],...R.form],me+"",y.SENSOR,R.anchors,window.visibleLevel,[...ee[y.LIGHT_PLATE],...R.form],v(l({width:100,height:30,name:"text",penName:"文本",text:"文本",disableAnchor:!0,penType:y.TEXT},R),{form:[...ee[y.TEXT],...R.form]}),l({width:100,height:100,name:"square",penName:"正方形"},h),v(l({type:1,name:"line",width:100,height:5,lineWidth:2,lineName:"line",penName:"line",background:"#FFF000",color:"#FFF000"},h),{lineAnimateType:1,anchors:[{x:0,y:.5,id:"0"},{x:1,y:.5,id:"1"}]}),l({width:200,height:50,borderRadius:0,name:"rectangle",penName:"矩形"},h),l({width:100,height:100,name:"circle",penName:"圆"},h),l({width:100,height:100,name:"triangle",penName:"三角形"},h),l({width:100,height:100,name:"diamond",penName:"菱形"},h),l({width:100,height:100,name:"pentagon",penName:"五边形"},h),l({width:100,height:100,name:"hexagon",penName:"六边形"},h),l({width:100,height:100,name:"pentagram",penName:"五角星"},h),l({width:120,height:60,name:"leftArrow",penName:"左箭头"},h),l({width:120,height:60,penName:"右箭头",name:"rightArrow"},h),l({width:150,height:60,name:"twowayArrow",penName:"双向箭头"},h),l({width:100,height:100,name:"cloud",penName:"云"},h),l({textTop:-.1,width:100,height:100,name:"message",penName:"消息框"},h),l({width:80,height:100,name:"file",penName:"文件"},h),v(l({width:60,height:100,name:"cube",penName:"立方体",z:.25},h),{props:{custom:[{key:"z",label:"Z",type:"number",min:0,placeholder:"<= 1 即宽度的比例"},{key:"backgroundFront",label:"前背景色",type:"color"},{key:"backgroundUp",label:"顶背景色",type:"color"},{key:"backgroundRight",label:"右背景色",type:"color"}]}}),l({width:70,height:100,name:"people",penName:"人"},h),v(l({name:"rectangle",penName:"按钮",width:80,height:30,borderRadius:.2,text:"按钮",background:"#1890ff",color:"#1890ff",textColor:"#fff",activeBackground:"#40a9ff",activeColor:"#40a9ff",activeTextColor:"#fff",hoverBackground:"#40a9ff",hoverColor:"#40a9ff",hoverTextColor:"#fff"},h),{penType:y.BUTTON}),v(l({name:"rectangle",penName:"输入框",height:50,width:200,input:!0,borderRadius:.05,ellipsis:!0,text:"输入数据",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10},h),{penType:y.INPUT}),v(l({name:"rectangle",penName:"选择器",height:50,width:200,borderRadius:.05,ellipsis:!0,text:"选项1",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10,dropdownList:[{text:"选项1"},{text:"选项2"},{text:"选项3"}]},h),{penType:y.SELECT}),v(l({name:"slider",penName:"进度条",width:300,height:30,value:10,textWidth:50,barHeight:4,fontSize:20,min:0,max:100,color:"#1890ff",background:"#D4D6D9",textColor:"#222",unit:"%"},h),{penType:y.SLIDER}),v(l({name:"time",penName:"时间",width:300,height:40,text:`${tn().format("YYYY-MM-DD HH:mm:ss")}`,lineWidth:0,fontSize:20,interval:67,fillZero:!0},h),{penType:y.TIME,form:[{key:"timeFormat",name:"显示格式",type:"text"},{key:"fillZero",name:"是否补0",type:"switch"},...h.form],timeFormat:"`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"}),v(l({name:"switch",penName:"开关",height:30,width:60,checked:!1,offColor:"#BFBFBF",onColor:"#1890ff",disableOffColor:"#E5E5E5",disableOnColor:"#A3D3FF",locked:0},h),{penType:y.SWITCH}),v(l({name:"radio",penName:"单选框",direction:"horizontal",width:150,height:30,checked:"",options:[{text:"选项一"},{text:"选项二"},{text:"选项三",isForbidden:!0}]},h),{penType:y.RADIO}),v(l({name:"checkbox",penName:"多选框",width:30,height:30,checked:!0,value:"选项一"},h),{penType:y.CHECKBOX}),v(l({name:"table2",penName:"表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType:y.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"}]}),v(l({name:"table2",penName:"斑马纹表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!0,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType:y.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"}]}),v(l({name:"table2",penName:"滚动表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,swiper:!0,maxNum:5,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType:y.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"}]}),v(l({name:"svg",width:100,height:100,image:me+"/icon/audio.svg",audioId:"",penName:"音频",datable:!0,penType:y.AUDIO},R),{form:[...ee[y.AUDIO],...R.form],events:[{name:"enter",action:Ee.Emit,value:Q.OPEN_AUDIO,where:{type:""},params:JSON.stringify({action:Q.OPEN_AUDIO,data:""})},{name:"leave",action:Ee.Emit,value:Q.CLOSE_AUDIO,where:{type:""},params:JSON.stringify({action:Q.CLOSE_AUDIO,data:""})}]}),v(l({name:"svg",width:100,height:100,image:me+"/icon/camera.svg",cameraId:"",penName:"摄像机",datable:!0,events:[{name:"enter",action:Ee.Emit,value:Q.OPEN_CAMERA,where:{type:""},params:JSON.stringify({action:Q.OPEN_CAMERA,data:""})},{name:"leave",action:Ee.Emit,value:Q.CLOSE_CAMERA,where:{type:""},params:JSON.stringify({action:Q.CLOSE_CAMERA,data:""})}],penType:y.CAMERA},R),{form:[...ee[y.CAMERA],...R.form]}),v(l({name:"video",width:100,height:100,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penName:"MP4",penType:y.MP4},R),{form:[...ee[y.MP4],...R.form]}),v(l({name:"video",width:100,height:100,penName:"视频流",datable:!0,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penType:y.VIDEO_STREAM},R),{form:[...ee[y.VIDEO_STREAM],...R.form]}),l({text:"开始/结束",width:120,height:40,borderRadius:.5,name:"rectangle",penName:"开始/结束"},h),l({text:"流程",width:120,height:40,name:"rectangle",penName:"流程"},h),l({text:"判定",width:120,height:60,name:"diamond",penName:"判定"},h),l({text:"数据",width:120,height:50,name:"flowData",penName:"数据",offsetX:.14},h),l({text:"准备",width:120,height:50,name:"hexagon",penName:"准备"},h),l({text:"子流程",width:120,height:50,name:"flowSubprocess",penName:"子流程"},h),l({text:"数据库",width:80,height:120,name:"flowDb",penName:"数据库"},h),l({text:"文档",width:120,height:100,name:"flowDocument",penName:"文档"},h),l({text:"内部存储",width:120,height:80,name:"flowInternalStorage",penName:"内部存储"},h),l({text:"外部存储",width:120,height:80,name:"flowExternStorage",penName:"外部存储"},h),l({text:"队列",width:100,height:100,name:"flowQueue",penName:"队列"},h),l({text:"手动输入",width:120,height:80,name:"flowManually",penName:"手动输入"},h),l({text:"展示",width:120,height:80,name:"flowDisplay",penName:"展示"},h),l({text:"并行模式",width:120,height:50,name:"flowParallel",penName:"并行模式"},h),l({text:"注释",width:100,height:100,name:"flowComment",penName:"注释"},h),l({text:"",width:30,height:30,name:"circle",penName:"开始",background:"#555",lineWidth:0},h),l({width:30,height:30,name:"activityFinal",penName:"结束"},h),l({text:"活动",width:120,height:50,borderRadius:.25,name:"rectangle",penName:"活动"},h),l({text:"决策/合并",width:120,height:50,name:"diamond",penName:"决策/合并"},h),l({text:"垂直泳道",width:200,height:500,name:"swimlaneV",penName:"垂直泳道",textBaseline:"top",textTop:20,lineTop:.08},h),l({text:"水平泳道",width:500,height:200,name:"swimlaneH",penName:"水平泳道",textWidth:.01,textLeft:.04,textAlign:"left",lineLeft:.08},h),l({text:"垂直分岔/汇合",width:10,height:150,name:"forkV",penName:"垂直分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({text:"水平分岔/汇合",width:150,height:10,name:"forkH",penName:"水平分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({name:"andGate",penName:"与门",width:100,height:150},h),l({name:"basicEvent",penName:"基本事件",width:100,height:150},h),l({name:"unexpandedEvent",penName:"未展开事件",width:100,height:150},h),l({name:"priorityAndGate",penName:"优先AND门",width:100,height:150},h),l({name:"forbiddenGate",penName:"禁止门",width:100,height:150},h),l({name:"event",penName:"事件",width:100,height:150},h),l({name:"switchEvent",penName:"开关事件",width:100,height:150},h),l({name:"conditionalEvent",penName:"条件事件",width:150,height:100},h),l({name:"transferSymbol",penName:"转移符号",width:100,height:150},h),l({name:"orGate",penName:"或门",width:100,height:150},h),l({name:"xorGate",penName:"异或门",width:100,height:150},h),l({name:"votingGate",penName:"表决门",width:100,height:150},h);const Yr=(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:sn}:${e.isDev?e.devServerPort:ln}`),e.isDev?n:n.replace("/baseUrl","")),Lt=(n,e)=>{const t=n.__vccOpts||n;for(const[r,a]of e)t[r]=a;return t},Jr=Object.assign({name:"ThreedEditor"},{__name:"editor",props:{data:{type:Object,default:()=>({})},preview:{type:Boolean,default:!1}},emits:["emit-three-editor","graph-event"],setup(n,{expose:e,emit:t}){var q;const r=t,a=n,s=Pt(),{currScene:o}=He.storeToRefs(s),d=((q=window.meta.threed)==null?void 0:q.draco_path)||me;z.ThreeEditor.dracoPath=d.endsWith("/")?d:`${d}/`;let c=null,p=null,A=!1;const B=M.ref(null),{setGuiParams:j,getDevicePixelRatio:D,ensureThreeEditorDB:g,createBlobUrl:N,revokeModelObjectUrls:oe,ensureThreedDesignRegistry:se}=yr();se(z.ThreeEditor),j({step:.1});const _=()=>{var T;return(T=c==null?void 0:c.renderSceneResize)==null?void 0:T.call(c)},I=()=>f(this,null,function*(){var w,F;if(A)return;let T=zr;try{if(a.data&&Object.keys(a.data).length)T=a.data;else if((w=o.value)!=null&&w.path){const H=yield Y.getApi((F=o.value)==null?void 0:F.path).catch(()=>({}));if(A)return;H.res&&(T=H.res)}const K=yield b(T);if(A)return;c?c.resetEditorStorage(K):c=new z.ThreeEditor(B.value,{fps:null,pixelRatio:D()*s.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0},sceneParams:K})}catch(K){console.error("三维图纸初始化失败",K),c==null||c.resetEditorStorage(T)}finally{x()}r("emit-three-editor",c),window.addEventListener("resize",_)}),b=T=>f(this,null,function*(){var re;const w=structuredClone(T||{});if((re=w.designCores)==null||re.forEach(P=>{P.preview=a.preview}),a.preview){w.handler.mode="none",w.handler.helpers.axes.showAxes=!1,w.handler.helpers.box3.useBox3=!1,w.handler.helpers.grid.showGrid=!1,w.handler.rightClickMenusEnable=!1;const{perspectiveCamera:P,orbitControls:G}=w,X=P==null?void 0:P.position,J=G==null?void 0:G.target;if(X&&J){const V=Math.hypot(X.x-J.x,X.y-J.y,X.z-J.z);Number.isFinite(V)&&V>0&&(G.maxDistance=V*(5/3))}}const F=yield g(),K=F.list||[],H=[];for(const P of w.modelCores||[]){const G=P.modelInfo.originPath;if(G){const X=K.find(V=>V.name===G);if(!X){const V=yield F.db.getRequest(Yr(G));V!=null&&V.url&&(P.modelInfo.url=V.url),H.push(P);continue}const J=N(X.blob);P.modelInfo.url=J}H.push(P)}return w.modelCores=H,w}),x=()=>{c!=null&&c.renderer&&(p=new z.THREE.PMREMGenerator(c.renderer),p.compileEquirectangularShader(),c.scene.environment=p.fromScene(new an.RoomEnvironment).texture)},U=()=>c;return M.watch([()=>o.value.path,()=>a.data],([T,w])=>{console.log("watch",T,w),I()},{deep:!0}),M.onMounted(()=>f(this,null,function*(){var T,w;A=!1,(T=B.value)!=null&&T.clientHeight&&((w=B.value)!=null&&w.clientWidth)&&I()})),M.onUnmounted(()=>{A=!0,window.removeEventListener("resize",_),c==null||c.destroySceneRender(),p==null||p.dispose(),oe()}),e({getEditorInstance:U}),(T,w)=>(M.openBlock(),M.createElementBlock("div",{ref_key:"editorRef",ref:B,class:"threed-editor",onDragover:w[0]||(w[0]=M.withModifiers(()=>{},["prevent"])),onDrop:w[1]||(w[1]=M.withModifiers(()=>{},["prevent"]))},null,544))}}),Qr=Lt(Jr,[["__scopeId","data-v-f4011fe8"]]),Zr={class:"threed-preview"},ea=Object.assign({name:"ThreedPreview"},{__name:"preview",props:{data:{type:Object,default:null},url:{type:String,default:""},id:{type:String,default:""},token:{type:String,default:""},socketUrl:{type:String,default:""}},emits:["loaded","graph-event"],setup(n,{expose:e,emit:t}){const r=n,a=t;let s=M.shallowRef({});const o=M.ref(),d=Pt();let c={},p=null,A=null;const B=_=>{var b,x,U;if(!_)return;if((b=_==null?void 0:_.includes)!=null&&b.call(_,"token 必传"))return fe({message:_,type:"warning"});const I=typeof _=="string"?JSON.parse(_):_;if((I==null?void 0:I.data)==="服务错误"||(U=(x=I==null?void 0:I.data)==null?void 0:x.includes)!=null&&U.call(x,"token is expired"))return fe({message:I.data,type:"warning"});switch(I.action){case je.ACPOINT.YCVALUE:case je.ACPOINT.YXVALUE:console.warn("遥测信息");break}},j=()=>{try{A=new Mn({socketUrl:r.socketUrl,token:r.token,onMessage:B})}catch(_){console.warn("三维场景消息处理失败",_)}},D=()=>f(this,null,function*(){var _;if(c){const I=Object.keys(c);if(I.length){const b=yield Y.postPDApi("querychannelstatus/",{data:I.map(x=>({ied_id:x,ln_list:c[x].map(U=>U.ln_id)}))});(_=b==null?void 0:b.data)!=null&&_.length&&I.forEach(x=>{const U=b.data.find(T=>T.ied_id===x),q=c[x];q!=null&&q.length&&q.forEach(T=>{const w=U.result.find(F=>F.ln_id===T.ln_id);if(w){const F=se();if(!(F!=null&&F.scene))return;const K=F.scene.getObjectsByProperty("dataId",T.guid);let H=K==null?void 0:K[0];if(H){const re=w.status==="告警"?2:w.status==="正常"?1:0;H.userData.params.state=re;const P=On(w.amp_peak)?kn(Number(w.amp_peak))?Number(w.amp_peak):0:w.amp_peak;H.userData.params.value=P,H.changeState(re),H.changeValue(P),H.changeName(w.name)}}})})}}}),g=_=>{a("graph-event",_)},N=_=>{_&&(r.socketUrl&&j(),setTimeout(()=>{const I=_.scene.getObjectsByProperty("designType","局放测点");I.forEach(b=>{const{ied_id:x,ln_id:U}=b.userData.params;c[x]||(c[x]=[]),c[x].push({guid:b.dataId,id:b.uuid,ied_id:x,ln_id:U})}),I!=null&&I.length&&(p&&clearInterval(p),D(),p=setInterval(()=>{D()},2e3)),a("loaded",_)},100))},oe=()=>f(this,null,function*(){if(s.value&&Object.keys(s.value).length)return;const _=Fn(),I=r.url||_.url;if(I){const U=yield Y.getApi(I).catch(()=>({}));U.res&&(s.value=U.res);return}if(!(r.id||_.id)){console.warn("三维场景渲染失败,场景id为空!");return}const x=yield Y.getCommonApi("threedfloorplan",{guid:r.id});x.data.length?d.setCurrScene(x.data[0]):console.warn("三维场景渲染失败,场景id为:"+r.id+"不存在!")}),se=()=>o.value?o.value.getEditorInstance():null;return M.watch(()=>r.data,_=>{_&&(s.value=_,oe())},{deep:!0,immediate:!0}),M.watch(()=>r.id,_=>{_&&oe()},{deep:!0,immediate:!0}),M.onMounted(()=>{Ie.on("three-event",g)}),M.onUnmounted(()=>{A&&A.destroy(),p&&clearInterval(p),Ie.off("three-event",g)}),e({getEditorInstance:se}),(_,I)=>(M.openBlock(),M.createElementBlock("div",Zr,[M.createVNode(Qr,{ref_key:"threedEditorRef",ref:o,data:M.unref(s),preview:"",onGraphEvent:g,onEmitThreeEditor:N},null,8,["data"])]))}}),ge=Lt(ea,[["__scopeId","data-v-edbc5791"]]);ge.name||(ge.name="SyThree");const ta=n=>{n.component(ge.name||"SyThree",ge)},na={install:ta};exports.SyThree=ge;exports.default=na;
|
|
44
|
+
`,key:"col",commonFinish:!0,render:"iTime+speed"}];let _e=null,G=null,Ne=[];const nt=n=>(n==null?void 0:n.name)||(n==null?void 0:n.label)||"",Ot=(n={})=>Object.values(n).filter(e=>e&&(e.label||e.name)),wr=Ot(fr),Ar=Ot(gr),yr=()=>({THREED_GUI_PARAMS:Fe,THREED_LOG_BUFFER:Zn,THREED_CURRSCENE:er,THREED_ACTIVE_MENU:tr,THREED_PIXEL_RATIO:nr,THREED_IMPORT_SIZE:or,THREED_LIGHT_TYPES:mr,THREED_EXPORT_BATCH:Pt,THREED_RELOAD_DELAY:sr,THREED_MODEL_DBNAME:ve,THREED_MODEL_DBSTORE:Oe,THREED_SCENE_PREVIEW:rr,THREED_USER_DATA_KEYS:Lt,THREED_MODEL_LOAD_KEY:ke,THREED_PREVIEW_URL_KEY:Ee,THREED_ADDON_EDITOR_JSON:ar,THREED_EXPORT_NODE_COUNT:lr,THREED_DEFAULT_SCENE_NAME:dr,THREED_DEFAULT_ACTIVE_MENU:ur,THREED_DEFAULT_PIXEL_RATIO:hr,THREED_EXPORT_VERTEX_COUNT:cr,THREED_SCENE_EXCLUDE_TYPES:pr,THREED_EXPORT_EXCLUDE_TYPES:Nt,THREED_EXPORT_RUNTIME_TYPES:Mt,THREED_SCENE_STORAGE_SUFFIX:ir});function Sr(){const{createInstance:n,dropInstance:e}=Qn(),t="/",r=i=>{const d=URL.createObjectURL(i);return Ne.push(d),d},a=()=>{Ne.forEach(i=>URL.revokeObjectURL(i)),Ne=[]},o=()=>p(this,null,function*(){return yield c(),{clearRequest:s,getAllRequest:E,getRequest:q,status:!0,message:"数据库打开成功",DATABASE:G}}),s=i=>p(this,null,function*(){if(!i)return{status:!1,message:"删除失败"};yield c(),yield G.removeItem(i);const d=yield W();return d.list=d.list.filter(m=>m.name!==i),{status:!0,message:"删除成功"}}),u=(...d)=>p(this,[...d],function*(i=ve){G=null,_e=null,yield e({name:i,storeName:Oe})}),c=()=>p(this,null,function*(){return G||(_e||(_e=n({name:ve,storeName:Oe}).then(i=>(G=i,i))),yield _e)}),f=i=>{if(!i)return!1;const d=String(i.message||"");return i.name==="DataError"||d.includes("in-line keys")},I=()=>p(this,null,function*(){G=null,_e=null,yield e({name:ve}),yield c()});let K=null;const W=()=>p(this,null,function*(){return window.threeEditorDB?window.threeEditorDB:(K||(K=p(this,null,function*(){const i=yield o(),{data:d}=yield i.getAllRequest();return window.threeEditorDB={db:i,list:d},window.threeEditorDB})),yield K)}),q=i=>p(this,null,function*(){if(!i)return{status:!1,message:"获取失败"};yield c();const d=yield G.getItem(i);if(d!=null&&d.blob&&!i)return{status:!0,message:"获取成功",url:r(d.blob)};if(!i)return{status:!1,message:"获取失败"};const m=yield fetch(i).then(N=>N.blob()),g={blob:m};try{yield G.setItem(i,g)}catch(N){if(!f(N))throw N;yield I(),yield G.setItem(i,g)}const T=yield W(),B=l({name:i},g),L=T.list.findIndex(N=>N.name===i);return L>-1?T.list.splice(L,1,B):T.list.push(B),{status:!0,message:"文件缓存成功",url:r(m)}}),E=()=>p(this,null,function*(){yield c();const i=[];return G&&(yield G.iterate((d,m)=>{i.push(R(l({},d||{}),{name:m}))})),window.threeEditorDB&&(window.threeEditorDB.list=i),{status:!0,message:"获取成功",data:i}}),Y=()=>p(this,null,function*(){var m;const{res:i}=yield V.getApi("/filehandle/scan",{path:It.threeModelPath,extension:"glb,gltf"}),d=[];if(((m=i==null?void 0:i.children)==null?void 0:m.length)>0)for(const g of i.children)d.push({name:g.name,path:"/"+g.path});return d}),ue=()=>window.GUI_PARAMS||Fe,he=()=>window.threeEditor||null,w=()=>window.editorJsons||[],C=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),b=()=>wr,v=()=>_r||{},P=()=>window[Ee]||"",z=()=>Ar,J=()=>window.devicePixelRatio||1,H=()=>window[Ee]||"",k=()=>{const i=b(),d=z();return{modelDesigns:i,componentDesigns:d,modelList:i.map(m=>m.label),componentList:d.map(m=>m.label)}},le=(i,d)=>{var m;return(m=i==null?void 0:i.__DESIGNS__)==null?void 0:m.find(g=>g.label===d)},X=(i=0)=>!Number.isFinite(i)||i<=0?"0 B":i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:i<1024*1024*1024?`${(i/1024/1024).toFixed(1)} MB`:`${(i/1024/1024/1024).toFixed(2)} GB`,me=i=>{const d=window[ke];typeof d=="function"&&d(i)},Q=i=>!!i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z),A=i=>{var d,m;return!i||!i.visible||(d=i.userData)!=null&&d.excludeFromExport||i.isTransformControls||i.isHelper||i.isLight||i.isPoints||(m=i.type)!=null&&m.includes("Helper")||Nt.has(i.type)||Mt.has(i.type)||i.isCSS2DObject||i.isCSS3DObject?!1:i.isMesh||i.isGroup||i.isObject3D||i.isLine},_=(i,d)=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)?i:d,$=i=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)&&Number.isFinite(i.w)?i:{x:0,y:0,z:0,w:1},Z=i=>{if(!(i!=null&&i.isObject3D))return;const d=_(i.position,{x:0,y:0,z:0});i.position.set(d.x,d.y,d.z);const m=_(i.scale,{x:1,y:1,z:1});i.scale.set(m.x===0?1:m.x,m.y===0?1:m.y,m.z===0?1:m.z);const g=_(i.up,{x:0,y:1,z:0});i.up.set(g.x,g.y,g.z);const T=$(i.quaternion);i.quaternion.set(T.x,T.y,T.z,T.w),i.pivot&&!Q(i.pivot)&&delete i.pivot,i.updateMatrix(),i.updateMatrixWorld(!1)},te=(i,d="_blank")=>window.open(i,d),Se=(i,d="")=>window.prompt(i,d),F=()=>window.location.reload(),j=()=>document.documentElement.classList.remove("dark"),ee=i=>{if(!Array.isArray(i==null?void 0:i.__DESIGNS__))return k();const d=[...b(),...z()],m=new Set(i.__DESIGNS__.map(g=>nt(g)));return d.forEach(g=>{const T=nt(g);!T||m.has(T)||(m.add(T),i.__DESIGNS__.unshift(g))}),k()},ne=i=>{if(!Array.isArray(i==null?void 0:i.__GLSLLIB__))return;const d=new Set(i.__GLSLLIB__.map(m=>m==null?void 0:m.name));Er.forEach(m=>{d.has(m.name)||(d.add(m.name),i.__GLSLLIB__.push(m))})},O=(i={})=>{const d={};return Object.entries(i||{}).forEach(([m,g])=>{if(!(Lt.has(m)||typeof g=="function")){if(!g||["string","number","boolean"].includes(typeof g)){d[m]=g;return}if(Array.isArray(g)){try{d[m]=structuredClone(g)}catch(T){return}return}if(!(g.isObject3D||g.isMaterial||g.isTexture||g.nodeType))try{d[m]=structuredClone(g)}catch(T){return}}}),d},Vt=(i=Fe)=>{window.GUI_PARAMS=i},Kt=i=>{window.threeEditor=i},zt=i=>{window.threeEditorDB=i},__$t__=i=>{window[ke]=i},Wt=(i="")=>{window[Ee]=i},qt=(i="")=>{window[Ee]=i},$e=i=>{var m;const d=[];return(m=i==null?void 0:i.children)==null||m.forEach(g=>{A(g)&&d.push(g)}),d},We=(i=[])=>{const d={rootCount:i.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return i.forEach(m=>{m.traverse(g=>{var T,B,L;if(A(g)){d.nodeCount+=1,g.isMesh&&(d.meshCount+=1,d.vertexCount+=((L=(B=(T=g.geometry)==null?void 0:T.attributes)==null?void 0:B.position)==null?void 0:L.count)||0);return}g!==m&&(d.skippedCount+=1)})}),d},qe=()=>new Promise(i=>requestAnimationFrame(()=>setTimeout(i,0))),Xe=()=>new Promise(i=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>i(),{timeout:80});return}setTimeout(i,0)}),Xt=(i,d)=>p(this,null,function*(){var T;if(!A(i))return null;const m=i.clone(!1);m.userData=O(i.userData),Q(i.pivot)?m.pivot=new U.THREE.Vector3(i.pivot.x,i.pivot.y,i.pivot.z):"pivot"in m&&delete m.pivot,Z(m);const g=[{source:i,clone:m}];for(;g.length;){const B=g.shift();for(const L of B.source.children){if(!A(L)){d.skippedCount+=1;continue}const N=L.clone(!1);N.userData=O(L.userData),Q(L.pivot)?N.pivot=new U.THREE.Vector3(L.pivot.x,L.pivot.y,L.pivot.z):"pivot"in N&&delete N.pivot,Z(N),B.clone.add(N),g.push({source:L,clone:N}),d.processedCount+=1,d.processedCount%Pt===0&&(yield(T=d.onProgress)==null?void 0:T.call(d,{processedCount:d.processedCount,totalCount:d.totalCount,skippedCount:d.skippedCount,progress:18+Math.min(d.processedCount/Math.max(d.totalCount,1)*54,54)}),yield qe())}}return m});return{baseUrl:t,getModels:Y,getRequest:q,reloadPage:F,promptInput:Se,waitForIdle:Xe,waitForPaint:qe,clearRequest:s,getGuiParams:ue,setGuiParams:Vt,getAllRequest:E,getEditorJsons:w,getThreeEditor:he,formatFileSize:X,setThreeEditor:Kt,removeDarkClass:j,openExternalUrl:te,getThreedModels:b,getViewportSize:C,buildExportScene:(m,...g)=>p(this,[m,...g],function*(i,d={}){const T=$e(i),B=We(T),L=new U.THREE.Scene,N={totalCount:B.nodeCount,processedCount:0,skippedCount:0,onProgress:d.onProgress};for(const jt of T){const je=yield Xt(jt,N);je&&L.add(je),yield Xe()}return L.updateMatrixWorld(!0),B.skippedCount+=N.skippedCount,{exportScene:L,exportObjects:T,stats:B}}),createModelDbApi:o,getEditorPreviewSceneUrl:H,sanitizeUserData:O,setThreeEditorDB:zt,findThreedDesign:le,getThreedLightMap:v,collectExportStats:We,getPreviewSceneUrl:P,setEditorPreviewSceneUrl:qt,setPreviewSceneUrl:Wt,setModelLoadHander:__$t__,isExportableObject:A,deleteThreeEditorDB:u,ensureThreeEditorDB:W,getDevicePixelRatio:J,getThreedComponents:z,collectExportObjects:$e,resetModelDbInstance:I,ensureModelDbInstance:c,getLocalDesignMenuData:k,invokeModelLoadHandler:me,isLegacyInlineKeyError:f,ensureThreedShaderLibrary:ne,ensureThreedDesignRegistry:ee,createBlobUrl:r,revokeModelObjectUrls:a}}const{THREED_LOG_BUFFER:kt,THREED_CURRSCENE:Ue,THREED_ACTIVE_MENU:Ft,THREED_PIXEL_RATIO:Ut,THREED_SCENE_PREVIEW:Ht,THREED_ADDON_EDITOR_JSON:He,THREED_DEFAULT_SCENE_NAME:Ir,THREED_DEFAULT_ACTIVE_MENU:Be,THREED_DEFAULT_PIXEL_RATIO:Ge,THREED_SCENE_STORAGE_SUFFIX:Cr}=yr(),oe=(n,e)=>{const t=ze.getLocal(n);return t==null?e:t},ae=(n,e)=>{n&&ze.setLocal(n,e)},xr=n=>{n&&ze.removeLocal(n)},Tr=(n,e)=>{var r,a;const t=(r=n==null?void 0:n.trim)==null?void 0:r.call(n);return t&&e.some(o=>o.name===t)?t:((a=e[0])==null?void 0:a.name)||Ir},Ve=(n=[])=>Array.isArray(n)?n.filter(e=>typeof e=="string"&&e):[],vr=()=>{const n=[],e=oe(Ue,{name:"",path:""}),t=Number.parseFloat(oe(Ut,Ge));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:n,previewScene:!!oe(Ht,!1),activeMenuTitle:oe(Ft,Be)||Be,pixelRatio:Number.isFinite(t)&&t>0?t:Ge,logarithmicDepthBuffer:oe(kt,!0)!==!1,addonEditorJson:Ve(oe(He,[]))}},Bt=Ke.defineStore("threed",{state:()=>vr(),actions:{getSceneList(n){return p(this,null,function*(){var t;const e=yield V.getCommonApi("threedfloorplan",{limit:1e4,ordering:"-create_time"});if((t=e==null?void 0:e.data)!=null&&t.length){if(this.sceneList=e.data,n){const r=this.sceneList.find(a=>a.org_id===n);r?this.setCurrScene(r):this.setCurrScene({name:"",path:""});return}this.currScene.path?this.sceneList.find(a=>a.id===this.currScene.id)||this.setCurrScene({name:"",path:""}):this.setCurrScene(this.sceneList[0])}else this.sceneList=[],this.setCurrScene({name:"",path:""})})},setSceneList(n){this.sceneList=n},setSceneName(n){this.sceneName=Tr(n,this.sceneList),ae(Ue,this.sceneName)},createScene(n,e=""){return p(this,null,function*(){var u,c,f;const t=(c=(u=n.name)==null?void 0:u.trim)==null?void 0:c.call(u);if(!t||this.sceneList.some(I=>I.name===t))return!1;const r=It.threeSavePath+"/"+Ze()+".json",a=Ze();if(!(yield V.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:r,guid:a,org_id:n.org_id,org_name:n.org_name}]})).success)return!1;if(yield Jn(r,e)){const I=yield V.postCommonApi("threedfloorplan",{guid:a});if((f=I==null?void 0:I.data)!=null&&f.length)return this.sceneList=[...this.sceneList,I.data[0]],I.data[0]}return!1})},updateScene(n){return p(this,null,function*(){var r,a;const e=(a=(r=n.name)==null?void 0:r.trim)==null?void 0:a.call(r);return!e||this.sceneList.some(o=>o.name===e)?!1:(yield V.postCommonApi("query/threedfloorplan/update",{data:[{name:e,id:n.id,org_id:n.org_id,org_name:n.org_name}]})).success})},toggleSceneEnable(n){return p(this,null,function*(){if(!(n!=null&&n.id)||!(yield V.postCommonApi("query/threedfloorplan/update",{data:[{id:n.id,name:n.name,enable:!!n.enable}]})).success)return!1;const t=this.sceneList.findIndex(r=>r.id===n.id);return t!==-1&&(this.sceneList[t].enable=!!n.enable),!0})},deleteScene(n){return p(this,null,function*(){var r;if(!n)return;if(!(yield V.postCommonApi("query/threedfloorplan/delete",{data:[n]})).success)return!1;const t=this.sceneList.findIndex(a=>a.id===n);return t===-1?!1:(this.sceneList.splice(t,1),((r=this.currScene)==null?void 0:r.id)===n&&this.setCurrScene(this.sceneList[0]||{name:"",path:""}),!0)})},setCurrScene(n){return p(this,null,function*(){this.currScene=n,ae(Ue,this.currScene)})},setPreviewMode(n){this.previewScene=!!n,ae(Ht,this.previewScene)},setActiveMenuTitle(n){this.activeMenuTitle=n||Be,ae(Ft,this.activeMenuTitle)},setPixelRatio(n){const e=Number.parseFloat(n);this.pixelRatio=Number.isFinite(e)&&e>0?e:Ge,ae(Ut,this.pixelRatio)},setLogarithmicDepthBuffer(n){this.logarithmicDepthBuffer=!!n,ae(kt,this.logarithmicDepthBuffer)},getSceneStorageKey(n){return`${n||this.sceneName}${Cr}`},getSceneStorageParams(n,e=null){return oe(this.getSceneStorageKey(n),e)},setSceneStorageParams(n,e){n&&ae(this.getSceneStorageKey(n),e)},removeSceneStorageParams(n){n&&xr(this.getSceneStorageKey(n))},resetTaskState(){return p(this,null,function*(){yield new Promise(n=>setTimeout(n,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=Ve(oe(He,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(n){this.addonEditorJson=Ve(n),ae(He,this.addonEditorJson)}}}),Rr={backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},Dr={fov:50,near:.1,far:1e5,zoom:1,layers:{mask:1},filmOffset:0,filmGauge:35,position:{x:247.72931803058157,y:715.3890430349733,z:789.6794984861216}},br={outputColorSpace:"srgb",toneMapping:0,toneMappingExposure:1,shadowMap:{enabled:!1,type:1},color:0,opacity:0,sortObjects:!0,localClippingEnabled:!1,autoClear:!0,autoClearColor:!0,renderListCompare:[{name:"stats",enabled:!0},{name:"controls",enabled:!0},{name:"scene",enabled:!0},{name:"css3DRender",enabled:!0},{name:"css2DRender",enabled:!0}]},Pr={autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,minDistance:.01,maxDistance:1e6,maxAzimuthAngle:null,minAzimuthAngle:null,maxPolarAngle:3.141592653589793,minPolarAngle:0,maxTargetRadius:null,minTargetRadius:0,enablePan:!0,panSpeed:1,enableRotate:!0,rotateSpeed:1,enableZoom:!0,zoomSpeed:1,zoomToCursor:!1,target:{x:-38.59603927643809,y:-48.97202695679889,z:-49.19814250541991}},Lr={mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},Nr={renderWay:"effectComposer",fxaaPass:{enabled:!0,order:60,multPixel:1},outlinePass:{enabled:!0,order:40,edgeStrength:3,edgeGlow:0,edgeThickness:1,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16449071,hiddenEdgeColor:16449071,overlayMaterial:{blending:5,blendEquation:100,blendSrc:201,blendDst:205}},outputPass:{enabled:!0,order:50},saoPass:{enabled:!1,order:10,saoBias:.5,saoIntensity:.01,saoScale:100,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},screenMaskPass:{enabled:!1,order:70,intensity:1,maskColor:16777215,R:.2,sr:1.2},ssrPass:{enabled:!1,order:30,maxDistance:.01,distanceAttenuation:!0,opacity:.5,thickness:.018,fresnel:!0,infiniteThick:!1,bouncing:!1},unrealBloomPass:{enabled:!1,order:20,strength:1.5,radius:.4,threshold:.85}},Mr={mode:"transform",openKeyEnable:!0,rightClickMenusEnable:!0,selectChildEnabled:!1,selectChildLevel:1,stats:{showStats:!1,statsMode:0},helpers:{axes:{showAxes:!0,axesLength:1e3},grid:{showGrid:!0,size:1e3,divisions:15,colorCenterLine:4473924,colorGrid:8947848},box3:{useBox3:!0,color:16776960}}},Or=[],kr=[],Fr=[],Ur=[],Hr=[],Br=[],Gr={},Vr=[],Kr={viewAngleList:[],clipping:{size:20,clipList:[]}},zr={scene:Rr,perspectiveCamera:Dr,webglRenderer:br,orbitControls:Pr,transformControls:Lr,effectComposer:Nr,handler:Mr,lightCores:Or,innerCores:kr,modelCores:Fr,drawCores:Ur,textCores:Hr,particleCores:Br,geoCores:Gr,designCores:Vr,other:Kr},$r=[{key:0,value:"离线"},{key:1,value:"在线"}],Wr=[{key:0,value:"反向"},{key:1,value:"正向"},{key:2,value:"停止"}],qr=[{key:1,value:1},{key:2,value:2},{key:3,value:3},{key:4,value:4},{key:5,value:5}],Xr="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1753954524851'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1506'%20width='256'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M888.65792%20280.15616a46.80704%2046.80704%200%200%200-46.80704-46.80704H233.34912a46.80704%2046.80704%200%200%200-46.80704%2046.80704v93.61408h702.11584V280.15616zM186.54208%20420.5824v374.46144a46.80704%2046.80704%200%200%200%2046.80704%2046.80704h608.49664a46.80704%2046.80704%200%200%200%2046.80704-46.80704V420.5824H186.54208z%20m442.9056%2084.98688l30.92992%2011.47904c-15.62624%2024.23808-35.39968%2050.38592-50.70848%2067.6096l-25.51296-10.84416c15.31392-17.85856%2034.7648-46.56128%2045.29152-68.24448z%20m-184.64768-1.59744c17.54112%2020.09088%2038.26688%2047.5136%2047.5136%2065.37728l-25.51296%2015.62624c-8.61184-17.85856-28.70272-46.23872-45.92128-67.28704l23.92064-13.71648z%20m199.95136%20267.2384h-45.28128c-32.20992%200-39.86432-8.92928-39.86432-39.86432v-102.36416h-46.23872c-5.73952%2069.8368-21.6832%20121.18528-101.0944%20149.56544-3.5072-7.97184-11.47904-19.456-18.49344-25.51296%2072.07424-22.9632%2083.87072-66.01728%2088.65792-124.05248H399.19616v-28.70272h122.7776V483.88096h30.92992v116.39808h122.46016v28.70272h-85.7856v102.04672c0%2010.5216%201.90976%2012.11904%2013.71136%2012.11904h38.90176c8.92928%200%2010.84416-4.1472%2011.8016-28.38016%206.69696%204.78208%2019.12832%209.56928%2027.42272%2011.47904-3.49696%2035.39968-11.4688%2044.96384-36.66432%2044.96384z'%20fill='%23005CFF'%20p-id='1507'%3e%3c/path%3e%3c/svg%3e",ie=window.meta.graph.penFormMap?window.meta.graph.penFormMap:{NORMAL:[{name:"颜色",key:"color",type:"color",dataIds:{}}],TEXT:[{name:"显示内容",key:"text",type:"text",dataIds:{}}],AUDIO:[{name:"颜色",key:"color",type:"color",dataIds:{}}],MP4:[{name:"颜色",key:"color",type:"color",dataIds:{}}],CAMERA:[{name:"颜色",key:"color",type:"color",dataIds:{}}],VIDEO_STREAM:[{name:"颜色",key:"color",type:"color",dataIds:{}}],LIGHT_PLATE:[{name:"光字牌",key:"light_plate",type:"select",dataIds:{},options:[{label:"离线",value:-1},{label:"正常",value:0},{label:"预警",value:1},{label:"一般",value:2},{label:"严重",value:3},{label:"危急",value:4}]}]},jr=window.meta.graph.lightPlateColorMap?window.meta.graph.lightPlateColorMap:{0:"#00d200"},Yr=window.meta.graph.lightPlateTextMap?window.meta.graph.lightPlateTextMap:{0:"#fff"},D={form:[{name:"带电状态",key:"charged_state",type:"select",dataIds:{},options:$r.map(n=>({label:n.value,value:n.key}))},{name:"潮流方向",key:"electric_direction",type:"select",dataIds:{},options:Wr.map(n=>({label:n.value,value:n.key}))},{name:"电荷大小",key:"electric_size",type:"select",dataIds:{},options:qr.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},h=R(l({penType:S.NORMAL},D),{form:[...ie[S.NORMAL],...D.form]});be.YX,be.YX,be.YX,S.POINT_VALUE,D.anchors,window.visibleLevel,D.form,D.form,window.dataType,window.dataProp,window.visibleLevel,D.form,window.dataType,window.dataProp,window.visibleLevel,D.form,window.dataType,window.dataProp,window.visibleLevel,Yr[0],S.LIGHT_PLATE,jr[0],D.anchors,window.visibleLevel,[...ie[S.LIGHT_PLATE],...D.form],we+"",S.SENSOR,D.anchors,window.visibleLevel,[...ie[S.LIGHT_PLATE],...D.form],R(l({width:100,height:30,name:"text",penName:"文本",text:"文本",disableAnchor:!0,penType:S.TEXT},D),{form:[...ie[S.TEXT],...D.form]}),l({width:100,height:100,name:"square",penName:"正方形"},h),R(l({type:1,name:"line",width:100,height:5,lineWidth:2,lineName:"line",penName:"line",background:"#FFF000",color:"#FFF000"},h),{lineAnimateType:1,anchors:[{x:0,y:.5,id:"0"},{x:1,y:.5,id:"1"}]}),l({width:200,height:50,borderRadius:0,name:"rectangle",penName:"矩形"},h),l({width:100,height:100,name:"circle",penName:"圆"},h),l({width:100,height:100,name:"triangle",penName:"三角形"},h),l({width:100,height:100,name:"diamond",penName:"菱形"},h),l({width:100,height:100,name:"pentagon",penName:"五边形"},h),l({width:100,height:100,name:"hexagon",penName:"六边形"},h),l({width:100,height:100,name:"pentagram",penName:"五角星"},h),l({width:120,height:60,name:"leftArrow",penName:"左箭头"},h),l({width:120,height:60,penName:"右箭头",name:"rightArrow"},h),l({width:150,height:60,name:"twowayArrow",penName:"双向箭头"},h),l({width:100,height:100,name:"cloud",penName:"云"},h),l({textTop:-.1,width:100,height:100,name:"message",penName:"消息框"},h),l({width:80,height:100,name:"file",penName:"文件"},h),R(l({width:60,height:100,name:"cube",penName:"立方体",z:.25},h),{props:{custom:[{key:"z",label:"Z",type:"number",min:0,placeholder:"<= 1 即宽度的比例"},{key:"backgroundFront",label:"前背景色",type:"color"},{key:"backgroundUp",label:"顶背景色",type:"color"},{key:"backgroundRight",label:"右背景色",type:"color"}]}}),l({width:70,height:100,name:"people",penName:"人"},h),R(l({name:"rectangle",penName:"按钮",width:80,height:30,borderRadius:.2,text:"按钮",background:"#1890ff",color:"#1890ff",textColor:"#fff",activeBackground:"#40a9ff",activeColor:"#40a9ff",activeTextColor:"#fff",hoverBackground:"#40a9ff",hoverColor:"#40a9ff",hoverTextColor:"#fff"},h),{penType:S.BUTTON}),R(l({name:"rectangle",penName:"输入框",height:50,width:200,input:!0,borderRadius:.05,ellipsis:!0,text:"输入数据",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10},h),{penType:S.INPUT}),R(l({name:"rectangle",penName:"选择器",height:50,width:200,borderRadius:.05,ellipsis:!0,text:"选项1",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10,dropdownList:[{text:"选项1"},{text:"选项2"},{text:"选项3"}]},h),{penType:S.SELECT}),R(l({name:"slider",penName:"进度条",width:300,height:30,value:10,textWidth:50,barHeight:4,fontSize:20,min:0,max:100,color:"#1890ff",background:"#D4D6D9",textColor:"#222",unit:"%"},h),{penType:S.SLIDER}),R(l({name:"time",penName:"时间",width:300,height:40,text:`${an().format("YYYY-MM-DD HH:mm:ss")}`,lineWidth:0,fontSize:20,interval:67,fillZero:!0},h),{penType:S.TIME,form:[{key:"timeFormat",name:"显示格式",type:"text"},{key:"fillZero",name:"是否补0",type:"switch"},...h.form],timeFormat:"`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"}),R(l({name:"switch",penName:"开关",height:30,width:60,checked:!1,offColor:"#BFBFBF",onColor:"#1890ff",disableOffColor:"#E5E5E5",disableOnColor:"#A3D3FF",locked:0},h),{penType:S.SWITCH}),R(l({name:"radio",penName:"单选框",direction:"horizontal",width:150,height:30,checked:"",options:[{text:"选项一"},{text:"选项二"},{text:"选项三",isForbidden:!0}]},h),{penType:S.RADIO}),R(l({name:"checkbox",penName:"多选框",width:30,height:30,checked:!0,value:"选项一"},h),{penType:S.CHECKBOX}),R(l({name:"table2",penName:"表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType: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"}]}),R(l({name:"table2",penName:"斑马纹表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!0,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType: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"}]}),R(l({name:"table2",penName:"滚动表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,swiper:!0,maxNum:5,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType: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"}]}),R(l({name:"svg",width:100,height:100,image:we+"/icon/audio.svg",audioId:"",penName:"音频",datable:!0,penType:S.AUDIO},D),{form:[...ie[S.AUDIO],...D.form],events:[{name:"enter",action:Ie.Emit,value:re.OPEN_AUDIO,where:{type:""},params:JSON.stringify({action:re.OPEN_AUDIO,data:""})},{name:"leave",action:Ie.Emit,value:re.CLOSE_AUDIO,where:{type:""},params:JSON.stringify({action:re.CLOSE_AUDIO,data:""})}]}),R(l({name:"svg",width:100,height:100,image:we+"/icon/camera.svg",cameraId:"",penName:"摄像机",datable:!0,events:[{name:"enter",action:Ie.Emit,value:re.OPEN_CAMERA,where:{type:""},params:JSON.stringify({action:re.OPEN_CAMERA,data:""})},{name:"leave",action:Ie.Emit,value:re.CLOSE_CAMERA,where:{type:""},params:JSON.stringify({action:re.CLOSE_CAMERA,data:""})}],penType:S.CAMERA},D),{form:[...ie[S.CAMERA],...D.form]}),R(l({name:"video",width:100,height:100,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penName:"MP4",penType:S.MP4},D),{form:[...ie[S.MP4],...D.form]}),R(l({name:"video",width:100,height:100,penName:"视频流",datable:!0,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penType:S.VIDEO_STREAM},D),{form:[...ie[S.VIDEO_STREAM],...D.form]}),l({text:"开始/结束",width:120,height:40,borderRadius:.5,name:"rectangle",penName:"开始/结束"},h),l({text:"流程",width:120,height:40,name:"rectangle",penName:"流程"},h),l({text:"判定",width:120,height:60,name:"diamond",penName:"判定"},h),l({text:"数据",width:120,height:50,name:"flowData",penName:"数据",offsetX:.14},h),l({text:"准备",width:120,height:50,name:"hexagon",penName:"准备"},h),l({text:"子流程",width:120,height:50,name:"flowSubprocess",penName:"子流程"},h),l({text:"数据库",width:80,height:120,name:"flowDb",penName:"数据库"},h),l({text:"文档",width:120,height:100,name:"flowDocument",penName:"文档"},h),l({text:"内部存储",width:120,height:80,name:"flowInternalStorage",penName:"内部存储"},h),l({text:"外部存储",width:120,height:80,name:"flowExternStorage",penName:"外部存储"},h),l({text:"队列",width:100,height:100,name:"flowQueue",penName:"队列"},h),l({text:"手动输入",width:120,height:80,name:"flowManually",penName:"手动输入"},h),l({text:"展示",width:120,height:80,name:"flowDisplay",penName:"展示"},h),l({text:"并行模式",width:120,height:50,name:"flowParallel",penName:"并行模式"},h),l({text:"注释",width:100,height:100,name:"flowComment",penName:"注释"},h),l({text:"",width:30,height:30,name:"circle",penName:"开始",background:"#555",lineWidth:0},h),l({width:30,height:30,name:"activityFinal",penName:"结束"},h),l({text:"活动",width:120,height:50,borderRadius:.25,name:"rectangle",penName:"活动"},h),l({text:"决策/合并",width:120,height:50,name:"diamond",penName:"决策/合并"},h),l({text:"垂直泳道",width:200,height:500,name:"swimlaneV",penName:"垂直泳道",textBaseline:"top",textTop:20,lineTop:.08},h),l({text:"水平泳道",width:500,height:200,name:"swimlaneH",penName:"水平泳道",textWidth:.01,textLeft:.04,textAlign:"left",lineLeft:.08},h),l({text:"垂直分岔/汇合",width:10,height:150,name:"forkV",penName:"垂直分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({text:"水平分岔/汇合",width:150,height:10,name:"forkH",penName:"水平分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({name:"andGate",penName:"与门",width:100,height:150},h),l({name:"basicEvent",penName:"基本事件",width:100,height:150},h),l({name:"unexpandedEvent",penName:"未展开事件",width:100,height:150},h),l({name:"priorityAndGate",penName:"优先AND门",width:100,height:150},h),l({name:"forbiddenGate",penName:"禁止门",width:100,height:150},h),l({name:"event",penName:"事件",width:100,height:150},h),l({name:"switchEvent",penName:"开关事件",width:100,height:150},h),l({name:"conditionalEvent",penName:"条件事件",width:150,height:100},h),l({name:"transferSymbol",penName:"转移符号",width:100,height:150},h),l({name:"orGate",penName:"或门",width:100,height:150},h),l({name:"xorGate",penName:"异或门",width:100,height:150},h),l({name:"votingGate",penName:"表决门",width:100,height:150},h);const Jr=(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:un}:${e.isDev?e.devServerPort:hn}`),e.isDev?n:n.replace("/baseUrl","")),Gt=(n,e)=>{const t=n.__vccOpts||n;for(const[r,a]of e)t[r]=a;return t},Qr={key:0,class:"threed-editor__loading"},Zr={class:"threed-loading-text"},ea=Object.assign({name:"ThreedEditor"},{__name:"editor",props:{data:{type:Object,default:()=>({})},preview:{type:Boolean,default:!1}},emits:["emit-three-editor","graph-event"],setup(n,{expose:e,emit:t}){var Q;const r=t,a=n,o=Bt(),{currScene:s}=Ke.storeToRefs(o),u=((Q=window.meta.threed)==null?void 0:Q.draco_path)||we;U.ThreeEditor.dracoPath=u.endsWith("/")?u:`${u}/`;let c=null,f=null,I=!1;const K=y.ref(null),W=y.ref(!1),q=y.ref("加载场景中..."),{setGuiParams:E,getDevicePixelRatio:Y,ensureThreeEditorDB:ue,createBlobUrl:he,revokeModelObjectUrls:w,ensureThreedDesignRegistry:C}=Sr();C(U.ThreeEditor),E({step:.1});const b=()=>{var A;return(A=c==null?void 0:c.renderSceneResize)==null?void 0:A.call(c)},v=["mousedown","contextmenu"];let P=null;const z=A=>{var _;a.preview||A.type==="mousedown"&&((_=c==null?void 0:c.transformControls)!=null&&_.axis)||c==null||c.getSceneEvent(A,$=>{r("graph-event",{type:A.type,data:$})})},J=()=>{P&&(v.forEach(A=>P.removeEventListener(A,z)),P=null)},H=()=>{var _;const A=(_=c==null?void 0:c.renderer)==null?void 0:_.domElement;!A||A===P||(J(),P=A,v.forEach($=>A.addEventListener($,z)))},k=()=>p(this,null,function*(){var _,$;if(I)return;W.value=!0,q.value="加载场景数据中...";let A=zr;try{if(a.data&&Object.keys(a.data).length)A=a.data;else if((_=s.value)!=null&&_.path){const te=yield V.getApi(($=s.value)==null?void 0:$.path).catch(()=>({}));if(I)return;te.res&&(A=te.res)}q.value="场景加载中...";const Z=yield le(A);if(I)return;c?c.resetEditorStorage(Z):c=new U.ThreeEditor(K.value,{fps:null,pixelRatio:Y()*o.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0},sceneParams:Z})}catch(Z){console.error("三维图纸初始化失败",Z),c==null||c.resetEditorStorage(A)}finally{c&&H(),X(),W.value=!1}r("emit-three-editor",c),window.addEventListener("resize",b)}),le=A=>p(this,null,function*(){var Se;const _=structuredClone(A||{});if((Se=_.designCores)==null||Se.forEach(F=>{F.preview=a.preview}),a.preview){_.handler.mode="none",_.handler.helpers.axes.showAxes=!1,_.handler.helpers.box3.useBox3=!1,_.handler.helpers.grid.showGrid=!1,_.handler.rightClickMenusEnable=!1;const{perspectiveCamera:F,orbitControls:j}=_,ee=F==null?void 0:F.position,ne=j==null?void 0:j.target;if(ee&&ne){const O=Math.hypot(ee.x-ne.x,ee.y-ne.y,ee.z-ne.z);Number.isFinite(O)&&O>0&&(j.maxDistance=O*(5/3))}}const $=yield ue(),Z=$.list||[],te=[];for(const F of _.modelCores||[]){const j=F.modelInfo.originPath;if(j){const ee=Z.find(O=>O.name===j);if(!ee){const O=yield $.db.getRequest(Jr(j));O!=null&&O.url&&(F.modelInfo.url=O.url),te.push(F);continue}const ne=he(ee.blob);F.modelInfo.url=ne}te.push(F)}return _.modelCores=te,_}),X=()=>{c!=null&&c.renderer&&(f=new U.THREE.PMREMGenerator(c.renderer),f.compileEquirectangularShader(),c.scene.environment=f.fromScene(new sn.RoomEnvironment).texture)},me=()=>c;return y.watch([()=>s.value.path,()=>a.data],([A,_])=>{console.log("watch",A,_),k()},{deep:!0}),y.onMounted(()=>p(this,null,function*(){var A,_;I=!1,(A=K.value)!=null&&A.clientHeight&&((_=K.value)!=null&&_.clientWidth)&&k()})),y.onUnmounted(()=>{I=!0,window.removeEventListener("resize",b),J(),c==null||c.destroySceneRender(),f==null||f.dispose(),w()}),e({getEditorInstance:me}),(A,_)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"editorRef",ref:K,class:"threed-editor",onDragover:_[0]||(_[0]=y.withModifiers(()=>{},["prevent"])),onDrop:_[1]||(_[1]=y.withModifiers(()=>{},["prevent"]))},[y.createVNode(y.Transition,{name:"threed-fade"},{default:y.withCtx(()=>[W.value?(y.openBlock(),y.createElementBlock("div",Qr,[_[2]||(_[2]=y.createElementVNode("div",{class:"threed-loading-spinner"},null,-1)),y.createElementVNode("span",Zr,y.toDisplayString(q.value),1)])):y.createCommentVNode("",!0)]),_:1})],544))}}),ta=Gt(ea,[["__scopeId","data-v-5bf6177a"]]),na={class:"threed-preview"},ra=Object.assign({name:"ThreedPreview"},{__name:"preview",props:{data:{type:Object,default:null},url:{type:String,default:""},id:{type:String,default:""},token:{type:String,default:""},socketUrl:{type:String,default:""}},emits:["loaded","graph-event"],setup(n,{expose:e,emit:t}){const r=n,a=t;let o=y.shallowRef({});const s=y.ref(),u=Bt();let c={},f=null,I=null;const K=w=>{var b,v,P;if(!w)return;if((b=w==null?void 0:w.includes)!=null&&b.call(w,"token 必传"))return Ae({message:w,type:"warning"});const C=typeof w=="string"?JSON.parse(w):w;if((C==null?void 0:C.data)==="服务错误"||(P=(v=C==null?void 0:C.data)==null?void 0:v.includes)!=null&&P.call(v,"token is expired"))return Ae({message:C.data,type:"warning"});switch(C.action){case Je.ACPOINT.YCVALUE:case Je.ACPOINT.YXVALUE:console.warn("遥测信息");break}},W=()=>{try{I=new Fn({socketUrl:r.socketUrl,token:r.token,onMessage:K})}catch(w){console.warn("三维场景消息处理失败",w)}},q=()=>p(this,null,function*(){var w;if(c){const C=Object.keys(c);if(C.length){const b=yield V.postPDApi("querychannelstatus/",{data:C.map(v=>({ied_id:v,ln_list:c[v].map(P=>P.ln_id)}))});(w=b==null?void 0:b.data)!=null&&w.length&&C.forEach(v=>{const P=b.data.find(J=>J.ied_id===v),z=c[v];z!=null&&z.length&&z.forEach(J=>{const H=P.result.find(k=>k.ln_id===J.ln_id);if(H){const k=he();if(!(k!=null&&k.scene))return;const le=k.scene.getObjectsByProperty("dataId",J.guid);let X=le==null?void 0:le[0];if(X){const me=H.status==="告警"?2:H.status==="正常"?1:0;X.userData.params.state=me;const Q=Hn(H.amp_peak)?Bn(Number(H.amp_peak))?Number(H.amp_peak):0:H.amp_peak;X.userData.params.value=Q,X.changeState(me),X.changeValue(Q),X.changeName(H.name)}}})})}}}),E=w=>{a("graph-event",w)},Y=w=>{w&&(r.socketUrl&&W(),setTimeout(()=>{const C=w.scene.getObjectsByProperty("designType","局放测点");C.forEach(b=>{const{ied_id:v,ln_id:P}=b.userData.params;c[v]||(c[v]=[]),c[v].push({guid:b.dataId,id:b.uuid,ied_id:v,ln_id:P})}),C!=null&&C.length&&(f&&clearInterval(f),q(),f=setInterval(()=>{q()},2e3)),a("loaded",w)},100))},ue=()=>p(this,null,function*(){if(o.value&&Object.keys(o.value).length)return;const w=Gn(),C=r.url||w.url;if(C){const P=yield V.getApi(C).catch(()=>({}));P.res&&(o.value=P.res);return}if(!(r.id||w.id)){console.warn("三维场景渲染失败,场景id为空!");return}const v=yield V.getCommonApi("threedfloorplan",{guid:r.id});v.data.length?u.setCurrScene(v.data[0]):console.warn("三维场景渲染失败,场景id为:"+r.id+"不存在!")}),he=()=>s.value?s.value.getEditorInstance():null;return y.watch(()=>r.data,w=>{w&&(o.value=w,ue())},{deep:!0,immediate:!0}),y.watch(()=>r.id,w=>{w&&ue()},{deep:!0,immediate:!0}),y.onMounted(()=>{Qe.on("three-event",E)}),y.onUnmounted(()=>{I&&I.destroy(),f&&clearInterval(f),Qe.off("three-event",E)}),e({getEditorInstance:he}),(w,C)=>(y.openBlock(),y.createElementBlock("div",na,[y.createVNode(ta,{ref_key:"threedEditorRef",ref:s,data:y.unref(o),preview:"",onGraphEvent:E,onEmitThreeEditor:Y},null,8,["data"])]))}}),ye=Gt(ra,[["__scopeId","data-v-0a315360"]]);ye.name||(ye.name="SyThree");const aa=n=>{n.component(ye.name||"SyThree",ye)},ia={install:aa};exports.SyThree=ye;exports.default=ia;
|
package/dist-three/sy-three.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.threed-editor[data-v-
|
|
1
|
+
@charset "UTF-8";.threed-editor[data-v-5bf6177a]{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sc-bg-color)}.threed-editor[data-v-5bf6177a] .top-info{z-index:9999!important}.threed-editor__loading[data-v-5bf6177a]{position:absolute;inset:0;z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background-color:var(--sc-bg-color)}.threed-loading-spinner[data-v-5bf6177a]{width:36px;height:36px;border:3px solid var(--sc-border-color);border-top-color:var(--sc-color-primary);border-radius:50%;animation:threed-spin-5bf6177a .8s linear infinite}.threed-loading-text[data-v-5bf6177a]{font-size:14px;color:var(--sc-text-color-secondary)}@keyframes threed-spin-5bf6177a{to{transform:rotate(360deg)}}.threed-fade-enter-active[data-v-5bf6177a],.threed-fade-leave-active[data-v-5bf6177a]{transition:opacity .3s ease}.threed-fade-enter-from[data-v-5bf6177a],.threed-fade-leave-to[data-v-5bf6177a]{opacity:0}.threed-preview[data-v-0a315360]{position:relative;width:100%;height:100%}
|