ss-component-new 1.2.9 → 1.2.10

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 (85) hide show
  1. package/dist/{animationData-BQdcO65E.cjs → animationData-CZgXSZj6.cjs} +1 -1
  2. package/dist/{animationData-1jRSDcwE.js → animationData-_I5Ta9Mb.js} +3 -3
  3. package/dist/{array-BivICFct.js → array-CibDR1WD.js} +1 -1
  4. package/dist/{array-BI6c3lN7.cjs → array-CuhJ8NbH.cjs} +1 -1
  5. package/dist/{index-CXbvmuYZ.cjs → index--_dC4FBE.cjs} +1 -1
  6. package/dist/{index-DGE2awa5.js → index-0ud2Po_J.js} +1 -1
  7. package/dist/{index-D9wa1LMS.js → index-B-a5HS4_.js} +2 -2
  8. package/dist/{index-BzOBvH4x.cjs → index-B-tEg91u.cjs} +1 -1
  9. package/dist/{index-C9gh-jny.js → index-B3mDmf7s.js} +8 -8
  10. package/dist/{index-BxL4p0ej.cjs → index-BDGnm6c8.cjs} +1 -1
  11. package/dist/{index-pleSKUL2.cjs → index-BNkldtkn.cjs} +1 -1
  12. package/dist/{index-BkrJ0cBf.js → index-BVlthzKV.js} +2 -2
  13. package/dist/{index-B--6DX0M.js → index-Bju4088G.js} +1 -1
  14. package/dist/{index-Duqrg0DV.cjs → index-BtTZ3EU5.cjs} +1 -1
  15. package/dist/{index-BM6YLczV.js → index-BvCS9t_Y.js} +7 -7
  16. package/dist/{index-BDVOKqI5.js → index-BvLcKRn_.js} +5 -5
  17. package/dist/{index-CxbH4zmS.js → index-Bx3pGJI8.js} +1 -1
  18. package/dist/{index-Dy3FE211.cjs → index-CBZ52OZo.cjs} +1 -1
  19. package/dist/{index-C_MIoNOd.cjs → index-CDMtXN-6.cjs} +1 -1
  20. package/dist/{index-Djagy2ww.cjs → index-CIeESMCL.cjs} +1 -1
  21. package/dist/{index-1vs_3Pz3.cjs → index-CKw9V7SH.cjs} +1 -1
  22. package/dist/{index-CVfC3cyK.js → index-CR9tXV-b.js} +2 -2
  23. package/dist/{index-CA-edgmV.js → index-CSt381YJ.js} +1 -1
  24. package/dist/{index-CgtkRkQ3.js → index-CTQJw9gg.js} +1 -1
  25. package/dist/{index-DbisH6iI.cjs → index-CcZtXwBy.cjs} +1 -1
  26. package/dist/{index-lyUWApVE.js → index-CdBwsDHj.js} +3 -3
  27. package/dist/{index-L3WHrdzB.cjs → index-Ck-Pyzel.cjs} +1 -1
  28. package/dist/{index-Dcd9HZXq.js → index-Cw7EHgAH.js} +2 -2
  29. package/dist/{index-BQdJqnJf.cjs → index-Czne009c.cjs} +1 -1
  30. package/dist/{index-BxftyAcm.cjs → index-D2K5hwYt.cjs} +1 -1
  31. package/dist/{index-D732VV-0.js → index-D4Axp_O-.js} +2 -2
  32. package/dist/{index-BsPQl6nI.cjs → index-D5Ge7afE.cjs} +1 -1
  33. package/dist/{index-BaOQV1JK.cjs → index-DIiXHX3o.cjs} +1 -1
  34. package/dist/{index-DW7I4GY6.cjs → index-DPz8gNWB.cjs} +1 -1
  35. package/dist/{index-wpD5_HUA.cjs → index-DTEwonWc.cjs} +1 -1
  36. package/dist/{index-C2aGGJxk.cjs → index-DTx1lKjf.cjs} +1 -1
  37. package/dist/{index-y1YK6w8c.js → index-DZ1QNkXN.js} +5 -5
  38. package/dist/{index-DdFUblTC.cjs → index-DZCVaUOY.cjs} +1 -1
  39. package/dist/{index-BWECkG4C.js → index-DcK-QFLd.js} +5 -5
  40. package/dist/{index-BSa3xW1H.js → index-Dg_Riles.js} +2 -2
  41. package/dist/{index-CIv0zRrQ.cjs → index-Dh1Y0XF1.cjs} +1 -1
  42. package/dist/{index-Cyk0Tzhx.cjs → index-Dn1cF4a6.cjs} +1 -1
  43. package/dist/{index-Dfhvay-Y.js → index-Dzo3UK7P.js} +5 -5
  44. package/dist/{index-CQAvn30B.cjs → index-EDiWyCbT.cjs} +1 -1
  45. package/dist/{index-BBVbSXk-.cjs → index-Iq_U20xc.cjs} +1 -1
  46. package/dist/{index-LjRfbvxs.js → index-No8P9Ao2.js} +10 -10
  47. package/dist/{index-pkxiNiXI.js → index-bN9Uw0Q1.js} +2 -2
  48. package/dist/{index-cA_EynOM.js → index-dkJup9RS.js} +3 -3
  49. package/dist/{index-B1NmIRwn.js → index-gxTF9iU0.js} +2 -2
  50. package/dist/{index-fMxLuU_H.js → index-mUa2IQX2.js} +1 -1
  51. package/dist/{index-DNm5s2Lm.cjs → index-o4i99pOt.cjs} +1 -1
  52. package/dist/{index-DWfuOOVD.js → index-sDYlQpWf.js} +18 -18
  53. package/dist/{index-Ci_C9h8v.js → index-tBF9s086.js} +1 -1
  54. package/dist/{index-BFl4mw2K.cjs → index-tpadNrUw.cjs} +1 -1
  55. package/dist/{index-fzCcjoGJ.js → index-w5zmoNRw.js} +1 -1
  56. package/dist/{index-YMD55UlA.cjs → index-xeZL-vfA.cjs} +1 -1
  57. package/dist/{index-BlZXanJX.js → index-yIgyb0hz.js} +1 -1
  58. package/dist/{index-sS7-HQlI.cjs → index-yN-prski.cjs} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-hGi9c2Ju.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D_eQQ80N.cjs} +1 -1
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DkSoLqEi.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DupE6w_h.js} +1 -1
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-BfcynI3w.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-By1Hrwna.js} +5 -5
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-B5nxyyO7.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-xER5xJ0G.cjs} +1 -1
  63. package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-86_u8ovk.js → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-B1Qlnp33.js} +10 -10
  64. package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-dAkBFPF0.cjs → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CYe2Mod4.cjs} +1 -1
  65. package/dist/{index.vue_vue_type_style_index_1_lang-Bmq_QiXo.js → index.vue_vue_type_style_index_1_lang-B7DhfWIS.js} +2 -2
  66. package/dist/{index.vue_vue_type_style_index_1_lang-B_ESWhzz.cjs → index.vue_vue_type_style_index_1_lang-CQV0PEvz.cjs} +1 -1
  67. package/dist/{index.vue_vue_type_style_index_1_lang-Cb3WPLY1.cjs → index.vue_vue_type_style_index_1_lang-kn2HGYiz.cjs} +11 -11
  68. package/dist/{index.vue_vue_type_style_index_1_lang-Bl5IzVKi.js → index.vue_vue_type_style_index_1_lang-pV-HGjB2.js} +1337 -1337
  69. package/dist/{main-YbBj49yf.cjs → main-Ba0GCSQr.cjs} +1 -1
  70. package/dist/{main-CSTH0D6W.js → main-DFY6Z82x.js} +4 -4
  71. package/dist/ss-component.cjs +1 -1
  72. package/dist/ss-component.js +10 -10
  73. package/dist/ss-component2.cjs +1 -1
  74. package/dist/ss-component2.js +11 -11
  75. package/dist/{threeModel-Xb9BSJ_k.js → threeModel-BiLTPWZc.js} +2 -2
  76. package/dist/{threeModel-nbfSsMNt.cjs → threeModel-BlbCxxhC.cjs} +1 -1
  77. package/dist/{threeSceneView-JPxH8xcz.cjs → threeSceneView-Cj9A_P6F.cjs} +1 -1
  78. package/dist/{threeSceneView-BLWTfaec.js → threeSceneView-DG8GKpe0.js} +8 -8
  79. package/dist/{threeSceneViewForCPMPIP-CT63Js8f.cjs → threeSceneViewForCPMPIP-C9Ujac4S.cjs} +1 -1
  80. package/dist/{threeSceneViewForCPMPIP-skA3ZWC-.js → threeSceneViewForCPMPIP-XM1smwTG.js} +6 -6
  81. package/dist/{threeViewerHost-UHWY3q2v.cjs → threeViewerHost-BX4apXHF.cjs} +1 -1
  82. package/dist/{threeViewerHost-Enxz60zh.js → threeViewerHost-CPLLWPXa.js} +3 -3
  83. package/dist/{useRayCaster-CvOiIyjA.cjs → useRayCaster-D5RIG3dr.cjs} +1 -1
  84. package/dist/{useRayCaster-CQ61IQT5.js → useRayCaster-DmL8uPfl.js} +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index-L3WHrdzB.cjs"),i=require("./index-1z9RrjZc.cjs"),T=require("./index.vue_vue_type_style_index_1_lang-Cb3WPLY1.cjs"),Z=require("./index-BBVbSXk-.cjs"),G=require("./array-BI6c3lN7.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"}],s=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"LineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"}],v={key:0,class:"show-content"},ee={class:"item-view-group"},te={__name:"index",props:{content:String,jsonContents:Array},emits:["change"],setup(x,{emit:E}){const t=x,j=E,h=T.useModelComp(i.pinia),{itemData:_}=i.storeToRefs(h),p=e.ref([]),C=e.ref([]),I=c=>{j("change",{wholeValue:p.value,editValue:c})},S=c=>{const g=i.cloneDeep(p.value),B=g==null?void 0:g.map((d,b)=>(b===(c==null?void 0:c.index)&&(d.compData=c==null?void 0:c.contents),d));p.value=B};e.watch(()=>_.value,()=>{var c;!_.value||((c=_.value)==null?void 0:c.length)===0||(C.value=_.value,p.value=_.value)},{deep:!0,immediate:!0}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{var g;if(((g=t==null?void 0:t.jsonContents)==null?void 0:g.length)>0){h.setOriginalData(t==null?void 0:t.jsonContents),h.setItemData(t==null?void 0:t.jsonContents);return}if(!(t!=null&&t.content)||(t==null?void 0:t.content)==="")return;const c=G.expandStringToJson(t==null?void 0:t.content);h.setOriginalData(c),h.setItemData(c)},{deep:!0,immediate:!0});const w=c=>Z.getComponent(c);return(c,g)=>{var B;return((B=C.value)==null?void 0:B.length)>0?(e.openBlock(),e.createElementBlock("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:b},[e.createElementVNode("div",ee,e.toDisplayString(d.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w(d.comp)),{itemData:d==null?void 0:d.compData,childItemData:d==null?void 0:d.itemChildData,key:b,onChange:I,index:b,onContentChange:S},null,40,["itemData","childItemData","index"]))]))),128))])):e.createCommentVNode("",!0)}}},ne=K._export_sfc(te,[["__scopeId","data-v-1c04adc8"]]),oe={class:"add-model-content"},ae={key:0,class:"model-import-data"},re={class:"import-button"},le={key:0},ce={key:1,class:"model-operate"},se={class:"model-select"},ue={class:"model-fill"},ie={key:2,class:"model-view ssComponent"},de={__name:"main",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change"],setup(x,{emit:E}){const t=x,j=E,h=e.ref(""),_=e.ref([]),p=e.ref(0),C=T.useModelComp(i.pinia);T.useMenuState(i.pinia);const{itemData:I,originalData:S}=i.storeToRefs(C),w=e.ref(null),c=e.ref(0),g=e.ref(""),B=()=>{p.value=window.innerWidth},d=async r=>{var u;const a=(u=i.cloneDeep(r==null?void 0:r.wholeValue))==null?void 0:u.map(o=>{var f;return(o==null?void 0:o.comp)==="Form"&&(o.compData=(f=o.compData)==null?void 0:f.map(k=>((k==null?void 0:k.key)==="formContent"&&(k.contents=G.arrayToNumberArray(k==null?void 0:k.contents)),k))),o});j("change",{originalContents:S.value,currentContents:r==null?void 0:r.wholeValue,editContent:r==null?void 0:r.editValue,stringContent:b(i.cloneDeep(r==null?void 0:r.wholeValue)),arrayToContents:a})},b=r=>{var u;let a=[];return(u=i.cloneDeep(r))==null||u.forEach(o=>{var f,k;V!=null&&V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp))&&a.push(((f=V==null?void 0:V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp)))==null?void 0:f.key)+"="+o.name+"/r/n"),(k=o==null?void 0:o.compData)==null||k.forEach(n=>{var F,$,J,A,q,M,L,R,z,W,H,P;if(s!=null&&s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))if(!((F=n==null?void 0:n.contents)!=null&&F.length))a.push((($=s==null?void 0:s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))==null?void 0:$.key)+"="+(n.contents===!0?'""':"Vertical")+"/r/n");else{let m=(J=n==null?void 0:n.contents)==null?void 0:J[0];if(!m)return;if(Object.keys(m).includes("label")&&Object.keys(m).includes("key")&&Object.keys(m).includes("width"))if(((q=(A=n.contents)==null?void 0:A.filter(y=>y.width!==1))==null?void 0:q.length)===0){const y=(M=i.cloneDeep(n==null?void 0:n.contents))==null?void 0:M.map(l=>({[l.label]:l.value}));a.push(((L=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:L.key)+"="+JSON.stringify(y)+"/r/n")}else{let y=[];(R=i.cloneDeep(n==null?void 0:n.contents))==null||R.reduce((l,D)=>{var U;return l[D.label]=D.key,((U=Object.keys(i.cloneDeep(l)))==null?void 0:U.length)>=D.width&&(y.push(i.cloneDeep(l)),l={}),l},{}),a.push(((z=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:z.key)+"="+JSON.stringify(y)+"/r/n")}else if(Object.keys(m).includes("label")){const y=(W=i.cloneDeep(n==null?void 0:n.contents))==null?void 0:W.map(l=>l.label);a.push(((H=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:H.key)+"="+JSON.stringify(y)+"/r/n")}else a.push(((P=s==null?void 0:s.find(y=>(y==null?void 0:y.value)===(n==null?void 0:n.key)))==null?void 0:P.key)+"="+JSON.stringify(n==null?void 0:n.contents)+"/r/n")}})}),JSON.stringify(a)},N=e.ref([]),Q=()=>{w.value.click()},X=r=>{const a=r.target.files[0];if(!a)return;const u=new FileReader;u.onload=o=>{try{h.value=o.target.result,N.value=Y(o.target.result),c.value++}catch(f){console.error("解析失败:",f)}},u.onerror=o=>{console.error("文件读取错误:",o)},u.readAsText(a)};e.onMounted(()=>{window.addEventListener("resize",B)}),e.onUnmounted(()=>{window.removeEventListener("resize",B)}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{h.value=t==null?void 0:t.content,_.value=t==null?void 0:t.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>c.value,()=>{var r;((r=N.value)==null?void 0:r.length)!==0&&(C.setOriginalData(N.value),C.setItemData(N.value))},{deep:!0,immediate:!0});const Y=r=>{let a=r.replace(/,/g,",").replace(/;/g,";").replace(/:/g,":");a=a.replace(/(\w+)\s*:/g,"$1:"),a=a.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\t/g,"").replace(/\s+/g," ").trim(),a=a.replace(/,\s*([}\]])/g,"$1"),a=a.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g,": $2$4");try{return JSON.parse(a)}catch(u){try{const f=new Function(`return ${a}`)();if(Array.isArray(f)||typeof f=="object")return f;throw new Error(`解析结果不是有效的数组或对象: ${u}`)}catch(o){throw new Error(`无法解析JSON: ${o.message}`)}}};return(r,a)=>{var u;return e.openBlock(),e.createElementBlock("div",oe,[((u=t==null?void 0:t.jsonContents)==null?void 0:u.length)===0?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",re,[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:w,accept:".txt",onChange:X,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:Q,class:"import-button-content"},"导入文件"),g.value?(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",se,[e.createVNode(O.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:p.value},[e.createVNode(O.modelShow)])),e.createElementVNode("div",ue,[e.createVNode(O.modelFill)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="view"?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(ne,{content:h.value,onChange:d,jsonContents:_.value,key:p.value},null,8,["content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},me=K._export_sfc(de,[["__scopeId","data-v-91ce80be"]]);exports.default=me;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index-Ck-Pyzel.cjs"),i=require("./index-1z9RrjZc.cjs"),T=require("./index.vue_vue_type_style_index_1_lang-kn2HGYiz.cjs"),Z=require("./index-Iq_U20xc.cjs"),G=require("./array-CuhJ8NbH.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"}],s=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"LineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"}],v={key:0,class:"show-content"},ee={class:"item-view-group"},te={__name:"index",props:{content:String,jsonContents:Array},emits:["change"],setup(x,{emit:E}){const t=x,j=E,h=T.useModelComp(i.pinia),{itemData:_}=i.storeToRefs(h),p=e.ref([]),C=e.ref([]),I=c=>{j("change",{wholeValue:p.value,editValue:c})},S=c=>{const g=i.cloneDeep(p.value),B=g==null?void 0:g.map((d,b)=>(b===(c==null?void 0:c.index)&&(d.compData=c==null?void 0:c.contents),d));p.value=B};e.watch(()=>_.value,()=>{var c;!_.value||((c=_.value)==null?void 0:c.length)===0||(C.value=_.value,p.value=_.value)},{deep:!0,immediate:!0}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{var g;if(((g=t==null?void 0:t.jsonContents)==null?void 0:g.length)>0){h.setOriginalData(t==null?void 0:t.jsonContents),h.setItemData(t==null?void 0:t.jsonContents);return}if(!(t!=null&&t.content)||(t==null?void 0:t.content)==="")return;const c=G.expandStringToJson(t==null?void 0:t.content);h.setOriginalData(c),h.setItemData(c)},{deep:!0,immediate:!0});const w=c=>Z.getComponent(c);return(c,g)=>{var B;return((B=C.value)==null?void 0:B.length)>0?(e.openBlock(),e.createElementBlock("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:b},[e.createElementVNode("div",ee,e.toDisplayString(d.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w(d.comp)),{itemData:d==null?void 0:d.compData,childItemData:d==null?void 0:d.itemChildData,key:b,onChange:I,index:b,onContentChange:S},null,40,["itemData","childItemData","index"]))]))),128))])):e.createCommentVNode("",!0)}}},ne=K._export_sfc(te,[["__scopeId","data-v-1c04adc8"]]),oe={class:"add-model-content"},ae={key:0,class:"model-import-data"},re={class:"import-button"},le={key:0},ce={key:1,class:"model-operate"},se={class:"model-select"},ue={class:"model-fill"},ie={key:2,class:"model-view ssComponent"},de={__name:"main",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change"],setup(x,{emit:E}){const t=x,j=E,h=e.ref(""),_=e.ref([]),p=e.ref(0),C=T.useModelComp(i.pinia);T.useMenuState(i.pinia);const{itemData:I,originalData:S}=i.storeToRefs(C),w=e.ref(null),c=e.ref(0),g=e.ref(""),B=()=>{p.value=window.innerWidth},d=async r=>{var u;const a=(u=i.cloneDeep(r==null?void 0:r.wholeValue))==null?void 0:u.map(o=>{var f;return(o==null?void 0:o.comp)==="Form"&&(o.compData=(f=o.compData)==null?void 0:f.map(k=>((k==null?void 0:k.key)==="formContent"&&(k.contents=G.arrayToNumberArray(k==null?void 0:k.contents)),k))),o});j("change",{originalContents:S.value,currentContents:r==null?void 0:r.wholeValue,editContent:r==null?void 0:r.editValue,stringContent:b(i.cloneDeep(r==null?void 0:r.wholeValue)),arrayToContents:a})},b=r=>{var u;let a=[];return(u=i.cloneDeep(r))==null||u.forEach(o=>{var f,k;V!=null&&V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp))&&a.push(((f=V==null?void 0:V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp)))==null?void 0:f.key)+"="+o.name+"/r/n"),(k=o==null?void 0:o.compData)==null||k.forEach(n=>{var F,$,J,A,q,M,L,R,z,W,H,P;if(s!=null&&s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))if(!((F=n==null?void 0:n.contents)!=null&&F.length))a.push((($=s==null?void 0:s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))==null?void 0:$.key)+"="+(n.contents===!0?'""':"Vertical")+"/r/n");else{let m=(J=n==null?void 0:n.contents)==null?void 0:J[0];if(!m)return;if(Object.keys(m).includes("label")&&Object.keys(m).includes("key")&&Object.keys(m).includes("width"))if(((q=(A=n.contents)==null?void 0:A.filter(y=>y.width!==1))==null?void 0:q.length)===0){const y=(M=i.cloneDeep(n==null?void 0:n.contents))==null?void 0:M.map(l=>({[l.label]:l.value}));a.push(((L=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:L.key)+"="+JSON.stringify(y)+"/r/n")}else{let y=[];(R=i.cloneDeep(n==null?void 0:n.contents))==null||R.reduce((l,D)=>{var U;return l[D.label]=D.key,((U=Object.keys(i.cloneDeep(l)))==null?void 0:U.length)>=D.width&&(y.push(i.cloneDeep(l)),l={}),l},{}),a.push(((z=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:z.key)+"="+JSON.stringify(y)+"/r/n")}else if(Object.keys(m).includes("label")){const y=(W=i.cloneDeep(n==null?void 0:n.contents))==null?void 0:W.map(l=>l.label);a.push(((H=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:H.key)+"="+JSON.stringify(y)+"/r/n")}else a.push(((P=s==null?void 0:s.find(y=>(y==null?void 0:y.value)===(n==null?void 0:n.key)))==null?void 0:P.key)+"="+JSON.stringify(n==null?void 0:n.contents)+"/r/n")}})}),JSON.stringify(a)},N=e.ref([]),Q=()=>{w.value.click()},X=r=>{const a=r.target.files[0];if(!a)return;const u=new FileReader;u.onload=o=>{try{h.value=o.target.result,N.value=Y(o.target.result),c.value++}catch(f){console.error("解析失败:",f)}},u.onerror=o=>{console.error("文件读取错误:",o)},u.readAsText(a)};e.onMounted(()=>{window.addEventListener("resize",B)}),e.onUnmounted(()=>{window.removeEventListener("resize",B)}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{h.value=t==null?void 0:t.content,_.value=t==null?void 0:t.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>c.value,()=>{var r;((r=N.value)==null?void 0:r.length)!==0&&(C.setOriginalData(N.value),C.setItemData(N.value))},{deep:!0,immediate:!0});const Y=r=>{let a=r.replace(/,/g,",").replace(/;/g,";").replace(/:/g,":");a=a.replace(/(\w+)\s*:/g,"$1:"),a=a.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\t/g,"").replace(/\s+/g," ").trim(),a=a.replace(/,\s*([}\]])/g,"$1"),a=a.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g,": $2$4");try{return JSON.parse(a)}catch(u){try{const f=new Function(`return ${a}`)();if(Array.isArray(f)||typeof f=="object")return f;throw new Error(`解析结果不是有效的数组或对象: ${u}`)}catch(o){throw new Error(`无法解析JSON: ${o.message}`)}}};return(r,a)=>{var u;return e.openBlock(),e.createElementBlock("div",oe,[((u=t==null?void 0:t.jsonContents)==null?void 0:u.length)===0?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",re,[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:w,accept:".txt",onChange:X,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:Q,class:"import-button-content"},"导入文件"),g.value?(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",se,[e.createVNode(O.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:p.value},[e.createVNode(O.modelShow)])),e.createElementVNode("div",ue,[e.createVNode(O.modelFill)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="view"?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(ne,{content:h.value,onChange:d,jsonContents:_.value,key:p.value},null,8,["content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},me=K._export_sfc(de,[["__scopeId","data-v-91ce80be"]]);exports.default=me;
@@ -1,9 +1,9 @@
1
1
  import { ref as _, watch as V, createElementBlock as C, createCommentVNode as I, openBlock as f, Fragment as le, renderList as se, createElementVNode as O, createBlock as Z, toDisplayString as v, resolveDynamicComponent as ue, onMounted as ce, onUnmounted as ie, createVNode as A } from "vue";
2
- import { m as me, a as de, b as ye } from "./index-Dfhvay-Y.js";
2
+ import { m as me, a as de, b as ye } from "./index-Dzo3UK7P.js";
3
3
  import { p as E, s as ee, c as k } from "./index-DbzvXPKu.js";
4
- import { a as te, u as fe } from "./index.vue_vue_type_style_index_1_lang-Bl5IzVKi.js";
5
- import { g as ge } from "./index-C9gh-jny.js";
6
- import { e as he, a as ke } from "./array-BivICFct.js";
4
+ import { a as te, u as fe } from "./index.vue_vue_type_style_index_1_lang-pV-HGjB2.js";
5
+ import { g as ge } from "./index-B3mDmf7s.js";
6
+ import { e as he, a as ke } from "./array-CibDR1WD.js";
7
7
  import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const x = [
9
9
  {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),v=require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-hGi9c2Ju.cjs");const C=require("./index.vue_vue_type_style_index_1_lang-Cb3WPLY1.cjs");require("./index-1z9RrjZc.cjs");const s=require("./ss-component2.cjs"),t=require("./index-9hspBVrQ.cjs"),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-YbBj49yf.cjs")));r.install=e=>{e.component("ssComponent",r)};const i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Cyk0Tzhx.cjs")).then(e=>e.index$1));i.install=e=>{e.component("ssTab",i)};const c=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BsPQl6nI.cjs")));c.install=e=>{e.component("ssMenu",c)};const l=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-sS7-HQlI.cjs")));l.install=e=>{e.component("ssMenuComponent",l)};const m=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-CQAvn30B.cjs")));m.install=e=>{e.component("ssCanvas",m)};const u=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DEEZPcpU.cjs")));u.install=e=>{e.component("ssFold",u)};const a=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-C2aGGJxk.cjs")).then(e=>e.index));a.install=e=>{e.component("ssAvatar",a)};const h=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeModel-nbfSsMNt.cjs")));h.install=e=>{e.component("ssThree",h)};const f=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeViewerHost-UHWY3q2v.cjs")).then(e=>e.threeViewerHost));f.install=e=>{e.component("threeViewerHost",f)};const p=C.useMenuState(),P=[r,i,c,l,m,u,a,h,f],q=e=>{P.forEach(o=>{e.use(o)}),e.use(s),e.config.globalProperties.$router=s},g=e=>{switch(e){case"browser":return t.browserThemeConfig;case"client":return t.clientThemeConfig;case"three":return t.threeThemeConfig}},y=e=>{const o=document.documentElement;e==null||e.forEach(d=>{o.style.setProperty(d.name,d.value)})},A=e=>{p.setPlatform(e);const o=g(e);y(o)},T={getPlatform:p.getPlatform,setPlatform:p.setPlatform,initPlatform:A};exports.SvgIcon=v.SvgIcon;exports.router=s;exports.default=q;exports.platformApi=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),v=require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D_eQQ80N.cjs");const C=require("./index.vue_vue_type_style_index_1_lang-kn2HGYiz.cjs");require("./index-1z9RrjZc.cjs");const s=require("./ss-component2.cjs"),t=require("./index-9hspBVrQ.cjs"),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-Ba0GCSQr.cjs")));r.install=e=>{e.component("ssComponent",r)};const i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Dn1cF4a6.cjs")).then(e=>e.index$1));i.install=e=>{e.component("ssTab",i)};const c=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-D5Ge7afE.cjs")));c.install=e=>{e.component("ssMenu",c)};const l=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-yN-prski.cjs")));l.install=e=>{e.component("ssMenuComponent",l)};const m=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-EDiWyCbT.cjs")));m.install=e=>{e.component("ssCanvas",m)};const u=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DEEZPcpU.cjs")));u.install=e=>{e.component("ssFold",u)};const a=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DTx1lKjf.cjs")).then(e=>e.index));a.install=e=>{e.component("ssAvatar",a)};const h=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeModel-BlbCxxhC.cjs")));h.install=e=>{e.component("ssThree",h)};const f=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeViewerHost-BX4apXHF.cjs")).then(e=>e.threeViewerHost));f.install=e=>{e.component("threeViewerHost",f)};const p=C.useMenuState(),P=[r,i,c,l,m,u,a,h,f],q=e=>{P.forEach(o=>{e.use(o)}),e.use(s),e.config.globalProperties.$router=s},g=e=>{switch(e){case"browser":return t.browserThemeConfig;case"client":return t.clientThemeConfig;case"three":return t.threeThemeConfig}},y=e=>{const o=document.documentElement;e==null||e.forEach(d=>{o.style.setProperty(d.name,d.value)})},A=e=>{p.setPlatform(e);const o=g(e);y(o)},T={getPlatform:p.getPlatform,setPlatform:p.setPlatform,initPlatform:A};exports.SvgIcon=v.SvgIcon;exports.router=s;exports.default=q;exports.platformApi=T;
@@ -1,27 +1,27 @@
1
1
  import { defineAsyncComponent as o } from "vue";
2
2
  import { S as I } from "./index-BHtNKL1L.js";
3
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DkSoLqEi.js";
4
- import { u as C } from "./index.vue_vue_type_style_index_1_lang-Bl5IzVKi.js";
3
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DupE6w_h.js";
4
+ import { u as C } from "./index.vue_vue_type_style_index_1_lang-pV-HGjB2.js";
5
5
  import "./index-DbzvXPKu.js";
6
6
  import u from "./ss-component2.js";
7
7
  import { t as g, c as T, b as P } from "./index-C2usxP_Q.js";
8
- const n = o(() => import("./main-CSTH0D6W.js"));
8
+ const n = o(() => import("./main-DFY6Z82x.js"));
9
9
  n.install = (t) => {
10
10
  t.component("ssComponent", n);
11
11
  };
12
- const s = o(() => import("./index-BWECkG4C.js").then((t) => t.k));
12
+ const s = o(() => import("./index-DcK-QFLd.js").then((t) => t.k));
13
13
  s.install = (t) => {
14
14
  t.component("ssTab", s);
15
15
  };
16
- const r = o(() => import("./index-CgtkRkQ3.js"));
16
+ const r = o(() => import("./index-CTQJw9gg.js"));
17
17
  r.install = (t) => {
18
18
  t.component("ssMenu", r);
19
19
  };
20
- const m = o(() => import("./index-LjRfbvxs.js"));
20
+ const m = o(() => import("./index-No8P9Ao2.js"));
21
21
  m.install = (t) => {
22
22
  t.component("ssMenuComponent", m);
23
23
  };
24
- const i = o(() => import("./index-fMxLuU_H.js"));
24
+ const i = o(() => import("./index-mUa2IQX2.js"));
25
25
  i.install = (t) => {
26
26
  t.component("ssCanvas", i);
27
27
  };
@@ -29,15 +29,15 @@ const c = o(() => import("./index-DiRBJiMW.js"));
29
29
  c.install = (t) => {
30
30
  t.component("ssFold", c);
31
31
  };
32
- const a = o(() => import("./index-CxbH4zmS.js").then((t) => t.i));
32
+ const a = o(() => import("./index-Bx3pGJI8.js").then((t) => t.i));
33
33
  a.install = (t) => {
34
34
  t.component("ssAvatar", a);
35
35
  };
36
- const l = o(() => import("./threeModel-Xb9BSJ_k.js"));
36
+ const l = o(() => import("./threeModel-BiLTPWZc.js"));
37
37
  l.install = (t) => {
38
38
  t.component("ssThree", l);
39
39
  };
40
- const p = o(() => import("./threeViewerHost-Enxz60zh.js").then((t) => t.t));
40
+ const p = o(() => import("./threeViewerHost-CPLLWPXa.js").then((t) => t.t));
41
41
  p.install = (t) => {
42
42
  t.component("threeViewerHost", p);
43
43
  };
@@ -1 +1 @@
1
- "use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-CxnH4vfV.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-CXbvmuYZ.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-CIv0zRrQ.cjs")),children:[{path:"系统配置/站内信",name:"Message",component:async()=>Promise.resolve().then(()=>require("./index-DPIg2S6M.cjs"))},{path:"系统配置/自动生成",name:"Automatic",component:async()=>Promise.resolve().then(()=>require("./index-B2BAJXIH.cjs"))},{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-BxftyAcm.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-1vs_3Pz3.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-DNm5s2Lm.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-YMD55UlA.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-C_MIoNOd.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-DbisH6iI.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-DdFUblTC.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-pleSKUL2.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-Djagy2ww.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-CxnH4vfV.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index--_dC4FBE.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-Dh1Y0XF1.cjs")),children:[{path:"系统配置/站内信",name:"Message",component:async()=>Promise.resolve().then(()=>require("./index-DPIg2S6M.cjs"))},{path:"系统配置/自动生成",name:"Automatic",component:async()=>Promise.resolve().then(()=>require("./index-B2BAJXIH.cjs"))},{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-D2K5hwYt.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-CKw9V7SH.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-o4i99pOt.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-xeZL-vfA.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-CDMtXN-6.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-CcZtXwBy.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-DZCVaUOY.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-BNkldtkn.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-CIeESMCL.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;
@@ -8,12 +8,12 @@ const a = [
8
8
  {
9
9
  path: "/login",
10
10
  name: "Login",
11
- component: async () => import("./index-pkxiNiXI.js")
11
+ component: async () => import("./index-bN9Uw0Q1.js")
12
12
  },
13
13
  {
14
14
  path: "/",
15
15
  name: "Model",
16
- component: async () => import("./index-DWfuOOVD.js"),
16
+ component: async () => import("./index-sDYlQpWf.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'),
@@ -31,47 +31,47 @@ const a = [
31
31
  {
32
32
  path: "平台管理/菜单管理",
33
33
  name: "Menu",
34
- component: async () => import("./index-BDVOKqI5.js")
34
+ component: async () => import("./index-BvLcKRn_.js")
35
35
  },
36
36
  {
37
37
  path: "平台管理/主菜单管理",
38
38
  name: "MainMenu",
39
- component: async () => import("./index-BkrJ0cBf.js")
39
+ component: async () => import("./index-BVlthzKV.js")
40
40
  },
41
41
  {
42
42
  path: "系统管理/个人中心",
43
43
  name: "PersonalCenter",
44
- component: async () => import("./index-y1YK6w8c.js")
44
+ component: async () => import("./index-DZ1QNkXN.js")
45
45
  },
46
46
  {
47
47
  path: "系统管理/职位管理",
48
48
  name: "Post",
49
- component: async () => import("./index-BSa3xW1H.js")
49
+ component: async () => import("./index-Dg_Riles.js")
50
50
  },
51
51
  {
52
52
  path: "系统管理/用户管理",
53
53
  name: "User",
54
- component: async () => import("./index-Dcd9HZXq.js")
54
+ component: async () => import("./index-Cw7EHgAH.js")
55
55
  },
56
56
  {
57
57
  path: "系统管理/角色管理",
58
58
  name: "Role",
59
- component: async () => import("./index-D9wa1LMS.js")
59
+ component: async () => import("./index-B-a5HS4_.js")
60
60
  },
61
61
  {
62
62
  path: "系统管理/部门管理",
63
63
  name: "Dept",
64
- component: async () => import("./index-lyUWApVE.js")
64
+ component: async () => import("./index-CdBwsDHj.js")
65
65
  },
66
66
  {
67
67
  path: "系统维护/登录日志",
68
68
  name: "LoginLog",
69
- component: async () => import("./index-B1NmIRwn.js")
69
+ component: async () => import("./index-gxTF9iU0.js")
70
70
  },
71
71
  {
72
72
  path: "系统维护/操作日志",
73
73
  name: "OperateLog",
74
- component: async () => import("./index-D732VV-0.js")
74
+ component: async () => import("./index-D4Axp_O-.js")
75
75
  }
76
76
  // {
77
77
  // 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
2
  import { V as M, B as be, S as Ze, C as We, P as Ke, W as Ne, a as Qe, A as et, b as tt, M as Re, X as nt, G as at, c as Me, d as ot, e as De, f as st, D as ke, H as lt, g as Ve, h as Oe, i as Ue, j as ze, E as _e, k as de, l as it, m as rt, T as ct } from "./three-viewport-gizmo-CkQ98n-T.js";
3
3
  import { O as ut } from "./OrbitControls-C0QRmW6_.js";
4
- import { s as dt } from "./index-BM6YLczV.js";
5
- import { u as pt } from "./index.vue_vue_type_style_index_1_lang-Bmq_QiXo.js";
4
+ import { s as dt } from "./index-BvCS9t_Y.js";
5
+ import { u as pt } from "./index.vue_vue_type_style_index_1_lang-B7DhfWIS.js";
6
6
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  import { c as Ge, E as Ie } from "./index-DbzvXPKu.js";
8
8
  function mt(E) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./three-viewport-gizmo-BV37JzRa.cjs"),pe=require("./OrbitControls-Co_9huz0.cjs"),me=require("./index-DW7I4GY6.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-B_ESWhzz.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-1z9RrjZc.cjs");function ve(z){let h=null,u=null,d=null,g=null,x=null,P=null,c=null,E=null;const D=1e3/30;let S=0;const b=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(),C()},t=(m,l)=>{c&&(h.remove(c),c.dispose()),E&&(h.remove(E),E.geometry.dispose(),E.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});E=new n.Mesh(B,O),E.position.copy(l),E.position.z-=.01,E.receiveShadow=!0,h.add(E)},p=()=>{if(b.value.length===0)return;const m=new n.Box3;let l=!1;if(b.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)},C=()=>{P=requestAnimationFrame(C),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:b,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||b.value.length===0)return;const l=new n.Box3;let _=!1;if(b.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;b.value.forEach(l=>{h.remove(l),A(l)});const m=[];h.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==E&&m.push(l)}),m.forEach(l=>{h.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),E&&(E.geometry.dispose(),E.material.dispose()),d&&d.dispose(),g&&g.dispose(),x&&x.dispose()},updateGridForModels:p}}function he(z,h){const u=e.ref(!1);let d=null,g=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,E=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=E*1.2,C=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(C,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},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,C=Math.min(f/g,1);if(C>=1){k();return}const I=S(C);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},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(U=>{f.expandByObject(U)});const C=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),E=Math.max(C.x,C.y,C.z)*1.2;const I=new n.Vector3(c.x+E*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const U=Date.now()-$,Y=Math.min(U/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,b())};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(),C=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),U=D(J);t.position.lerpVectors(f,x,U),p.target.lerpVectors(C,P,U),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function ge(z,h){const u=e.ref(!1),d=e.ref("none");let g=[],x=[],P=new n.Box3,c=new n.Vector3;const E=()=>{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,C;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=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),C=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),C=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(C),A},S=()=>{if(b(),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(C=>{C.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{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?(E(),h.value.length>0&&F()):(d.value="none",b(),r())},updateClippingPlanes:S,clearClippingPlanes:b,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__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",ye,[(e.openBlock(),e.createBlock(me.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"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},Pe={class:"joint-left"},Ce={class:"joint-name"},Ee={class:"joint-range"},be={class:"joint-type"},_e={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},ae=.001,Re=1e3,ue=60,Fe={__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(),E=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;E.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 C=(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??C(s._jointType,!1),upper:s.limit.upper??C(s._jointType,!0)}:{lower:C(s._jointType,!1),upper:C(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 G=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(G),w.localZ.applyMatrix4(G)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const G=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=G*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},U=(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,E.value-s),w=[];w.push(new n.Vector3(0,0,0));const G=new n.Vector3(0,a*ae,0);a>0&&w.push(G);let T={pos:G.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))}),U(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,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.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,b.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(),b.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),U(-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",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(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",ke,[e.createElementVNode("div",Pe,[e.createElementVNode("span",Ce,e.toDisplayString(i.name),1),e.createElementVNode("span",Ee," ["+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",_e,[e.createElementVNode("div",ze,[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:G=>L(i.name,G.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-035ae936"]]),Le={class:"panel-content"},Ie="id",$e={__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},E=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)),b=e.computed(()=>u!=null&&u.model?E(u.model):[]);return e.watch(b,r=>{g.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:g.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ge=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,Oe)],6))],6))}}),N=oe._export_sfc(Ge,[["__scopeId","data-v-3150a90b"]]),Ue={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__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),E=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:C,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:U,stopAnimation:Y}=he(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=ge(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,E,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,G=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(G,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=>{b.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",C)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",C),J.value&&Y(),$()}),h({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var G,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",je,[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",qe,[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(U),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[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",He,[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:b.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:b.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(G=k.value)==null?void 0:G.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",Ze,[e.createElementVNode("div",We,[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(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[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",tt,[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",nt,[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",at,[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",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>b.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{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(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,b.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(E.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-7bc47bb3"]]);exports.default=rt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./three-viewport-gizmo-BV37JzRa.cjs"),pe=require("./OrbitControls-Co_9huz0.cjs"),me=require("./index-DPz8gNWB.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-CQV0PEvz.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-1z9RrjZc.cjs");function ve(z){let h=null,u=null,d=null,g=null,x=null,P=null,c=null,E=null;const D=1e3/30;let S=0;const b=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(),C()},t=(m,l)=>{c&&(h.remove(c),c.dispose()),E&&(h.remove(E),E.geometry.dispose(),E.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});E=new n.Mesh(B,O),E.position.copy(l),E.position.z-=.01,E.receiveShadow=!0,h.add(E)},p=()=>{if(b.value.length===0)return;const m=new n.Box3;let l=!1;if(b.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)},C=()=>{P=requestAnimationFrame(C),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:b,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||b.value.length===0)return;const l=new n.Box3;let _=!1;if(b.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;b.value.forEach(l=>{h.remove(l),A(l)});const m=[];h.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==E&&m.push(l)}),m.forEach(l=>{h.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),E&&(E.geometry.dispose(),E.material.dispose()),d&&d.dispose(),g&&g.dispose(),x&&x.dispose()},updateGridForModels:p}}function he(z,h){const u=e.ref(!1);let d=null,g=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,E=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=E*1.2,C=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(C,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},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,C=Math.min(f/g,1);if(C>=1){k();return}const I=S(C);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},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(U=>{f.expandByObject(U)});const C=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),E=Math.max(C.x,C.y,C.z)*1.2;const I=new n.Vector3(c.x+E*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const U=Date.now()-$,Y=Math.min(U/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,b())};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(),C=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),U=D(J);t.position.lerpVectors(f,x,U),p.target.lerpVectors(C,P,U),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function ge(z,h){const u=e.ref(!1),d=e.ref("none");let g=[],x=[],P=new n.Box3,c=new n.Vector3;const E=()=>{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,C;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=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),C=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),C=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(C),A},S=()=>{if(b(),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(C=>{C.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{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?(E(),h.value.length>0&&F()):(d.value="none",b(),r())},updateClippingPlanes:S,clearClippingPlanes:b,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__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",ye,[(e.openBlock(),e.createBlock(me.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"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},Pe={class:"joint-left"},Ce={class:"joint-name"},Ee={class:"joint-range"},be={class:"joint-type"},_e={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},ae=.001,Re=1e3,ue=60,Fe={__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(),E=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;E.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 C=(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??C(s._jointType,!1),upper:s.limit.upper??C(s._jointType,!0)}:{lower:C(s._jointType,!1),upper:C(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 G=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(G),w.localZ.applyMatrix4(G)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const G=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=G*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},U=(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,E.value-s),w=[];w.push(new n.Vector3(0,0,0));const G=new n.Vector3(0,a*ae,0);a>0&&w.push(G);let T={pos:G.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))}),U(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,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.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,b.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(),b.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),U(-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",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(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",ke,[e.createElementVNode("div",Pe,[e.createElementVNode("span",Ce,e.toDisplayString(i.name),1),e.createElementVNode("span",Ee," ["+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",_e,[e.createElementVNode("div",ze,[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:G=>L(i.name,G.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-035ae936"]]),Le={class:"panel-content"},Ie="id",$e={__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},E=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)),b=e.computed(()=>u!=null&&u.model?E(u.model):[]);return e.watch(b,r=>{g.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:g.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ge=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,Oe)],6))],6))}}),N=oe._export_sfc(Ge,[["__scopeId","data-v-3150a90b"]]),Ue={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__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),E=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:C,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:U,stopAnimation:Y}=he(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=ge(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,E,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,G=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(G,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=>{b.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",C)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",C),J.value&&Y(),$()}),h({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var G,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",je,[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",qe,[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(U),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[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",He,[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:b.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:b.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(G=k.value)==null?void 0:G.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",Ze,[e.createElementVNode("div",We,[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(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[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",tt,[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",nt,[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",at,[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",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>b.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{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(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,b.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(E.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-7bc47bb3"]]);exports.default=rt;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),K=require("./useRayCaster-CvOiIyjA.cjs"),R=require("./iconfont-t5epssvu.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-hGi9c2Ju.cjs");const F=require("./index-1z9RrjZc.cjs");require("./index.vue_vue_type_style_index_1_lang-Cb3WPLY1.cjs");require("./index-BpPyaNFa.cjs");const te=require("./index-BzOBvH4x.cjs");require("./index.vue_vue_type_style_index_1_lang-B_ESWhzz.cjs");const r=require("./three-viewport-gizmo-BV37JzRa.cjs");require("./index-BaOQV1JK.cjs");const ge=require("./animationData-BQdcO65E.cjs"),he=require("./index-Dy3FE211.cjs"),fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ve=require("./urdfTree-CCktg0FK.cjs"),W=.001,le=r.MathUtils.degToRad,be=new r.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:r.DoubleSide}),we=C=>C.reduce((b,E)=>{let s=0;const N=E.Y??0,k=E.C??0,v=E.R??0;return N>0&&(s+=N),k>0&&v>0&&(s+=v*le(k)),b+s},0),Ne=C=>{const b=[],E=C.Y??0,s=C.B??0,N=C.C??0,k=C.R??0,v={pos:new r.Vector3(0,0,0),localY:new r.Vector3(0,1,0),localX:new r.Vector3(1,0,0),localZ:new r.Vector3(0,0,1)};if(!E&&!N)return b;if(b.push(v.pos.clone()),s!==0){const x=new r.Matrix4().makeRotationAxis(v.localY,le(s));v.localX.applyMatrix4(x),v.localZ.applyMatrix4(x)}if(E>0&&(v.pos.add(v.localY.clone().multiplyScalar(E*W)),b.push(v.pos.clone())),N>0&&k>0){const x=le(N),S=k*W,c=v.pos.clone().add(v.localX.clone().multiplyScalar(-S)),i=Math.max(16,Math.ceil(N/5));for(let g=1;g<=i;g++){const l=x*g/i,h=new r.Matrix4().makeRotationAxis(v.localZ,l),V=v.localX.clone().multiplyScalar(S).applyMatrix4(h),f=c.clone().add(V);b.push(f)}}return b};function Ce(C,b){const E=new r.Group;E.name="CompletePipe";const s={pos:new r.Vector3(0,0,0),localX:new r.Vector3(1,0,0),localY:new r.Vector3(0,1,0),localZ:new r.Vector3(0,0,1)};let N=0,k=1;for(let v=0;v<C.length;v++){const x=C[v],S=x.Y??0,c=x.B??0,i=x.C??0,g=x.R??0;if(c!==0){const l=new r.Matrix4().makeRotationAxis(s.localY,le(c));s.localX.applyMatrix4(l),s.localZ.applyMatrix4(l)}if(S>0){const l=s.pos.clone();s.pos.add(s.localY.clone().multiplyScalar(S*W));const h=s.pos.clone(),a=Ee(l,h,b*W);a.userData={segmentType:"straight",segmentIndex:N,frameIndex:v,length:S,frame:{Y:S,B:c,C:i,R:g}},a.name=`直段_${N}`,E.add(a);const V=l.clone();_e(E,k,V,b*W),N++}if(i>0&&g>0){const l=le(i),h=g*W,a=[];a.push(s.pos.clone());const V=s.pos.clone().add(s.localX.clone().multiplyScalar(-h)),f=Math.max(16,Math.ceil(i/5));for(let M=1;M<=f;M++){const Y=l*M/f,P=new r.Matrix4().makeRotationAxis(s.localZ,Y),I=s.localX.clone().multiplyScalar(h).applyMatrix4(P),J=V.clone().add(I);a.push(J)}const _=xe(a,b*W);_.userData={segmentType:"bend",segmentIndex:N,frameIndex:v,angle:i,radius:g,centerPoint:V.toArray(),frame:{Y:S,B:c,C:i,R:g}},_.name=`弯段_${N}`,E.add(_),Math.floor(a.length/2),a[0],s.pos=a[a.length-1].clone();const m=new r.Matrix4().makeRotationAxis(s.localZ,l);s.localY.applyMatrix4(m),s.localX.applyMatrix4(m),N++,k++}}return E}function _e(C,b,E,s){const N=new r.Vector3(0,s*2,s*5),k=E.clone().add(N),v=[E,k],x=new r.BufferGeometry().setFromPoints(v),S=new r.LineDashedMaterial({color:16711680,dashSize:s*.5,gapSize:s*.3,linewidth:1}),c=new r.Line(x,S);c.computeLineDistances(),C.add(c);const i=document.createElement("canvas"),g=i.getContext("2d");i.width=128,i.height=128,g.clearRect(0,0,128,128),g.fillStyle="#FF0000",g.font="bold 80px Arial",g.textAlign="center",g.textBaseline="middle",g.fillText(b.toString(),64,64);const l=new r.CanvasTexture(i),h=new r.SpriteMaterial({map:l,transparent:!0,depthTest:!1,depthWrite:!1}),a=new r.Sprite(h),V=s*3;a.scale.set(V,V,1),a.position.copy(k),a.name=`Label_${b}`,a.userData={labelNumber:b},C.add(a)}function Ee(C,b,E){const s=new r.LineCurve3(C,b),N=new r.TubeGeometry(s,2,E,18,!1);return new r.Mesh(N,be)}function xe(C,b){const E=new r.CatmullRomCurve3(C,!1,"catmullrom",.01),s=new r.TubeGeometry(E,Math.max(16,C.length*2),b,18,!1);return new r.Mesh(s,be)}function se(C,b,E,s,N,k=0){let v=b.slice(0,N+1);const x=b[N+1];if(x&&k>0){const a={...x,B:(x.B??0)*k,C:(x.C??0)*k};v.push(a)}const S=we(v),c=Math.max(0,E-S),i=[];i.push(new r.Vector3(0,0,0));const g=new r.Vector3(0,c*W,0);c>0&&i.push(g);let l={pos:g.clone(),localY:new r.Vector3(0,1,0),localX:new r.Vector3(1,0,0),localZ:new r.Vector3(0,0,1)};const h=[];for(let a=v.length-1;a>=0;a--){const V=v[a],f=Ne(V);if(f.length>0){const _=f.map(P=>{const D=P.clone(),I=new r.Matrix4;return I.makeBasis(l.localX,l.localY,l.localZ),D.applyMatrix4(I),D.add(l.pos)});h.push(_);const m=_[_.length-1];l.pos=m.clone();const M=V.B??0,Y=V.C??0;if(M!==0){const P=new r.Matrix4().makeRotationAxis(l.localY,le(M));l.localX.applyMatrix4(P),l.localZ.applyMatrix4(P)}if(Y>0){const P=le(Y),D=new r.Matrix4().makeRotationAxis(l.localZ,P);l.localY.applyMatrix4(D),l.localX.applyMatrix4(D)}}}for(const a of h)a.length>1&&i.push(...a.slice(1));i.length<2&&i.push(new r.Vector3(0,.001,0));try{const a=new r.CatmullRomCurve3(i,!1,"catmullrom",.01),V=new r.TubeGeometry(a,Math.max(2,i.length*4),s*W,18,!1);C.geometry.dispose(),C.geometry=V}catch(a){console.error("管件更新失败",a)}}function ye(C,b,E,s=0){let N=C.slice(0,E+1);const k=C[E+1];if(k&&s>0){const l={...k,B:(k.B??0)*s,C:(k.C??0)*s};N.push(l)}const v=we(N),x=Math.max(0,b-v),S=[];S.push(new r.Vector3(0,0,0));const c=new r.Vector3(0,x*W,0);x>0&&S.push(c);let i={pos:c.clone(),localY:new r.Vector3(0,1,0),localX:new r.Vector3(1,0,0),localZ:new r.Vector3(0,0,1)};const g=[];for(let l=N.length-1;l>=0;l--){const h=N[l],a=Ne(h);if(a.length>0){const V=a.map(M=>{const Y=M.clone(),P=new r.Matrix4;return P.makeBasis(i.localX,i.localY,i.localZ),Y.applyMatrix4(P),Y.add(i.pos)});g.push(V);const f=V[V.length-1];i.pos=f.clone();const _=h.B??0,m=h.C??0;if(_!==0){const M=new r.Matrix4().makeRotationAxis(i.localY,le(_));i.localX.applyMatrix4(M),i.localZ.applyMatrix4(M)}if(m>0){const M=le(m),Y=new r.Matrix4().makeRotationAxis(i.localZ,M);i.localY.applyMatrix4(Y),i.localX.applyMatrix4(Y)}}}for(const l of g)l.length>1&&S.push(...l.slice(1));return S.length<2&&S.push(new r.Vector3(0,.001,0)),S}function ae(C,b,E,s,N,k,v,x=0,S=0){const c=N-S,i=ye(s,c,v,x);let l=ye(E,S,v,x);l.forEach(a=>a.y=-a.y),l.reverse();const h=[...l,...i];try{const a=new r.CatmullRomCurve3(h,!1,"catmullrom",.01),V=new r.TubeGeometry(a,Math.max(2,h.length*4),k*W,18,!1);b.geometry.dispose(),C.geometry.dispose(),b.parent&&b.parent.remove(b),C.geometry=V}catch(a){console.error("管件更新失败",a)}}const ke={class:"panel-content"},Me={class:"action-bar"},Se={key:0,class:"animation-controls"},Pe={class:"control-row"},De={class:"control-row"},Re={class:"control-row"},Te={class:"frame-info"},$e={class:"control-row"},Be={class:"progress-bar"},ze={class:"dialog-footer"},Ae=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(C,{expose:b,emit:E}){const s=C,N=E,k=e.ref(),v=e.ref(),x=e.ref("单机器人弯管");e.watch(()=>s.threeData,n=>{const o=n==null?void 0:n.data;x.value=o==null?void 0:o.任务类型},{immediate:!0});const S=async()=>{if(!sessionStorage.getItem("systemKey")){N("getThreeData");return}let o={};x.value===K.robotMode.SINGLE&&(o=await ge.fetchSingleRobotAnimationData()),x.value===K.robotMode.DOUBLE&&(o=await ge.fetchDoubleRobotAnimationData());const{initialPipeLength:u=0,pipeRadius:w=0,clampLength:p=0,animationData:B}=o;P.value=u,D.value=w,I.value=p,k.value=B;const A=F.cloneDeep(k.value);c.value=(A==null?void 0:A["输出(动画数据)"])||[];let j=(A==null?void 0:A["输出(动画数据)Content"])??[];j&&(v.value=j)},c=e.ref([]),i=e.ref(!1),g=e.ref(""),l=e.ref(!1),h=e.ref(0),a=e.ref(0),V=e.ref(1e3),f=e.ref(null);let _=!1;const m=e.shallowRef(null),M=e.shallowRef(null),Y=e.shallowRef(null),P=e.ref(1302),D=e.ref(12.5),I=e.ref(30),J=e.ref([]),$=e.ref(null),y=e.computed(()=>s.model?Object.values(s.model.joints).filter(n=>n.jointType!=="fixed").map(n=>n.name):[]),U=e.ref(["Y","B","C","R"]),L=e.computed(()=>[...y.value,...U.value]),X=e.computed(()=>L.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),K=require("./useRayCaster-D5RIG3dr.cjs"),R=require("./iconfont-t5epssvu.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D_eQQ80N.cjs");const F=require("./index-1z9RrjZc.cjs");require("./index.vue_vue_type_style_index_1_lang-kn2HGYiz.cjs");require("./index-BpPyaNFa.cjs");const te=require("./index-B-tEg91u.cjs");require("./index.vue_vue_type_style_index_1_lang-CQV0PEvz.cjs");const r=require("./three-viewport-gizmo-BV37JzRa.cjs");require("./index-DIiXHX3o.cjs");const ge=require("./animationData-CZgXSZj6.cjs"),he=require("./index-CBZ52OZo.cjs"),fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ve=require("./urdfTree-CCktg0FK.cjs"),W=.001,le=r.MathUtils.degToRad,be=new r.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:r.DoubleSide}),we=C=>C.reduce((b,E)=>{let s=0;const N=E.Y??0,k=E.C??0,v=E.R??0;return N>0&&(s+=N),k>0&&v>0&&(s+=v*le(k)),b+s},0),Ne=C=>{const b=[],E=C.Y??0,s=C.B??0,N=C.C??0,k=C.R??0,v={pos:new r.Vector3(0,0,0),localY:new r.Vector3(0,1,0),localX:new r.Vector3(1,0,0),localZ:new r.Vector3(0,0,1)};if(!E&&!N)return b;if(b.push(v.pos.clone()),s!==0){const x=new r.Matrix4().makeRotationAxis(v.localY,le(s));v.localX.applyMatrix4(x),v.localZ.applyMatrix4(x)}if(E>0&&(v.pos.add(v.localY.clone().multiplyScalar(E*W)),b.push(v.pos.clone())),N>0&&k>0){const x=le(N),S=k*W,c=v.pos.clone().add(v.localX.clone().multiplyScalar(-S)),i=Math.max(16,Math.ceil(N/5));for(let g=1;g<=i;g++){const l=x*g/i,h=new r.Matrix4().makeRotationAxis(v.localZ,l),V=v.localX.clone().multiplyScalar(S).applyMatrix4(h),f=c.clone().add(V);b.push(f)}}return b};function Ce(C,b){const E=new r.Group;E.name="CompletePipe";const s={pos:new r.Vector3(0,0,0),localX:new r.Vector3(1,0,0),localY:new r.Vector3(0,1,0),localZ:new r.Vector3(0,0,1)};let N=0,k=1;for(let v=0;v<C.length;v++){const x=C[v],S=x.Y??0,c=x.B??0,i=x.C??0,g=x.R??0;if(c!==0){const l=new r.Matrix4().makeRotationAxis(s.localY,le(c));s.localX.applyMatrix4(l),s.localZ.applyMatrix4(l)}if(S>0){const l=s.pos.clone();s.pos.add(s.localY.clone().multiplyScalar(S*W));const h=s.pos.clone(),a=Ee(l,h,b*W);a.userData={segmentType:"straight",segmentIndex:N,frameIndex:v,length:S,frame:{Y:S,B:c,C:i,R:g}},a.name=`直段_${N}`,E.add(a);const V=l.clone();_e(E,k,V,b*W),N++}if(i>0&&g>0){const l=le(i),h=g*W,a=[];a.push(s.pos.clone());const V=s.pos.clone().add(s.localX.clone().multiplyScalar(-h)),f=Math.max(16,Math.ceil(i/5));for(let M=1;M<=f;M++){const Y=l*M/f,P=new r.Matrix4().makeRotationAxis(s.localZ,Y),I=s.localX.clone().multiplyScalar(h).applyMatrix4(P),J=V.clone().add(I);a.push(J)}const _=xe(a,b*W);_.userData={segmentType:"bend",segmentIndex:N,frameIndex:v,angle:i,radius:g,centerPoint:V.toArray(),frame:{Y:S,B:c,C:i,R:g}},_.name=`弯段_${N}`,E.add(_),Math.floor(a.length/2),a[0],s.pos=a[a.length-1].clone();const m=new r.Matrix4().makeRotationAxis(s.localZ,l);s.localY.applyMatrix4(m),s.localX.applyMatrix4(m),N++,k++}}return E}function _e(C,b,E,s){const N=new r.Vector3(0,s*2,s*5),k=E.clone().add(N),v=[E,k],x=new r.BufferGeometry().setFromPoints(v),S=new r.LineDashedMaterial({color:16711680,dashSize:s*.5,gapSize:s*.3,linewidth:1}),c=new r.Line(x,S);c.computeLineDistances(),C.add(c);const i=document.createElement("canvas"),g=i.getContext("2d");i.width=128,i.height=128,g.clearRect(0,0,128,128),g.fillStyle="#FF0000",g.font="bold 80px Arial",g.textAlign="center",g.textBaseline="middle",g.fillText(b.toString(),64,64);const l=new r.CanvasTexture(i),h=new r.SpriteMaterial({map:l,transparent:!0,depthTest:!1,depthWrite:!1}),a=new r.Sprite(h),V=s*3;a.scale.set(V,V,1),a.position.copy(k),a.name=`Label_${b}`,a.userData={labelNumber:b},C.add(a)}function Ee(C,b,E){const s=new r.LineCurve3(C,b),N=new r.TubeGeometry(s,2,E,18,!1);return new r.Mesh(N,be)}function xe(C,b){const E=new r.CatmullRomCurve3(C,!1,"catmullrom",.01),s=new r.TubeGeometry(E,Math.max(16,C.length*2),b,18,!1);return new r.Mesh(s,be)}function se(C,b,E,s,N,k=0){let v=b.slice(0,N+1);const x=b[N+1];if(x&&k>0){const a={...x,B:(x.B??0)*k,C:(x.C??0)*k};v.push(a)}const S=we(v),c=Math.max(0,E-S),i=[];i.push(new r.Vector3(0,0,0));const g=new r.Vector3(0,c*W,0);c>0&&i.push(g);let l={pos:g.clone(),localY:new r.Vector3(0,1,0),localX:new r.Vector3(1,0,0),localZ:new r.Vector3(0,0,1)};const h=[];for(let a=v.length-1;a>=0;a--){const V=v[a],f=Ne(V);if(f.length>0){const _=f.map(P=>{const D=P.clone(),I=new r.Matrix4;return I.makeBasis(l.localX,l.localY,l.localZ),D.applyMatrix4(I),D.add(l.pos)});h.push(_);const m=_[_.length-1];l.pos=m.clone();const M=V.B??0,Y=V.C??0;if(M!==0){const P=new r.Matrix4().makeRotationAxis(l.localY,le(M));l.localX.applyMatrix4(P),l.localZ.applyMatrix4(P)}if(Y>0){const P=le(Y),D=new r.Matrix4().makeRotationAxis(l.localZ,P);l.localY.applyMatrix4(D),l.localX.applyMatrix4(D)}}}for(const a of h)a.length>1&&i.push(...a.slice(1));i.length<2&&i.push(new r.Vector3(0,.001,0));try{const a=new r.CatmullRomCurve3(i,!1,"catmullrom",.01),V=new r.TubeGeometry(a,Math.max(2,i.length*4),s*W,18,!1);C.geometry.dispose(),C.geometry=V}catch(a){console.error("管件更新失败",a)}}function ye(C,b,E,s=0){let N=C.slice(0,E+1);const k=C[E+1];if(k&&s>0){const l={...k,B:(k.B??0)*s,C:(k.C??0)*s};N.push(l)}const v=we(N),x=Math.max(0,b-v),S=[];S.push(new r.Vector3(0,0,0));const c=new r.Vector3(0,x*W,0);x>0&&S.push(c);let i={pos:c.clone(),localY:new r.Vector3(0,1,0),localX:new r.Vector3(1,0,0),localZ:new r.Vector3(0,0,1)};const g=[];for(let l=N.length-1;l>=0;l--){const h=N[l],a=Ne(h);if(a.length>0){const V=a.map(M=>{const Y=M.clone(),P=new r.Matrix4;return P.makeBasis(i.localX,i.localY,i.localZ),Y.applyMatrix4(P),Y.add(i.pos)});g.push(V);const f=V[V.length-1];i.pos=f.clone();const _=h.B??0,m=h.C??0;if(_!==0){const M=new r.Matrix4().makeRotationAxis(i.localY,le(_));i.localX.applyMatrix4(M),i.localZ.applyMatrix4(M)}if(m>0){const M=le(m),Y=new r.Matrix4().makeRotationAxis(i.localZ,M);i.localY.applyMatrix4(Y),i.localX.applyMatrix4(Y)}}}for(const l of g)l.length>1&&S.push(...l.slice(1));return S.length<2&&S.push(new r.Vector3(0,.001,0)),S}function ae(C,b,E,s,N,k,v,x=0,S=0){const c=N-S,i=ye(s,c,v,x);let l=ye(E,S,v,x);l.forEach(a=>a.y=-a.y),l.reverse();const h=[...l,...i];try{const a=new r.CatmullRomCurve3(h,!1,"catmullrom",.01),V=new r.TubeGeometry(a,Math.max(2,h.length*4),k*W,18,!1);b.geometry.dispose(),C.geometry.dispose(),b.parent&&b.parent.remove(b),C.geometry=V}catch(a){console.error("管件更新失败",a)}}const ke={class:"panel-content"},Me={class:"action-bar"},Se={key:0,class:"animation-controls"},Pe={class:"control-row"},De={class:"control-row"},Re={class:"control-row"},Te={class:"frame-info"},$e={class:"control-row"},Be={class:"progress-bar"},ze={class:"dialog-footer"},Ae=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(C,{expose:b,emit:E}){const s=C,N=E,k=e.ref(),v=e.ref(),x=e.ref("单机器人弯管");e.watch(()=>s.threeData,n=>{const o=n==null?void 0:n.data;x.value=o==null?void 0:o.任务类型},{immediate:!0});const S=async()=>{if(!sessionStorage.getItem("systemKey")){N("getThreeData");return}let o={};x.value===K.robotMode.SINGLE&&(o=await ge.fetchSingleRobotAnimationData()),x.value===K.robotMode.DOUBLE&&(o=await ge.fetchDoubleRobotAnimationData());const{initialPipeLength:u=0,pipeRadius:w=0,clampLength:p=0,animationData:B}=o;P.value=u,D.value=w,I.value=p,k.value=B;const A=F.cloneDeep(k.value);c.value=(A==null?void 0:A["输出(动画数据)"])||[];let j=(A==null?void 0:A["输出(动画数据)Content"])??[];j&&(v.value=j)},c=e.ref([]),i=e.ref(!1),g=e.ref(""),l=e.ref(!1),h=e.ref(0),a=e.ref(0),V=e.ref(1e3),f=e.ref(null);let _=!1;const m=e.shallowRef(null),M=e.shallowRef(null),Y=e.shallowRef(null),P=e.ref(1302),D=e.ref(12.5),I=e.ref(30),J=e.ref([]),$=e.ref(null),y=e.computed(()=>s.model?Object.values(s.model.joints).filter(n=>n.jointType!=="fixed").map(n=>n.name):[]),U=e.ref(["Y","B","C","R"]),L=e.computed(()=>[...y.value,...U.value]),X=e.computed(()=>L.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${L.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),H=(n,o)=>{if(!o)return null;const u=n.links[o];if(!u)return console.warn(`在模型中未找到名为 '${o}' 的 link`),console.log("可用的链接:",Object.keys(n.links)),null;let w=null;return u.traverse(p=>{p instanceof r.Mesh&&!w&&(w=p)}),w||console.warn(`在 link '${o}' 中未找到可用的 Mesh 对象`),w},Q=()=>{Y.value&&(Y.value.visible=!0),m.value&&m.value.parent&&m.value.parent.remove(m.value),Y.value=null,m.value=null,M.value=null};e.watch(L,(n,o)=>{if(JSON.stringify(n)!==JSON.stringify(o))if(n.length>0){const u=n.reduce((w,p)=>(w[p]="0",w),{});c.value=[u]}else c.value=[]},{immediate:!0}),e.watch(()=>s.model,n=>{Q(),n?(f.value=new K.URDFRobotController(n),J.value=Object.keys(n.links),J.value.includes("Pipe_Link")?$.value="Pipe_Link":$.value=null):(f.value=null,J.value=[],$.value=null)},{immediate:!0}),e.watch([$,I],([n,o])=>{if(Q(),s.model&&n){const u=H(s.model,n);if(console.log(u,"meshToReplace"),u&&u.parent){Y.value=u;const w=new r.Mesh(u.geometry.clone(),u.material);if(w.name="managed_pipe_clone",u.parent.add(w),w.position.copy(u.position),w.rotation.copy(u.rotation),w.scale.copy(u.scale),u.visible=!1,x.value===K.robotMode.SINGLE&&(w.position.y-=o*.001),m.value=w,x.value===K.robotMode.DOUBLE){const p=new r.Mesh(u.geometry.clone(),u.material);p.name="managed_oppsite_pipe_clone",p.position.copy(u.position),p.rotation.copy(u.rotation),p.scale.copy(u.scale),u.parent.add(p),M.value=p}m.value&&M.value&&ae(m.value,M.value,[],[],P.value,D.value,0,0,I.value)}else n&&console.warn(`在 link '${n}' 中未找到可替换的网格或其没有父级。`)}});const oe=()=>c.value.map(n=>({Y:parseFloat(n.Y)||0,B:parseFloat(n.B)||0,C:parseFloat(n.C)||0,R:parseFloat(n.R)||0})),q=()=>{const n=[],o=[];return c.value.forEach(u=>{const{Y1:w,B1:p,C1:B,R1:A,Y2:j,B2:G,C2:d,R2:t}=u;n.push({Y:parseFloat(w)||0,B:parseFloat(p)||0,C:parseFloat(B)||0,R:parseFloat(A)||0}),o.push({Y:parseFloat(j)||0,B:parseFloat(G)||0,C:parseFloat(d)||0,R:parseFloat(t)||0})}),{posPipeYbcr:n,negPipeYbcr:o}},z=n=>{if(n<0||n>=c.value.length){console.error(`帧索引 ${n} 超出范围`);return}const o=c.value[n];if(console.log(`应用第 ${n} 帧数据 ${o}`),h.value=n,f.value){const u={};y.value.forEach(w=>{const p=parseFloat(o[w]);isNaN(p)||(u[w]=p)}),f.value.setJointAngles(u)}if(m.value&&M.value){const u=q();console.log("ybcr数据:",u),ae(m.value,M.value,u.posPipeYbcr,u.negPipeYbcr,P.value,D.value,n,0,I.value);return}if(m.value){const u=oe();console.log("ybcr数据:",u),se(m.value,u,P.value,D.value,n,0);return}},ne=async()=>{if(c.value.length===0){F.ElMessage.error("无法播放动画:无数据");return}l.value=!0,_=!1;const n=m.value?oe():[];try{for(let o=h.value+1;o<c.value.length&&!_;o++){h.value=o;const u=c.value[o],w={};f.value&&y.value.forEach(p=>{const B=parseFloat(u[p]);isNaN(B)||(w[p]=B)}),f.value?await f.value.animateToState(w,V.value,p=>{if(a.value=(o+p)/c.value.length*100,m.value&&M.value){const B=q();console.log("ybcr数据:",n),ae(m.value,M.value,B.posPipeYbcr,B.negPipeYbcr,P.value,D.value,o-1,p,I.value)}else m.value&&se(m.value,n,P.value,D.value,o-1,p)}):m.value&&M.value?await new Promise(p=>{const B=performance.now();let A;const j=G=>{if(_){cancelAnimationFrame(A),p();return}const d=G-B,t=Math.min(d/V.value,1);a.value=(o+t)/c.value.length*100;const ee=q();ae(m.value,M.value,ee.posPipeYbcr,ee.negPipeYbcr,P.value,D.value,o-1,t,I.value),t<1?A=requestAnimationFrame(j):p()};A=requestAnimationFrame(j)}):m.value?await new Promise(p=>{const B=performance.now();let A;const j=G=>{if(_){cancelAnimationFrame(A),p();return}const d=G-B,t=Math.min(d/V.value,1);a.value=(o+t)/c.value.length*100,se(m.value,n,P.value,D.value,o-1,t),t<1?A=requestAnimationFrame(j):p()};A=requestAnimationFrame(j)}):(await new Promise(p=>setTimeout(p,V.value)),a.value=(o+1)/c.value.length*100)}_||F.ElMessage.success("动画播放完成")}catch(o){console.error("动画播放出错:",o),F.ElMessage.error("动画播放出错")}finally{l.value=!1,a.value=0}},T=()=>{_=!0,l.value=!1,a.value=0,F.ElMessage.info("动画已停止")},re=()=>{if(f.value&&f.value.resetToZero(),console.log("pipeMesh.value",m.value),m.value&&M.value){const n=q();ae(m.value,M.value,n.posPipeYbcr,n.negPipeYbcr,P.value,D.value,-1,0,I.value)}else if(m.value){const n=oe();se(m.value,n,P.value,D.value,-1,0)}h.value=0,F.ElMessage.success("机器人和管件已重置")},ie=()=>{console.log("当前管件Mesh:",m.value)},ce=n=>{l.value&&T(),z(n)},ue=()=>{l.value&&T(),!(h.value+1>=c.value.length)&&z(h.value+1)},de=()=>{l.value&&T(),h.value!==0&&z(h.value-1)},pe=async()=>{if(L.value.length===0){F.ElMessage.warning("没有可导出的表头");return}const n=L.value.join(" ");try{await navigator.clipboard.writeText(n),F.ElMessage.success("表头已成功复制到剪贴板!")}catch(o){console.error("复制失败:",o),F.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},me=()=>{if(!g.value.trim()){F.ElMessage.warning("导入内容不能为空");return}const n=g.value.trim().split(`
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as Le, ref as _, watch as de, shallowRef as he, computed as _e, onUnmounted as Ie, resolveComponent as J, createElementBlock as ge, openBlock as ee, createElementVNode as o, createCommentVNode as ve, createVNode as t, withCtx as A, createBlock as Ce, unref as F, Fragment as Je, renderList as Ne, toDisplayString as fe, onBeforeUnmount as Ee, createTextVNode as qe, onMounted as He, nextTick as We, withDirectives as oe, vShow as me, renderSlot as be, isRef as ke, vModelRadio as Pe } from "vue";
2
- import { U as Ke, r as xe, s as Ye, u as Qe, a as et, W as tt } from "./useRayCaster-CQ61IQT5.js";
2
+ import { U as Ke, r as xe, s as Ye, u as Qe, a as et, W as tt } from "./useRayCaster-DmL8uPfl.js";
3
3
  import { u as Oe, a as lt, b as ot, S as U } from "./iconfont-pt17sMx3.js";
4
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DkSoLqEi.js";
4
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DupE6w_h.js";
5
5
  import { R as at, c as nt, E as Z, a as st, aC as it, ak as rt } from "./index-DbzvXPKu.js";
6
- import "./index.vue_vue_type_style_index_1_lang-Bl5IzVKi.js";
6
+ import "./index.vue_vue_type_style_index_1_lang-pV-HGjB2.js";
7
7
  import "./index-BHtNKL1L.js";
8
- import { _ as ue, s as ut } from "./index-Ci_C9h8v.js";
9
- import "./index.vue_vue_type_style_index_1_lang-Bmq_QiXo.js";
8
+ import { _ as ue, s as ut } from "./index-tBF9s086.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-B7DhfWIS.js";
10
10
  import { m as Be, T as Me, V as X, k as ne, l as ct, n as pt, L as dt, e as we, o as mt, p as vt, q as ft, r as gt, s as ht, t as bt, u as yt, i as _t } from "./three-viewport-gizmo-CkQ98n-T.js";
11
- import "./index-BlZXanJX.js";
12
- import { f as wt, a as Ct } from "./animationData-1jRSDcwE.js";
13
- import { o as kt, p as Pt } from "./index-CA-edgmV.js";
11
+ import "./index-yIgyb0hz.js";
12
+ import { f as wt, a as Ct } from "./animationData-_I5Ta9Mb.js";
13
+ import { o as kt, p as Pt } from "./index-CSt381YJ.js";
14
14
  import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
15
  import { U as xt, J as Tt } from "./urdfTree-BuTtRGdl.js";
16
16
  const ae = 1e-3, ce = ct.degToRad, Xe = new mt({
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-1z9RrjZc.cjs"),Q=require("./index.vue_vue_type_style_index_1_lang-Cb3WPLY1.cjs"),R=require("./useRayCaster-CvOiIyjA.cjs"),m=require("./iconfont-t5epssvu.cjs"),ne=require("./index-BzOBvH4x.cjs");require("./index.vue_vue_type_style_index_1_lang-B_ESWhzz.cjs");const ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./urdfTree-CCktg0FK.cjs"),Be=require("./animationData-BQdcO65E.cjs"),Ue=require("./STLLoader-RU7KqloS.cjs"),Le=require("./index-BBVbSXk-.cjs"),Ae=require("./isUndefined-ClRzgwTy.cjs"),Oe=require("./three-viewport-gizmo-BV37JzRa.cjs"),Ie={class:"panel-content"},qe={class:"action-bar"},Fe={key:0,class:"animation-controls"},Ge={class:"control-row"},Je={class:"control-row"},He={class:"frame-info"},Xe={class:"control-row"},Ke={key:1,class:"empty-state"},We={class:"dialog-footer"},Ye=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(U,{expose:J}){const w=U,a=e.ref([]),D=e.ref(!1),$=e.ref(""),h=e.ref("stopped"),b=e.ref(0),T=e.ref(0),L=e.ref(10),N=e.ref(null);let f=0;const k=e.ref([]),M=e.computed(()=>w.model?Object.values(w.model.joints).filter(s=>s.jointType!=="fixed").map(s=>s.name):[]),j=e.computed(()=>[...M.value]),z=e.computed(()=>j.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-1z9RrjZc.cjs"),Q=require("./index.vue_vue_type_style_index_1_lang-kn2HGYiz.cjs"),R=require("./useRayCaster-D5RIG3dr.cjs"),m=require("./iconfont-t5epssvu.cjs"),ne=require("./index-B-tEg91u.cjs");require("./index.vue_vue_type_style_index_1_lang-CQV0PEvz.cjs");const ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./urdfTree-CCktg0FK.cjs"),Be=require("./animationData-CZgXSZj6.cjs"),Ue=require("./STLLoader-RU7KqloS.cjs"),Le=require("./index-Iq_U20xc.cjs"),Ae=require("./isUndefined-ClRzgwTy.cjs"),Oe=require("./three-viewport-gizmo-BV37JzRa.cjs"),Ie={class:"panel-content"},qe={class:"action-bar"},Fe={key:0,class:"animation-controls"},Ge={class:"control-row"},Je={class:"control-row"},He={class:"frame-info"},Xe={class:"control-row"},Ke={key:1,class:"empty-state"},We={class:"dialog-footer"},Ye=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(U,{expose:J}){const w=U,a=e.ref([]),D=e.ref(!1),$=e.ref(""),h=e.ref("stopped"),b=e.ref(0),T=e.ref(0),L=e.ref(10),N=e.ref(null);let f=0;const k=e.ref([]),M=e.computed(()=>w.model?Object.values(w.model.joints).filter(s=>s.jointType!=="fixed").map(s=>s.name):[]),j=e.computed(()=>[...M.value]),z=e.computed(()=>j.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${j.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),C=e.computed(()=>a.value[b.value]||{});e.watch(()=>w.model,s=>{s?(N.value=new R.URDFRobotController(s),k.value=Object.keys(s.links),b.value=0):(N.value=null,k.value=[])},{immediate:!0});const S=s=>{if(s<0||s>=a.value.length){console.error(`帧索引 ${s} 超出范围`);return}const l=a.value[s];if(N.value){const p={};M.value.forEach(d=>{const r=parseFloat(l[d]);isNaN(r)||(p[d]=r)}),N.value.setJointAngles(p)}b.value=s,T.value=a.value.length>1?s/(a.value.length-1)*100:100},H=async s=>{try{for(let l=b.value;l<a.value.length;l++){if(s!==f)return;const p=a.value[l],d={};if(N.value)M.value.forEach(r=>{const i=parseFloat(p[r]);isNaN(i)||(d[r]=i)}),await N.value.animateToState(d,L.value,r=>{s===f&&(T.value=(l+r)/a.value.length*100)});else{if(await new Promise(r=>setTimeout(r,L.value)),s!==f)return;T.value=(l+1)/a.value.length*100}b.value=l}s===f&&(u.ElMessage.success("动画播放完成"),h.value="stopped",T.value=100)}catch(l){console.error("动画播放出错:",l),u.ElMessage.error("动画播放出错"),h.value="stopped"}},X=()=>{if(a.value.length===0){u.ElMessage.error("无动画数据");return}h.value==="stopped"&&(b.value=0,S(0)),h.value="playing",f++,H(f),u.ElMessage.info("动画播放中")},K=()=>{h.value==="playing"&&(f++,h.value="paused",u.ElMessage.info("动画已暂停"))},A=()=>{f++,h.value="stopped",b.value=0,T.value=0,S(0),u.ElMessage.info("动画已停止并重置")},B=()=>{h.value==="playing"?K():X()},O=s=>{f++,h.value="paused",S(s)},W=()=>{if(!$.value.trim()){u.ElMessage.warning("导入内容不能为空");return}const s=$.value.trim().split(`
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as Ue, ref as u, computed as T, watch as H, onUnmounted as at, resolveComponent as K, createElementBlock as O, openBlock as z, createElementVNode as l, createCommentVNode as I, createVNode as i, toDisplayString as R, Fragment as nt, renderList as ot, withCtx as ne, inject as ve, shallowRef as pe, onMounted as st, nextTick as it, onBeforeUnmount as ut, withDirectives as x, vShow as F, renderSlot as ae, unref as c, createBlock as $e, isRef as me, vModelRadio as fe } from "vue";
2
2
  import { c as rt, E as y, p as be, s as ye, u as dt } from "./index-DbzvXPKu.js";
3
- import { k as ct, a as vt, u as pt, aG as mt } from "./index.vue_vue_type_style_index_1_lang-Bl5IzVKi.js";
4
- import { U as ft, s as ke, u as gt, a as ht, W as bt } from "./useRayCaster-CQ61IQT5.js";
3
+ import { k as ct, a as vt, u as pt, aG as mt } from "./index.vue_vue_type_style_index_1_lang-pV-HGjB2.js";
4
+ import { U as ft, s as ke, u as gt, a as ht, W as bt } from "./useRayCaster-DmL8uPfl.js";
5
5
  import { u as yt, a as kt, b as Pt, S as h } from "./iconfont-pt17sMx3.js";
6
- import { _ as Pe } from "./index-Ci_C9h8v.js";
7
- import "./index.vue_vue_type_style_index_1_lang-Bmq_QiXo.js";
6
+ import { _ as Pe } from "./index-tBF9s086.js";
7
+ import "./index.vue_vue_type_style_index_1_lang-B7DhfWIS.js";
8
8
  import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  import { U as Ct, J as wt } from "./urdfTree-BuTtRGdl.js";
10
- import { i as _t } from "./animationData-1jRSDcwE.js";
10
+ import { i as _t } from "./animationData-_I5Ta9Mb.js";
11
11
  import { O as xt } from "./STLLoader-CiUjaQtA.js";
12
- import { h as Tt } from "./index-C9gh-jny.js";
12
+ import { h as Tt } from "./index-B3mDmf7s.js";
13
13
  import { d as $t } from "./isUndefined-chfCDxUU.js";
14
14
  import { e as zt } from "./three-viewport-gizmo-CkQ98n-T.js";
15
15
  const Ut = { class: "panel-content" }, jt = { class: "action-bar" }, Vt = {
@@ -1 +1 @@
1
- "use strict";const t=require("vue"),m=require("./index-1z9RrjZc.cjs"),A=require("./index.vue_vue_type_style_index_1_lang-Cb3WPLY1.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-hGi9c2Ju.cjs");const L=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function O(l){const f=sessionStorage.getItem("loginToken")??"123456";return m.service({url:"/api/sysFile/uploadFile",method:"post",data:l,headers:{Authorization:f,"Content-Type":"multipart/form-data"}})}function B(l){const f=sessionStorage.getItem("loginToken")??"123456";return m.service({url:"/api/sysFile/downloadFile",method:"post",data:l,headers:{Authorization:f,Accept:"application/octet-stream"},responseType:"blob"})}function q(l){const f=sessionStorage.getItem("loginToken")??"123456";return m.service({url:"/api/sysFile/uploadFiles",method:"post",data:l,headers:{Authorization:f,"Content-Type":"multipart/form-data"}})}const I=m.defineStore("threeState",{state:()=>({data:{extension:"",url:[],data:{},isThreeScene:!0}}),actions:{setData(l){this.data=l},getData(){return this.data}}});function R(){const l=A.useMenuState(m.pinia),{platform:f}=m.storeToRefs(l),y=I(m.pinia),S=t.computed(()=>{var e;return(e=y==null?void 0:y.data)==null?void 0:e.extension}),d=["uv","cpt","cyd"],v=["urdf"],s=["obj","stl"],o=[...d,...v,...s],P=e=>{if(!E())throw new Error("不是三维系统");y.setData(e)},h=()=>y.getData(),E=()=>f.value==="three",u=e=>{const i=e==null?void 0:e.toLowerCase(),c=i==null?void 0:i.lastIndexOf(".");let T=i;return c>=0&&(T=T==null?void 0:T.slice(c+1)),T},w=e=>{if(!e)return!1;const i=u(e);return o==null?void 0:o.includes(i)};return{getData:h,setData:P,isThreeSystem:E,isUrdf:e=>{if(!e)return!1;const i=u(e);return v==null?void 0:v.includes(i)},isGeneralFile:e=>{if(!e)return!1;const i=u(e);return s==null?void 0:s.includes(i)},isTrackPathFile:e=>{if(!e)return!1;const i=u(e);return d==null?void 0:d.includes(i)},isThreeFile:w,isUseBackdrop:e=>E()&&w(e),initTrackFileType:e=>{if(!e)return{isCpt:!1,isCyd:!1,isUv:!1};const i=u(e),c=d==null?void 0:d.find(b=>b===i);return{isCpt:c==="cpt",isCyd:c==="cyd",isUv:c==="uv"}},getFileExtension:u,extraExtension:S}}const x={key:4,class:"loading"},z=t.defineComponent({__name:"threeViewerHost",props:{fileUrls:{default:()=>[]},host:{default:"inline"},extension:{},animationData:{default:()=>({})},width:{default:"100%"},height:{default:"100%"},threeData:{},componentType:{}},emits:["getThreeData"],setup(l,{emit:f}){const y=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-JPxH8xcz.cjs"))),S=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-C_mY_TBC.cjs"))),d=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeLatheView-CZdorls1.cjs"))),v=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-CT63Js8f.cjs"))),s={ROBOT_SCENE:"robot",LATHE_SCENE:"latheScene",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},o=l,P=A.useMenuState(m.pinia),{platName:h}=m.storeToRefs(P),{isGeneralFile:E,isUrdf:u,isTrackPathFile:w,extraExtension:g}=R(),F=t.computed(()=>(o==null?void 0:o.extension)||g.value),k=t.computed(()=>{var n,r;return(r=(n=o==null?void 0:o.threeData)==null?void 0:n.data)==null?void 0:r.trackFileType}),C=t.computed(()=>{var r;if(o.componentType)switch(o.componentType){case"robot":return s.ROBOT_SCENE;case"latheScene":return s.LATHE_SCENE;case"cpmpip":return s.CPMPIP_SCENE;case"preview":return s.PREVIEW}const n=(r=o==null?void 0:o.fileUrls)==null?void 0:r[0];return E(n)?s.PREVIEW:(h==null?void 0:h.value)==="CPMPIP"&&(u(n)||u(F.value))?s.CPMPIP_SCENE:(h==null?void 0:h.value)==="SFRTubeBend"&&(u(n)||u(F.value))?s.ROBOT_SCENE:w(F.value)&&k.value?s.LATHE_SCENE:s.PREVIEW}),D=f,e=t.ref([]),i=t.ref(!1);function c(n){try{const r=new URL(n).pathname,p=r.substring(r.lastIndexOf("/")+1);return decodeURIComponent(p)}catch(r){return console.error("无法解析URL以提取文件名:",n,r),"未知文件名"}}async function T(n){let r,p;if(/^https?:\/\//.test(n))try{const a=await fetch(n);if(!a.ok)throw new Error(`下载文件失败: ${a.statusText} (URL: ${n})`);r=await a.blob(),p=c(n)}catch(a){throw console.error("使用 fetch 下载文件时出错:",a),a}else try{const a=await B({url:n});if(a.status!==200)throw new Error(`下载失败: ${a.status}`);const _=a.headers["content-disposition"];p=b(_)||"无文件名",r=a.data}catch(a){throw console.error("通过 API 下载文件时出错:",a),a}return new File([r],p,{type:r.type})}function b(n){if(!n)return;const r=n.match(/filename\*\s*=\s*([^;]+)/i);if(r){let a=r[1].trim();a=a.replace(/^"(.*)"$/,"$1");const _=a.split("''");if(_.length===2){const H=_[0].toUpperCase(),U=_[1];try{if(H==="UTF-8")return decodeURIComponent(U)}catch{}return U}try{return decodeURIComponent(a)}catch{return a}}const p=n.match(/filename\s*=\s*("?)([^";]+)\1/i);if(p)return p[2].trim()}async function N(n){if(!n||!n.length){e.value=[];return}i.value=!0;try{const r=await Promise.all(n.map(p=>T(p)));e.value=r}catch(r){console.error("文件下载时发生错误:",r),e.value=[]}finally{i.value=!1}}const M=()=>{D("getThreeData")};return t.watch(()=>o.fileUrls,async n=>{await N(n??[])},{immediate:!0,deep:!0}),(n,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([o.host==="electron"?"mv-electron":"mv-inline","three-platform"])},[C.value===s.ROBOT_SCENE?(t.openBlock(),t.createBlock(t.unref(y),{key:0,"file-blobs":e.value,"animation-data":n.animationData,onGetThreeData:M,threeData:o.threeData},null,8,["file-blobs","animation-data","threeData"])):C.value===s.LATHE_SCENE?(t.openBlock(),t.createBlock(t.unref(d),{key:1,fileUrls:n.fileUrls,threeData:o.threeData,trackFileType:k.value},null,8,["fileUrls","threeData","trackFileType"])):C.value===s.CPMPIP_SCENE?(t.openBlock(),t.createBlock(t.unref(v),{key:2,"file-blobs":e.value,threeData:o.threeData},null,8,["file-blobs","threeData"])):C.value===s.PREVIEW?(t.openBlock(),t.createBlock(t.unref(S),{key:3,"file-blobs":e.value,"animation-data":n.animationData},null,8,["file-blobs","animation-data"])):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("div",x," 文件下载中,请稍候... ")):t.createCommentVNode("",!0)],2))}}),V=L._export_sfc(z,[["__scopeId","data-v-5e37b1fe"]]),W=Object.freeze(Object.defineProperty({__proto__:null,default:V},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=V;exports.downloadAvatarApi=B;exports.threeViewerHost=W;exports.uploadAmountApi=q;exports.uploadFile=O;exports.useThreeState=I;exports.useThreeSystem=R;
1
+ "use strict";const t=require("vue"),m=require("./index-1z9RrjZc.cjs"),A=require("./index.vue_vue_type_style_index_1_lang-kn2HGYiz.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D_eQQ80N.cjs");const L=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function O(l){const f=sessionStorage.getItem("loginToken")??"123456";return m.service({url:"/api/sysFile/uploadFile",method:"post",data:l,headers:{Authorization:f,"Content-Type":"multipart/form-data"}})}function B(l){const f=sessionStorage.getItem("loginToken")??"123456";return m.service({url:"/api/sysFile/downloadFile",method:"post",data:l,headers:{Authorization:f,Accept:"application/octet-stream"},responseType:"blob"})}function q(l){const f=sessionStorage.getItem("loginToken")??"123456";return m.service({url:"/api/sysFile/uploadFiles",method:"post",data:l,headers:{Authorization:f,"Content-Type":"multipart/form-data"}})}const I=m.defineStore("threeState",{state:()=>({data:{extension:"",url:[],data:{},isThreeScene:!0}}),actions:{setData(l){this.data=l},getData(){return this.data}}});function R(){const l=A.useMenuState(m.pinia),{platform:f}=m.storeToRefs(l),y=I(m.pinia),S=t.computed(()=>{var e;return(e=y==null?void 0:y.data)==null?void 0:e.extension}),d=["uv","cpt","cyd"],v=["urdf"],s=["obj","stl"],o=[...d,...v,...s],P=e=>{if(!E())throw new Error("不是三维系统");y.setData(e)},h=()=>y.getData(),E=()=>f.value==="three",u=e=>{const i=e==null?void 0:e.toLowerCase(),c=i==null?void 0:i.lastIndexOf(".");let T=i;return c>=0&&(T=T==null?void 0:T.slice(c+1)),T},w=e=>{if(!e)return!1;const i=u(e);return o==null?void 0:o.includes(i)};return{getData:h,setData:P,isThreeSystem:E,isUrdf:e=>{if(!e)return!1;const i=u(e);return v==null?void 0:v.includes(i)},isGeneralFile:e=>{if(!e)return!1;const i=u(e);return s==null?void 0:s.includes(i)},isTrackPathFile:e=>{if(!e)return!1;const i=u(e);return d==null?void 0:d.includes(i)},isThreeFile:w,isUseBackdrop:e=>E()&&w(e),initTrackFileType:e=>{if(!e)return{isCpt:!1,isCyd:!1,isUv:!1};const i=u(e),c=d==null?void 0:d.find(b=>b===i);return{isCpt:c==="cpt",isCyd:c==="cyd",isUv:c==="uv"}},getFileExtension:u,extraExtension:S}}const x={key:4,class:"loading"},z=t.defineComponent({__name:"threeViewerHost",props:{fileUrls:{default:()=>[]},host:{default:"inline"},extension:{},animationData:{default:()=>({})},width:{default:"100%"},height:{default:"100%"},threeData:{},componentType:{}},emits:["getThreeData"],setup(l,{emit:f}){const y=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-Cj9A_P6F.cjs"))),S=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-C_mY_TBC.cjs"))),d=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeLatheView-CZdorls1.cjs"))),v=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-C9Ujac4S.cjs"))),s={ROBOT_SCENE:"robot",LATHE_SCENE:"latheScene",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},o=l,P=A.useMenuState(m.pinia),{platName:h}=m.storeToRefs(P),{isGeneralFile:E,isUrdf:u,isTrackPathFile:w,extraExtension:g}=R(),F=t.computed(()=>(o==null?void 0:o.extension)||g.value),k=t.computed(()=>{var n,r;return(r=(n=o==null?void 0:o.threeData)==null?void 0:n.data)==null?void 0:r.trackFileType}),C=t.computed(()=>{var r;if(o.componentType)switch(o.componentType){case"robot":return s.ROBOT_SCENE;case"latheScene":return s.LATHE_SCENE;case"cpmpip":return s.CPMPIP_SCENE;case"preview":return s.PREVIEW}const n=(r=o==null?void 0:o.fileUrls)==null?void 0:r[0];return E(n)?s.PREVIEW:(h==null?void 0:h.value)==="CPMPIP"&&(u(n)||u(F.value))?s.CPMPIP_SCENE:(h==null?void 0:h.value)==="SFRTubeBend"&&(u(n)||u(F.value))?s.ROBOT_SCENE:w(F.value)&&k.value?s.LATHE_SCENE:s.PREVIEW}),D=f,e=t.ref([]),i=t.ref(!1);function c(n){try{const r=new URL(n).pathname,p=r.substring(r.lastIndexOf("/")+1);return decodeURIComponent(p)}catch(r){return console.error("无法解析URL以提取文件名:",n,r),"未知文件名"}}async function T(n){let r,p;if(/^https?:\/\//.test(n))try{const a=await fetch(n);if(!a.ok)throw new Error(`下载文件失败: ${a.statusText} (URL: ${n})`);r=await a.blob(),p=c(n)}catch(a){throw console.error("使用 fetch 下载文件时出错:",a),a}else try{const a=await B({url:n});if(a.status!==200)throw new Error(`下载失败: ${a.status}`);const _=a.headers["content-disposition"];p=b(_)||"无文件名",r=a.data}catch(a){throw console.error("通过 API 下载文件时出错:",a),a}return new File([r],p,{type:r.type})}function b(n){if(!n)return;const r=n.match(/filename\*\s*=\s*([^;]+)/i);if(r){let a=r[1].trim();a=a.replace(/^"(.*)"$/,"$1");const _=a.split("''");if(_.length===2){const H=_[0].toUpperCase(),U=_[1];try{if(H==="UTF-8")return decodeURIComponent(U)}catch{}return U}try{return decodeURIComponent(a)}catch{return a}}const p=n.match(/filename\s*=\s*("?)([^";]+)\1/i);if(p)return p[2].trim()}async function N(n){if(!n||!n.length){e.value=[];return}i.value=!0;try{const r=await Promise.all(n.map(p=>T(p)));e.value=r}catch(r){console.error("文件下载时发生错误:",r),e.value=[]}finally{i.value=!1}}const M=()=>{D("getThreeData")};return t.watch(()=>o.fileUrls,async n=>{await N(n??[])},{immediate:!0,deep:!0}),(n,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([o.host==="electron"?"mv-electron":"mv-inline","three-platform"])},[C.value===s.ROBOT_SCENE?(t.openBlock(),t.createBlock(t.unref(y),{key:0,"file-blobs":e.value,"animation-data":n.animationData,onGetThreeData:M,threeData:o.threeData},null,8,["file-blobs","animation-data","threeData"])):C.value===s.LATHE_SCENE?(t.openBlock(),t.createBlock(t.unref(d),{key:1,fileUrls:n.fileUrls,threeData:o.threeData,trackFileType:k.value},null,8,["fileUrls","threeData","trackFileType"])):C.value===s.CPMPIP_SCENE?(t.openBlock(),t.createBlock(t.unref(v),{key:2,"file-blobs":e.value,threeData:o.threeData},null,8,["file-blobs","threeData"])):C.value===s.PREVIEW?(t.openBlock(),t.createBlock(t.unref(S),{key:3,"file-blobs":e.value,"animation-data":n.animationData},null,8,["file-blobs","animation-data"])):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("div",x," 文件下载中,请稍候... ")):t.createCommentVNode("",!0)],2))}}),V=L._export_sfc(z,[["__scopeId","data-v-5e37b1fe"]]),W=Object.freeze(Object.defineProperty({__proto__:null,default:V},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=V;exports.downloadAvatarApi=B;exports.threeViewerHost=W;exports.uploadAmountApi=q;exports.uploadFile=O;exports.useThreeState=I;exports.useThreeSystem=R;
@@ -1,7 +1,7 @@
1
1
  import { computed as _, defineComponent as $, defineAsyncComponent as S, ref as M, watch as G, createElementBlock as B, openBlock as y, normalizeClass as j, createBlock as b, createCommentVNode as L, unref as P } from "vue";
2
2
  import { a as R, bY as Y, p as I, s as O } from "./index-DbzvXPKu.js";
3
- import { u as H } from "./index.vue_vue_type_style_index_1_lang-Bl5IzVKi.js";
4
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DkSoLqEi.js";
3
+ import { u as H } from "./index.vue_vue_type_style_index_1_lang-pV-HGjB2.js";
4
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DupE6w_h.js";
5
5
  import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  function se(c) {
7
7
  const f = sessionStorage.getItem("loginToken") ?? "123456";
@@ -137,7 +137,7 @@ const X = {
137
137
  },
138
138
  emits: ["getThreeData"],
139
139
  setup(c, { emit: f }) {
140
- const h = S(() => import("./threeSceneView-BLWTfaec.js")), g = S(() => import("./threePreview-CYX5wKoL.js")), p = S(() => import("./threeLatheView-BmVBnC8n.js")), T = S(() => import("./threeSceneViewForCPMPIP-skA3ZWC-.js")), o = {
140
+ const h = S(() => import("./threeSceneView-DG8GKpe0.js")), g = S(() => import("./threePreview-CYX5wKoL.js")), p = S(() => import("./threeLatheView-BmVBnC8n.js")), T = S(() => import("./threeSceneViewForCPMPIP-XM1smwTG.js")), o = {
141
141
  ROBOT_SCENE: "robot",
142
142
  // 机器人场景
143
143
  LATHE_SCENE: "latheScene",