ss-component-new 1.1.694 → 1.1.697

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.
Files changed (84) hide show
  1. package/dist/{array-CLO83-EB.cjs → array-CdPv8cht.cjs} +1 -1
  2. package/dist/{array-CnNqzjsa.js → array-Tj9n22LW.js} +1 -1
  3. package/dist/{index-BMiW54Gf.cjs → index-2p69g4HY.cjs} +6 -6
  4. package/dist/{index-CO3hiJWF.cjs → index-2ulWVy3d.cjs} +1 -1
  5. package/dist/{index-f5HYi-wc.cjs → index-B-htrQ8o.cjs} +1 -1
  6. package/dist/{index-B88z5SyL.cjs → index-B3UVui7c.cjs} +1 -1
  7. package/dist/{index-3okZjs5B.js → index-B8ibXIR2.js} +1 -1
  8. package/dist/{index-BQbrejA1.js → index-BCZ59Y4K.js} +0 -1
  9. package/dist/{index-DLKAgEkI.cjs → index-BK_gZgTv.cjs} +1 -1
  10. package/dist/{index-BBSPbEbw.cjs → index-BKlz7cS9.cjs} +1 -1
  11. package/dist/{index-DzT_yWYR.cjs → index-BZkH2AYa.cjs} +1 -1
  12. package/dist/{index-DiasHZKs.js → index-B_Flzztl.js} +4 -4
  13. package/dist/{index-BaenyMCV.cjs → index-BeHWA6-5.cjs} +1 -1
  14. package/dist/{index-l1qJOF-L.cjs → index-Bpb5Dn-j.cjs} +1 -1
  15. package/dist/{index-kVoQP8UP.cjs → index-BrQVl4Zd.cjs} +1 -1
  16. package/dist/{index-BHMtvveZ.js → index-BufGU2BU.js} +1 -1
  17. package/dist/{index-3KbnXDaT.cjs → index-C5KU7P4g.cjs} +1 -1
  18. package/dist/{index-Cxf8S0LH.js → index-C6F_Qv9_.js} +5 -5
  19. package/dist/index-C97ZQO8T.cjs +1 -0
  20. package/dist/{index-CoCtXags.js → index-COhyHXFv.js} +2 -2
  21. package/dist/{index-Cr0ZkdxV.js → index-CQTl5wS0.js} +15 -15
  22. package/dist/{index-DNcULVa1.js → index-CRtV5WuL.js} +4 -4
  23. package/dist/{index-YTgiRG5n.cjs → index-CThTE4nC.cjs} +1 -1
  24. package/dist/{index-ChSY5Uq6.js → index-CUeBezD8.js} +4 -4
  25. package/dist/{index-CaRTRULq.cjs → index-CX0lapAz.cjs} +13 -13
  26. package/dist/{index-RFdUIF3u.cjs → index-CYr6JfTw.cjs} +1 -1
  27. package/dist/{index-Dbzxle58.js → index-CatyTybI.js} +1 -1
  28. package/dist/{index-Btw1E8X9.js → index-Cb32xjFZ.js} +4 -4
  29. package/dist/index-CfiHbfhD.js +4738 -0
  30. package/dist/{index-A-taUOit.js → index-ChtHQFmB.js} +1 -1
  31. package/dist/{index-DZUUfAXM.js → index-CjWYNXJT.js} +4 -4
  32. package/dist/{index-Rg7QR0ET.js → index-CjYmcl8U.js} +5239 -5255
  33. package/dist/{index-x_O_YF4W.js → index-CkSPb2p9.js} +3 -3
  34. package/dist/{index-DU_gpFDl.js → index-Cq4go058.js} +6 -6
  35. package/dist/{index-BoR3liun.js → index-Ct0CmWjo.js} +1 -1
  36. package/dist/{index-C4UXIaf0.cjs → index-DD6f1KgD.cjs} +1 -1
  37. package/dist/{index-Cqa_rbSi.js → index-DGiFskaY.js} +6 -6
  38. package/dist/{index-DbUTgcpC.cjs → index-DMVFhY2W.cjs} +1 -1
  39. package/dist/{index-Cgfr_w1z.cjs → index-DTS5HoBL.cjs} +1 -1
  40. package/dist/{index-BxUQoC9Z.js → index-DUa3ddEk.js} +5891 -5821
  41. package/dist/{index-BcCP1oal.cjs → index-DZfla_UC.cjs} +1 -1
  42. package/dist/{index-D6Qn8t_Y.cjs → index-Db34Sg1u.cjs} +42 -42
  43. package/dist/{index-BOJk-Uby.cjs → index-DgPw8IAq.cjs} +1 -1
  44. package/dist/{index-D1Z0idRA.cjs → index-Dwq8e9ki.cjs} +1 -1
  45. package/dist/{index-BgFmbRIH.cjs → index-F0K1-Asd.cjs} +1 -1
  46. package/dist/{index-BGnqSXsM.cjs → index-HNS_Afdo.cjs} +1 -1
  47. package/dist/{index-CzRqJqyA.js → index-ILPebZ25.js} +7 -7
  48. package/dist/{index-D_aaFuMD.js → index-LjCKAD2x.js} +9 -9
  49. package/dist/{index-CoNDs5B_.js → index-M3N-cMRq.js} +6 -6
  50. package/dist/{index-BY6icLE5.js → index-OoPrBaU7.js} +3 -3
  51. package/dist/{index-Cmhvuxao.cjs → index-YnHPocII.cjs} +1 -1
  52. package/dist/{index-BnRcpT_T.js → index-gcJ4pdsy.js} +4 -4
  53. package/dist/{index-BfpHmqEV.cjs → index-kC3tMDYl.cjs} +1 -1
  54. package/dist/{index-BByN6sng.js → index-wNYNwwJM.js} +5 -5
  55. package/dist/{index.vue_vue_type_script_setup_true_lang-DF9XGIz3.cjs → index.vue_vue_type_script_setup_true_lang-CI5FfMjW.cjs} +1 -1
  56. package/dist/{index.vue_vue_type_script_setup_true_lang-LHENnk2N.js → index.vue_vue_type_script_setup_true_lang-DC9cV5xc.js} +2 -2
  57. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CwuI0Ee7.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BQgfwA0P.js} +977 -979
  58. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C1DluSxa.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DS3sCjjh.cjs} +37 -37
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_8606206c_lang-BRe0ZOKp.js → index.vue_vue_type_style_index_0_scoped_8606206c_lang-BBC89yNZ.js} +17 -17
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_8606206c_lang-D2FKUBBW.cjs → index.vue_vue_type_style_index_0_scoped_8606206c_lang-BWo8YVs4.cjs} +1 -1
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_c81d0427_lang-CJTS3KF1.cjs → index.vue_vue_type_style_index_0_scoped_c81d0427_lang-C62GAj1y.cjs} +1 -1
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_c81d0427_lang-DTtvCDfz.js → index.vue_vue_type_style_index_0_scoped_c81d0427_lang-CEVyTtSC.js} +9 -9
  63. package/dist/{login-CRSg2R6u.js → login-CA5LBy6E.js} +2 -2
  64. package/dist/{login-BEyTR2B-.cjs → login-CViEGqhb.cjs} +1 -1
  65. package/dist/{main-KZ_ESpJb.js → main-CUVDwLar.js} +5 -5
  66. package/dist/{main-DYdqysWL.cjs → main-CuPyTaKx.cjs} +1 -1
  67. package/dist/{menu-Clnb_mar.cjs → menu-CfFgYmpV.cjs} +1 -1
  68. package/dist/{menu-C0-tjFtV.js → menu-DznNubRA.js} +1 -1
  69. package/dist/{modelComp-w6fn45mn.cjs → modelComp-BR-oztFR.cjs} +1 -1
  70. package/dist/{modelComp-ulXkhiT8.js → modelComp-BuMlc62t.js} +1 -1
  71. package/dist/ss-component.cjs +1 -1
  72. package/dist/ss-component.css +3 -3
  73. package/dist/ss-component.js +10 -10
  74. package/dist/ss-component2.cjs +1 -1
  75. package/dist/ss-component2.js +10 -10
  76. package/dist/{threeModel-TwH55MhO.js → threeModel-CMj4sied.js} +3 -3
  77. package/dist/{threeModel-D4XEOs2e.cjs → threeModel-Dkxksn8L.cjs} +1 -1
  78. package/package.json +2 -2
  79. package/dist/index-CqHNjQcE.js +0 -4717
  80. package/dist/index-kfJONCM6.cjs +0 -1
  81. package/dist/obj/model.mtl +0 -42
  82. package/dist/obj/model.obj +0 -26110
  83. package/public/obj/model.mtl +0 -42
  84. package/public/obj/model.obj +0 -26110
@@ -1,26 +1,26 @@
1
1
  import { defineAsyncComponent as s } from "vue";
2
2
  import { S as g } from "./index-BHtNKL1L.js";
3
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CwuI0Ee7.js";
4
- import "./menu-C0-tjFtV.js";
5
- import "./index-BQbrejA1.js";
3
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BQgfwA0P.js";
4
+ import "./menu-DznNubRA.js";
5
+ import "./index-BCZ59Y4K.js";
6
6
  import l from "./ss-component2.js";
7
- const n = s(() => import("./main-KZ_ESpJb.js"));
7
+ const n = s(() => import("./main-CUVDwLar.js"));
8
8
  n.install = (o) => {
9
9
  o.component("ssComponent", n);
10
10
  };
11
- const t = s(() => import("./index-Rg7QR0ET.js").then((o) => o.m));
11
+ const t = s(() => import("./index-CjYmcl8U.js").then((o) => o.m));
12
12
  t.install = (o) => {
13
13
  o.component("ssTab", t);
14
14
  };
15
- const e = s(() => import("./index-A-taUOit.js"));
15
+ const e = s(() => import("./index-ChtHQFmB.js"));
16
16
  e.install = (o) => {
17
17
  o.component("ssMenu", e);
18
18
  };
19
- const m = s(() => import("./index-D_aaFuMD.js"));
19
+ const m = s(() => import("./index-LjCKAD2x.js"));
20
20
  m.install = (o) => {
21
21
  o.component("ssMenuComponent", m);
22
22
  };
23
- const r = s(() => import("./index-BHMtvveZ.js"));
23
+ const r = s(() => import("./index-BufGU2BU.js"));
24
24
  r.install = (o) => {
25
25
  o.component("ssCanvas", r);
26
26
  };
@@ -28,11 +28,11 @@ const p = s(() => import("./index-CZtXRS3l.js"));
28
28
  p.install = (o) => {
29
29
  o.component("ssFold", p);
30
30
  };
31
- const i = s(() => import("./index-3okZjs5B.js"));
31
+ const i = s(() => import("./index-B8ibXIR2.js"));
32
32
  i.install = (o) => {
33
33
  o.component("ssAvatar", i);
34
34
  };
35
- const c = s(() => import("./threeModel-TwH55MhO.js"));
35
+ const c = s(() => import("./threeModel-CMj4sied.js"));
36
36
  c.install = (o) => {
37
37
  o.component("ssThree", c);
38
38
  };
@@ -1 +1 @@
1
- "use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-BOJk-Uby.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-CO3hiJWF.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-Cmhvuxao.cjs")),children:[{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-BfpHmqEV.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-RFdUIF3u.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-BBSPbEbw.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-BgFmbRIH.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-YTgiRG5n.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-BaenyMCV.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-D1Z0idRA.cjs"))},{path:"priority",name:"Priority",component:async()=>Promise.resolve().then(()=>require("./index-D0QjuJev.cjs"))}]}],o=n.createRouter({history:n.createWebHashHistory(),routes:t});o.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=o;
1
+ "use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-DgPw8IAq.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-2ulWVy3d.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-YnHPocII.cjs")),children:[{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-kC3tMDYl.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-CYr6JfTw.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-BKlz7cS9.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-F0K1-Asd.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-CThTE4nC.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-BeHWA6-5.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-Dwq8e9ki.cjs"))},{path:"priority",name:"Priority",component:async()=>Promise.resolve().then(()=>require("./index-D0QjuJev.cjs"))}]}],o=n.createRouter({history:n.createWebHashHistory(),routes:t});o.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=o;
@@ -3,17 +3,17 @@ const a = [
3
3
  {
4
4
  path: "/tenant",
5
5
  name: "Tenant",
6
- component: async () => import("./index-BoR3liun.js")
6
+ component: async () => import("./index-Ct0CmWjo.js")
7
7
  },
8
8
  {
9
9
  path: "/login",
10
10
  name: "Login",
11
- component: async () => import("./index-DZUUfAXM.js")
11
+ component: async () => import("./index-CjWYNXJT.js")
12
12
  },
13
13
  {
14
14
  path: "/",
15
15
  name: "Model",
16
- component: async () => import("./index-Cr0ZkdxV.js"),
16
+ component: async () => import("./index-CQTl5wS0.js"),
17
17
  // component: async ()=>import('@/components/views/model/component/main.vue'),
18
18
  // component: async ()=>import('@/components/views/canvas/index.vue'),
19
19
  // component: async ()=>import('@/components/views/test/index.vue'),
@@ -21,37 +21,37 @@ const a = [
21
21
  {
22
22
  path: "平台管理/菜单管理",
23
23
  name: "Menu",
24
- component: async () => import("./index-DNcULVa1.js")
24
+ component: async () => import("./index-CRtV5WuL.js")
25
25
  },
26
26
  {
27
27
  path: "平台管理/主菜单管理",
28
28
  name: "MainMenu",
29
- component: async () => import("./index-DiasHZKs.js")
29
+ component: async () => import("./index-B_Flzztl.js")
30
30
  },
31
31
  {
32
32
  path: "系统管理/个人中心",
33
33
  name: "PersonalCenter",
34
- component: async () => import("./index-BByN6sng.js")
34
+ component: async () => import("./index-wNYNwwJM.js")
35
35
  },
36
36
  {
37
37
  path: "系统管理/职位管理",
38
38
  name: "Post",
39
- component: async () => import("./index-DU_gpFDl.js")
39
+ component: async () => import("./index-Cq4go058.js")
40
40
  },
41
41
  {
42
42
  path: "系统管理/用户管理",
43
43
  name: "User",
44
- component: async () => import("./index-BnRcpT_T.js")
44
+ component: async () => import("./index-gcJ4pdsy.js")
45
45
  },
46
46
  {
47
47
  path: "系统管理/角色管理",
48
48
  name: "Role",
49
- component: async () => import("./index-BY6icLE5.js")
49
+ component: async () => import("./index-OoPrBaU7.js")
50
50
  },
51
51
  {
52
52
  path: "系统管理/部门管理",
53
53
  name: "Dept",
54
- component: async () => import("./index-Cqa_rbSi.js")
54
+ component: async () => import("./index-DGiFskaY.js")
55
55
  },
56
56
  {
57
57
  path: "priority",
@@ -1,8 +1,8 @@
1
1
  import { ref as b, watch as Pe, createElementBlock as q, 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 qe, 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 be, S as Ze, C as We, P as Ke, W as Ne, d as Qe, A as et, e as tt, O as nt, M as Re, X as at, G as ot, h as Me, j as st, k as De, l as lt, D as ke, H as it, m as Ve, n as Oe, o as Ue, p as ze, E as _e, s as rt, q as de, r as ct, v as ut, T as dt, w as pt } from "./index-BxUQoC9Z.js";
2
+ import { V as M, B as be, S as Ze, C as We, P as Ke, W as Ne, d as Qe, A as et, e as tt, O as nt, M as Re, X as at, G as ot, h as Me, j as st, k as De, l as lt, D as ke, H as it, m as Ve, n as Oe, o as Ue, p as ze, E as _e, s as rt, q as de, r as ct, v as ut, T as dt, w as pt } from "./index-DUa3ddEk.js";
3
3
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import { c as Ge } from "./menu-C0-tjFtV.js";
5
- import { E as Ie } from "./index-BQbrejA1.js";
4
+ import { c as Ge } from "./menu-DznNubRA.js";
5
+ import { E as Ie } from "./index-BCZ59Y4K.js";
6
6
  function mt(E) {
7
7
  let f = null, r = null, c = null, v = null, w = null, k = null, i = null, A = null;
8
8
  const F = 1e3 / 30;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-D6Qn8t_Y.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),pe=require("./menu-Clnb_mar.cjs"),de=require("./index-BMiW54Gf.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 n.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=pe.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,ce=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/ce/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=pe.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 de.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):(de.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(),ue=new n.Matrix4;return ue.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(ue),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/ce,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>ce&&(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()},re=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{re(),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}},re=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:re,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-Db34Sg1u.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),pe=require("./menu-CfFgYmpV.cjs"),de=require("./index-2p69g4HY.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 n.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=pe.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,ce=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/ce/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=pe.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 de.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):(de.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(),ue=new n.Matrix4;return ue.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(ue),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/ce,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>ce&&(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()},re=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{re(),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}},re=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:re,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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ss-component-new",
3
3
  "private": false,
4
- "version": "1.1.694",
4
+ "version": "1.1.697",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -27,7 +27,7 @@
27
27
  "codemirror": "^6.0.2",
28
28
  "cropperjs": "^1.6.2",
29
29
  "dayjs": "^1.11.13",
30
- "docx-preview": "^0.3.5",
30
+ "docx-preview": "^0.3.6",
31
31
  "echarts": "^5.6.0",
32
32
  "element-plus": "^2.10.0",
33
33
  "fast-deep-equal": "^3.1.3",