ss-component-new 1.1.652 → 1.1.653
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/{OrbitControls-DQKCQqAM.js → OrbitControls-mRDk-CFe.js} +1 -1
- package/dist/{OrbitControls-RNnt_mcM.cjs → OrbitControls-vGwW_cWN.cjs} +1 -1
- package/dist/{index-CGPCGRRh.js → index-B2qyUYLc.js} +2 -2
- package/dist/{index-CoVdQV0i.js → index-B3Lx1yip.js} +1 -1
- package/dist/{index-DhtFD1-B.cjs → index-BAXOETod.cjs} +1 -1
- package/dist/{index-4u-23Xo4.js → index-BG9H9Qni.js} +3718 -3712
- package/dist/{index-BtpXvIA6.js → index-BHr-BW96.js} +2 -2
- package/dist/{index-CzetAh_D.js → index-BLV5l4R8.js} +5733 -5577
- package/dist/{index-B5_rLo35.cjs → index-BROrPZko.cjs} +1 -1
- package/dist/index-BaOr2wAK.cjs +1 -0
- package/dist/{index-DqWKrP7p.cjs → index-BdsE5z3_.cjs} +1 -1
- package/dist/{index-wGULs5QZ.cjs → index-Beb9S5gs.cjs} +183 -183
- package/dist/{index-d9EmloJa.cjs → index-Bf4kCF97.cjs} +13 -13
- package/dist/{index-CYAUSnqq.js → index-BgeUym2U.js} +5 -5
- package/dist/{index-AQlYfiDo.cjs → index-BrECcQU1.cjs} +1 -1
- package/dist/{index-Cz_HbE8e.js → index-BzKAW_PT.js} +2 -2
- package/dist/{index-D5kNDyke.cjs → index-C4aTLnJh.cjs} +1 -1
- package/dist/{index-BblcmVmO.js → index-CQjHLPoz.js} +1 -1
- package/dist/{index-he-22_jo.cjs → index-CSuLNsDU.cjs} +1 -1
- package/dist/{index-DA3sQfEs.js → index-CX2l1K2K.js} +1 -1
- package/dist/{index-dWBhk9Dk.js → index-Cc20qlYT.js} +91 -91
- package/dist/{index-CjMBj5BR.js → index-CchZ9k7R.js} +2 -2
- package/dist/{index-DJVi8ojh.cjs → index-CgN1-UR1.cjs} +1 -1
- package/dist/{index-D7XVufPP.js → index-CjTg7w1G.js} +1 -1
- package/dist/{index-DzjLEJ2G.cjs → index-Cmx0b-H9.cjs} +1 -1
- package/dist/index-CxKdAqmo.cjs +1 -0
- package/dist/{index-Ce2J4d7D.js → index-DHekAkut.js} +1 -1
- package/dist/{index-C3rKctcY.js → index-DQISIign.js} +1 -1
- package/dist/{index-ZjWIhy36.cjs → index-Dsz9CbWY.cjs} +1 -1
- package/dist/{index-D7YhWesS.js → index-DuSYVCRx.js} +3 -3
- package/dist/{index-C0beLcSH.cjs → index-K6fDxSbJ.cjs} +1 -1
- package/dist/{index-DkYoWwCG.cjs → index-SEnxhXOq.cjs} +1 -1
- package/dist/{index-DQKyxjSf.cjs → index-Uvy0X3kn.cjs} +1 -1
- package/dist/{index-C42OOZRy.js → index-hPBRipv2.js} +2 -2
- package/dist/{index-kmklo8FV.js → index-vS9J-CWm.js} +2309 -2327
- package/dist/{index-DDzG6c2B.cjs → index-zCk6kmbR.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-DrQm9pS8.cjs → index.vue_vue_type_script_setup_true_lang-CH5vPYjU.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-D32wqX6B.js → index.vue_vue_type_script_setup_true_lang-CI7GcLW5.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D3x-AlQS.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bj0rjhcm.cjs} +35 -35
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-uJF9vYMQ.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DY2sTvK_.js} +973 -978
- package/dist/{index.vue_vue_type_style_index_0_scoped_264dc673_lang-9D6uXhMg.cjs → index.vue_vue_type_style_index_0_scoped_264dc673_lang-CdgVMbYx.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_264dc673_lang-DsD_HsX5.js → index.vue_vue_type_style_index_0_scoped_264dc673_lang-G0ymECie.js} +7 -7
- package/dist/{index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-kQnSo8kS.js → index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-BzcsnNuf.js} +4 -4
- package/dist/{index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-MGyd1nJE.cjs → index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-DSIiVdpD.cjs} +1 -1
- package/dist/{main-Br1m2nJe.cjs → main-Au0Y3Inu.cjs} +1 -1
- package/dist/{main-COl_jsOs.js → main-Yz6RMc79.js} +2 -2
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +7 -7
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-CLfnrscV.cjs → threeModel-CYQ0W7om.cjs} +1 -1
- package/dist/{threeModel-y4tbC87W.js → threeModel-Dw65EtfY.js} +31 -31
- package/package.json +1 -1
- package/dist/index-DpYdEBga.cjs +0 -1
- package/dist/index-G2O6ETUf.cjs +0 -1
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
package/dist/ss-component.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { defineAsyncComponent as s } from "vue";
|
|
2
2
|
import { S as b } from "./index-BHtNKL1L.js";
|
|
3
|
-
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
3
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DY2sTvK_.js";
|
|
4
4
|
import "./menu-Bj0eSg6d.js";
|
|
5
5
|
import l from "./ss-component2.js";
|
|
6
|
-
const n = s(() => import("./main-
|
|
6
|
+
const n = s(() => import("./main-Yz6RMc79.js"));
|
|
7
7
|
n.install = (o) => {
|
|
8
8
|
o.component("ssComponent", n);
|
|
9
9
|
};
|
|
10
|
-
const t = s(() => import("./index-
|
|
10
|
+
const t = s(() => import("./index-BG9H9Qni.js").then((o) => o.m));
|
|
11
11
|
t.install = (o) => {
|
|
12
12
|
o.component("ssTab", t);
|
|
13
13
|
};
|
|
14
|
-
const e = s(() => import("./index-
|
|
14
|
+
const e = s(() => import("./index-DHekAkut.js"));
|
|
15
15
|
e.install = (o) => {
|
|
16
16
|
o.component("ssMenu", e);
|
|
17
17
|
};
|
|
18
|
-
const m = s(() => import("./index-
|
|
18
|
+
const m = s(() => import("./index-BgeUym2U.js"));
|
|
19
19
|
m.install = (o) => {
|
|
20
20
|
o.component("ssMenuComponent", m);
|
|
21
21
|
};
|
|
@@ -27,11 +27,11 @@ const p = s(() => import("./index-CZtXRS3l.js"));
|
|
|
27
27
|
p.install = (o) => {
|
|
28
28
|
o.component("ssFold", p);
|
|
29
29
|
};
|
|
30
|
-
const i = s(() => import("./index-
|
|
30
|
+
const i = s(() => import("./index-CjTg7w1G.js"));
|
|
31
31
|
i.install = (o) => {
|
|
32
32
|
o.component("ssAvatar", i);
|
|
33
33
|
};
|
|
34
|
-
const c = s(() => import("./threeModel-
|
|
34
|
+
const c = s(() => import("./threeModel-Dw65EtfY.js"));
|
|
35
35
|
c.install = (o) => {
|
|
36
36
|
o.component("ssThree", c);
|
|
37
37
|
};
|
package/dist/ss-component2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("vue-router"),t=[{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-BypkILb5.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-
|
|
1
|
+
"use strict";const o=require("vue-router"),t=[{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-BypkILb5.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-CxKdAqmo.cjs")),children:[{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-Cmx0b-H9.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-Uvy0X3kn.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-BAXOETod.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-CSuLNsDU.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-SEnxhXOq.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-CgN1-UR1.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-BROrPZko.cjs"))},{path:"priority",name:"Priority",component:async()=>Promise.resolve().then(()=>require("./index-D0QjuJev.cjs"))}]}],n=o.createRouter({history:o.createWebHashHistory(),routes:t});n.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=n;
|
package/dist/ss-component2.js
CHANGED
|
@@ -8,7 +8,7 @@ const a = [
|
|
|
8
8
|
{
|
|
9
9
|
path: "/",
|
|
10
10
|
name: "Model",
|
|
11
|
-
component: async () => import("./index-
|
|
11
|
+
component: async () => import("./index-Cc20qlYT.js"),
|
|
12
12
|
// component: async ()=>import('@/components/views/model/component/main.vue'),
|
|
13
13
|
// component: async ()=>import('@/components/views/canvas/index.vue'),
|
|
14
14
|
// component: async ()=>import('@/components/views/test/index.vue'),
|
|
@@ -16,37 +16,37 @@ const a = [
|
|
|
16
16
|
{
|
|
17
17
|
path: "平台管理/菜单管理",
|
|
18
18
|
name: "Menu",
|
|
19
|
-
component: async () => import("./index-
|
|
19
|
+
component: async () => import("./index-DuSYVCRx.js")
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
path: "平台管理/主菜单管理",
|
|
23
23
|
name: "MainMenu",
|
|
24
|
-
component: async () => import("./index-
|
|
24
|
+
component: async () => import("./index-CX2l1K2K.js")
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
path: "系统管理/个人中心",
|
|
28
28
|
name: "PersonalCenter",
|
|
29
|
-
component: async () => import("./index-
|
|
29
|
+
component: async () => import("./index-B2qyUYLc.js")
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
path: "系统管理/职位管理",
|
|
33
33
|
name: "Post",
|
|
34
|
-
component: async () => import("./index-
|
|
34
|
+
component: async () => import("./index-CchZ9k7R.js")
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
path: "系统管理/用户管理",
|
|
38
38
|
name: "User",
|
|
39
|
-
component: async () => import("./index-
|
|
39
|
+
component: async () => import("./index-DQISIign.js")
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
path: "系统管理/角色管理",
|
|
43
43
|
name: "Role",
|
|
44
|
-
component: async () => import("./index-
|
|
44
|
+
component: async () => import("./index-B3Lx1yip.js")
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
path: "系统管理/部门管理",
|
|
48
48
|
name: "Dept",
|
|
49
|
-
component: async () => import("./index-
|
|
49
|
+
component: async () => import("./index-BzKAW_PT.js")
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
path: "priority",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-wGULs5QZ.cjs"),pe=require("./OrbitControls-RNnt_mcM.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./menu-ScIJ5kqr.cjs");function me(z){let h=null,u=null,d=null,g=null,x=null,P=null,c=null,C=null;const D=1e3/30;let S=0;const E=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;h=new n.Scene,h.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),g=new pe.OrbitControls(u,d.domElement),g.enableDamping=!0,g.dampingFactor=.05,g.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},g.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(g),f(),b()},t=(m,l)=>{c&&(h.remove(c),c.dispose()),C&&(h.remove(C),C.geometry.dispose(),C.material.dispose());const _=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,_,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),h.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});C=new n.Mesh(B,O),C.position.copy(l),C.position.z-=.01,C.receiveShadow=!0,h.add(C)},p=()=>{if(E.value.length===0)return;const m=new n.Box3;let l=!1;if(E.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const _=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(_.x,_.y,_.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);h.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,h.add(l);const _=new n.DirectionalLight(16777215,.8);_.position.set(-8,-8,6),h.add(_);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),h.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);h.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),h.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),h.add(q)},b=()=>{P=requestAnimationFrame(b),g&&g.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&h&&u&&d.render(h,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(_=>{m[_]&&m[_].dispose&&m[_].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(_=>{I(_)}):I(l.material))})};return{currentModels:E,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,_=m.clientHeight;u.aspect=l/_,u.updateProjectionMatrix(),d.setSize(l,_),x.update()},fitCameraToAllModels:m=>{if(!u||!g||E.value.length===0)return;const l=new n.Box3;let _=!1;if(E.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),_=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),_=!0}else l.expandByObject(Z),_=!0}),!_){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),g.target.copy(O),g.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:h,camera:u,renderer:d,controls:g,gizmo:x}),clearAllModels:()=>{if(!h)return;E.value.forEach(l=>{h.remove(l),A(l)});const m=[];h.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==C&&m.push(l)}),m.forEach(l=>{h.remove(l),A(l)}),E.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),C&&(C.geometry.dispose(),C.material.dispose()),d&&d.dispose(),g&&g.dispose(),x&&x.dispose()},updateGridForModels:p}}function fe(z,h){const u=e.ref(!1);let d=null,g=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,C=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=C*1.2,b=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(b,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},E=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,b=Math.min(f/g,1);if(b>=1){k();return}const I=S(b);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(E)},r=()=>{if(h.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const f=new n.Box3;h.value.forEach(G=>{f.expandByObject(G)});const b=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),C=Math.max(b.x,b.y,b.z)*1.2;const I=new n.Vector3(c.x+C*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const G=Date.now()-$,Y=Math.min(G/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,E())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(P))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const f=t.position.clone(),b=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(f,x,G),p.target.lerpVectors(b,P,G),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function ve(z,h){const u=e.ref(!1),d=e.ref("none");let g=[],x=[],P=new n.Box3,c=new n.Vector3;const C=()=>{g=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{P.makeEmpty(),h.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,f,b;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),b=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),b=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),b=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(b),A},S=()=>{if(E(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(g[0].constant=-c.x,y=g[0]):d.value==="y"?(g[1].constant=-c.y,y=g[1]):d.value==="z"&&(g[2].constant=-c.z,y=g[2]),y){h.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(b=>{b.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},E=()=>{h.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(C(),h.value.length>0&&F()):(d.value="none",E(),r())},updateClippingPlanes:S,clearClippingPlanes:E,clearClippingMeshes:r}}const he={class:"panel-content"},ge={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const h=z;e.ref();const u=e.ref();return e.watch(()=>[h==null?void 0:h.animationData],()=>{var g;let d=((g=re.cloneDeep(h==null?void 0:h.animationData))==null?void 0:g.动画输出Content)??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,g)=>{var x,P,c;return e.openBlock(),e.createElementBlock("div",he,[(e.openBlock(),e.createBlock(n.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},ye=oe._export_sfc(ge,[["__scopeId","data-v-1e90a659"]]),we={class:"panel-content"},xe={key:0,class:"joints-list"},Ve={class:"joint-info-row"},Me={class:"joint-left"},ke={class:"joint-name"},Pe={class:"joint-range"},be={class:"joint-type"},Ce={key:0,class:"joint-control-row"},Ee={class:"slider-container"},_e=["min","max","value","onInput","disabled"],ze={class:"value-display"},De={class:"joint-value"},Ne={class:"unit"},Se={key:1,class:"empty-state"},ae=.001,Be=1e3,ue=60,Ae={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:h}){const u=z;e.ref(!0);const d=e.ref([]),g=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),C=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),E=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Be/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i.动画输出)??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const b=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!g.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return g.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(re.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??b(s._jointType,!1),upper:s.limit.upper??b(s._jointType,!0)}:{lower:b(s._jointType,!1),upper:b(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const U=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(U),w.localZ.applyMatrix4(U)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const U=y(s),T=a*ae,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=U*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},G=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,C.value-s),w=[];w.push(new n.Vector3(0,0,0));const U=new n.Vector3(0,a*ae,0);a>0&&w.push(U);let T={pos:U.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),de=new n.Matrix4;return de.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(de),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),P.value*ae,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),G(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},_=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,E.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=E.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ue,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,E.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};h({startAnimation:_,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),E.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),G(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(g.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},ce=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{ce(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",we,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",Ve,[e.createElementVNode("div",Me,[e.createElementVNode("span",ke,e.toDisplayString(i.name),1),e.createElementVNode("span",Pe," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",be,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("div",Ee,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:U=>L(i.name,U.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,_e)]),e.createElementVNode("div",ze,[e.createElementVNode("span",De,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Ne,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Se,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Re=oe._export_sfc(Ae,[["__scopeId","data-v-0bb82714"]]),Fe={class:"panel-content"},Te="id",Le={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:h}){const u=z,d=h,g=e.ref([]),x={children:"children",label:"label"},P=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},C=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!g.value||g.value.length===0?[]:u.expandStrategy==="firstLevel"?D(g.value,u.maxExpandCount):F(g.value,u.maxExpandCount)),E=e.computed(()=>u!=null&&u.model?C(u.model):[]);return e.watch(E,r=>{g.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Fe,[e.createVNode(y,{data:g.value,props:x,"default-expanded-keys":S.value,"node-key":Te,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Ie=oe._export_sfc(Le,[["__scopeId","data-v-290ff4e1"]]),$e=["xlink:href"],Je=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const h=z,u=e.computed(()=>({backgroundColor:h.backgroundColor})),d=e.computed(()=>`#${h.prefix}-${h.name}`),g=e.computed(()=>{const{size:x}=h;let P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(g.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,$e)],6))],6))}}),N=oe._export_sfc(Je,[["__scopeId","data-v-3150a90b"]]),Oe={class:"obj-viewer-container"},Ue={class:"buttonGroup-top"},Ge={class:"buttonGroup-topLeft"},je={class:"buttonGroup-left"},qe={class:"buttonGroup-right"},Xe={class:"buttonGroup-bottom"},He={class:"left-panel"},Ye={class:"panel-header"},Ze={key:1,class:"clipping-content"},We={class:"radio-group"},Ke={class:"radio-label"},Qe={class:"radio-label"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"right-panel"},at={class:"panel-header"},ot={key:0,class:"loading-overlay"},lt={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:h,emit:u}){const d=u;let g=null,x=!1;const P=e.ref(null),c=e.ref(!1),C=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),E=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:b,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=me(P),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=fe(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=ve(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=n.useModelLoader(A,y,c,C,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,U=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(U,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&_();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&_()},i=s=>{E.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),g=A().scene,x=!0,window.addEventListener("resize",b)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",b),J.value&&Y(),$()}),h({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var U,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",Ue,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",Ge,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(G),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",je,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:E.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:E.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(U=k.value)==null?void 0:U.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",He,[e.createElementVNode("div",Ye,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Ie,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("label",Ke,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Qe,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",nt,[e.createElementVNode("div",at,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>E.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Re,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(g),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(ye,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,E.value]]),c.value?(e.openBlock(),e.createElementBlock("div",ot,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)])}}},st=oe._export_sfc(lt,[["__scopeId","data-v-7bc47bb3"]]);exports.default=st;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-Beb9S5gs.cjs"),pe=require("./OrbitControls-vGwW_cWN.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./menu-ScIJ5kqr.cjs");function me(z){let h=null,u=null,d=null,g=null,x=null,P=null,c=null,C=null;const D=1e3/30;let S=0;const E=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;h=new n.Scene,h.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),g=new pe.OrbitControls(u,d.domElement),g.enableDamping=!0,g.dampingFactor=.05,g.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},g.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(g),f(),b()},t=(m,l)=>{c&&(h.remove(c),c.dispose()),C&&(h.remove(C),C.geometry.dispose(),C.material.dispose());const _=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,_,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),h.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});C=new n.Mesh(B,O),C.position.copy(l),C.position.z-=.01,C.receiveShadow=!0,h.add(C)},p=()=>{if(E.value.length===0)return;const m=new n.Box3;let l=!1;if(E.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const _=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(_.x,_.y,_.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);h.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,h.add(l);const _=new n.DirectionalLight(16777215,.8);_.position.set(-8,-8,6),h.add(_);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),h.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);h.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),h.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),h.add(q)},b=()=>{P=requestAnimationFrame(b),g&&g.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&h&&u&&d.render(h,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(_=>{m[_]&&m[_].dispose&&m[_].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(_=>{I(_)}):I(l.material))})};return{currentModels:E,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,_=m.clientHeight;u.aspect=l/_,u.updateProjectionMatrix(),d.setSize(l,_),x.update()},fitCameraToAllModels:m=>{if(!u||!g||E.value.length===0)return;const l=new n.Box3;let _=!1;if(E.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),_=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),_=!0}else l.expandByObject(Z),_=!0}),!_){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),g.target.copy(O),g.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:h,camera:u,renderer:d,controls:g,gizmo:x}),clearAllModels:()=>{if(!h)return;E.value.forEach(l=>{h.remove(l),A(l)});const m=[];h.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==C&&m.push(l)}),m.forEach(l=>{h.remove(l),A(l)}),E.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),C&&(C.geometry.dispose(),C.material.dispose()),d&&d.dispose(),g&&g.dispose(),x&&x.dispose()},updateGridForModels:p}}function fe(z,h){const u=e.ref(!1);let d=null,g=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,C=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=C*1.2,b=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(b,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},E=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,b=Math.min(f/g,1);if(b>=1){k();return}const I=S(b);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(E)},r=()=>{if(h.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const f=new n.Box3;h.value.forEach(G=>{f.expandByObject(G)});const b=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),C=Math.max(b.x,b.y,b.z)*1.2;const I=new n.Vector3(c.x+C*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const G=Date.now()-$,Y=Math.min(G/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,E())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(P))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const f=t.position.clone(),b=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(f,x,G),p.target.lerpVectors(b,P,G),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function ve(z,h){const u=e.ref(!1),d=e.ref("none");let g=[],x=[],P=new n.Box3,c=new n.Vector3;const C=()=>{g=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{P.makeEmpty(),h.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,f,b;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),b=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),b=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),b=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(b),A},S=()=>{if(E(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(g[0].constant=-c.x,y=g[0]):d.value==="y"?(g[1].constant=-c.y,y=g[1]):d.value==="z"&&(g[2].constant=-c.z,y=g[2]),y){h.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(b=>{b.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},E=()=>{h.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(C(),h.value.length>0&&F()):(d.value="none",E(),r())},updateClippingPlanes:S,clearClippingPlanes:E,clearClippingMeshes:r}}const he={class:"panel-content"},ge={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const h=z;e.ref();const u=e.ref();return e.watch(()=>[h==null?void 0:h.animationData],()=>{var g;let d=((g=re.cloneDeep(h==null?void 0:h.animationData))==null?void 0:g.动画输出Content)??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,g)=>{var x,P,c;return e.openBlock(),e.createElementBlock("div",he,[(e.openBlock(),e.createBlock(n.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},ye=oe._export_sfc(ge,[["__scopeId","data-v-1e90a659"]]),we={class:"panel-content"},xe={key:0,class:"joints-list"},Ve={class:"joint-info-row"},Me={class:"joint-left"},ke={class:"joint-name"},Pe={class:"joint-range"},be={class:"joint-type"},Ce={key:0,class:"joint-control-row"},Ee={class:"slider-container"},_e=["min","max","value","onInput","disabled"],ze={class:"value-display"},De={class:"joint-value"},Ne={class:"unit"},Se={key:1,class:"empty-state"},ae=.001,Be=1e3,ue=60,Ae={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:h}){const u=z;e.ref(!0);const d=e.ref([]),g=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),C=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),E=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Be/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i.动画输出)??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const b=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!g.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return g.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(re.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??b(s._jointType,!1),upper:s.limit.upper??b(s._jointType,!0)}:{lower:b(s._jointType,!1),upper:b(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const U=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(U),w.localZ.applyMatrix4(U)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const U=y(s),T=a*ae,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=U*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},G=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,C.value-s),w=[];w.push(new n.Vector3(0,0,0));const U=new n.Vector3(0,a*ae,0);a>0&&w.push(U);let T={pos:U.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),de=new n.Matrix4;return de.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(de),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),P.value*ae,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),G(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},_=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,E.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=E.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ue,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,E.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};h({startAnimation:_,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),E.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),G(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(g.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},ce=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{ce(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",we,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",Ve,[e.createElementVNode("div",Me,[e.createElementVNode("span",ke,e.toDisplayString(i.name),1),e.createElementVNode("span",Pe," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",be,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("div",Ee,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:U=>L(i.name,U.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,_e)]),e.createElementVNode("div",ze,[e.createElementVNode("span",De,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Ne,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Se,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Re=oe._export_sfc(Ae,[["__scopeId","data-v-0bb82714"]]),Fe={class:"panel-content"},Te="id",Le={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:h}){const u=z,d=h,g=e.ref([]),x={children:"children",label:"label"},P=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},C=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!g.value||g.value.length===0?[]:u.expandStrategy==="firstLevel"?D(g.value,u.maxExpandCount):F(g.value,u.maxExpandCount)),E=e.computed(()=>u!=null&&u.model?C(u.model):[]);return e.watch(E,r=>{g.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Fe,[e.createVNode(y,{data:g.value,props:x,"default-expanded-keys":S.value,"node-key":Te,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Ie=oe._export_sfc(Le,[["__scopeId","data-v-290ff4e1"]]),$e=["xlink:href"],Je=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const h=z,u=e.computed(()=>({backgroundColor:h.backgroundColor})),d=e.computed(()=>`#${h.prefix}-${h.name}`),g=e.computed(()=>{const{size:x}=h;let P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(g.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,$e)],6))],6))}}),N=oe._export_sfc(Je,[["__scopeId","data-v-3150a90b"]]),Oe={class:"obj-viewer-container"},Ue={class:"buttonGroup-top"},Ge={class:"buttonGroup-topLeft"},je={class:"buttonGroup-left"},qe={class:"buttonGroup-right"},Xe={class:"buttonGroup-bottom"},He={class:"left-panel"},Ye={class:"panel-header"},Ze={key:1,class:"clipping-content"},We={class:"radio-group"},Ke={class:"radio-label"},Qe={class:"radio-label"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"right-panel"},at={class:"panel-header"},ot={key:0,class:"loading-overlay"},lt={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:h,emit:u}){const d=u;let g=null,x=!1;const P=e.ref(null),c=e.ref(!1),C=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),E=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:b,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=me(P),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=fe(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=ve(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=n.useModelLoader(A,y,c,C,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,U=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(U,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&_();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&_()},i=s=>{E.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),g=A().scene,x=!0,window.addEventListener("resize",b)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",b),J.value&&Y(),$()}),h({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var U,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",Ue,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",Ge,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(G),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",je,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:E.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:E.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(U=k.value)==null?void 0:U.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",He,[e.createElementVNode("div",Ye,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Ie,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("label",Ke,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Qe,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",nt,[e.createElementVNode("div",at,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>E.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Re,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(g),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(ye,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,E.value]]),c.value?(e.openBlock(),e.createElementBlock("div",ot,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)])}}},st=oe._export_sfc(lt,[["__scopeId","data-v-7bc47bb3"]]);exports.default=st;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as P, watch as be, createElementBlock as
|
|
2
|
-
import { V as M, B as Pe, S as
|
|
3
|
-
import { O as pt } from "./OrbitControls-
|
|
1
|
+
import { ref as P, watch as be, createElementBlock as Z, openBlock as H, createBlock as Le, computed as ie, onMounted as $e, onUnmounted as je, Fragment as Xe, renderList as He, createElementVNode as h, createCommentVNode as xe, toDisplayString as ae, resolveComponent as Je, createVNode as z, defineComponent as Ye, normalizeStyle as Ee, normalizeClass as Fe, nextTick as Be, onBeforeUnmount as Ze, withDirectives as se, unref as O, withCtx as Te, isRef as he, vModelRadio as ye, vShow as we } from "vue";
|
|
2
|
+
import { V as M, B as Pe, S as qe, C as We, P as Ke, W as Ne, b as Qe, A as et, c as tt, M as Re, X as nt, G as at, d as Me, e as ot, f as De, g as st, D as ke, H as lt, h as Ve, i as Oe, j as Ue, k as ze, E as _e, I as it, J as de, K as rt, N as ct, T as ut, Z as dt } from "./index-BLV5l4R8.js";
|
|
3
|
+
import { O as pt } from "./OrbitControls-mRDk-CFe.js";
|
|
4
4
|
import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
import { c as Ge, E as Ie } from "./menu-Bj0eSg6d.js";
|
|
6
6
|
function mt(E) {
|
|
@@ -9,7 +9,7 @@ function mt(E) {
|
|
|
9
9
|
let T = 0;
|
|
10
10
|
const D = P([]), l = P(new M()), C = P(new M()), g = () => {
|
|
11
11
|
if (!E.value) return;
|
|
12
|
-
f = new
|
|
12
|
+
f = new qe(), f.background = new We(15790320);
|
|
13
13
|
const d = E.value;
|
|
14
14
|
r = new Ke(75, d.clientWidth / d.clientHeight, 0.1, 1e4), r.position.set(8, -8, 6), r.up.set(0, 0, 1), r.lookAt(0, 0, 0), c = new Ne({
|
|
15
15
|
antialias: !0,
|
|
@@ -217,15 +217,15 @@ function ft(E, f) {
|
|
|
217
217
|
if (!e || !u) return;
|
|
218
218
|
w.copy(e.position), k.copy(u.target);
|
|
219
219
|
const p = new Pe();
|
|
220
|
-
f.value.forEach((
|
|
221
|
-
p.expandByObject(
|
|
220
|
+
f.value.forEach((q) => {
|
|
221
|
+
p.expandByObject(q);
|
|
222
222
|
});
|
|
223
223
|
const _ = p.getSize(new M());
|
|
224
224
|
i = p.getCenter(new M()), A = Math.max(_.x, _.y, _.z) * 1.2;
|
|
225
225
|
const U = new M(i.x + A * 1.2, i.y, i.z);
|
|
226
226
|
u.enabled = !1;
|
|
227
227
|
const V = e.position.clone(), J = 1e3, G = Date.now(), j = () => {
|
|
228
|
-
const
|
|
228
|
+
const q = Date.now() - G, ee = Math.min(q / J, 1), d = F(ee);
|
|
229
229
|
e.position.lerpVectors(V, U, d), e.lookAt(i), u.target.copy(i), ee < 1 ? requestAnimationFrame(j) : (r.value = !0, c = null, D());
|
|
230
230
|
};
|
|
231
231
|
j();
|
|
@@ -243,8 +243,8 @@ function ft(E, f) {
|
|
|
243
243
|
if (!e || !u) return;
|
|
244
244
|
u.enabled = !0;
|
|
245
245
|
const p = e.position.clone(), _ = u.target.clone(), U = 1500, V = Date.now(), J = () => {
|
|
246
|
-
const G = Date.now() - V, j = Math.min(G / U, 1),
|
|
247
|
-
e.position.lerpVectors(p, w,
|
|
246
|
+
const G = Date.now() - V, j = Math.min(G / U, 1), q = F(j);
|
|
247
|
+
e.position.lerpVectors(p, w, q), u.target.lerpVectors(_, k, q), j < 1 && requestAnimationFrame(J);
|
|
248
248
|
};
|
|
249
249
|
J();
|
|
250
250
|
} else
|
|
@@ -346,7 +346,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
346
346
|
{ deep: !0, immediate: !0 }
|
|
347
347
|
), (c, v) => {
|
|
348
348
|
var w, k, i;
|
|
349
|
-
return H(),
|
|
349
|
+
return H(), Z("div", gt, [
|
|
350
350
|
(H(), Le(it, {
|
|
351
351
|
itemData: (w = r.value) == null ? void 0 : w.compData,
|
|
352
352
|
key: (k = r.value) == null ? void 0 : k.id,
|
|
@@ -464,7 +464,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
return m;
|
|
467
|
-
},
|
|
467
|
+
}, q = (n, m = 0) => {
|
|
468
468
|
let s = p.slice(0, n + 1);
|
|
469
469
|
const x = p[n + 1];
|
|
470
470
|
if (x && m > 0) {
|
|
@@ -522,7 +522,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
522
522
|
n && (Object.keys(n).forEach((x) => {
|
|
523
523
|
const o = n[x], t = c.value.find((y) => y.name === x);
|
|
524
524
|
t && (t.currentValue = o, r.model && r.model.setJointValue ? r.model.setJointValue(x, o) : t.urdfJoint && t.urdfJoint.setJointValue(o));
|
|
525
|
-
}),
|
|
525
|
+
}), q(m, s));
|
|
526
526
|
}, d = (n, m, s) => n + (m - n) * s, a = (n, m, s) => {
|
|
527
527
|
if (!n || !m) return n || m;
|
|
528
528
|
const x = {};
|
|
@@ -563,7 +563,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
563
563
|
resetAll: () => {
|
|
564
564
|
W(), D.value = 0, l.value = 0, c.value.forEach((n) => {
|
|
565
565
|
(n.type === "revolute" || n.type === "prismatic") && J(n.name, 0);
|
|
566
|
-
}),
|
|
566
|
+
}), q(-1, 0);
|
|
567
567
|
},
|
|
568
568
|
fastForward: () => {
|
|
569
569
|
e.value < 4 && (e.value = Math.min(4, e.value * 2));
|
|
@@ -594,11 +594,11 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
594
594
|
fe();
|
|
595
595
|
}), je(() => {
|
|
596
596
|
Ce(), W();
|
|
597
|
-
}), (n, m) => (H(),
|
|
598
|
-
c.value.length > 0 ? (H(),
|
|
599
|
-
(H(!0),
|
|
597
|
+
}), (n, m) => (H(), Z("div", wt, [
|
|
598
|
+
c.value.length > 0 ? (H(), Z("div", xt, [
|
|
599
|
+
(H(!0), Z(Xe, null, He(c.value, (s) => {
|
|
600
600
|
var x, o, t, y;
|
|
601
|
-
return H(),
|
|
601
|
+
return H(), Z("div", {
|
|
602
602
|
key: s.name,
|
|
603
603
|
class: "joint-item"
|
|
604
604
|
}, [
|
|
@@ -609,7 +609,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
609
609
|
]),
|
|
610
610
|
h("span", kt, ae(s.type), 1)
|
|
611
611
|
]),
|
|
612
|
-
s.type === "revolute" || s.type === "prismatic" ? (H(),
|
|
612
|
+
s.type === "revolute" || s.type === "prismatic" ? (H(), Z("div", zt, [
|
|
613
613
|
h("div", _t, [
|
|
614
614
|
h("input", {
|
|
615
615
|
type: "range",
|
|
@@ -629,7 +629,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
629
629
|
])) : xe("", !0)
|
|
630
630
|
]);
|
|
631
631
|
}), 128))
|
|
632
|
-
])) : (H(),
|
|
632
|
+
])) : (H(), Z("div", Ft, m[0] || (m[0] = [
|
|
633
633
|
h("p", null, "未检测到可控制的关节", -1)
|
|
634
634
|
])))
|
|
635
635
|
]));
|
|
@@ -710,7 +710,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
710
710
|
{ immediate: !0 }
|
|
711
711
|
), (l, C) => {
|
|
712
712
|
const g = Je("el-tree");
|
|
713
|
-
return H(),
|
|
713
|
+
return H(), Z("div", Vt, [
|
|
714
714
|
z(g, {
|
|
715
715
|
data: v.value,
|
|
716
716
|
props: w,
|
|
@@ -744,11 +744,11 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
744
744
|
height: k
|
|
745
745
|
};
|
|
746
746
|
});
|
|
747
|
-
return (w, k) => (H(),
|
|
747
|
+
return (w, k) => (H(), Z("div", {
|
|
748
748
|
class: Fe(["container", { active: w.active }]),
|
|
749
749
|
style: Ee(r.value)
|
|
750
750
|
}, [
|
|
751
|
-
(H(),
|
|
751
|
+
(H(), Z("svg", {
|
|
752
752
|
class: Fe(["svg-icon", [w.$attrs.class, w.spin && "svg-icon-spin"]]),
|
|
753
753
|
style: Ee(v.value),
|
|
754
754
|
"aria-hidden": "true"
|
|
@@ -757,7 +757,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
757
757
|
], 6))
|
|
758
758
|
], 6));
|
|
759
759
|
}
|
|
760
|
-
}), B = /* @__PURE__ */ me(Ot, [["__scopeId", "data-v-3150a90b"]]), Ut = { class: "obj-viewer-container" }, Gt = { class: "buttonGroup-top" }, jt = { class: "buttonGroup-topLeft" }, Xt = { class: "buttonGroup-left" }, Ht = { class: "buttonGroup-right" }, Yt = { class: "buttonGroup-bottom" },
|
|
760
|
+
}), B = /* @__PURE__ */ me(Ot, [["__scopeId", "data-v-3150a90b"]]), Ut = { class: "obj-viewer-container" }, Gt = { class: "buttonGroup-top" }, jt = { class: "buttonGroup-topLeft" }, Xt = { class: "buttonGroup-left" }, Ht = { class: "buttonGroup-right" }, Yt = { class: "buttonGroup-bottom" }, Zt = { class: "left-panel" }, qt = { class: "panel-header" }, Wt = {
|
|
761
761
|
key: 1,
|
|
762
762
|
class: "clipping-content"
|
|
763
763
|
}, Kt = { class: "radio-group" }, Nt = { class: "radio-label" }, Qt = { class: "radio-label" }, en = { class: "radio-label" }, tn = { class: "radio-label" }, nn = { class: "right-panel" }, an = { class: "panel-header" }, on = {
|
|
@@ -788,7 +788,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
788
788
|
getThreeJSObjects: V,
|
|
789
789
|
clearAllModels: J,
|
|
790
790
|
cleanup: G
|
|
791
|
-
} = mt(k), { isAnimating: j, toggleAnimation:
|
|
791
|
+
} = mt(k), { isAnimating: j, toggleAnimation: q, stopAnimation: ee } = ft(V, g), { isClipping: d, activeClippingAxis: a, toggleClipping: S, updateClippingPlanes: R } = vt(
|
|
792
792
|
V,
|
|
793
793
|
g
|
|
794
794
|
), { addModelsFromUrls: X, loadModelByDefaultPath: W, urdfModel: K, modelBoundingBoxes: N } = dt(
|
|
@@ -838,7 +838,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
838
838
|
} catch (o) {
|
|
839
839
|
console.error("Three.js初始化失败:", o);
|
|
840
840
|
}
|
|
841
|
-
}),
|
|
841
|
+
}), Ze(() => {
|
|
842
842
|
w = !1, T.value = "", l.value = "", window.removeEventListener("resize", _), j.value && ee(), G();
|
|
843
843
|
}), f({
|
|
844
844
|
addModelsFromUrls: Ce,
|
|
@@ -846,7 +846,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
846
846
|
}), (o, t) => {
|
|
847
847
|
var Y, $, ne, I;
|
|
848
848
|
const y = Je("el-scrollbar");
|
|
849
|
-
return H(),
|
|
849
|
+
return H(), Z("div", Ut, [
|
|
850
850
|
h("div", {
|
|
851
851
|
ref_key: "threejsContainer",
|
|
852
852
|
ref: k,
|
|
@@ -894,7 +894,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
894
894
|
z(B, {
|
|
895
895
|
name: "lookAround",
|
|
896
896
|
size: "24",
|
|
897
|
-
onClick: O(
|
|
897
|
+
onClick: O(q),
|
|
898
898
|
title: O(j) ? "停止动画" : "动画视图"
|
|
899
899
|
}, null, 8, ["onClick", "title"])
|
|
900
900
|
]),
|
|
@@ -993,8 +993,8 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
993
993
|
onClick: (I = C.value) == null ? void 0 : I.resetAll
|
|
994
994
|
}, null, 8, ["onClick"])
|
|
995
995
|
]),
|
|
996
|
-
se(h("div",
|
|
997
|
-
h("div",
|
|
996
|
+
se(h("div", Zt, [
|
|
997
|
+
h("div", qt, [
|
|
998
998
|
h("span", null, ae(T.value), 1),
|
|
999
999
|
h("span", {
|
|
1000
1000
|
class: "close",
|
|
@@ -1007,7 +1007,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
1007
1007
|
key: 0,
|
|
1008
1008
|
model: O(K)
|
|
1009
1009
|
}, null, 8, ["model"])) : xe("", !0),
|
|
1010
|
-
T.value === "剖面视图" ? (H(),
|
|
1010
|
+
T.value === "剖面视图" ? (H(), Z("div", Wt, [
|
|
1011
1011
|
h("div", Kt, [
|
|
1012
1012
|
h("label", Nt, [
|
|
1013
1013
|
se(h("input", {
|
|
@@ -1093,7 +1093,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
1093
1093
|
], 512), [
|
|
1094
1094
|
[we, D.value]
|
|
1095
1095
|
]),
|
|
1096
|
-
i.value ? (H(),
|
|
1096
|
+
i.value ? (H(), Z("div", on, [
|
|
1097
1097
|
t[20] || (t[20] = h("div", { class: "loading-spinner" }, null, -1)),
|
|
1098
1098
|
h("p", null, ae(A.value), 1)
|
|
1099
1099
|
])) : xe("", !0)
|
package/package.json
CHANGED
package/dist/index-DpYdEBga.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./index-AQlYfiDo.cjs"),$e=require("./index-C0beLcSH.cjs"),C=require("./index.vue_vue_type_style_index_0_scoped_264dc673_lang-9D6uXhMg.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),l=require("./menu-ScIJ5kqr.cjs"),Me=require("./login-9FT8kgSz.cjs"),fe=require("./index-BpPyaNFa.cjs"),we=require("./modelComp-CkSDfH0-.cjs"),te=require("./index-d9EmloJa.cjs"),ye=require("./index-wGULs5QZ.cjs"),Ie=require("./index.vue_vue_type_script_setup_true_lang-DrQm9pS8.cjs"),Pe=require("./index-G2O6ETUf.cjs"),Ee=require("./threeModel-CLfnrscV.cjs");require("vue-router");const ie=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D3x-AlQS.cjs"),Oe=require("./array-A9Rs-yNQ.cjs"),Ae=require("./index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-MGyd1nJE.cjs"),ze={class:"horizontal-f-18"};function Ge(x,oe,a,B,L,I){const s=e.resolveComponent("svg-icon"),q=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(q,{mode:x.mode,menuList:x.renderMenuList,onClickMenu:x.clickMenu,onOpenMenu:x.openMenu,onCloseMenu:x.closeMenu},{title:e.withCtx(({menu:P})=>[e.createVNode(s,{class:"horizontal-icon-18",name:P.icon??"",style:{"margin-right":"8px"}},null,8,["name"]),e.createElementVNode("span",ze,e.toDisplayString(P.title??""),1)]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"])}const je=ge._export_sfc(C._sfc_main,[["render",Ge],["__scopeId","data-v-9a59c14d"]]),He={class:"bread-content"},Xe=["onClick"],Je={key:0,class:"split-title"},We={__name:"index",props:{breadArray:{type:Array,default:()=>[]}},emits:["click"],setup(x,{emit:oe}){const a=x,B=e.ref([]),L=oe;e.onMounted(()=>{B.value=a==null?void 0:a.breadArray}),e.watch(()=>a==null?void 0:a.breadArray,()=>{B.value=a==null?void 0:a.breadArray},{deep:!0,immediate:!0});const I=s=>{L("click",s)};return(s,q)=>(e.openBlock(),e.createElementBlock("div",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,(P,A)=>{var $;return e.openBlock(),e.createElementBlock("div",{key:A,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:le=>I(P),style:e.normalizeStyle({opacity:(($=B.value)==null?void 0:$.length)-1===A?"0.7":"1"})},e.toDisplayString(P.value),13,Xe),A!==B.value.length-1&&Array.isArray(B.value)?(e.openBlock(),e.createElementBlock("div",Je,e.toDisplayString("/"))):e.createCommentVNode("",!0)])}),128))]))}},Ue=ge._export_sfc(We,[["__scopeId","data-v-ded7e2bd"]]),Qe={class:"structure-buttons"},Ye={class:"structure-paths"},Ze={class:"client-header-user"},et={class:"model-select"},tt={class:"model-show"},ot={class:"model-fill"},at={class:"client-header-logo"},nt={class:"client-header-menu"},lt={class:"client-header-user"},rt={class:"drop-menu"},it={class:"client-main-operate","element-loading-text":"正在加载页面数据..."},st={key:0,class:"main-back-btn"},ct={class:"main-body"},ut={key:0,class:"item-view-group"},dt={key:2,class:"item-view-child-content"},mt=e.defineComponent({__name:"index2",props:{windowConfig:{type:Object,default:()=>{}},showButton:{type:Boolean,default:!0}},emits:["buildContent"],setup(x,{emit:oe}){const a=ye.useUnit(l.pinia),{selectTitle:B}=l.storeToRefs(a),L=Me.useLoginState(),{loginUserInfo:I}=l.storeToRefs(L),s=we.useModelComp(l.pinia),{isEdit:q,routeToChildPath:P}=l.storeToRefs(s),A=oe,$=l.useMenuState(l.pinia),{importLoading:le,activeAsideMenu:y,contentLoading:J,platName:K}=l.storeToRefs($),O=e.ref(""),ee=e.computed(()=>y.value.isRouter),Q=()=>{sessionStorage.clear(),window.location.reload()},b=()=>{A("buildContent")},Y=async()=>{var T,z,se,g;$.setImportLoading(!0);const W=await l.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey")}});if(((T=W==null?void 0:W.data)==null?void 0:T.code)===200){let S=(g=(se=(z=W==null?void 0:W.data)==null?void 0:z.result)==null?void 0:se.map(V=>{var F;if(((F=V==null?void 0:V.key)==null?void 0:F.layer)!=="superAdmin")return V==null?void 0:V.id}))==null?void 0:g.filter(V=>V);await l.batchDeleteInsofDataApi({ids:S}),$.setRawMenus([])}$.setImportLoading(!1)},me=async()=>{await Pe.onSaveBack()};return(W,T)=>{const z=e.resolveComponent("el-button"),se=e.resolveComponent("el-avatar"),g=e.resolveComponent("el-header"),S=e.resolveComponent("el-container"),V=e.resolveComponent("el-icon"),F=e.resolveComponent("el-input"),G=e.resolveComponent("el-aside"),h=e.resolveComponent("router-view"),Z=e.resolveComponent("el-main"),U=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives(e.createVNode(S,{class:"client-container"},{default:e.withCtx(()=>[e.createVNode(g,{class:"client-structure-header"},{default:e.withCtx(()=>{var M;return[e.createElementVNode("div",Qe,[e.createVNode(z,{id:"transparentBgButton",onClick:e.unref(C.onBack)},{default:e.withCtx(()=>T[3]||(T[3]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[3]},8,["onClick"]),e.createVNode(z,{id:"transparentBgButton",onClick:T[0]||(T[0]=R=>{var f,H;return e.unref(C.clickSavePage)((H=(f=e.unref(B))==null?void 0:f.map(ae=>ae.value))==null?void 0:H.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(fe.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[T[4]||(T[4]=e.createTextVNode(" 保存页面 "))]),_:1,__:[4]})]),e.createElementVNode("div",Ye,[e.createVNode(Ue,{breadArray:e.unref(B),onClick:e.unref(C.onClick)},null,8,["breadArray","onClick"])]),e.createElementVNode("div",Ze,[e.renderSlot(W.$slots,"default",{},void 0,!0),e.createVNode(se,{size:35,src:(M=e.unref(I))==null?void 0:M.avatarUrl},{default:e.withCtx(()=>{var R;return[e.createTextVNode(e.toDisplayString(((R=e.unref(I))==null?void 0:R.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(q)==="edit"?(e.openBlock(),e.createBlock(S,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",et,[e.createVNode(ne.modelSelect)]),e.createElementVNode("div",tt,[e.createVNode(ne.modelShow)]),e.createElementVNode("div",ot,[e.createVNode(ne.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3},512),[[e.vShow,e.unref(q)==="edit"]]),e.withDirectives((e.openBlock(),e.createBlock(S,{class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(g,{class:"client-header"},{default:e.withCtx(()=>[e.createElementVNode("div",at,e.toDisplayString(e.unref(K)===""?"ISIP":e.unref(K))+" ISIP ",1),e.createElementVNode("div",nt,[e.createVNode(je,{mode:"horizontal"})]),e.createElementVNode("div",lt,[e.createVNode(F,{modelValue:O.value,"onUpdate:modelValue":T[1]||(T[1]=M=>O.value=M),clearable:"",placeholder:"搜索"},{prefix:e.withCtx(()=>[e.createVNode(V,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(l.search_default))]),_:1})]),_:1},8,["modelValue"]),x.showButton?(e.openBlock(),e.createBlock(z,{key:0,id:"transparentBgButton",onClick:b},{icon:e.withCtx(()=>[e.createVNode(fe.SvgIcon,{name:"App"})]),default:e.withCtx(()=>[T[5]||(T[5]=e.createTextVNode(" 生成APP "))]),_:1,__:[5]})):e.createCommentVNode("",!0),x.showButton&&e.unref(q)==="view"?(e.openBlock(),e.createBlock(z,{key:1,id:"transparentBgButton",onClick:e.unref(C.onSelectFixContent)},{icon:e.withCtx(()=>[e.createVNode(fe.SvgIcon,{name:"write"})]),default:e.withCtx(()=>[T[6]||(T[6]=e.createTextVNode(" 修改布局 "))]),_:1,__:[6]},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(W.$slots,"default",{},void 0,!0),e.createVNode(te._sfc_main,null,{dropTitle:e.withCtx(()=>{var M;return[e.createVNode(Ie._sfc_main,{size:"35",avatarUrl:(M=e.unref(I))==null?void 0:M.avatarUrl,showCropper:!1,banClick:!0},{avatarDefault:e.withCtx(()=>{var R,f,H;return[e.createTextVNode(e.toDisplayString((R=e.unref(I))!=null&&R.account?(f=e.unref(I))==null?void 0:f.account:((H=e.unref(I))==null?void 0:H.账号)??"未知"),1)]}),_:1},8,["avatarUrl"])]}),dropMenu:e.withCtx(()=>[e.createElementVNode("div",rt,[e.createVNode(te._sfc_main$1,{emptyColor:!0,class:"menu-button",onClickTrigger:Y,modelValue:"清空数据",buttonType:""}),e.createVNode(te._sfc_main$1,{emptyColor:!0,class:"menu-button",onClickTrigger:Q,modelValue:"退出登录",buttonType:""})])]),_:1})])]),_:3}),e.createVNode(S,{class:"client-body"},{default:e.withCtx(()=>[e.createVNode(Z,{class:"client-main"},{default:e.withCtx(()=>{var M,R;return[e.createVNode(G,{class:"client-aside"},{default:e.withCtx(()=>[e.createVNode($e.default,{mode:"vertical"})]),_:1}),e.withDirectives((e.openBlock(),e.createElementBlock("div",it,[e.unref(P)!==""?(e.openBlock(),e.createElementBlock("div",st,[e.createVNode(te._sfc_main$1,{class:"calculator-content back-content",onClickTrigger:T[2]||(T[2]=f=>e.unref(C.onPageBack)()),modelValue:"返回"})])):e.createCommentVNode("",!0),e.createElementVNode("div",ct,[ee.value?(e.openBlock(),e.createBlock(h,{key:0})):e.createCommentVNode("",!0),ee.value?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList((M=e.unref(l.cloneDeep)(e.unref(C.showItems)))==null?void 0:M.filter(f=>f.comp!=="FormTop"),(f,H)=>{var ae;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:H},[((ae=f==null?void 0:f.comp)==null?void 0:ae.toUpperCase())!=="TABLE"&&f.name?(e.openBlock(),e.createElementBlock("div",ut,e.toDisplayString(f.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(C.getComponents)(f.comp)),{compName:f.name,itemData:f==null?void 0:f.compData,childItemData:f==null?void 0:f.itemChildData,key:(f==null?void 0:f.id)??H,onChange:e.unref(C.onChange),index:(f==null?void 0:f.id)??H,onContentChange:e.unref(C.onContentChange),onPageChange:e.unref(C.onPageChange)},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128)),!ee.value&&!((R=e.unref(l.cloneDeep)(e.unref(C.showItems)))!=null&&R.find(f=>f.comp==="methodButton"))?(e.openBlock(),e.createElementBlock("div",dt,[e.unref(P)!==""?(e.openBlock(),e.createBlock(te._sfc_main$1,{key:0,class:"calculator-content",onClickTrigger:me,modelValue:"保存"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])),[[U,e.unref(J)]])]}),_:1})]),_:1})]),_:3})),[[e.vShow,e.unref(q)==="view"],[U,e.unref(le)]])],64)}}}),pt=ge._export_sfc(mt,[["__scopeId","data-v-506dae0e"]]),ke=[{key:"FitCurve_Eleven",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35326658522693",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35326658522693",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35326658522693/outputResources"},{key:"MakeShape",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018179530309",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018179530309",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018179530309/outputResources"},{key:"FillEmpty",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018289382469",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018289382469",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018289382469/outputResources"},{key:"ToolPathFakeFast",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35484063607109",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35484063607109",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35484063607109/outputResources"},{key:"FiveAxisCalculator",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35237389477957",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35237389477957",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35237389477957/outputResources"},{key:"DetectionAlgorithm",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35459977498949",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35459977498949",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources"},{key:"FeatureSelectionAlgorithm_FFS",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35277984187973",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35277984187973",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35277984187973/outputResources"},{key:"AIParameterOptimization",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35788169784389",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35788169784389"}],Be=[{key:"型线生成",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35326658522693/outputResources/sampling_points_20.cpt"},{key:"曲面生成",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018179530309/outputResources/output.obj"},{key:"叶片生成",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018289382469/outputResources/output_TwoSections_completed.obj"},{key:"轨迹规划",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35484063607109/outputResources/complete_data.txt"},{key:"加工规划",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35237389477957/outputResources/NC_BC.NC"},{key:"产品检测",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources/source.pcd,http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources/target.pcd"},{key:"参数筛选训练方法",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35277984187973/outputResources/fitness_iteration.png"}],ht={class:"structure-buttons"},ft={class:"structure-paths"},gt={class:"client-header-user"},_t={class:"model-select"},Ct={class:"model-show"},yt={class:"model-fill"},wt={class:"client-header-menu"},vt={class:"client-header-user"},kt={class:"drop-menu"},Bt={class:"client-main-operate","element-loading-text":"正在加载页面数据..."},Vt={class:"main-body"},Nt={key:0,class:"item-view-group"},xt=e.defineComponent({__name:"index2",props:{windowConfig:{type:Object,default:()=>{}},showButton:{type:Boolean,default:!0}},emits:["showChild","buildContent"],setup(x,{emit:oe}){const a=ye.useUnit(l.pinia),B=e.ref(!1);e.ref(0),e.ref(!1);const{selectTitle:L}=l.storeToRefs(a),I=e.ref(!1),s=e.ref(!1);e.ref(!1);const q=ye.useTableComp(l.pinia),P=e.ref(!1),{tableShowThree:A}=l.storeToRefs(q),$=e.ref(),le=Me.useLoginState(),{loginUserInfo:y}=l.storeToRefs(le);e.ref(null);const J=we.useModelComp(l.pinia),{isEdit:K}=l.storeToRefs(J),O=l.useMenuState(l.pinia),ee=Pe.useFormComp(l.pinia),{objUrl:Q,blobUrls:b}=l.storeToRefs(ee),Y=e.ref(null);e.ref(!1);const me=e.ref(),W=e.ref(!0);e.ref(!1);const{importLoading:T,activeMenuPath:z,activeTopMenuPath:se,platName:g,activeAsideMenu:S,contentLoading:V}=l.storeToRefs(O),F=e.ref(!1),G=e.ref(!1),h=e.ref(!1),Z=oe,U=()=>{Z("buildContent")};e.watch(()=>z.value,async o=>{o&&(h.value=!0),o==="弯管仿真加工管理/仿真动画生成"?F.value=!0:F.value=!1,o==="弯管仿真加工管理/程序输出"?G.value=!0:G.value=!1,Be!=null&&Be.find(r=>{var c;return(r==null?void 0:r.key)===((c=o==null?void 0:o.split("/"))==null?void 0:c[(o==null?void 0:o.split("/").length)-1])})?P.value=!0:P.value=!1},{immediate:!0});const M=o=>{if((o==null?void 0:o.type)==="table"){let r=Object.values(o==null?void 0:o.row),c=r==null?void 0:r.find(u=>typeof u=="string"&&((u==null?void 0:u.includes(".urdf"))||(u==null?void 0:u.includes(".obj"))));c&&($.value={url:c,row:o==null?void 0:o.row},Z("showChild",{url:c,row:o==null?void 0:o.row}))}},R=()=>{sessionStorage.clear(),window.location.reload()},f=async()=>{var r,c,u,v;O.setImportLoading(!0);const o=await l.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey")}});if(((r=o==null?void 0:o.data)==null?void 0:r.code)===200){let t=(v=(u=(c=o==null?void 0:o.data)==null?void 0:c.result)==null?void 0:u.map(i=>{var n;if(((n=i==null?void 0:i.key)==null?void 0:n.layer)!=="superAdmin")return i==null?void 0:i.id}))==null?void 0:v.filter(i=>i);await l.batchDeleteInsofDataApi({ids:t}),O.setRawMenus([])}O.setImportLoading(!1)},H=async o=>{var u,v,t,i,n,N,_;const r=(u=o==null?void 0:o.split("/"))==null?void 0:u[0],c=await l.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey"),pageKey:r}});return((v=c==null?void 0:c.data)==null?void 0:v.type)==="success"?((_=(N=(n=(i=(t=c==null?void 0:c.data)==null?void 0:t.result)==null?void 0:i[0])==null?void 0:n.value)==null?void 0:N.tableData)==null?void 0:_.隐藏三维显示)!==!0:!0};e.watch(()=>C.showItems.value,()=>{var o,r,c,u,v;if(((o=C.showItems.value)==null?void 0:o.length)===2&&((r=C.showItems.value)!=null&&r.find(t=>(t==null?void 0:t.name)==="输入"))&&((c=C.showItems.value)!=null&&c.find(t=>(t==null?void 0:t.name)==="输出"))){const t=(u=C.showItems.value)==null?void 0:u.find(i=>(i==null?void 0:i.name)==="输出");s.value=((v=t==null?void 0:t.comp)==null?void 0:v.toUpperCase())==="FORM",I.value=!0}else I.value=!1,s.value=!1},{deep:!0,immediate:!0}),e.watch(()=>z.value,async()=>{z.value&&(W.value=await H(z.value))},{deep:!0,immediate:!0}),e.watch(()=>[Q.value,Y.value],()=>{var o;((o=Q.value)==null?void 0:o.length)>0&&Y.value&&Y.value.addModelsFromUrls(Q.value)},{immediate:!0,deep:!0}),e.watch(()=>[b==null?void 0:b.value],async()=>{var o,r,c,u,v;if(b!=null&&b.value&&((o=b==null?void 0:b.value)==null?void 0:o.length)>0&&!P.value&&!((r=C.showItems.value)!=null&&r.find(t=>(t==null?void 0:t.name)==="输入")&&((c=C.showItems.value)!=null&&c.find(t=>(t==null?void 0:t.name)==="输出")))){B.value=!0;let t=[];const i=await((u=l.cloneDeep(b==null?void 0:b.value))==null?void 0:u.map(async n=>{var X,k,p,m,w,ue,Ce,Ve,Ne,xe;let N,_,d;n!=null&&n.blob.includes("undefined")?d=(k=(X=n==null?void 0:n.blob)==null?void 0:X.split("undefined,"))==null?void 0:k[1]:d=n==null?void 0:n.blob;let E=d==null?void 0:d.split(",");if((E==null?void 0:E.length)>1){let de=await(E==null?void 0:E.map(async j=>{var re,be,Te,Se,Fe,De;N=await l.axios.get(j,{responseType:"blob",headers:{"Content-Type":"application/json"}});let he=[];if(((re=n==null?void 0:n.mtlBlobs)==null?void 0:re.length)>0){let qe=await((be=n==null?void 0:n.mtlBlobs)==null?void 0:be.map(async Ke=>{let Re=await l.axios.get(Ke,{responseType:"blob",headers:{"Content-Type":"application/json"}});return he.push(new Blob([Re.data],{type:"application/octet-stream;charset=UTF-8"})),Re}));await Promise.all(qe)}return((Se=j==null?void 0:j.split("."))==null?void 0:Se[((Te=j==null?void 0:j.split("."))==null?void 0:Te.length)-1])!=="undefined"&&t.push({suffix:"."+((De=j==null?void 0:j.split("."))==null?void 0:De[((Fe=j==null?void 0:j.split("."))==null?void 0:Fe.length)-1]),blob:new Blob([N.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:he}),N}));await Promise.all(de)}else if(!(d!=null&&d.includes("https://"))&&!(d!=null&&d.includes("http://"))){N=await te.downloadAvatarApi({url:d});let de=[];if(((p=n==null?void 0:n.mtlBlobs)==null?void 0:p.length)>0){let j=await((m=n==null?void 0:n.mtlBlobs)==null?void 0:m.map(async he=>{let re=await te.downloadAvatarApi({url:he});return de.push(new Blob([re.data],{type:"application/octet-stream;charset=UTF-8"})),re}));await Promise.all(j)}_={suffix:"."+((ue=d==null?void 0:d.split("."))==null?void 0:ue[((w=d==null?void 0:d.split("."))==null?void 0:w.length)-1]),blob:new Blob([N.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:de}}else{N=await l.axios.get(d,{responseType:"blob",headers:{"Content-Type":"application/json"}});let de=[];if(((Ce=n==null?void 0:n.mtlBlobs)==null?void 0:Ce.length)>0){let j=await((Ve=n==null?void 0:n.mtlBlobs)==null?void 0:Ve.map(async he=>{let re=await l.axios.get(he,{responseType:"blob",headers:{"Content-Type":"application/json"}});return de.push(new Blob([re.data],{type:"application/octet-stream;charset=UTF-8"})),re}));await Promise.all(j)}_={suffix:"."+((xe=d==null?void 0:d.split("."))==null?void 0:xe[((Ne=d==null?void 0:d.split("."))==null?void 0:Ne.length)-1]),blob:new Blob([N.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:de}}_&&t.push(_)}));await Promise.all(i),(t==null?void 0:t.length)!==0&&((v=Y.value)==null||v.loadModelByDefaultPath(t))}},{immediate:!0,deep:!0});const ae=()=>{B.value=!1,Y.value=null};e.watch(()=>A.value,async()=>{var r,c,u,v;if(A.value!==""&&A.value){let t=(r=z.value)==null?void 0:r.split("/"),i=t[(t==null?void 0:t.length)-2];const N=(((c=ke==null?void 0:ke.find(E=>(E==null?void 0:E.key)===i))==null?void 0:c.download)??"")+"/"+A.value,_=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),d=await l.axios.post(N,null,{responseType:"blob",headers:{Authorization:_,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var o=new Blob([d.data],{type:"application/octet-stream;charset=UTF-8"});""+((v=(u=A.value)==null?void 0:u.split("."))==null?void 0:v[1])}},{deep:!0,immediate:!0});const pe=e.ref("");e.ref("open"),e.ref("open"),e.ref(!1),e.computed(()=>C.showItems.value);const _e=e.computed(()=>S.value.isRouter),D=o=>{let r=l.cloneDeep(o),c=[],u=[];return r==null||r.forEach((v,t)=>{t===(o==null?void 0:o.length)-1?(u.push(v),c.push(u)):((u==null?void 0:u.length)!==0&&v.includes(".obj")&&(c.push(u),u=[]),u.push(v))}),c},ce=async()=>{let o={};const r=await ie.getItemData("弯管仿真加工管理/仿真动画生成",sessionStorage.getItem("systemKey"),""),c=await ie.getItemData("弯管仿真加工管理/管件解析",sessionStorage.getItem("systemKey"),"");let u=["管长","外径"],v={};c==null||c.forEach(t=>{var i;(t==null?void 0:t.comp)==="Form"&&((i=t==null?void 0:t.compData)==null||i.forEach(n=>{var N;(n==null?void 0:n.key)==="formContent"&&((N=n==null?void 0:n.contents)==null||N.forEach(_=>{u.includes(_==null?void 0:_.key)&&(v[_.key]=_.value)}))}))}),r==null||r.forEach(t=>{var i,n,N,_,d,E;if((t==null?void 0:t.comp)==="Table"){let X=[],k=(N=(n=(i=t==null?void 0:t.compData)==null?void 0:i.find(m=>(m==null?void 0:m.key)==="header"))==null?void 0:n.contents)==null?void 0:N.map(m=>m==null?void 0:m.label),p=(E=(d=(_=t==null?void 0:t.compData)==null?void 0:_.find(m=>(m==null?void 0:m.key)==="tableContents"))==null?void 0:d.contents)==null?void 0:E.map(m=>(m=m==null?void 0:m.filter(w=>!(w!=null&&w.id)),m));p==null||p.forEach(m=>{X.push(ie.getValueToObjectValue(m,k==null?void 0:k.filter(w=>w!=="操作")))}),o[t.name]=X,o[t.name+"Content"]=t}}),o.extra=v,me.value=o},ve=e.ref(!1),Le=async()=>{var o,r;if(ve.value=!0,$.value){const c=$.value;let u=[];if(typeof(c==null?void 0:c.url)=="string"){let v=(o=c==null?void 0:c.url)==null?void 0:o.split(","),t=(r=D(v))==null?void 0:r.map(async i=>{var n,N;if((i==null?void 0:i.length)===1){let _=i==null?void 0:i.map(async d=>{var p,m;let E=await l.axios.get(d,{responseType:"blob",headers:{"Content-Type":"application/json"}});const X=new Blob([E.data],{type:"application/octet-stream;charset=UTF-8"});let k={suffix:"."+((m=d==null?void 0:d.split("."))==null?void 0:m[((p=d==null?void 0:d.split("."))==null?void 0:p.length)-1]),blob:X,mtlBlobs:[]};return u.push(k),k});return await Promise.all(_),_}else{let _=i==null?void 0:i.find(w=>w==null?void 0:w.includes(".obj")),d=await l.axios.get(_,{responseType:"blob",headers:{"Content-Type":"application/json"}});const E=new Blob([d.data],{type:"application/octet-stream;charset=UTF-8"});let X=i==null?void 0:i.filter(w=>w==null?void 0:w.includes(".mtl")),k=[],p=X==null?void 0:X.map(async w=>{let ue=await l.axios.get(_,{responseType:"blob",headers:{"Content-Type":"application/json"}});const Ce=new Blob([ue.data],{type:"application/octet-stream;charset=UTF-8"});return k.push(Ce),ue});await Promise.all(p);let m={suffix:"."+((N=_==null?void 0:_.split("."))==null?void 0:N[((n=_==null?void 0:_.split("."))==null?void 0:n.length)-1]),blob:E,mtlBlobs:k};return u.push(m),m}});await Promise.all(t)}Y.value.loadModelByDefaultPath(u)}};return(o,r)=>{const c=e.resolveComponent("el-dialog"),u=e.resolveComponent("el-button"),v=e.resolveComponent("el-avatar"),t=e.resolveComponent("el-header"),i=e.resolveComponent("el-container"),n=e.resolveComponent("el-icon"),N=e.resolveComponent("el-input"),_=e.resolveComponent("el-aside"),d=e.resolveComponent("router-view"),E=e.resolveComponent("el-main"),X=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(c,{modelValue:ve.value,"onUpdate:modelValue":r[0]||(r[0]=k=>ve.value=k),style:{height:"700px",width:"1800px"}},{default:e.withCtx(()=>[e.createVNode(Ee.default,{ref_key:"threeModelRef",ref:Y,onGetAnimationData:ce,animationData:me.value},null,8,["animationData"])]),_:1},8,["modelValue"]),e.withDirectives(e.createVNode(i,{class:"client-container"},{default:e.withCtx(()=>[e.createVNode(t,{class:"client-structure-header"},{default:e.withCtx(()=>{var k;return[e.createElementVNode("div",ht,[e.createVNode(u,{id:"transparentBgButton",onClick:e.unref(C.onBack)},{default:e.withCtx(()=>r[3]||(r[3]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[3]},8,["onClick"]),e.createVNode(u,{id:"transparentBgButton",onClick:r[1]||(r[1]=p=>{var m,w;return e.unref(C.clickSavePage)((w=(m=e.unref(L))==null?void 0:m.map(ue=>ue.value))==null?void 0:w.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(fe.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[r[4]||(r[4]=e.createTextVNode(" 保存页面 "))]),_:1,__:[4]})]),e.createElementVNode("div",ft,[e.createVNode(Ue,{breadArray:e.unref(L),onClick:e.unref(C.onClick)},null,8,["breadArray","onClick"])]),e.createElementVNode("div",gt,[e.renderSlot(o.$slots,"default",{},void 0,!0),e.createVNode(v,{size:35,src:(k=e.unref(y))==null?void 0:k.avatarUrl},{default:e.withCtx(()=>{var p,m,w;return[e.createTextVNode(e.toDisplayString((p=e.unref(y))!=null&&p.account?(m=e.unref(y))==null?void 0:m.account:((w=e.unref(y))==null?void 0:w.账号)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(K)==="edit"?(e.openBlock(),e.createBlock(i,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",_t,[e.createVNode(ne.modelSelect)]),e.createElementVNode("div",Ct,[e.createVNode(ne.modelShow)]),e.createElementVNode("div",yt,[e.createVNode(ne.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3},512),[[e.vShow,e.unref(K)==="edit"]]),e.withDirectives((e.openBlock(),e.createBlock(i,{class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(t,{class:"client-header"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"client-header-logo",onClick:Le},e.toDisplayString(e.unref(g)===""?"CPMPIP":e.unref(g)),1),e.createElementVNode("div",wt,[e.createVNode(je,{mode:"horizontal"})]),e.createElementVNode("div",vt,[e.createVNode(N,{modelValue:pe.value,"onUpdate:modelValue":r[2]||(r[2]=k=>pe.value=k),clearable:"",placeholder:"搜索"},{prefix:e.withCtx(()=>[e.createVNode(n,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(l.search_default))]),_:1})]),_:1},8,["modelValue"]),x.showButton?(e.openBlock(),e.createBlock(u,{key:0,id:"transparentBgButton",onClick:U},{icon:e.withCtx(()=>[e.createVNode(fe.SvgIcon,{name:"App"})]),default:e.withCtx(()=>[r[5]||(r[5]=e.createTextVNode(" 生成APP "))]),_:1,__:[5]})):e.createCommentVNode("",!0),x.showButton&&e.unref(K)==="view"?(e.openBlock(),e.createBlock(u,{key:1,id:"transparentBgButton",onClick:e.unref(C.onSelectFixContent)},{icon:e.withCtx(()=>[e.createVNode(fe.SvgIcon,{name:"write"})]),default:e.withCtx(()=>[r[6]||(r[6]=e.createTextVNode(" 修改布局 "))]),_:1,__:[6]},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},void 0,!0),e.createVNode(te._sfc_main,null,{dropTitle:e.withCtx(()=>{var k;return[e.createVNode(Ie._sfc_main,{size:"35",avatarUrl:(k=e.unref(y))==null?void 0:k.avatarUrl,showCropper:!1,banClick:!0},{avatarDefault:e.withCtx(()=>{var p,m;return[e.createTextVNode(e.toDisplayString(((p=e.unref(y))==null?void 0:p.account)??((m=e.unref(y))==null?void 0:m.姓名)??"未知"),1)]}),_:1},8,["avatarUrl"])]}),dropMenu:e.withCtx(()=>[e.createElementVNode("div",kt,[e.createVNode(te._sfc_main$1,{emptyColor:!0,class:"menu-button",onClickTrigger:f,modelValue:"清空数据",buttonType:""}),e.createVNode(te._sfc_main$1,{emptyColor:!0,class:"menu-button",onClickTrigger:R,modelValue:"退出登录",buttonType:""})])]),_:1})])]),_:3}),e.createVNode(i,{class:"client-body"},{default:e.withCtx(()=>[e.createVNode(E,{class:"client-main"},{default:e.withCtx(()=>{var k;return[e.createVNode(_,{class:"client-aside"},{default:e.withCtx(()=>[e.createVNode($e.default,{mode:"vertical"})]),_:1}),e.withDirectives((e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("div",Vt,[_e.value?(e.openBlock(),e.createBlock(d,{key:0})):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList((k=e.unref(l.cloneDeep)(e.unref(C.showItems)))==null?void 0:k.filter(p=>p.comp!=="FormTop"),(p,m)=>{var w;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:m},[((w=p==null?void 0:p.comp)==null?void 0:w.toUpperCase())!=="TABLE"&&p.name?(e.openBlock(),e.createElementBlock("div",Nt,e.toDisplayString(p.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(C.getComponents)(p.comp)),{compName:p.name,itemData:p==null?void 0:p.compData,childItemData:p==null?void 0:p.itemChildData,key:(p==null?void 0:p.id)??m,onChange:e.unref(C.onChange),index:(p==null?void 0:p.id)??m,onContentChange:e.unref(C.onContentChange),onPageChange:e.unref(C.onPageChange),onRowClick:M},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128))])])),[[X,e.unref(V)]])]}),_:1})]),_:1})]),_:3})),[[e.vShow,e.unref(K)==="view"],[X,e.unref(T)]]),e.createElementVNode("div",null,[e.createVNode(te.ssDialog,{visible:B.value,onBeforeDestroy:ae,style:{height:"700px",width:"1000px"}},{default:e.withCtx(()=>[e.createVNode(Ee.default,{ref_key:"threeModelRef",ref:Y},null,512)]),_:1},8,["visible"])])],64)}}}),bt=ge._export_sfc(xt,[["__scopeId","data-v-68753589"]]),Tt={class:"system-wrap"},St={__name:"index",props:{windowConfig:{type:Object,default:()=>{}},platform:{type:String,default:"browser"},showButton:{type:Boolean,default:!0},content:String,jsonContents:Array},emits:["buildContent","showChild"],setup(x,{emit:oe}){const a=we.useModelComp(l.pinia),B=ye.useUnit(l.pinia),L=l.useMenuState();e.ref(!1);const I=e.ref(!0),s=x,q=oe,P=y=>{q("showChild",y)},A=e.computed(()=>{switch(s==null?void 0:s.platform){case"browser":return Ae.browserThemeConfig;case"client":return Ae.clientThemeConfig}}),$=y=>{const J=document.documentElement;y==null||y.forEach(K=>{J.style.setProperty(K.name,K.value)})};e.watch(()=>s.platform,(y,J)=>{y&&$(A.value)},{immediate:!0});const le=()=>{q("buildContent")};return e.watch(()=>[s==null?void 0:s.content,s==null?void 0:s.jsonContents],async()=>{var K,O,ee,Q;if(((K=s==null?void 0:s.jsonContents)==null?void 0:K.length)>0){a.setOriginalData(s==null?void 0:s.jsonContents);return}if(!(s!=null&&s.content)||((O=s==null?void 0:s.content)==null?void 0:O.length)===0)return;I.value=!0,L.setImportLoading(!0);let y=[],J=[];B.setSelectTitle([]),B.setSelectIndex(""),B.setSelectMenu(""),(Q=(ee=s==null?void 0:s.content)==null?void 0:ee.filter(b=>b!==""))==null||Q.forEach(b=>{J.push(C.expandToNewContents(b))}),y=J==null?void 0:J[0],await C.savePageDataAsync(y),await ie.loadingSystemType(),a.setOriginalData(y),L.setImportLoading(!1)},{deep:!0,immediate:!0}),(y,J)=>(e.openBlock(),e.createElementBlock("div",Tt,[x.platform==="browser"?(e.openBlock(),e.createBlock(pt,{key:0,showButton:x.showButton,onBuildContent:le},{default:e.withCtx(()=>[e.renderSlot(y.$slots,"default",{},void 0,!0)]),_:3},8,["showButton"])):(e.openBlock(),e.createBlock(bt,{key:1,windowConfig:x.windowConfig,showButton:x.showButton,onBuildContent:le,onShowChild:P},{default:e.withCtx(()=>[e.renderSlot(y.$slots,"default",{},void 0,!0)]),_:3},8,["windowConfig","showButton"]))]))}},Ft=ge._export_sfc(St,[["__scopeId","data-v-fa46916e"]]),Dt={class:"add-model-content"},Rt={key:0,class:"model-operate"},Et={class:"model-select"},At={class:"model-fill"},$t={key:1,class:"model-view"},Mt={__name:"index",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0},pathContent:{type:String,default:""},pageKey:{type:String,default:""}},emits:["change","contentChange","buildContent","openThreeBuild","threeData"],setup(x,{emit:oe}){const a=x,B=oe,L=e.ref([]),I=e.ref(0),s=e.ref([]),q=e.ref([]),P=e.ref(0),A=we.useModelComp(l.pinia),$=l.useMenuState(l.pinia),{itemData:le,originalData:y}=l.storeToRefs(A),{activeMenuPath:J,platform:K}=l.storeToRefs($),O=e.ref(null),ee=e.ref(0),Q=e.ref([]);e.ref("");const b=e.ref(0),Y=()=>{B("buildContent")};e.watch(()=>a==null?void 0:a.pageKey,async()=>{let g={};if((a==null?void 0:a.pageKey)!==""){const S=await ie.getItemData(a==null?void 0:a.pageKey,sessionStorage.getItem("systemKey"),""),V=await ie.getItemData("弯管仿真加工管理/管件解析",sessionStorage.getItem("systemKey"),"");let F=["管长","外径"],G={};V==null||V.forEach(h=>{var Z;(h==null?void 0:h.comp)==="Form"&&((Z=h==null?void 0:h.compData)==null||Z.forEach(U=>{var M;(U==null?void 0:U.key)==="formContent"&&((M=U==null?void 0:U.contents)==null||M.forEach(R=>{F.includes(R==null?void 0:R.key)&&(G[R.key]=R.value)}))}))}),S==null||S.forEach(h=>{var Z,U,M,R,f,H;if((h==null?void 0:h.comp)==="Table"){let ae=[],pe=(M=(U=(Z=h==null?void 0:h.compData)==null?void 0:Z.find(D=>(D==null?void 0:D.key)==="header"))==null?void 0:U.contents)==null?void 0:M.map(D=>D==null?void 0:D.label),_e=(H=(f=(R=h==null?void 0:h.compData)==null?void 0:R.find(D=>(D==null?void 0:D.key)==="tableContents"))==null?void 0:f.contents)==null?void 0:H.map(D=>(D=D==null?void 0:D.filter(ce=>!(ce!=null&&ce.id)),D));_e==null||_e.forEach(D=>{ae.push(ie.getValueToObjectValue(D,pe==null?void 0:pe.filter(ce=>ce!=="操作")))}),g[h.name]=ae,g[h.name+"Content"]=h}}),g.extra=G,B("threeData",g)}},{deep:!0,immediate:!0});const me=g=>{B("openThreeBuild",g)};e.watch(()=>a==null?void 0:a.pathContent,()=>{(a==null?void 0:a.pathContent)!==""&&A.setSystemPath(a==null?void 0:a.pathContent)},{deep:!0,immediate:!0});const W=g=>{B("contentChange",g)},T=g=>{var V;const S=(V=l.cloneDeep(g==null?void 0:g.wholeValue))==null?void 0:V.map(F=>{var G;return(F==null?void 0:F.comp)==="Form"&&(F.compData=(G=F.compData)==null?void 0:G.map(h=>((h==null?void 0:h.key)==="formContent"&&(h.contents=Oe.arrayToNumberArray(h==null?void 0:h.contents)),h))),F});B("change",{originalContents:y.value,currentContents:g==null?void 0:g.wholeValue,editContent:g==null?void 0:g.editValue,arrayToContents:S})};e.watch(()=>s.value,()=>{b.value===s.value.length&&s.value.length!==0&&(L.value=s.value)},{deep:!0,immediate:!0});const z=()=>{O.value!==null&&O.value.click()},se=async g=>{$.setActiveMenuPath(""),$.setActiveTopMenuPath(""),$.setAsideMenus([]);const S=g.target.files;if(!S)return;new FileReader,L.value=[],s.value=[],b.value=S.length;const V=Array.from(S).map(async F=>await new Promise(G=>{const h=new FileReader;h.onload=Z=>{try{s.value.push(Z.target.result),ee.value++}catch(U){console.error("解析失败:",U);return}},h.onerror=()=>G(`读取 ${F.name} 失败`),h.readAsText(F),g.target.value="",O.value=null,I.value++}));await Promise.all(V)};return e.watch(()=>[a==null?void 0:a.content,a==null?void 0:a.jsonContents],async()=>{await ie.loadingSystemType(),L.value=a.content,q.value=a==null?void 0:a.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>ee.value,()=>{var g;((g=Q.value)==null?void 0:g.length)!==0&&(A.setOriginalData(Q.value),A.setItemData(Q.value))},{deep:!0,immediate:!0}),(g,S)=>{const V=e.resolveComponent("svg-icon"),F=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",Dt,[(a==null?void 0:a.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",Rt,[e.createElementVNode("div",Et,[e.createVNode(ne.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:P.value},[e.createVNode(ne.modelShow)])),e.createElementVNode("div",At,[e.createVNode(ne.modelFill)])])):e.createCommentVNode("",!0),(a==null?void 0:a.mode)==="view"?(e.openBlock(),e.createElementBlock("div",$t,[(e.openBlock(),e.createBlock(Ft,{showButton:x.showButton,platform:e.unref(K),content:L.value,onChange:T,jsonContents:q.value,onContentChange:W,onBuildContent:Y,key:P.value,onShowChild:me},{default:e.withCtx(()=>{var G;return[((G=a==null?void 0:a.jsonContents)==null?void 0:G.length)===0&&(a!=null&&a.showButton)?(e.openBlock(),e.createBlock(F,{key:0,id:"transparentBgButton",onClick:z},{icon:e.withCtx(()=>[e.createVNode(V,{name:"import"})]),default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("input",{type:"file",key:I.value,ref_key:"fileInput",ref:O,accept:".txt, .inm, .iml, .imd",onChange:se,style:{display:"none"},multiple:""},null,32)),S[0]||(S[0]=e.createTextVNode(" 导入模型 "))]),_:1,__:[0]})):e.createCommentVNode("",!0)]}),_:1},8,["showButton","platform","content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},It=ge._export_sfc(Mt,[["__scopeId","data-v-264dc673"]]);exports.default=It;
|