@syhr/sy-three 1.0.0-rc.1
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/CHANGELOG.md +717 -0
- package/README.md +223 -0
- package/dist-three/sy-three.cjs +51 -0
- package/dist-three/sy-three.css +1 -0
- package/dist-three/sy-three.mjs +2311 -0
- package/dist-three/sy-three.umd.js +52 -0
- package/package.json +159 -0
- package/readme.text +4 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
(function(_,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("vue"),require("qs"),require("axios"),require("dayjs"),require("mitt"),require("pinia"),require("crypto-js"),require("gm-crypto"),require("lodash-es"),require("element-plus"),require("three/examples/jsm/renderers/CSS2DRenderer.js"),require("three-edit-cores"),require("localforage"),require("@element-plus/icons-vue"),require("three/addons/environments/RoomEnvironment.js")):typeof define=="function"&&define.amd?define(["exports","vue","qs","axios","dayjs","mitt","pinia","crypto-js","gm-crypto","lodash-es","element-plus","three/examples/jsm/renderers/CSS2DRenderer.js","three-edit-cores","localforage","@element-plus/icons-vue","three/addons/environments/RoomEnvironment.js"],f):(_=typeof globalThis!="undefined"?globalThis:_||self,f(_.SyThree={},_.Vue,_.qs,_.axios,null,_.mitt,_.Pinia,null,_.gmCrypto,_._,_.ElementPlus,_.CSS2DRenderer_js,_.ThreeEditCores,_.localforage,_.ElementPlusIconsVue,_.RoomEnvironment_js))})(this,function(_,f,C,_e,Ee,Ae,Z,ae,P,ee,V,bt,L,x,_r,Lt){"use strict";var dr=Object.defineProperty,hr=Object.defineProperties;var mr=Object.getOwnPropertyDescriptors;var Pt=Object.getOwnPropertySymbols;var fr=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable;var Fe=(_,f,C)=>f in _?dr(_,f,{enumerable:!0,configurable:!0,writable:!0,value:C}):_[f]=C,M=(_,f)=>{for(var C in f||(f={}))fr.call(f,C)&&Fe(_,C,f[C]);if(Pt)for(var C of Pt(f))pr.call(f,C)&&Fe(_,C,f[C]);return _},pe=(_,f)=>hr(_,mr(f));var Y=(_,f,C)=>Fe(_,typeof f!="symbol"?f+"":f,C);var p=(_,f,C)=>new Promise((_e,Ee)=>{var Ae=P=>{try{ae(C.next(P))}catch(ee){Ee(ee)}},Z=P=>{try{ae(C.throw(P))}catch(ee){Ee(ee)}},ae=P=>P.done?_e(P.value):Promise.resolve(P.value).then(Ae,Z);ae((C=C.apply(_,f)).next())});var dt,ht,mt,ft,pt,_t,Et,At,gt,wt,St,It,Ct;var Ne=document.createElement("style");Ne.textContent=`@charset "UTF-8";.threed-editor[data-v-cebfdbf8]{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sc-bg-color)}.threed-preview[data-v-46ac6fc4]{width:100%;height:100%}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(Ne);const ce={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},Be={ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"}};var le={};/*!
|
|
3
|
+
* vite-plugin-qiankun.js v1.0.14
|
|
4
|
+
* (c) 2021-2022 Teng Mao Qing
|
|
5
|
+
* Released under the MIT License.
|
|
6
|
+
*/Object.defineProperty(le,"__esModule",{value:!0});var J=typeof window!="undefined"?window.proxy||window:{},Ge=function(r){J!=null&&J.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),J.qiankunName&&(window.moudleQiankunAppLifeCycles[J.qiankunName]=r))};le.default=Ge;var ge=le.qiankunWindow=J;le.renderWithQiankun=Ge;function Mt(){return window.__POWERED_BY_WUJIE__||window.$wujie?ce.WUJIE:window.__POWERED_BY_QIANKUN__||ge!=null&&ge.__POWERED_BY_QIANKUN__?ce.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?ce.MICROAPP:ce.NONE}const Ot="/";Mt();const Ut=location.origin,Ve={savePath:((ht=(dt=window.meta)==null?void 0:dt.graph)==null?void 0:ht.savePath)||"/cockpit/drawing",graphPenPath:((ft=(mt=window.meta)==null?void 0:mt.graph)==null?void 0:ft.graphPenPath)||"/cockpit/graph",templatePath:((_t=(pt=window.meta)==null?void 0:pt.graph)==null?void 0:_t.templatePath)||"/cockpit/template",graphImgUploadPath:((At=(Et=window.meta)==null?void 0:Et.graph)==null?void 0:At.graphImgUploadPath)||"/cockpit/upload",threeSavePath:((wt=(gt=window.meta)==null?void 0:gt.graph)==null?void 0:wt.threeSavePath)||"/cockpit/threed",threeModelPath:((It=(St=window.meta)==null?void 0:St.graph)==null?void 0:It.threeModelPath)||"/cockpit/models"},w=_e.create({baseURL:Ut,timeout:window.meta.axios.timeout||12e4,withCredentials:!1,paramsSerializer:r=>C.stringify(r)});w.interceptors.request.use(r=>(r.headers["x-token"]="ewoglCJhbGcilDogpc3",r),r=>Promise.reject(r)),w.interceptors.response.use(r=>{const{data:e}=r;return Promise.resolve(e)},r=>Promise.reject(r));function Ht(r,e={},t={}){return new Promise(n=>{w.get(r,M({params:e},t)).then(s=>n({res:s,err:null})).catch(s=>n({res:null,err:s}))})}function kt(r,e={},t={}){return new Promise(n=>{w.post(r,e,t).then(s=>n({res:s,err:null})).catch(s=>n({res:null,err:s}))})}function Ft(r,e={},t={}){return w.get(r,M({params:e},t))}function Nt(r,e={},t={}){return w.post(r,e,t)}function Bt(r,e={}){return w.get(`/filehandle/${r}`,{params:e})}function Gt(r,e={},t={}){return w.post(`/filehandle/${r}`,e,t)}function Vt(r,e={}){return w.get(`/user/${r}`,{params:e})}function Kt(r,e={},t={}){return w.post(`/user/${r}`,e,t)}function zt(r,e={}){return w.get(`${r}`,e.local?{params:e,baseURL:Ot}:{params:e})}function __$t__(r,e={}){return w.get(`/media/${r}/`,{params:e})}function Wt(r,e={},t={}){return w.post(`/media/${r}/`,e,t)}function qt(r,e={}){return w.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,{params:e})}function jt(r,e={},t={}){return w.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,e,t)}function Yt(r,e={}){return w.get(`/history/${r}`,{params:e})}function Jt(r,e={},t={}){return w.post(`/history/${r}`,e,t)}function Xt(r,e={}){return w.get(`/scada/${r}`,{params:e})}function Qt(r,e={},t={}){return w.post(`/scada/${r}`,e,t)}function Zt(r,e={}){return w.get(`/common/factory/${r}`,{params:e})}function en(r,e={},t={}){return w.post(`/common/factory/${r}`,e,t)}function tn(r,e={}){return w.get(`/factory/${r}`,{params:e})}function nn(r,e={},t={}){return w.post(`/factory/${r}`,e,t)}function rn(r,e={}){return w.get(`/pd/${r}`,{params:e})}function sn(r,e={},t={}){return w.post(`/pd/${r}`,e,t)}const N={getApi:Ht,postApi:kt,getFileApi:Bt,postFileApi:Gt,getBaseApi:Ft,postBaseApi:Nt,getUserApi:Vt,postUserApi:Kt,getGraphApi:zt,getMediaApi:__$t__,postMediaApi:Wt,getScadaApi:Xt,postScadaApi:Qt,getCommonApi:qt,postCommonApi:jt,getHistoryApi:Yt,postHistoryApi:Jt,getFactoryApi:tn,postFactoryApi:nn,getCommonFactoryApi:Zt,postCommonFactoryApi:en,getPDApi:rn,postPDApi:sn},on=()=>{var n;const r={},e=((n=window.location.href.split("?"))==null?void 0:n[1])||"",t=new URLSearchParams(e);for(const[s,o]of t.entries())r[s]=o;return r};function Ke(r){return Object.prototype.toString.call(r).slice(8,-1)}function we(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,r=>(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16))}const Se=Ae();class an{constructor(e={}){this._options=M({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:n,onError:s,onMessage:o,token:a}=this._options;WebSocket!==void 0?this._client=new WebSocket(e,[a]):this.$message({type:"error",message:"当前浏览器不支持WebSocket推送!"}),this._client.onopen=l=>{this._client.readyState===WebSocket.OPEN&&(this._retryCount=0,this._isConnect=!0,this._closeClient=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null),t&&t(l)},this._client.onclose=l=>{!this._closeClient&&this.retryIntervalStart(),this._isConnect=!1,n&&n(l)},this._client.onerror=l=>{s&&s(l)},this._client.onmessage=l=>{o&&o(l)}}_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 cn=(r,e)=>new Promise((t,n)=>{N.postApi("/filehandle/save",{path:r,data:e}).then(s=>{s.res.success?t(!0):n(!1)})});Z.createPinia(),function(){if(typeof Object.id=="undefined"){var r=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++r,enumerable:!1,writable:!1}),e.__uniqueid}}}();function ln(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];this.encode=function(t){var n,s,o,a,l,u;for(o=t.length,s=0,n="";s<o;){if(a=t.charCodeAt(s++)&255,s==o){n+=r.charAt(a>>2),n+=r.charAt((a&3)<<4),n+="==";break}if(l=t.charCodeAt(s++),s==o){n+=r.charAt(a>>2),n+=r.charAt((a&3)<<4|(l&240)>>4),n+=r.charAt((l&15)<<2),n+="=";break}u=t.charCodeAt(s++),n+=r.charAt(a>>2),n+=r.charAt((a&3)<<4|(l&240)>>4),n+=r.charAt((l&15)<<2|(u&192)>>6),n+=r.charAt(u&63)}return n},this.decode=function(t){var n,s,o,a,l,u,h;for(u=t.length,l=0,h="";l<u;){do n=e[t.charCodeAt(l++)&255];while(l<u&&n==-1);if(n==-1)break;do s=e[t.charCodeAt(l++)&255];while(l<u&&s==-1);if(s==-1)break;h+=String.fromCharCode(n<<2|(s&48)>>4);do{if(o=t.charCodeAt(l++)&255,o==61)return h;o=e[o]}while(l<u&&o==-1);if(o==-1)break;h+=String.fromCharCode((s&15)<<4|(o&60)>>2);do{if(a=t.charCodeAt(l++)&255,a==61)return h;a=e[a]}while(l<u&&a==-1);if(a==-1)break;h+=String.fromCharCode((o&3)<<6|a)}return h},this.utf16to8=function(t){var n,s,o,a;for(n="",o=t.length,s=0;s<o;s++)a=t.charCodeAt(s),a>=1&&a<=127?n+=t.charAt(s):a>2047?(n+=String.fromCharCode(224|a>>12&15),n+=String.fromCharCode(128|a>>6&63),n+=String.fromCharCode(128|a>>0&63)):(n+=String.fromCharCode(192|a>>6&31),n+=String.fromCharCode(128|a>>0&63));return n},this.utf8to16=function(t){var n,s,o,a,l,u;for(n="",o=t.length,s=0;s<o;)switch(a=t.charCodeAt(s++),a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=t.charAt(s-1);break;case 12:case 13:l=t.charCodeAt(s++),n+=String.fromCharCode((a&31)<<6|l&63);break;case 14:l=t.charCodeAt(s++),u=t.charCodeAt(s++),n+=String.fromCharCode((a&15)<<12|(l&63)<<6|(u&63)<<0);break}return n},this.charToHex=function(t){var n,s,o;for(n="",s=0;s<t.length;)o=t.charCodeAt(s++).toString(16),n+="\\0x"+o,n+=s>0&&s%8==0?`\r
|
|
7
|
+
`:", ";return n}}function un(){var r=0,e=new Object;this.add=function(t,n){this.containsKey(t)||r++,e[t]=n},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&r--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var n in e)if(e[n]==t)return!0;return!1},this.getValues=function(){var t=[];for(var n in e)t.push(e[n]);return t},this.getKeys=function(){var t=[];for(var n in e)t.push(n);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function dn(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new un,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,n){var s=Object.id(n).toString();this.callbacks_.add(s,n);var o={MsgId:s,Method:e+"|"+r};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),n=t.MsgId;if(this.callbacks_.containsKey(n)){var s=this.callbacks_.getValue(n);s(t.Result,t.Response),this.callbacks_.remove(n)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},n){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],n)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:n},s){this.exec("Arm_VerifyPIN",[parseInt(e),n,t],s)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},n){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],n)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},n){this.exec("Arm_LEDControl",[parseInt(e),t],n)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},n){this.exec("Arm_SwitchProtocol",[parseInt(e),t],n)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:n,AttrBuffer:s},o){this.exec("Arm_CreateFile",[parseInt(e),n,parseInt(t),s],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:n,FileOffset:s,DataInput:o},a){this.exec("Arm_WriteFile",[parseInt(e),n,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:n},s){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),n],s)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:n,DataLen:s},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),n,n.length,parseInt(s)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:n},s){this.exec("Arm_DeleteFile",[parseInt(e),n,parseInt(t)],s)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:n},s){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),n],s)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:n},s){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),n],s)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},n){this.exec("Arm_WriteShareMemory",[parseInt(e),t],n)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},n){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],n)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:n,TryCount:s,PinFlag:o},a){this.exec("Arm_ChangePIN",[parseInt(e),o,n,t,parseInt(s)],a)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},n){this.exec("Arm_ResetUserPIN",[parseInt(e),t],n)},this.Arm_SetUserID=function({Handle:e,UserID:t},n){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],n)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},n){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],n)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},n){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},n){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},n){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:n,RsaPriFileID:s,RsaPriFileSize:o},a){this.exec("Arm_RsaPri",[parseInt(e),parseInt(s),parseInt(o),t,n],a)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:n,RsaPubInData:s,RsaPubFileSize:o},a){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),n,t,t.length,s],a)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:n},s){this.exec("Arm_EccSign",[parseInt(e),parseInt(n),t],s)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:n,EccSignData:s},o){this.exec("Arm_EccVerify",[parseInt(e),n,n.length,t,s],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:n},s){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(n),t],s)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:n,Sm2SignData:s},o){this.exec("Arm_Sm2Verify",[parseInt(e),n,n.length,t,s],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:n,TdesInData:s},o){this.exec("Arm_TDES",[parseInt(e),parseInt(n),t,s],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:n,Sm4InData:s},o){this.exec("Arm_SM4",[parseInt(e),parseInt(n),t,s],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:n},s){this.exec("Arm_HASH",[parseInt(e),t,n],s)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:n},s){this.exec("Arm_Seed",[parseInt(e),n,t],s)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},n){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],n)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:n,SonCount:s,StartUserID:o,AdminTryCount:a,UserPin:l,UserTryCount:u,UpdateRSAPriKey:h},b){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),n,l,parseInt(u),parseInt(a),h,parseInt(o),parseInt(s)],b)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},n){this.exec("Arm_InitSon",[parseInt(e),t],n)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},n){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],n)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:n,FileID:s,FileType:o,Offset:a,DataLen:l,DataBuffer:u,UpRSAPubKey:h},b){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,n,o,parseInt(s),parseInt(a),u,h,parseInt(l)],b)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:n,FileID:s,FileType:o,Offset:a,DataLen:l,DataBuffer:u},h){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,n,o,parseInt(s),parseInt(a),u,parseInt(l)],h)},this.Arm_Update=function({Handle:e,UpdateData:t},n){this.exec("Arm_Update",[parseInt(e),t],n)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:n},s){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(n)],s)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:n,Priv:s,IsReset:o,IsDecOnRAM:a},l){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[n,parseInt(t),parseInt(e),parseInt(s),parseInt(a),parseInt(o)],l)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},n){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},n){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},n){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],n)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:n,IsDecOnRAM:s},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(s),parseInt(n)],o)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:n,InBuffer:s,CallLimit:o},a){this.exec("Arm_Set_EXE_FILE_INFO",[s,parseInt(n),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 hn={HID:0},ue={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},ze={USER:0};class $e{constructor(){Y(this,"Base64",new ln);Y(this,"AtlCtrl",null);Y(this,"ArmCount",0);Y(this,"ArmIndex",0);Y(this,"ArmHandle",0);Y(this,"ArmRandom","");try{this.AtlCtrl=new dn("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((n,s)=>{n?(this.ArmCount=+s,e(s)):t(s)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,n)=>{this.AtlCtrl.Arm_Open({Index:e},(s,o)=>{s?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,n(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_Close({Handle:e},(s,o)=>{s?t(o):n(o)})})}armChangePIN(e,t,n=255,s=ze.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,l)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:n,PinFlag:s},(u,h)=>{u&&h==0?(this.ArmPin=e,a(h)):l(h)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,a)=>{o?(this.ArmRandom=a,n(a)):s(a)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(s,o)=>{s?(this.ArmDeadline=o,t(o)):n(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,a)=>{o?(this.ArmUKey=a,n(a)):s(a)})})}armGetDongleInfo(e=0,t=ue.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((n,s)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,a)=>{if(o){switch(t){case ue.USER_ID:this.ArmUid=a;break;case ue.PRODUCT_ID:this.ArmPid=a;break;case ue.HARDWARE_ID:this.ArmHid=a;break}n(a)}else s(a)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,a)=>{o&&a==0?n(a):s(a)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_RFS({Handle:e},(s,o)=>{s&&o==0?t(o):n(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,a)=>{if(o&&a.length>0)try{a=this.Base64.decode(a),n(a)}catch(l){console.error(l),n(a)}else s(a)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(s,o)=>{s&&o==0?t(o):n(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,a)=>{o&&a==0?n(a):s(a)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,a)=>{o&&a==0?n(a):s(a)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,a)=>{o&&a==0?n(a):s(a)})})}armSwitchProtocol(e=hn.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,a)=>{o&&a==0?n(a):s(a)})})}armVerifyPIN(e,t=ze.USER,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:n,UserPin:e,UserType:t},(a,l)=>{a&&l==0?(this.ArmPin=e,s(l)):o(l)})})}armReadData(e=0,t=128,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,o)=>{this.AtlCtrl.Arm_ReadData({Handle:n,Offset:e,ReadLength:t},(a,l)=>{a?(this.ArmData=l,s(l)):o(l)})})}armWriteData(e,t=0,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,o)=>{this.AtlCtrl.Arm_WriteData({Handle:n,Offset:t,DataInput:e},(a,l)=>{a&&l==0?s(l):o(l)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(s,o)=>{s?(this.ArmData=o,t(o)):n(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,a)=>{o&&a==0?n(a):s(a)})})}}const We="0123456789abcdeffedcba9876543210",qe="4b0de988570c3a0f";let X=window.ENCRYPT&&new $e;function je(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",n=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*n)],r--;return t}function Ye(){return p(this,null,function*(){return X||(X=new $e),new Promise((r,e)=>{X.armEnum().then(t=>{r(+t)}).catch(t=>{V.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}ee.throttle(()=>p(this,null,function*(){const r=yield Ye(),e={};if(typeof r!="number"||r<=0)V.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield fn();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(V.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(V.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function mn(r=0){return p(this,null,function*(){return X?new Promise((e,t)=>{X.armGetDongleInfo(r).then(n=>{n?e(n):(V.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(n))}).catch(n=>{t(n)})}):V.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function fn(){return p(this,null,function*(){if(!X)return V.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield Ye();let e=[];for(let t=0;t<r;t++){const n=yield mn(t);e.push(n)}return e})}je(16),je(16);const Je=window.meta.app.inspect?P.SM4.constants.CBC:P.SM4.constants.ECB,{publicKey:Ar,privateKey:gr}=P.SM2.generateKeyPair();function Xe(r,e,t={}){const n=Ze(qe),s=t.mode||Je;t=s===P.SM4.constants.ECB?M({mode:s,inputEncoding:"utf8",outputEncoding:"hex"},t):M({iv:We,mode:s,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=P.SM4.encrypt(r,n,t)}catch(a){console.log("err: ",a)}return o}function Qe(r,e,t={}){const n=Ze(qe),s=t.mode||Je;return t=s===P.SM4.constants.ECB?M({mode:s,inputEncoding:"hex",outputEncoding:"utf8"},t):M({iv:We,mode:s,inputEncoding:"hex",outputEncoding:"utf8"},t),P.SM4.decrypt(r,n,t)}function Ze(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}const Ie={getLocal:r=>{try{let e=window.localStorage.getItem(r);return e=e!==null?Qe(e):e,JSON.parse(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Xe(t):t,window.localStorage.setItem(r,t)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||Ke(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const n=window.localStorage.key(e);r((void 0).getLocal(n),n)}},clearLocal:()=>{window.localStorage.clear()},removeLocal:r=>{window.localStorage.removeItem(r)},getSession:r=>{try{let e=window.sessionStorage.getItem(r);return e=e!==null?Qe(e):e,JSON.parse(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Xe(t):t,window.sessionStorage.setItem(r,t)}catch(t){console.error(t)}},eachSession:r=>{if(!r||Ke(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const n=window.sessionStorage.key(e);r((void 0).getSession(n),n)}},clearSession:()=>{window.sessionStorage.clear()},removeSession:r=>{window.sessionStorage.removeItem(r)}},pn="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='1778134039448'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1155'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M512%20512m-500.62222187%200a500.62222187%20500.62222187%200%201%200%201001.24444374%200%20500.62222187%20500.62222187%200%201%200-1001.24444374%200Z'%20fill='%231afa29'%20p-id='1156'%3e%3c/path%3e%3c/svg%3e",et="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='1778135587292'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1657'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M512%20512m-500.62222187%200a500.62222187%20500.62222187%200%201%200%201001.24444374%200%20500.62222187%20500.62222187%200%201%200-1001.24444374%200Z'%20fill='%23808080'%20p-id='1658'%3e%3c/path%3e%3c/svg%3e",_n="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='1778133589331'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='25776'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M377.083%20125.44c74.606-135.314%20195.292-135.314%20269.897%200l346.332%20629.394c74.606%20135.315%209.508%20245.395-145.189%20245.395H175.94c-154.697%200-219.428-109.715-145.188-245.395L377.083%20125.44z'%20fill='%23FF2D16'%20p-id='25777'%3e%3c/path%3e%3cpath%20d='M567.986%20328.046c0-31.086-25.234-55.955-55.954-55.955s-55.954%2025.235-55.954%2055.955v280.137c0%2031.086%2025.234%2055.954%2055.954%2055.954s55.954-25.234%2055.954-55.954V328.046z%20m-111.908%20448h111.908v111.908H456.078z'%20fill='%23FFFFFF'%20p-id='25778'%3e%3c/path%3e%3c/svg%3e",En={name:"局放测点",label:"局放测点",create:function(r,e){return p(this,null,function*(){const{transformControls:t}=e,n=document.createElement("div");n.style.position="relative",n.style.gap="20px";const s=document.createElement("img");s.style.objectFit="fill",s.style.width="1.3vw",s.style.height="1.3vw",s.src=et,s.style.cursor="pointer",s.style.pointerEvents="auto",s.style.userSelect="none",n.append(s);const o=document.createElement("div");Object.assign(o.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"}),r.valueEleId||(r.valueEleId=we()),o.innerHTML=`
|
|
8
|
+
<div style="padding-bottom: 10px; font-size: 16px; color: #ffffff; border-bottom: 1px solid rgba(255, 113, 108, 0.5);white-space: nowrap;">${r.name}</div>
|
|
9
|
+
<div style="font-size: 14px; color: #cae4ff;">幅值峰值</div>
|
|
10
|
+
<div style="display: flex; align-items: flex-end; gap: 10px; color: #FF716C;">
|
|
11
|
+
<span id="${r.valueEleId}" style="font-size: 24px;font-weight: 600;">${r.value}</span>
|
|
12
|
+
<span style="font-size: 14px;">dBm</span>
|
|
13
|
+
</div>
|
|
14
|
+
`;const a=new bt.CSS2DObject(n);a.name=r.name,a.dataId=r.id,a.userData.params=r,s.addEventListener("mouseover",()=>{o.style.display="flex"}),s.addEventListener("mouseleave",()=>{o.style.display="none"}),s.addEventListener("click",()=>{Se.emit("three-event",{type:"pd-sensor-click",data:a}),r.preview||setTimeout(()=>{t.attach(a)},100)}),n.append(o);const l=h=>{h===0?s.src=et:h===1?s.src=pn:h===2&&(s.src=_n)},u=h=>{const b=document.getElementById(r.valueEleId);b&&(b.innerText=h)};return a.changeState=l,a.changeValue=u,setTimeout(()=>{l(r.state),u(r.value)},200),a})},getStorage:function(r){return r.userData.params}};x.config(M({driver:[x.INDEXEDDB,x.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((Ct=window.meta.storage)==null?void 0:Ct.config)||{}));function An(){return{getKey:A=>p(this,null,function*(){return yield x.key(A)}),getKeys:()=>p(this,null,function*(){return yield x.keys()}),getItem:A=>p(this,null,function*(){if(A)return yield x.getItem(A)}),setItem:(A,k)=>p(this,null,function*(){if(A)return yield x.setItem(A,k)}),removeItem:A=>p(this,null,function*(){if(A)return yield x.removeItem(A)}),clearItems:()=>p(this,null,function*(){return yield x.clear()}),iterateItems:(A,k)=>p(this,null,function*(){if(A)return yield x.iterate(A,k)}),getReady:()=>p(this,null,function*(){return yield x.ready()}),getLength:()=>p(this,null,function*(){return yield x.length()}),getDriver:()=>p(this,null,function*(){return yield x.driver()}),setDriver:A=>p(this,null,function*(){if(A)return yield x.setDriver(A)}),setConfig:A=>p(this,null,function*(){if(A)return yield x.config(A)}),dropInstance:A=>p(this,null,function*(){if(A)return yield x.dropInstance(A)}),createInstance:A=>p(this,null,function*(){if(A)return yield x.createInstance(A)})}}const gn="THREED_LOG_BUFFER",wn="THREED_CURRSCENE",Sn="THREED_ACTIVE_MENU",In="THREED_PIXEL_RATIO",de="THREED_MODEL_DBNAME",Ce="THREED_MODEL_DBSTORE",Cn="THREED_SCENE_PREVIEW",ye="THREED_MODEL_LOAD_KEY",te="THREED_PREVIEW_URL_KEY",yn="THREED_ADDON_EDITOR_JSON",Rn="THREED_SCENE_STORAGE_SUFFIX",Re={step:.1},Dn=80,tt=30,xn=1e3,vn=1200,Tn=3e5,Pn="三维测试",bn="灯光",Ln=1,Mn=["环境光","平行光","点光源","聚光灯","半球光","平面光"],nt=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),On=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],rt=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),st=new Set(["CSS2DObject","CSS3DObject"]),Un=Object.assign({"/src/views/threed/models/pd-sensor.js":En}),Hn=Object.assign({}),kn={环境光:()=>new L.THREE.AmbientLight(16777215,1),平行光:()=>new L.THREE.DirectionalLight(16777215,1),点光源:()=>new L.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new L.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new L.THREE.HemisphereLight(16777215,0,1),平面光:()=>new L.THREE.RectAreaLight(16777215,1,100,100)},Fn=[{name:"荧光流动",commonUniforms:!0,vertex:"vUv-material",fragment:`
|
|
15
|
+
vec4 o = gl_FragColor.rgba;
|
|
16
|
+
vec2 u = gl_FragCoord.xy;
|
|
17
|
+
vec2 v = iResolution.xy;
|
|
18
|
+
vec2 uv = .2*(u+u-v)/v.y;
|
|
19
|
+
<UV_PLACEHOLDER>
|
|
20
|
+
u = uv;
|
|
21
|
+
vec4 z = o = vec4(1,2,3,0);
|
|
22
|
+
for (float a = .5, t = iTime, i;
|
|
23
|
+
++i < 19.;
|
|
24
|
+
o += (1. + cos(z+t))
|
|
25
|
+
/ length((1.+i*dot(v,v))
|
|
26
|
+
* sin(1.5*u/(.5-dot(u,u)) - 9.*u.yx + t))
|
|
27
|
+
)
|
|
28
|
+
v = cos(++t - 7.*u*pow(a += .03, i)) - 5.*u,
|
|
29
|
+
u += tanh(40. * dot(u *= mat2(cos(i + .02*t - vec4(0,11,33,0)))
|
|
30
|
+
,u)
|
|
31
|
+
* cos(1e2*u.yx + t)) / 2e2
|
|
32
|
+
+ .2 * a * u
|
|
33
|
+
+ cos(4./exp(dot(o,o)/1e2) + t) / 3e2;
|
|
34
|
+
|
|
35
|
+
o = 25.6 / (min(o, 13.) + 164. / o)
|
|
36
|
+
- dot(u, u) / 250.;
|
|
37
|
+
vec3 col = o.rgb;
|
|
38
|
+
`,key:"col",commonFinish:!0,render:"iTime+speed"},{name:"太阳照射",commonUniforms:!0,vertex:"vUv-material",fragment:`
|
|
39
|
+
float cheap_star(vec2 uv, float anim)
|
|
40
|
+
{
|
|
41
|
+
uv = abs(uv);
|
|
42
|
+
vec2 pos = min(uv.xy/uv.yx, anim);
|
|
43
|
+
float p = (2.0 - pos.x - pos.y);
|
|
44
|
+
return (2.0+p*(p*p-1.5)) / (uv.x+uv.y);
|
|
45
|
+
}
|
|
46
|
+
<SPLIT_PLACEHOLDER>
|
|
47
|
+
vec2 uv = ( gl_FragCoord.xy - .5*iResolution.xy ) / iResolution.y;
|
|
48
|
+
<UV_PLACEHOLDER>
|
|
49
|
+
uv *= 2.0 * ( cos(iTime * 2.0) -2.5);
|
|
50
|
+
float anim = sin(iTime * 12.0) * 0.1 + 1.0;
|
|
51
|
+
vec3 col = cheap_star(uv, anim) * vec3(0.35,0.2,0.15);
|
|
52
|
+
`,key:"col",commonFinish:!0,render:"iTime+speed"}];let ne=null,H=null;const it=r=>(r==null?void 0:r.name)||(r==null?void 0:r.label)||"",ot=(r={})=>Object.values(r).filter(e=>e&&(e.label||e.name)),Nn=ot(Un),Bn=ot(Hn),Gn=()=>({THREED_GUI_PARAMS:Re,THREED_LOG_BUFFER:gn,THREED_CURRSCENE:wn,THREED_ACTIVE_MENU:Sn,THREED_PIXEL_RATIO:In,THREED_IMPORT_SIZE:Dn,THREED_LIGHT_TYPES:Mn,THREED_EXPORT_BATCH:tt,THREED_RELOAD_DELAY:xn,THREED_MODEL_DBNAME:de,THREED_MODEL_DBSTORE:Ce,THREED_SCENE_PREVIEW:Cn,THREED_USER_DATA_KEYS:nt,THREED_MODEL_LOAD_KEY:ye,THREED_PREVIEW_URL_KEY:te,THREED_ADDON_EDITOR_JSON:yn,THREED_EXPORT_NODE_COUNT:vn,THREED_DEFAULT_SCENE_NAME:Pn,THREED_DEFAULT_ACTIVE_MENU:bn,THREED_DEFAULT_PIXEL_RATIO:Ln,THREED_EXPORT_VERTEX_COUNT:Tn,THREED_SCENE_EXCLUDE_TYPES:On,THREED_EXPORT_EXCLUDE_TYPES:rt,THREED_EXPORT_RUNTIME_TYPES:st,THREED_SCENE_STORAGE_SUFFIX:Rn});function Vn(){const{createInstance:r,dropInstance:e}=An(),t="/";let n=[];const s=i=>{let c=URL.createObjectURL(i);return n.push(c),c},o=()=>{n.forEach(i=>URL.revokeObjectURL(i)),n=[]},a=()=>p(this,null,function*(){return yield h(),{clearRequest:l,getAllRequest:A,getRequest:G,status:!0,message:"数据库打开成功",DATABASE:H}}),l=i=>p(this,null,function*(){if(!i)return{status:!1,message:"删除失败"};yield h(),yield H.removeItem(i);const c=B();return c.list=c.list.filter(d=>d.name!==i),{status:!0,message:"删除成功"}}),u=(...c)=>p(this,[...c],function*(i=de){H=null,ne=null,yield e({name:i,storeName:Ce})}),h=()=>p(this,null,function*(){return H||(ne||(ne=r({name:de,storeName:Ce}).then(i=>(H=i,i))),yield ne)}),b=i=>{if(!i)return!1;const c=String(i.message||"");return i.name==="DataError"||c.includes("in-line keys")},W=()=>p(this,null,function*(){H=null,ne=null,yield e({name:de}),yield h()}),B=()=>(window.threeEditorDB||(window.threeEditorDB={db:null,list:[]}),window.threeEditorDB),G=i=>p(this,null,function*(){if(!i)return{status:!1,message:"获取失败"};yield h();const c=yield H.getItem(i);if(c!=null&&c.blob&&!i)return{status:!0,message:"获取成功",url:s(c.blob)};if(!i)return{status:!1,message:"获取失败"};const d=yield fetch(i).then(v=>v.blob()),m={blob:d};try{yield H.setItem(i,m)}catch(v){if(!b(v))throw v;yield W(),yield H.setItem(i,m)}const S=B(),U=M({name:i},m),D=S.list.findIndex(v=>v.name===i);return D>-1?S.list.splice(D,1,U):S.list.push(U),{status:!0,message:"文件缓存成功",url:s(d)}}),A=()=>p(this,null,function*(){const i=B();yield h();const c=[];return yield H.iterate((d,m)=>{c.push(pe(M({},d||{}),{name:m}))}),i.list=c,{status:!0,message:"获取成功",data:c}}),k=()=>p(this,null,function*(){const i=yield N.getApi("/filehandle/scan",{path:Ve.threeModelPath,extension:"glb,gltf"}),{children:c}=i.res,d=[];if(c!=null&&c.length)for(const m of c)d.push({name:m.name,path:"/"+m.path});return d}),Q=()=>window.GUI_PARAMS||Re,E=()=>window.threeEditor||null,g=()=>window.editorJsons||[],T=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),y=()=>Nn,I=()=>B(),R=()=>kn||{},O=()=>window[te]||"",$=()=>Bn,F=()=>window.devicePixelRatio||1,q=()=>window[te]||"",j=()=>{const i=y(),c=$();return{modelDesigns:i,componentDesigns:c,modelList:i.map(d=>d.label),componentList:c.map(d=>d.label)}},fe=(i,c)=>{var d;return(d=i==null?void 0:i.__DESIGNS__)==null?void 0:d.find(m=>m.label===c)},Oe=(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`,ie=i=>{const c=window[ye];typeof c=="function"&&c(i)},Ue=i=>!!i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z),oe=i=>{var c,d;return!i||!i.visible||(c=i.userData)!=null&&c.excludeFromExport||i.isTransformControls||i.isHelper||i.isLight||i.isPoints||(d=i.type)!=null&&d.includes("Helper")||rt.has(i.type)||st.has(i.type)||i.isCSS2DObject||i.isCSS3DObject?!1:i.isMesh||i.isGroup||i.isObject3D||i.isLine},He=(i,c)=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)?i:c,Jn=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},yt=i=>{if(!(i!=null&&i.isObject3D))return;const c=He(i.position,{x:0,y:0,z:0});i.position.set(c.x,c.y,c.z);const d=He(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 m=He(i.up,{x:0,y:1,z:0});i.up.set(m.x,m.y,m.z);const S=Jn(i.quaternion);i.quaternion.set(S.x,S.y,S.z,S.w),i.pivot&&!Ue(i.pivot)&&delete i.pivot,i.updateMatrix(),i.updateMatrixWorld(!1)},Xn=(i,c="_blank")=>window.open(i,c),Qn=(i,c="")=>window.prompt(i,c),Zn=()=>window.location.reload(),er=()=>document.documentElement.classList.remove("dark"),tr=i=>{if(!Array.isArray(i==null?void 0:i.__DESIGNS__))return j();const c=[...y(),...$()],d=new Set(i.__DESIGNS__.map(m=>it(m)));return c.forEach(m=>{const S=it(m);!S||d.has(S)||(d.add(S),i.__DESIGNS__.unshift(m))}),j()},nr=i=>{if(!Array.isArray(i==null?void 0:i.__GLSLLIB__))return;const c=new Set(i.__GLSLLIB__.map(d=>d==null?void 0:d.name));Fn.forEach(d=>{c.has(d.name)||(c.add(d.name),i.__GLSLLIB__.push(d))})},ke=(i={})=>{const c={};return Object.entries(i||{}).forEach(([d,m])=>{if(!(nt.has(d)||typeof m=="function")){if(!m||["string","number","boolean"].includes(typeof m)){c[d]=m;return}if(Array.isArray(m)){try{c[d]=structuredClone(m)}catch(S){return}return}if(!(m.isObject3D||m.isMaterial||m.isTexture||m.nodeType))try{c[d]=structuredClone(m)}catch(S){return}}}),c},rr=(i=Re)=>{window.GUI_PARAMS=i},sr=i=>{window.threeEditor=i},ir=i=>{window.threeEditorDB=i},or=i=>{window[ye]=i},ar=(i="")=>{window[te]=i},cr=(i="")=>{window[te]=i},Rt=i=>{var d;const c=[];return(d=i==null?void 0:i.children)==null||d.forEach(m=>{oe(m)&&c.push(m)}),c},Dt=(i=[])=>{const c={rootCount:i.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return i.forEach(d=>{d.traverse(m=>{var S,U,D;if(oe(m)){c.nodeCount+=1,m.isMesh&&(c.meshCount+=1,c.vertexCount+=((D=(U=(S=m.geometry)==null?void 0:S.attributes)==null?void 0:U.position)==null?void 0:D.count)||0);return}m!==d&&(c.skippedCount+=1)})}),c},xt=()=>new Promise(i=>requestAnimationFrame(()=>setTimeout(i,0))),vt=()=>new Promise(i=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>i(),{timeout:80});return}setTimeout(i,0)}),lr=(i,c)=>p(this,null,function*(){var S;if(!oe(i))return null;const d=i.clone(!1);d.userData=ke(i.userData),Ue(i.pivot)?d.pivot=new L.THREE.Vector3(i.pivot.x,i.pivot.y,i.pivot.z):"pivot"in d&&delete d.pivot,yt(d);const m=[{source:i,clone:d}];for(;m.length;){const U=m.shift();for(const D of U.source.children){if(!oe(D)){c.skippedCount+=1;continue}const v=D.clone(!1);v.userData=ke(D.userData),Ue(D.pivot)?v.pivot=new L.THREE.Vector3(D.pivot.x,D.pivot.y,D.pivot.z):"pivot"in v&&delete v.pivot,yt(v),U.clone.add(v),m.push({source:D,clone:v}),c.processedCount+=1,c.processedCount%tt===0&&(yield(S=c.onProgress)==null?void 0:S.call(c,{processedCount:c.processedCount,totalCount:c.totalCount,skippedCount:c.skippedCount,progress:18+Math.min(c.processedCount/Math.max(c.totalCount,1)*54,54)}),yield xt())}}return d});return{baseUrl:t,getModels:k,getRequest:G,reloadPage:Zn,promptInput:Qn,waitForIdle:vt,waitForPaint:xt,clearRequest:l,getGuiParams:Q,setGuiParams:rr,getAllRequest:A,getEditorJsons:g,getThreeEditor:E,formatFileSize:Oe,setThreeEditor:sr,removeDarkClass:er,openExternalUrl:Xn,getThreedModels:y,getViewportSize:T,buildExportScene:(d,...m)=>p(this,[d,...m],function*(i,c={}){const S=Rt(i),U=Dt(S),D=new L.THREE.Scene,v={totalCount:U.nodeCount,processedCount:0,skippedCount:0,onProgress:c.onProgress};for(const ur of S){const Tt=yield lr(ur,v);Tt&&D.add(Tt),yield vt()}return D.updateMatrixWorld(!0),U.skippedCount+=v.skippedCount,{exportScene:D,exportObjects:S,stats:U}}),createModelDbApi:a,getEditorPreviewSceneUrl:q,getThreeEditorDB:I,sanitizeUserData:ke,setThreeEditorDB:ir,findThreedDesign:fe,getThreedLightMap:R,collectExportStats:Dt,getPreviewSceneUrl:O,setEditorPreviewSceneUrl:cr,setPreviewSceneUrl:ar,setModelLoadHander:or,isExportableObject:oe,deleteThreeEditorDB:u,ensureThreeEditorDB:B,getDevicePixelRatio:F,getThreedComponents:$,collectExportObjects:Rt,resetModelDbInstance:W,ensureModelDbInstance:h,getLocalDesignMenuData:j,invokeModelLoadHandler:ie,isLegacyInlineKeyError:b,ensureThreedShaderLibrary:nr,ensureThreedDesignRegistry:tr,createBlobUrl:s,revokeModelObjectUrls:o}}const{THREED_LOG_BUFFER:De,THREED_CURRSCENE:he,THREED_ACTIVE_MENU:xe,THREED_PIXEL_RATIO:ve,THREED_SCENE_PREVIEW:Te,THREED_ADDON_EDITOR_JSON:me,THREED_DEFAULT_SCENE_NAME:Kn,THREED_DEFAULT_ACTIVE_MENU:Pe,THREED_DEFAULT_PIXEL_RATIO:be,THREED_SCENE_STORAGE_SUFFIX:at}=Gn(),zn=[De,he,xe,ve,Te,me],K=(r,e)=>{const t=Ie.getLocal(r);return t==null?e:t},z=(r,e)=>{r&&Ie.setLocal(r,e)},Le=r=>{r&&Ie.removeLocal(r)},$n=(r,e)=>{var n,s;const t=(n=r==null?void 0:r.trim)==null?void 0:n.call(r);return t&&e.some(o=>o.name===t)?t:((s=e[0])==null?void 0:s.name)||Kn},Me=(r=[])=>Array.isArray(r)?r.filter(e=>typeof e=="string"&&e):[],ct=()=>{const r=[],e=K(he,{name:"",path:""}),t=Number.parseFloat(K(ve,be));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:r,previewScene:!!K(Te,!1),activeMenuTitle:K(xe,Pe)||Pe,pixelRatio:Number.isFinite(t)&&t>0?t:be,logarithmicDepthBuffer:K(De,!0)!==!1,addonEditorJson:Me(K(me,[]))}},lt=Z.defineStore("threed",{state:()=>ct(),actions:{getSceneList(){return p(this,null,function*(){var e;const r=yield N.getCommonApi("threedfloorplan",{limit:1e4,ordering:"-create_time"});(e=r==null?void 0:r.data)!=null&&e.length?(this.sceneList=r.data,this.currScene.path?this.sceneList.find(n=>n.id===this.currScene.id)||this.setCurrScene({name:"",path:""}):this.setCurrScene(this.sceneList[0])):(this.sceneList=[],this.setCurrScene({name:"",path:""}))})},setSceneList(r){this.sceneList=r},setSceneName(r){this.sceneName=$n(r,this.sceneList),z(he,this.sceneName)},createScene(r,e=""){return p(this,null,function*(){var l,u;const t=(l=r==null?void 0:r.trim)==null?void 0:l.call(r);if(!t||this.sceneList.some(h=>h.name===t))return!1;const n=Ve.threeSavePath+"/"+we()+".json",s=we();if(!(yield N.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:n,guid:s}]})).success)return!1;if(yield cn(n,e)){const h=yield N.postCommonApi("threedfloorplan",{guid:s});if((u=h==null?void 0:h.data)!=null&&u.length)return this.sceneList=[...this.sceneList,h.data[0]],h.data[0]}return!0})},deleteScene(r){return p(this,null,function*(){var n;if(!r)return;if(!(yield N.postCommonApi("query/threedfloorplan/delete",{data:[r]})).success)return!1;const t=this.sceneList.findIndex(s=>s.id===r);return t===-1?!1:(this.sceneList.splice(t,1),((n=this.currScene)==null?void 0:n.id)===r&&this.setCurrScene(this.sceneList[0]||{name:"",path:""}),!0)})},setCurrScene(r){return p(this,null,function*(){this.currScene=r,z(he,this.currScene)})},setPreviewMode(r){this.previewScene=!!r,z(Te,this.previewScene)},setActiveMenuTitle(r){this.activeMenuTitle=r||Pe,z(xe,this.activeMenuTitle)},setPixelRatio(r){const e=Number.parseFloat(r);this.pixelRatio=Number.isFinite(e)&&e>0?e:be,z(ve,this.pixelRatio)},setLogarithmicDepthBuffer(r){this.logarithmicDepthBuffer=!!r,z(De,this.logarithmicDepthBuffer)},getSceneStorageKey(r){return`${r||this.sceneName}${at}`},getSceneStorageParams(r,e=null){return K(this.getSceneStorageKey(r),e)},setSceneStorageParams(r,e){r&&z(this.getSceneStorageKey(r),e)},removeSceneStorageParams(r){r&&Le(this.getSceneStorageKey(r))},resetTaskState(){return p(this,null,function*(){yield new Promise(r=>setTimeout(r,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=Me(K(me,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(r){this.addonEditorJson=Me(r),z(me,this.addonEditorJson)},clearThreedStorage(){zn.forEach(e=>Le(e)),Object.keys(window.localStorage).filter(e=>e.endsWith(at)).forEach(e=>Le(e));const r=ct();this.currScene=r.currScene,this.sceneList=r.sceneList,this.previewScene=r.previewScene,this.activeMenuTitle=r.activeMenuTitle,this.pixelRatio=r.pixelRatio,this.logarithmicDepthBuffer=r.logarithmicDepthBuffer,this.addonEditorJson=r.addonEditorJson}}}),re=r=>{const{onClose:e,customClass:t}=r;return V.ElMessage(pe(M({},r),{center:!0,customClass:`sy-message ${t||""}`,onClose:s=>{e&&e(s)}}))};["success","warning","info","error"].forEach(r=>{re[r]=e=>re(typeof e=="string"?{type:r,message:e}:pe(M({},e),{type:r}))});const Wn={scene:{backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},perspectiveCamera:{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}},webglRenderer:{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}]},orbitControls:{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}},transformControls:{mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},effectComposer:{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}},handler:{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}}},lightCores:[],innerCores:[],modelCores:[],drawCores:[],textCores:[],particleCores:[],geoCores:{},designCores:[],other:{viewAngleList:[],clipping:{size:20,clipList:[]}}},ut=(r,e)=>{const t=r.__vccOpts||r;for(const[n,s]of e)t[n]=s;return t},qn=ut(Object.assign({name:"ThreedEditor"},{__name:"editor",props:{data:{type:Object,default:()=>({})},preview:{type:Boolean,default:!1}},emits:["emit-three-editor","graph-event"],setup(r,{expose:e,emit:t}){const n=r,s=lt(),{currScene:o}=Z.storeToRefs(s),a=t,l=window.__SY_THREED_DRACO_PATH__||"/draco/";L.ThreeEditor.dracoPath=l.endsWith("/")?l:l+"/";let u=null,h=null;const b=f.ref(null),{setGuiParams:W,getDevicePixelRatio:B,getThreeEditorDB:G,createBlobUrl:A,revokeModelObjectUrls:k,ensureThreedDesignRegistry:Q}=Vn();Q(L.ThreeEditor),W({step:.1});const E=()=>{var R;return(R=u==null?void 0:u.renderSceneResize)==null?void 0:R.call(u)},g=()=>p(this,null,function*(){var O,$;let R=Wn;try{if(n.data&&Object.keys(n.data).length)R=n.data;else if((O=o.value)!=null&&O.path){const F=yield N.getApi(($=o.value)==null?void 0:$.path).catch(()=>({}));console.log("初始化三维场景:",F),F.res&&(R=F.res)}u?u.resetEditorStorage(R):u=new L.ThreeEditor(b.value,{fps:null,pixelRatio:B()*s.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0,logarithmicDepthBuffer:s.logarithmicDepthBuffer},sceneParams:T(R)})}catch(F){console.error("三维图纸初始化失败",F),u==null||u.resetEditorStorage(R)}finally{n.preview&&u&&setTimeout(()=>{u.handler.mode="none",u.handler.helpers.axes.showAxes=!1,u.handler.helpers.box3.useBox3=!1,u.handler.helpers.grid.showGrid=!1},200),y()}a("emit-three-editor",u),window.addEventListener("resize",E)}),T=R=>{k(),R.designCores.forEach(q=>{q.preview=n.preview});const O=G(),$=O.list||[],F=structuredClone(R||{});return F.modelCores=(F.modelCores||[]).filter(q=>{const j=q.modelInfo.originPath;if(j){const fe=$.find(ie=>ie.name===j);if(!fe){const ie=O.db.getRequest(j);q.modelInfo.url=ie.url;return}const Oe=A(fe.blob);q.modelInfo.url=Oe}return!0}),F},y=()=>{u!=null&&u.renderer&&(h=new L.THREE.PMREMGenerator(u.renderer),h.compileEquirectangularShader(),u.scene.environment=h.fromScene(new Lt.RoomEnvironment).texture)},I=()=>u;return f.watch(()=>o.value.path,()=>p(this,null,function*(){g()})),f.watch(()=>n.data,()=>{g()},{deep:!0}),f.onMounted(()=>{g()}),f.onUnmounted(()=>{window.removeEventListener("resize",E),k(),u==null||u.destroySceneRender(),s.setCurrScene({name:"",path:""})}),e({getEditorInstance:I}),(R,O)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"editorRef",ref:b,class:"threed-editor",onDragover:O[0]||(O[0]=f.withModifiers(()=>{},["prevent"])),onDrop:O[1]||(O[1]=f.withModifiers(()=>{},["prevent"]))},null,544))}}),[["__scopeId","data-v-cebfdbf8"]]),jn={class:"threed-preview"},se=ut({__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(r,{expose:e,emit:t}){const n=r,s=t;let o=f.shallowRef({});const a=f.ref(),l=lt(),u={};let h=null;const b=E=>{var T,y,I;if(!E)return;if((T=E==null?void 0:E.includes)!=null&&T.call(E,"token 必传"))return re({message:E,type:"warning"});const g=typeof E=="string"?JSON.parse(E):E;if((g==null?void 0:g.data)==="服务错误"||(I=(y=g==null?void 0:g.data)==null?void 0:y.includes)!=null&&I.call(y,"token is expired"))return re({message:g.data,type:"warning"});switch(g.action){case Be.ACPOINT.YCVALUE:case Be.ACPOINT.YXVALUE:console.warn("遥测信息");break}},W=()=>{try{h=new an({socketUrl:n.socketUrl,token:n.token,onMessage:b})}catch(E){console.warn("三维场景消息处理失败",E)}},B=E=>p(this,null,function*(){var T;const g=yield N.postCommonApi("queryrealtimepoint",{point_id:E.join(",")});if((T=g==null?void 0:g.data)!=null&&T.length){g.data.forEach(I=>{u[I.guid]=I.value_disp||I.value});const y=Q();E.forEach(I=>{const R=y.scene.getObjectByProperty("dataId",I);R&&(R.userData.params.state=u[I],R.userData.params.value=u[I])})}}),G=E=>{console.log("🚀 ~ handleGraphEvent:",E),s("graph-event",E)},A=E=>{var y;if(!E)return;console.log("🚀 ~ handleEditorReady:",E),n.socketUrl&&W();const g=E.saveSceneEdit();let T=[];(y=g==null?void 0:g.designCores)==null||y.forEach(I=>{I.designType==="局放测点"&&I.id&&T.push(I.id)}),T!=null&&T.length&&B(T),s("loaded",E)},k=()=>p(this,null,function*(){if(o.value&&Object.keys(o.value).length)return;const E=on(),g=n.url||E.url;if(g){const I=yield N.getApi(g).catch(()=>({}));I.res&&(o.value=I.res);return}if(!(n.id||E.id)){console.warn("三维场景渲染失败,场景id为空!");return}const y=yield N.getCommonApi("threedfloorplan",{guid:n.id});y.data.length?l.setCurrScene(y.data[0]):console.warn("三维场景渲染失败,场景id为:"+n.id+"不存在!")}),Q=()=>a.value?a.value.getEditorInstance():null;return f.watch(()=>n.data,E=>{o.value=E,k()},{deep:!0,immediate:!0}),f.watch(()=>n.id,()=>{k()},{deep:!0,immediate:!0}),f.onMounted(()=>{Se.on("three-event",G)}),f.onUnmounted(()=>{h&&h.destroy(),Se.off("three-event",G)}),e({getEditorInstance:Q}),(E,g)=>(f.openBlock(),f.createElementBlock("div",jn,[f.createVNode(qn,{ref_key:"threedEditorRef",ref:a,data:f.unref(o),preview:"",onGraphEvent:G,onEmitThreeEditor:A},null,8,["data"])]))}},[["__scopeId","data-v-46ac6fc4"]]);se.name||(se.name="SyThree");const Yn={install:r=>{r.component(se.name||"SyThree",se)}};_.SyThree=se,_.default=Yn,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@syhr/sy-three",
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
|
+
"author": "syhr <aiops.sieyuan@gmail.com>",
|
|
5
|
+
"description": "Planar graphic config tool based on @meta2d.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist-three/sy-three.cjs",
|
|
9
|
+
"module": "./dist-three/sy-three.mjs",
|
|
10
|
+
"unpkg": "./dist-three/sy-three.umd.js",
|
|
11
|
+
"types": "./dist-three/sy-three.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist-three/sy-three.d.ts",
|
|
16
|
+
"import": "./dist-three/sy-three.mjs",
|
|
17
|
+
"require": "./dist-three/sy-three.umd.js",
|
|
18
|
+
"browser": "./dist-three/sy-three.umd.js"
|
|
19
|
+
},
|
|
20
|
+
"./style.css": {
|
|
21
|
+
"import": "./dist-three/sy-three.css",
|
|
22
|
+
"require": "./dist-three/sy-three.css"
|
|
23
|
+
},
|
|
24
|
+
"./sy-three.cjs": {
|
|
25
|
+
"types": "./dist-three/sy-three.d.ts",
|
|
26
|
+
"require": "./dist-three/sy-three.cjs"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/syhr/sy-three",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/syhr/sy-three.git"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"dev": "vite",
|
|
36
|
+
"dev:qiankun": "vite --mode qiankun",
|
|
37
|
+
"dev:microapp": "vite --mode microapp",
|
|
38
|
+
"build": "vite build",
|
|
39
|
+
"build:lib": "vite build --config vite.config.three.js",
|
|
40
|
+
"build:qiankun": "vite build --mode qiankun",
|
|
41
|
+
"build:microapp": "vite build --mode microapp",
|
|
42
|
+
"preview": "vite preview",
|
|
43
|
+
"preview:lib": "vite preview --config vite.config.three.js",
|
|
44
|
+
"lint": "eslint --ext .vue,.js,.jsx,.cjs,.mjs --fix src",
|
|
45
|
+
"release:first": "standard-version -f && pnpm changelog:replace",
|
|
46
|
+
"release:major": "standard-version -r major && pnpm changelog:replace",
|
|
47
|
+
"release:minor": "standard-version -r minor && pnpm changelog:replace",
|
|
48
|
+
"release:patch": "standard-version -r patch && pnpm changelog:replace",
|
|
49
|
+
"changelog:update": "conventional-changelog -p angular -i CHANGELOG.md -s && pnpm changelog:replace",
|
|
50
|
+
"changelog:rebuild": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && pnpm changelog:replace",
|
|
51
|
+
"changelog:replace": "replace 'https://10.17.196.142:10022/hmi-dev/cbb/cockpit-editor/commit/' '' CHANGELOG.md"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@element-plus/icons-vue": "~2.3.2",
|
|
55
|
+
"@ffmpeg/ffmpeg": "~0.12.15",
|
|
56
|
+
"@ffmpeg/util": "~0.12.2",
|
|
57
|
+
"@meta2d/activity-diagram": "~1.0.1",
|
|
58
|
+
"@meta2d/chart-diagram": "~1.0.22",
|
|
59
|
+
"@meta2d/class-diagram": "~1.0.2",
|
|
60
|
+
"@meta2d/core": "~1.1.20",
|
|
61
|
+
"@meta2d/flow-diagram": "~1.0.2",
|
|
62
|
+
"@meta2d/form-diagram": "~1.0.29",
|
|
63
|
+
"@meta2d/fta-diagram": "~1.0.1",
|
|
64
|
+
"@meta2d/le5le-charts": "~1.0.6",
|
|
65
|
+
"@meta2d/plugin-mind-collapse": "~1.0.1",
|
|
66
|
+
"@meta2d/plugin-mind-core": "~1.0.4",
|
|
67
|
+
"@meta2d/sequence-diagram": "~1.0.1",
|
|
68
|
+
"@meta2d/svg": "~1.0.7",
|
|
69
|
+
"@meta2d/utils": "1.0.3",
|
|
70
|
+
"@micro-zoe/micro-app": "1.0.0-rc.30",
|
|
71
|
+
"axios": "~1.16.0",
|
|
72
|
+
"comlink": "~4.4.2",
|
|
73
|
+
"crypto-js": "~4.2.0",
|
|
74
|
+
"dayjs": "~1.11.20",
|
|
75
|
+
"dxf": "~5.3.1",
|
|
76
|
+
"dxf-parser": "~1.1.2",
|
|
77
|
+
"element-plus": "~2.12.0",
|
|
78
|
+
"fabric": "~4.6.0",
|
|
79
|
+
"file-saver": "~2.0.5",
|
|
80
|
+
"flv.js": "~1.6.2",
|
|
81
|
+
"gm-crypto": "~0.1.12",
|
|
82
|
+
"jszip": "~3.10.1",
|
|
83
|
+
"localforage": "~1.10.0",
|
|
84
|
+
"lodash-es": "~4.18.1",
|
|
85
|
+
"mitt": "~3.0.1",
|
|
86
|
+
"monaco-editor": "~0.55.1",
|
|
87
|
+
"nprogress": "~0.2.0",
|
|
88
|
+
"pinia": "~3.0.4",
|
|
89
|
+
"qs": "~6.15.1",
|
|
90
|
+
"sm-crypto": "~0.4.0",
|
|
91
|
+
"three": "~0.180.0",
|
|
92
|
+
"three-edit-cores": "~0.0.16",
|
|
93
|
+
"vue": "~3.5.34",
|
|
94
|
+
"vue-draggable-plus": "~0.6.1",
|
|
95
|
+
"vue-router": "~4.6.4",
|
|
96
|
+
"vue3-colorpicker": "~2.3.0"
|
|
97
|
+
},
|
|
98
|
+
"devDependencies": {
|
|
99
|
+
"@babel/core": "~7.29.0",
|
|
100
|
+
"@babel/eslint-parser": "~7.28.6",
|
|
101
|
+
"@eslint/js": "~9.39.4",
|
|
102
|
+
"@iconify-json/ant-design": "~1.2.5",
|
|
103
|
+
"@iconify-json/ep": "~1.2.4",
|
|
104
|
+
"@iconify-json/tdesign": "~1.2.12",
|
|
105
|
+
"@iconify/utils": "~3.1.3",
|
|
106
|
+
"@oxc-parser/binding-win32-x64-msvc": "~0.130.0",
|
|
107
|
+
"@unocss/preset-rem-to-px": "~66.6.8",
|
|
108
|
+
"@vitejs/plugin-basic-ssl": "~2.3.0",
|
|
109
|
+
"@vitejs/plugin-vue": "~5.2.4",
|
|
110
|
+
"@vitejs/plugin-vue-jsx": "~4.2.0",
|
|
111
|
+
"@vue/eslint-config-prettier": "~10.2.0",
|
|
112
|
+
"autoprefixer": "~10.5.0",
|
|
113
|
+
"conventional-changelog-cli": "~5.0.0",
|
|
114
|
+
"dotenv": "~16.5.0",
|
|
115
|
+
"eslint": "~9.39.4",
|
|
116
|
+
"eslint-config-prettier": "~10.1.8",
|
|
117
|
+
"eslint-plugin-prettier": "~5.5.5",
|
|
118
|
+
"eslint-plugin-vue": "~10.8.0",
|
|
119
|
+
"glob": "~13.0.6",
|
|
120
|
+
"globals": "~17.6.0",
|
|
121
|
+
"picocolors": "~1.1.1",
|
|
122
|
+
"postcss": "~8.5.14",
|
|
123
|
+
"postcss-px-to-viewport-8-plugin": "~1.2.5",
|
|
124
|
+
"replace": "~1.2.2",
|
|
125
|
+
"sass": "~1.79.6",
|
|
126
|
+
"standard-version": "~9.5.0",
|
|
127
|
+
"terser": "~5.47.1",
|
|
128
|
+
"unocss": "~66.6.8",
|
|
129
|
+
"unplugin-auto-import": "~19.3.0",
|
|
130
|
+
"unplugin-element-plus": "~0.11.2",
|
|
131
|
+
"unplugin-vue-components": "~28.8.0",
|
|
132
|
+
"unplugin-vue-macros": "~2.14.5",
|
|
133
|
+
"vite": "~5.4.21",
|
|
134
|
+
"vite-plugin-css-injected-by-js": "~3.5.2",
|
|
135
|
+
"vite-plugin-eslint": "~1.8.1",
|
|
136
|
+
"vite-plugin-lib-inject-css": "~2.2.2",
|
|
137
|
+
"vite-plugin-qiankun": "~1.0.15"
|
|
138
|
+
},
|
|
139
|
+
"peerDependencies": {
|
|
140
|
+
"element-plus": "~2.12.0",
|
|
141
|
+
"vue": "~3.5.34"
|
|
142
|
+
},
|
|
143
|
+
"files": ["dist-three", "package.json", "CHANGELOG.md", "README.md"],
|
|
144
|
+
"keywords": ["vue3", "meta2d", "graph", "canvas", "editor", "diagram", "sy-three"],
|
|
145
|
+
"browserslist": ["> 1%", "last 2 versions", "not dead"],
|
|
146
|
+
"publishConfig": {
|
|
147
|
+
"access": "public",
|
|
148
|
+
"registry": "https://registry.npmjs.org/",
|
|
149
|
+
"registry_nexus": "http://10.17.196.142:8081/#browse/browse:sieyuan_npm_hosted"
|
|
150
|
+
},
|
|
151
|
+
"standard-version": {
|
|
152
|
+
"skip": {
|
|
153
|
+
"tag": true
|
|
154
|
+
},
|
|
155
|
+
"scripts": {
|
|
156
|
+
"postchangelog": "replace 'https://github.com/syhr/sy-three/commit/' '' CHANGELOG.md"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
package/readme.text
ADDED