@syhr/sy-three 1.0.0-rc.14 → 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 +2047 -1063
- 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 Tn(){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 Pn(n){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new Tn,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 s=Object.id(r).toString();this.callbacks_.add(s,r);var o={MsgId:s,Method:e+"|"+n};t&&(o.Param=JSON.stringify(t));var a=JSON.stringify(o);this.connect&&this.ws.send(a)},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 s=this.callbacks_.getValue(r);s(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},s){this.exec("Arm_VerifyPIN",[parseInt(e),r,t],s)},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:s},o){this.exec("Arm_CreateFile",[parseInt(e),r,parseInt(t),s],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:r,FileOffset:s,DataInput:o},a){this.exec("Arm_WriteFile",[parseInt(e),r,parseInt(t),parseInt(s),o],a)},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},s){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),r],s)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:r,DataLen:s},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),r,r.length,parseInt(s)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:r},s){this.exec("Arm_DeleteFile",[parseInt(e),r,parseInt(t)],s)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:r},s){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),r],s)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:r},s){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),r],s)},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:s,PinFlag:o},a){this.exec("Arm_ChangePIN",[parseInt(e),o,r,t,parseInt(s)],a)},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:s,RsaPriFileSize:o},a){this.exec("Arm_RsaPri",[parseInt(e),parseInt(s),parseInt(o),t,r],a)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:r,RsaPubInData:s,RsaPubFileSize:o},a){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),r,t,t.length,s],a)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:r},s){this.exec("Arm_EccSign",[parseInt(e),parseInt(r),t],s)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:r,EccSignData:s},o){this.exec("Arm_EccVerify",[parseInt(e),r,r.length,t,s],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:r},s){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(r),t],s)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:r,Sm2SignData:s},o){this.exec("Arm_Sm2Verify",[parseInt(e),r,r.length,t,s],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:r,TdesInData:s},o){this.exec("Arm_TDES",[parseInt(e),parseInt(r),t,s],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:r,Sm4InData:s},o){this.exec("Arm_SM4",[parseInt(e),parseInt(r),t,s],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:r},s){this.exec("Arm_HASH",[parseInt(e),t,r],s)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:r},s){this.exec("Arm_Seed",[parseInt(e),r,t],s)},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:s,StartUserID:o,AdminTryCount:a,UserPin:l,UserTryCount:c,UpdateRSAPriKey:h},A){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),r,l,parseInt(c),parseInt(a),h,parseInt(o),parseInt(s)],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:s,FileType:o,Offset:a,DataLen:l,DataBuffer:c,UpRSAPubKey:h},A){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,r,o,parseInt(s),parseInt(a),c,h,parseInt(l)],A)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:r,FileID:s,FileType:o,Offset:a,DataLen:l,DataBuffer:c},h){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,r,o,parseInt(s),parseInt(a),c,parseInt(l)],h)},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},s){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(r)],s)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:r,Priv:s,IsReset:o,IsDecOnRAM:a},l){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[r,parseInt(t),parseInt(e),parseInt(s),parseInt(a),parseInt(o)],l)},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:s},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(s),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:s,CallLimit:o},a){this.exec("Arm_Set_EXE_FILE_INFO",[s,parseInt(r),parseInt(e),parseInt(o),t,t.length],a)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const bn={HID:0},de={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},Be={USER:0};class ct{constructor(){Q(this,"Base64",new vn);Q(this,"AtlCtrl",null);Q(this,"ArmCount",0);Q(this,"ArmIndex",0);Q(this,"ArmHandle",0);Q(this,"ArmRandom","");try{this.AtlCtrl=new Pn("{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,s)=>{r?(this.ArmCount=+s,e(s)):t(s)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,r)=>{this.AtlCtrl.Arm_Open({Index:e},(s,o)=>{s?(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},(s,o)=>{s?t(o):r(o)})})}armChangePIN(e,t,r=255,s=Be.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,l)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:r,PinFlag:s},(c,h)=>{c&&h==0?(this.ArmPin=e,a(h)):l(h)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,a)=>{o?(this.ArmRandom=a,r(a)):s(a)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(s,o)=>{s?(this.ArmDeadline=o,t(o)):r(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,a)=>{o?(this.ArmUKey=a,r(a)):s(a)})})}armGetDongleInfo(e=0,t=de.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((r,s)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,a)=>{if(o){switch(t){case de.USER_ID:this.ArmUid=a;break;case de.PRODUCT_ID:this.ArmPid=a;break;case de.HARDWARE_ID:this.ArmHid=a;break}r(a)}else s(a)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,a)=>{o&&a==0?r(a):s(a)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_RFS({Handle:e},(s,o)=>{s&&o==0?t(o):r(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,a)=>{if(o&&a.length>0)try{a=this.Base64.decode(a),r(a)}catch(l){console.error(l),r(a)}else s(a)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(s,o)=>{s&&o==0?t(o):r(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,a)=>{o&&a==0?r(a):s(a)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,a)=>{o&&a==0?r(a):s(a)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,a)=>{o&&a==0?r(a):s(a)})})}armSwitchProtocol(e=bn.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,a)=>{o&&a==0?r(a):s(a)})})}armVerifyPIN(e,t=Be.USER,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:r,UserPin:e,UserType:t},(a,l)=>{a&&l==0?(this.ArmPin=e,s(l)):o(l)})})}armReadData(e=0,t=128,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,o)=>{this.AtlCtrl.Arm_ReadData({Handle:r,Offset:e,ReadLength:t},(a,l)=>{a?(this.ArmData=l,s(l)):o(l)})})}armWriteData(e,t=0,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,o)=>{this.AtlCtrl.Arm_WriteData({Handle:r,Offset:t,DataInput:e},(a,l)=>{a&&l==0?s(l):o(l)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(s,o)=>{s?(this.ArmData=o,t(o)):r(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,a)=>{o&&a==0?r(a):s(a)})})}}const lt="0123456789abcdeffedcba9876543210",ut="4b0de988570c3a0f",Ln=window.ENCRYPT;let se=Ln&&new ct;function dt(n=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",r=e.length;for(;n>0;)t+=e[Math.floor(Math.random()*r)],n--;return t}function ht(){return m(this,null,function*(){return se||(se=new ct),new Promise((n,e)=>{se.armEnum().then(t=>{n(+t)}).catch(t=>{Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}jt.throttle(()=>m(exports,null,function*(){const n=yield ht(),e={};if(typeof n!="number"||n<=0)Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield On();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(Y.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Mn(n=0){return m(this,null,function*(){return se?new Promise((e,t)=>{se.armGetDongleInfo(n).then(r=>{r?e(r):(Y.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(r))}).catch(r=>{t(r)})}):Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function On(){return m(this,null,function*(){if(!se)return Y.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const n=yield ht();let e=[];for(let t=0;t<n;t++){const r=yield Mn(t);e.push(r)}return e})}dt(16);dt(16);const mt=window.meta.app.inspect?Z.SM4.constants.CBC:Z.SM4.constants.ECB,{publicKey:Vr,privateKey:zr}=Z.SM2.generateKeyPair();function Hn(n,e,t={}){const r=ft(ut),s=t.mode||mt;t=s===Z.SM4.constants.ECB?k({mode:s,inputEncoding:"utf8",outputEncoding:"hex"},t):k({iv:lt,mode:s,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=Z.SM4.encrypt(n,r,t)}catch(a){console.log("err: ",a)}return o}function Un(n,e,t={}){const r=ft(ut),s=t.mode||mt;return t=s===Z.SM4.constants.ECB?k({mode:s,inputEncoding:"hex",outputEncoding:"utf8"},t):k({iv:lt,mode:s,inputEncoding:"hex",outputEncoding:"utf8"},t),Z.SM4.decrypt(n,r,t)}function ft(n){return[...n].map(e=>e.charCodeAt().toString(16)).join("")}const oe=n=>{const{onClose:e,customClass:t}=n;return Y.ElMessage(le(k({},n),{center:!0,customClass:`sy-message ${t||""}`,onClose:s=>{e&&e(s)}}))};["success","warning","info","error"].forEach(n=>{oe[n]=e=>oe(typeof e=="string"?{type:n,message:e}:le(k({},e),{type:n}))});be.createPinia();function he(n){return n=at&&Ie(n)?Un(n):n,Ie(n)?JSON.parse(n):n}function Ge(n){return n=at&&Ie(n)?Hn(n):n,JSON.stringify(n)}function ne(n,e,t,r){const s=new StorageEvent("storage",{url:window.location.href,key:n,oldValue:e,newValue:t,storageArea:r});window.dispatchEvent(s)}const Le={getLocal:n=>{try{const e=window.localStorage.getItem(n);return he(e)}catch(e){console.error(e)}},setLocal:(n,e)=>{try{const t=window.localStorage.getItem(n),r=Ge(e);window.localStorage.setItem(n,r),ne(n,t,r,window.localStorage)}catch(t){console.error(t)}},eachLocal:n=>{if(!n||we(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(),ne(null,null,null,window.localStorage)},removeLocal:n=>{const e=window.localStorage.getItem(n);window.localStorage.removeItem(n),ne(n,e,null,window.localStorage)},getSession:n=>{try{const e=window.sessionStorage.getItem(n);return he(e)}catch(e){console.error(e)}},setSession:(n,e)=>{try{const t=window.sessionStorage.getItem(n),r=Ge(e);window.sessionStorage.setItem(n,r),ne(n,t,r,window.sessionStorage)}catch(t){console.error(t)}},eachSession:n=>{if(!n||we(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(),ne(null,null,null,window.sessionStorage)},removeSession:n=>{const e=window.sessionStorage.getItem(n);window.sessionStorage.removeItem(n),ne(n,e,null,window.sessionStorage)},onStorageChange:n=>{if(!n||we(n)!=="Function")return console.error("传递参数非函数类型!");const e=t=>{n({url:t.url,key:t.key,newValue:t.newValue?he(t.newValue):null,oldValue:t.oldValue?he(t.oldValue):null,storageArea:t.storageArea})};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},kn=(n,e)=>new Promise((t,r)=>{$.postApi("/filehandle/save",{path:n,data:e}).then(s=>{s.res.success?t(!0):r(!1)})}),Fn='<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>',Ve='<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>',Nn='<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>',Bn={name:"局放测点",label:"局放测点",create:function(n,e){return m(this,null,function*(){const{transformControls:t}=e,r=document.createElement("div"),s=document.createElement("div");s.style.display="flex",s.style.alignItems="center",s.style.gap="10px",s.style.position="relative",s.style.zIndex="1";const o=document.createElement("div");o.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 a=document.createElement("div");a.style.width="1.3vw",a.style.height="1.3vw",a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center",a.style.cursor="pointer",a.style.pointerEvents="auto",a.style.userSelect="none",a.innerHTML=Ve;const l=document.createElement("style");l.innerHTML=`
|
|
14
|
-
.gis-icon { width: 100%; height: 100%; display: block; }
|
|
15
|
-
`,s.append(l,a,o),r.append(s);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.btnEleId||(n.btnEleId=pe()),c.innerHTML=`
|
|
16
|
-
<div 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=()=>{a.isFocus=!0},c.onmouseleave=()=>{a.isFocus=!1,c.style.display="none",r.className=""};const h=new Xt.CSS2DObject(r);h.name=n.name,h.dataId=n.guid,h.userData.params=n,a.onmouseover=()=>{c.style.display="flex",r.className="top-info";const P=document.getElementById(n.btnEleId);P.onclick=()=>{fe.emit("three-event",{type:"pd-history-click",data:h})}},a.onmouseleave=()=>{setTimeout(()=>{a.isFocus||(c.style.display="none",r.className="")},500)},a.onclick=()=>{fe.emit("three-event",{type:"pd-sensor-click",data:h}),n.preview||setTimeout(()=>{t.attach(h)},100)},s.append(c);const A=P=>{P===0?a.innerHTML=Ve:P===1?a.innerHTML=Fn:P===2&&(a.innerHTML=Nn)},M=P=>{const N=document.getElementsByClassName(`gis-val-${n.valueEleId}`);if(N.length)for(let p=0;p<N.length;p++)N[p].innerText=P};return h.changeState=A,h.changeValue=M,setTimeout(()=>{A(n.state),M(n.value)},200),h})},getStorage:function(n){return n.userData.params}};var rt;T.config(k({driver:[T.INDEXEDDB,T.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((rt=window.meta.storage)==null?void 0:rt.config)||{}));function Gn(){return{getKey:p=>m(this,null,function*(){return yield T.key(p)}),getKeys:()=>m(this,null,function*(){return yield T.keys()}),getItem:p=>m(this,null,function*(){if(p)return yield T.getItem(p)}),setItem:(p,W)=>m(this,null,function*(){if(p)return yield T.setItem(p,W)}),removeItem:p=>m(this,null,function*(){if(p)return yield T.removeItem(p)}),clearItems:()=>m(this,null,function*(){return yield T.clear()}),iterateItems:(p,W)=>m(this,null,function*(){if(p)return yield T.iterate(p,W)}),getReady:()=>m(this,null,function*(){return yield T.ready()}),getLength:()=>m(this,null,function*(){return yield T.length()}),getDriver:()=>m(this,null,function*(){return yield T.driver()}),setDriver:p=>m(this,null,function*(){if(p)return yield T.setDriver(p)}),setConfig:p=>m(this,null,function*(){if(p)return yield T.config(p)}),dropInstance:p=>m(this,null,function*(){if(p)return yield T.dropInstance(p)}),createInstance:p=>m(this,null,function*(){if(p)return yield T.createInstance(p)})}}const Vn="THREED_LOG_BUFFER",zn="THREED_CURRSCENE",Kn="THREED_ACTIVE_MENU",$n="THREED_PIXEL_RATIO",me="THREED_MODEL_DBNAME",ye="THREED_MODEL_DBSTORE",Wn="THREED_SCENE_PREVIEW",Ce="THREED_MODEL_LOAD_KEY",ae="THREED_PREVIEW_URL_KEY",qn="THREED_ADDON_EDITOR_JSON",jn="THREED_SCENE_STORAGE_SUFFIX",Re={step:.1},Xn=80,pt=30,Yn=1e3,Jn=1200,Qn=3e5,Zn="三维测试",er="灯光",tr=1,nr=["环境光","平行光","点光源","聚光灯","半球光","平面光"],_t=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),rr=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],Et=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),At=new Set(["CSS2DObject","CSS3DObject"]),sr=Object.assign({"/src/views/threed/models/pd-sensor.js":Bn}),ir=Object.assign({}),ar={环境光:()=>new F.THREE.AmbientLight(16777215,1),平行光:()=>new F.THREE.DirectionalLight(16777215,1),点光源:()=>new F.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new F.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new F.THREE.HemisphereLight(16777215,0,1),平面光:()=>new F.THREE.RectAreaLight(16777215,1,100,100)},or=[{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 ie=null,V=null,Se=[];const ze=n=>(n==null?void 0:n.name)||(n==null?void 0:n.label)||"",gt=(n={})=>Object.values(n).filter(e=>e&&(e.label||e.name)),cr=gt(sr),lr=gt(ir),ur=()=>({THREED_GUI_PARAMS:Re,THREED_LOG_BUFFER:Vn,THREED_CURRSCENE:zn,THREED_ACTIVE_MENU:Kn,THREED_PIXEL_RATIO:$n,THREED_IMPORT_SIZE:Xn,THREED_LIGHT_TYPES:nr,THREED_EXPORT_BATCH:pt,THREED_RELOAD_DELAY:Yn,THREED_MODEL_DBNAME:me,THREED_MODEL_DBSTORE:ye,THREED_SCENE_PREVIEW:Wn,THREED_USER_DATA_KEYS:_t,THREED_MODEL_LOAD_KEY:Ce,THREED_PREVIEW_URL_KEY:ae,THREED_ADDON_EDITOR_JSON:qn,THREED_EXPORT_NODE_COUNT:Jn,THREED_DEFAULT_SCENE_NAME:Zn,THREED_DEFAULT_ACTIVE_MENU:er,THREED_DEFAULT_PIXEL_RATIO:tr,THREED_EXPORT_VERTEX_COUNT:Qn,THREED_SCENE_EXCLUDE_TYPES:rr,THREED_EXPORT_EXCLUDE_TYPES:Et,THREED_EXPORT_RUNTIME_TYPES:At,THREED_SCENE_STORAGE_SUFFIX:jn});function dr(){const{createInstance:n,dropInstance:e}=Gn(),t="/",r=i=>{const u=URL.createObjectURL(i);return Se.push(u),u},s=()=>{Se.forEach(i=>URL.revokeObjectURL(i)),Se=[]},o=()=>m(this,null,function*(){return yield c(),{clearRequest:a,getAllRequest:p,getRequest:N,status:!0,message:"数据库打开成功",DATABASE:V}}),a=i=>m(this,null,function*(){if(!i)return{status:!1,message:"删除失败"};yield c(),yield V.removeItem(i);const u=yield P();return u.list=u.list.filter(d=>d.name!==i),{status:!0,message:"删除成功"}}),l=(...u)=>m(this,[...u],function*(i=me){V=null,ie=null,yield e({name:i,storeName:ye})}),c=()=>m(this,null,function*(){return V||(ie||(ie=n({name:me,storeName:ye}).then(i=>(V=i,i))),yield ie)}),h=i=>{if(!i)return!1;const u=String(i.message||"");return i.name==="DataError"||u.includes("in-line keys")},A=()=>m(this,null,function*(){V=null,ie=null,yield e({name:me}),yield c()});let M=null;const P=()=>m(this,null,function*(){return window.threeEditorDB?window.threeEditorDB:(M||(M=m(this,null,function*(){const i=yield o(),{data:u}=yield i.getAllRequest();return window.threeEditorDB={db:i,list:u},window.threeEditorDB})),yield M)}),N=i=>m(this,null,function*(){if(!i)return{status:!1,message:"获取失败"};yield c();const u=yield V.getItem(i);if(u!=null&&u.blob&&!i)return{status:!0,message:"获取成功",url:r(u.blob)};if(!i)return{status:!1,message:"获取失败"};const d=yield fetch(i).then(v=>v.blob()),f={blob:d};try{yield V.setItem(i,f)}catch(v){if(!h(v))throw v;yield A(),yield V.setItem(i,f)}const S=yield P(),G=k({name:i},f),D=S.list.findIndex(v=>v.name===i);return D>-1?S.list.splice(D,1,G):S.list.push(G),{status:!0,message:"文件缓存成功",url:r(d)}}),p=()=>m(this,null,function*(){yield c();const i=[];return V&&(yield V.iterate((u,d)=>{i.push(le(k({},u||{}),{name:d}))})),window.threeEditorDB&&(window.threeEditorDB.list=i),{status:!0,message:"获取成功",data:i}}),W=()=>m(this,null,function*(){var d;const{res:i}=yield $.getApi("/filehandle/scan",{path:ot.threeModelPath,extension:"glb,gltf"}),u=[];if(((d=i==null?void 0:i.children)==null?void 0:d.length)>0)for(const f of i.children)u.push({name:f.name,path:"/"+f.path});return u}),ee=()=>window.GUI_PARAMS||Re,te=()=>window.threeEditor||null,_=()=>window.editorJsons||[],g=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),C=()=>cr,I=()=>ar||{},L=()=>window[ae]||"",z=()=>lr,y=()=>window.devicePixelRatio||1,E=()=>window[ae]||"",b=()=>{const i=C(),u=z();return{modelDesigns:i,componentDesigns:u,modelList:i.map(d=>d.label),componentList:u.map(d=>d.label)}},B=(i,u)=>{var d;return(d=i==null?void 0:i.__DESIGNS__)==null?void 0:d.find(f=>f.label===u)},O=(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`,J=i=>{const u=window[Ce];typeof u=="function"&&u(i)},R=i=>!!i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z),H=i=>{var u,d;return!i||!i.visible||(u=i.userData)!=null&&u.excludeFromExport||i.isTransformControls||i.isHelper||i.isLight||i.isPoints||(d=i.type)!=null&&d.includes("Helper")||Et.has(i.type)||At.has(i.type)||i.isCSS2DObject||i.isCSS3DObject?!1:i.isMesh||i.isGroup||i.isObject3D||i.isLine},K=(i,u)=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)?i:u,q=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},U=i=>{if(!(i!=null&&i.isObject3D))return;const u=K(i.position,{x:0,y:0,z:0});i.position.set(u.x,u.y,u.z);const d=K(i.scale,{x:1,y:1,z:1});i.scale.set(d.x===0?1:d.x,d.y===0?1:d.y,d.z===0?1:d.z);const f=K(i.up,{x:0,y:1,z:0});i.up.set(f.x,f.y,f.z);const S=q(i.quaternion);i.quaternion.set(S.x,S.y,S.z,S.w),i.pivot&&!R(i.pivot)&&delete i.pivot,i.updateMatrix(),i.updateMatrixWorld(!1)},Dt=(i,u="_blank")=>window.open(i,u),xt=(i,u="")=>window.prompt(i,u),vt=()=>window.location.reload(),Tt=()=>document.documentElement.classList.remove("dark"),Pt=i=>{if(!Array.isArray(i==null?void 0:i.__DESIGNS__))return b();const u=[...C(),...z()],d=new Set(i.__DESIGNS__.map(f=>ze(f)));return u.forEach(f=>{const S=ze(f);!S||d.has(S)||(d.add(S),i.__DESIGNS__.unshift(f))}),b()},bt=i=>{if(!Array.isArray(i==null?void 0:i.__GLSLLIB__))return;const u=new Set(i.__GLSLLIB__.map(d=>d==null?void 0:d.name));or.forEach(d=>{u.has(d.name)||(u.add(d.name),i.__GLSLLIB__.push(d))})},Ee=(i={})=>{const u={};return Object.entries(i||{}).forEach(([d,f])=>{if(!(_t.has(d)||typeof f=="function")){if(!f||["string","number","boolean"].includes(typeof f)){u[d]=f;return}if(Array.isArray(f)){try{u[d]=structuredClone(f)}catch(S){return}return}if(!(f.isObject3D||f.isMaterial||f.isTexture||f.nodeType))try{u[d]=structuredClone(f)}catch(S){return}}}),u},Lt=(i=Re)=>{window.GUI_PARAMS=i},Mt=i=>{window.threeEditor=i},Ot=i=>{window.threeEditorDB=i},Ht=i=>{window[Ce]=i},Ut=(i="")=>{window[ae]=i},kt=(i="")=>{window[ae]=i},Me=i=>{var d;const u=[];return(d=i==null?void 0:i.children)==null||d.forEach(f=>{H(f)&&u.push(f)}),u},Oe=(i=[])=>{const u={rootCount:i.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return i.forEach(d=>{d.traverse(f=>{var S,G,D;if(H(f)){u.nodeCount+=1,f.isMesh&&(u.meshCount+=1,u.vertexCount+=((D=(G=(S=f.geometry)==null?void 0:S.attributes)==null?void 0:G.position)==null?void 0:D.count)||0);return}f!==d&&(u.skippedCount+=1)})}),u},He=()=>new Promise(i=>requestAnimationFrame(()=>setTimeout(i,0))),Ue=()=>new Promise(i=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>i(),{timeout:80});return}setTimeout(i,0)}),Ft=(i,u)=>m(this,null,function*(){var S;if(!H(i))return null;const d=i.clone(!1);d.userData=Ee(i.userData),R(i.pivot)?d.pivot=new F.THREE.Vector3(i.pivot.x,i.pivot.y,i.pivot.z):"pivot"in d&&delete d.pivot,U(d);const f=[{source:i,clone:d}];for(;f.length;){const G=f.shift();for(const D of G.source.children){if(!H(D)){u.skippedCount+=1;continue}const v=D.clone(!1);v.userData=Ee(D.userData),R(D.pivot)?v.pivot=new F.THREE.Vector3(D.pivot.x,D.pivot.y,D.pivot.z):"pivot"in v&&delete v.pivot,U(v),G.clone.add(v),f.push({source:D,clone:v}),u.processedCount+=1,u.processedCount%pt===0&&(yield(S=u.onProgress)==null?void 0:S.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 He())}}return d});return{baseUrl:t,getModels:W,getRequest:N,reloadPage:vt,promptInput:xt,waitForIdle:Ue,waitForPaint:He,clearRequest:a,getGuiParams:ee,setGuiParams:Lt,getAllRequest:p,getEditorJsons:_,getThreeEditor:te,formatFileSize:O,setThreeEditor:Mt,removeDarkClass:Tt,openExternalUrl:Dt,getThreedModels:C,getViewportSize:g,buildExportScene:(d,...f)=>m(this,[d,...f],function*(i,u={}){const S=Me(i),G=Oe(S),D=new F.THREE.Scene,v={totalCount:G.nodeCount,processedCount:0,skippedCount:0,onProgress:u.onProgress};for(const Nt of S){const ke=yield Ft(Nt,v);ke&&D.add(ke),yield Ue()}return D.updateMatrixWorld(!0),G.skippedCount+=v.skippedCount,{exportScene:D,exportObjects:S,stats:G}}),createModelDbApi:o,getEditorPreviewSceneUrl:E,sanitizeUserData:Ee,setThreeEditorDB:Ot,findThreedDesign:B,getThreedLightMap:I,collectExportStats:Oe,getPreviewSceneUrl:L,setEditorPreviewSceneUrl:kt,setPreviewSceneUrl:Ut,setModelLoadHander:Ht,isExportableObject:H,deleteThreeEditorDB:l,ensureThreeEditorDB:P,getDevicePixelRatio:y,getThreedComponents:z,collectExportObjects:Me,resetModelDbInstance:A,ensureModelDbInstance:c,getLocalDesignMenuData:b,invokeModelLoadHandler:J,isLegacyInlineKeyError:h,ensureThreedShaderLibrary:bt,ensureThreedDesignRegistry:Pt,createBlobUrl:r,revokeModelObjectUrls:s}}const{THREED_LOG_BUFFER:wt,THREED_CURRSCENE:De,THREED_ACTIVE_MENU:St,THREED_PIXEL_RATIO:It,THREED_SCENE_PREVIEW:yt,THREED_ADDON_EDITOR_JSON:xe,THREED_DEFAULT_SCENE_NAME:hr,THREED_DEFAULT_ACTIVE_MENU:ve,THREED_DEFAULT_PIXEL_RATIO:Te,THREED_SCENE_STORAGE_SUFFIX:mr}=ur(),X=(n,e)=>{const t=Le.getLocal(n);return t==null?e:t},j=(n,e)=>{n&&Le.setLocal(n,e)},fr=n=>{n&&Le.removeLocal(n)},pr=(n,e)=>{var r,s;const t=(r=n==null?void 0:n.trim)==null?void 0:r.call(n);return t&&e.some(o=>o.name===t)?t:((s=e[0])==null?void 0:s.name)||hr},Pe=(n=[])=>Array.isArray(n)?n.filter(e=>typeof e=="string"&&e):[],_r=()=>{const n=[],e=X(De,{name:"",path:""}),t=Number.parseFloat(X(It,Te));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:n,previewScene:!!X(yt,!1),activeMenuTitle:X(St,ve)||ve,pixelRatio:Number.isFinite(t)&&t>0?t:Te,logarithmicDepthBuffer:X(wt,!0)!==!1,addonEditorJson:Pe(X(xe,[]))}},Ct=be.defineStore("threed",{state:()=>_r(),actions:{getSceneList(n){return m(this,null,function*(){var t;const e=yield $.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(s=>s.org_id===n);r?this.setCurrScene(r):this.setCurrScene({name:"",path:""});return}this.currScene.path?this.sceneList.find(s=>s.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=pr(n,this.sceneList),j(De,this.sceneName)},createScene(n,e=""){return m(this,null,function*(){var l,c,h;const t=(c=(l=n.name)==null?void 0:l.trim)==null?void 0:c.call(l);if(!t||this.sceneList.some(A=>A.name===t))return!1;const r=ot.threeSavePath+"/"+pe()+".json",s=pe();if(!(yield $.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:r,guid:s,org_id:n.org_id,org_name:n.org_name}]})).success)return!1;if(yield kn(r,e)){const A=yield $.postCommonApi("threedfloorplan",{guid:s});if((h=A==null?void 0:A.data)!=null&&h.length)return this.sceneList=[...this.sceneList,A.data[0]],A.data[0]}return!0})},deleteScene(n){return m(this,null,function*(){var r;if(!n)return;if(!(yield $.postCommonApi("query/threedfloorplan/delete",{data:[n]})).success)return!1;const t=this.sceneList.findIndex(s=>s.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 m(this,null,function*(){this.currScene=n,j(De,this.currScene)})},setPreviewMode(n){this.previewScene=!!n,j(yt,this.previewScene)},setActiveMenuTitle(n){this.activeMenuTitle=n||ve,j(St,this.activeMenuTitle)},setPixelRatio(n){const e=Number.parseFloat(n);this.pixelRatio=Number.isFinite(e)&&e>0?e:Te,j(It,this.pixelRatio)},setLogarithmicDepthBuffer(n){this.logarithmicDepthBuffer=!!n,j(wt,this.logarithmicDepthBuffer)},getSceneStorageKey(n){return`${n||this.sceneName}${mr}`},getSceneStorageParams(n,e=null){return X(this.getSceneStorageKey(n),e)},setSceneStorageParams(n,e){n&&j(this.getSceneStorageKey(n),e)},removeSceneStorageParams(n){n&&fr(this.getSceneStorageKey(n))},resetTaskState(){return m(this,null,function*(){yield new Promise(n=>setTimeout(n,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=Pe(X(xe,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(n){this.addonEditorJson=Pe(n),j(xe,this.addonEditorJson)}}}),Er={backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},Ar={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}},gr={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}]},wr={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}},Sr={mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},Ir={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}},yr={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}}},Cr=[],Rr=[],Dr=[],xr=[],vr=[],Tr=[],Pr={},br=[],Lr={viewAngleList:[],clipping:{size:20,clipList:[]}},Mr={scene:Er,perspectiveCamera:Ar,webglRenderer:gr,orbitControls:wr,transformControls:Sr,effectComposer:Ir,handler:yr,lightCores:Cr,innerCores:Rr,modelCores:Dr,drawCores:xr,textCores:vr,particleCores:Tr,geoCores:Pr,designCores:br,other:Lr},Rt=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Or=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 z;const r=t,s=n,o=Ct(),{currScene:a}=be.storeToRefs(o),l=((z=window.meta.threed)==null?void 0:z.draco_path)||it;F.ThreeEditor.dracoPath=l.endsWith("/")?l:`${l}/`;let c=null,h=null,A=!1;const M=x.ref(null),{setGuiParams:P,getDevicePixelRatio:N,ensureThreeEditorDB:p,createBlobUrl:W,revokeModelObjectUrls:ee,ensureThreedDesignRegistry:te}=dr();te(F.ThreeEditor),P({step:.1});const _=()=>{var y;return(y=c==null?void 0:c.renderSceneResize)==null?void 0:y.call(c)},g=()=>m(this,null,function*(){var E,b;if(A)return;let y=Mr;try{if(s.data&&Object.keys(s.data).length)y=s.data;else if((E=a.value)!=null&&E.path){const O=yield $.getApi((b=a.value)==null?void 0:b.path).catch(()=>({}));if(A)return;O.res&&(y=O.res)}const B=yield C(y);if(A)return;c?c.resetEditorStorage(B):c=new F.ThreeEditor(M.value,{fps:null,pixelRatio:N()*o.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0},sceneParams:B})}catch(B){console.error("三维图纸初始化失败",B),c==null||c.resetEditorStorage(y)}finally{I()}r("emit-three-editor",c),window.addEventListener("resize",_)}),C=y=>m(this,null,function*(){var J;const E=structuredClone(y||{});if((J=E.designCores)==null||J.forEach(R=>{R.preview=s.preview}),s.preview){E.handler.mode="none",E.handler.helpers.axes.showAxes=!1,E.handler.helpers.box3.useBox3=!1,E.handler.helpers.grid.showGrid=!1,E.handler.rightClickMenusEnable=!1;const{perspectiveCamera:R,orbitControls:H}=E,K=R==null?void 0:R.position,q=H==null?void 0:H.target;if(K&&q){const U=Math.hypot(K.x-q.x,K.y-q.y,K.z-q.z);Number.isFinite(U)&&U>0&&(H.maxDistance=U*(5/3))}}const b=yield p(),B=b.list||[],O=[];for(const R of E.modelCores||[]){const H=R.modelInfo.originPath;if(H){const K=B.find(U=>U.name===H);if(!K){const U=yield b.db.getRequest(H);U!=null&&U.url&&(R.modelInfo.url=U.url),O.push(R);continue}const q=W(K.blob);R.modelInfo.url=q}O.push(R)}return E.modelCores=O,E}),I=()=>{c!=null&&c.renderer&&(h=new F.THREE.PMREMGenerator(c.renderer),h.compileEquirectangularShader(),c.scene.environment=h.fromScene(new Yt.RoomEnvironment).texture)},L=()=>c;return x.watch([()=>a.value.path,()=>s.data],([y,E])=>{console.log("watch",y,E),g()},{deep:!0}),x.onMounted(()=>m(this,null,function*(){var y,E;A=!1,(y=M.value)!=null&&y.clientHeight&&((E=M.value)!=null&&E.clientWidth)&&g()})),x.onUnmounted(()=>{A=!0,window.removeEventListener("resize",_),c==null||c.destroySceneRender(),h==null||h.dispose(),ee()}),e({getEditorInstance:L}),(y,E)=>(x.openBlock(),x.createElementBlock("div",{ref_key:"editorRef",ref:M,class:"threed-editor",onDragover:E[0]||(E[0]=x.withModifiers(()=>{},["prevent"])),onDrop:E[1]||(E[1]=x.withModifiers(()=>{},["prevent"]))},null,544))}}),Hr=Rt(Or,[["__scopeId","data-v-939f3c22"]]),Ur={class:"threed-preview"},kr=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,s=t;let o=x.shallowRef({});const a=x.ref(),l=Ct();let c={},h=null,A=null;const M=_=>{var C,I,L;if(!_)return;if((C=_==null?void 0:_.includes)!=null&&C.call(_,"token 必传"))return oe({message:_,type:"warning"});const g=typeof _=="string"?JSON.parse(_):_;if((g==null?void 0:g.data)==="服务错误"||(L=(I=g==null?void 0:g.data)==null?void 0:I.includes)!=null&&L.call(I,"token is expired"))return oe({message:g.data,type:"warning"});switch(g.action){case Ne.ACPOINT.YCVALUE:case Ne.ACPOINT.YXVALUE:console.warn("遥测信息");break}},P=()=>{try{A=new yn({socketUrl:r.socketUrl,token:r.token,onMessage:M})}catch(_){console.warn("三维场景消息处理失败",_)}},N=()=>m(this,null,function*(){var _;if(c){const g=Object.keys(c);if(g.length){const C=yield $.postPDApi("querychannelstatus/",{data:g.map(I=>({ied_id:I,ln_list:c[I].map(L=>L.ln_id)}))});(_=C==null?void 0:C.data)!=null&&_.length&&g.forEach(I=>{const L=C.data.find(y=>y.ied_id===I),z=c[I];z!=null&&z.length&&z.forEach(y=>{const E=L.result.find(b=>b.ln_id===y.ln_id);if(E){const b=te();if(!(b!=null&&b.scene))return;const B=b.scene.getObjectsByProperty("dataId",y.guid);let O=B==null?void 0:B[0];if(O){const J=E.status==="告警"?2:E.status==="正常"?1:0;O.userData.params.state=J;const R=Rn(E.amp_peak)?Dn(Number(E.amp_peak))?Number(E.amp_peak):0:E.amp_peak;O.userData.params.value=R,O.changeState(J),O.changeValue(R)}}})})}}}),p=_=>{s("graph-event",_)},W=_=>{_&&(r.socketUrl&&P(),setTimeout(()=>{const g=_.scene.getObjectsByProperty("designType","局放测点");g.forEach(C=>{const{ied_id:I,ln_id:L}=C.userData.params;c[I]||(c[I]=[]),c[I].push({guid:C.dataId,id:C.uuid,ied_id:I,ln_id:L})}),g!=null&&g.length&&(h&&clearInterval(h),N(),h=setInterval(()=>{N()},2e3)),s("loaded",_)},100))},ee=()=>m(this,null,function*(){if(o.value&&Object.keys(o.value).length)return;const _=xn(),g=r.url||_.url;if(g){const L=yield $.getApi(g).catch(()=>({}));L.res&&(o.value=L.res);return}if(!(r.id||_.id)){console.warn("三维场景渲染失败,场景id为空!");return}const I=yield $.getCommonApi("threedfloorplan",{guid:r.id});I.data.length?l.setCurrScene(I.data[0]):console.warn("三维场景渲染失败,场景id为:"+r.id+"不存在!")}),te=()=>a.value?a.value.getEditorInstance():null;return x.watch(()=>r.data,_=>{_&&(o.value=_,ee())},{deep:!0,immediate:!0}),x.watch(()=>r.id,_=>{_&&ee()},{deep:!0,immediate:!0}),x.onMounted(()=>{fe.on("three-event",p)}),x.onUnmounted(()=>{A&&A.destroy(),h&&clearInterval(h),fe.off("three-event",p)}),e({getEditorInstance:te}),(_,g)=>(x.openBlock(),x.createElementBlock("div",Ur,[x.createVNode(Hr,{ref_key:"threedEditorRef",ref:a,data:x.unref(o),preview:"",onGraphEvent:p,onEmitThreeEditor:W},null,8,["data"])]))}}),ce=Rt(kr,[["__scopeId","data-v-fbc5634a"]]);ce.name||(ce.name="SyThree");const Fr=n=>{n.component(ce.name||"SyThree",ce)},Nr={install:Fr};exports.SyThree=ce;exports.default=Nr;
|
|
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%}
|