ss-component-new 1.2.16 → 1.2.17

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 (83) hide show
  1. package/dist/{animationData-BWw4kCRg.js → animationData-Qb9CDU4l.js} +3 -3
  2. package/dist/{animationData-Gmqt1miw.cjs → animationData-xvLbS7TE.cjs} +1 -1
  3. package/dist/{array-BnEzUAqG.cjs → array-CAYNJHAO.cjs} +1 -1
  4. package/dist/{array-BzGprQMJ.js → array-DkjKZF8I.js} +1 -1
  5. package/dist/{index-VAoviGiD.js → index--cSKDs-m.js} +8 -8
  6. package/dist/{index-0yieO8oJ.js → index-00LBNRcE.js} +1 -1
  7. package/dist/{index-BN61mxV-.cjs → index-AmqN11m8.cjs} +1 -1
  8. package/dist/{index-DIVlMcU8.cjs → index-B2NWkIpp.cjs} +1 -1
  9. package/dist/{index-DMzjugA8.js → index-BGLsERtf.js} +5 -5
  10. package/dist/{index-i7c0i6cs.cjs → index-BLdyKmTu.cjs} +1 -1
  11. package/dist/{index-B775IA-h.js → index-BU242fNk.js} +2 -2
  12. package/dist/{index-D-aPtE2l.cjs → index-BZtXRbEZ.cjs} +1 -1
  13. package/dist/{index-Bog3Ps53.js → index-B_pmpVvZ.js} +2 -2
  14. package/dist/{index-DvS03o0x.js → index-BgbkehBL.js} +3 -3
  15. package/dist/{index-DE2PX8iP.cjs → index-Blj5w8sE.cjs} +1 -1
  16. package/dist/{index-Ol-nncQ8.js → index-Bp9hPbvn.js} +1 -1
  17. package/dist/{index-CcrmcbVW.cjs → index-Br3NE3cv.cjs} +1 -1
  18. package/dist/{index-DKqiOVYm.js → index-Bx7n6UDA.js} +2 -2
  19. package/dist/{index-MJGhXKrR.js → index-Bx9yQVlT.js} +1 -1
  20. package/dist/{index-0xuBTAzf.js → index-Byjao__A.js} +10 -10
  21. package/dist/{index-CO9tS7yE.cjs → index-C-imeITi.cjs} +1 -1
  22. package/dist/{index-Bxj1NF8c.js → index-C3pD8VjA.js} +1 -1
  23. package/dist/{index-CZs4OK7B.cjs → index-C8W8SOHQ.cjs} +1 -1
  24. package/dist/{index-Dw-oonRR.js → index-CBO4shBu.js} +3 -3
  25. package/dist/{index-DzKxXHO_.cjs → index-CSrtwaZ6.cjs} +1 -1
  26. package/dist/{index-BBp-QrUN.cjs → index-CTbiBChu.cjs} +1 -1
  27. package/dist/{index-Drtr5P6Z.js → index-CU44LzPf.js} +7 -7
  28. package/dist/{index-Dlqjb3Ae.js → index-CVHse7As.js} +2 -2
  29. package/dist/{index-45a8lajL.cjs → index-C__Dwz_q.cjs} +1 -1
  30. package/dist/{index-C0_dzZqi.cjs → index-ChL8bsns.cjs} +1 -1
  31. package/dist/{index-CgkhjQBg.js → index-Cki2sYVE.js} +5 -5
  32. package/dist/{index-B1VERzBW.cjs → index-ClK5MJAc.cjs} +1 -1
  33. package/dist/{index-Cdz24GlP.js → index-CpMQC4x1.js} +1 -1
  34. package/dist/{index-DjlNkAz3.js → index-D8_S-Iuf.js} +18 -18
  35. package/dist/{index-CQ2og4VS.cjs → index-DEwxTEA3.cjs} +1 -1
  36. package/dist/{index-CDVTwJO1.js → index-DNgeBOyL.js} +2 -2
  37. package/dist/{index-b0_Sdvtc.cjs → index-DORfWfLc.cjs} +1 -1
  38. package/dist/{index-DasYrMO9.js → index-DXPIuRqL.js} +2 -2
  39. package/dist/{index-BtktIcJr.js → index-DZ9voZQn.js} +5 -5
  40. package/dist/{index-CTMVMsEw.cjs → index-DZMLa6sl.cjs} +1 -1
  41. package/dist/{index-BWiorSLN.js → index-DbiyWVzT.js} +5 -5
  42. package/dist/{index-ClciGXhU.js → index-DbmOtV2k.js} +2 -2
  43. package/dist/{index-BF5O3SKN.cjs → index-Dg_l3ZIM.cjs} +1 -1
  44. package/dist/{index-DBS-llYZ.cjs → index-Dm9I-MGk.cjs} +1 -1
  45. package/dist/{index-c2Td0J53.js → index-DmYI7jW4.js} +1 -1
  46. package/dist/{index-ly9ku1Ig.cjs → index-DvEGoB_c.cjs} +1 -1
  47. package/dist/{index-C4KNN0N1.cjs → index-DwDRdcnb.cjs} +1 -1
  48. package/dist/{index-BSt5BRu5.js → index-DxQj6FZE.js} +1 -1
  49. package/dist/{index-B-78xMsr.cjs → index-HNf73U8z.cjs} +1 -1
  50. package/dist/{index-Cuw0COzP.cjs → index-JDMB7hc0.cjs} +1 -1
  51. package/dist/{index-Dtqc59Tk.js → index-JQmSnrnX.js} +1 -1
  52. package/dist/{index-N9O6PaDb.js → index-UMRAFAXe.js} +2 -2
  53. package/dist/{index-GPZD2ZHO.cjs → index-kJ1GNgTl.cjs} +1 -1
  54. package/dist/{index-Cc_TW4OE.cjs → index-lp8Qp4lU.cjs} +1 -1
  55. package/dist/{index-0s9a7Rpc.cjs → index-nldJ9Wpt.cjs} +1 -1
  56. package/dist/{index-CF9Y_2xa.cjs → index-snrR_lCj.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DDk9QivU.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-0YQ6oGXD.cjs} +1 -1
  58. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DM8to6QE.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CmdURFaC.js} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-CX2RbTN9.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-Bwe93Xrr.js} +5 -5
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-BbO6f96z.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-pzTuaxv5.cjs} +1 -1
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-Cg8Mjd8K.cjs → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-6VezR8np.cjs} +1 -1
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-BgGmA99m.js → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-q9M1UN39.js} +9 -9
  63. package/dist/{index.vue_vue_type_style_index_1_lang-D2WqwMCZ.cjs → index.vue_vue_type_style_index_1_lang-0RaoPzBs.cjs} +10 -10
  64. package/dist/{index.vue_vue_type_style_index_1_lang-CrPsDsEY.js → index.vue_vue_type_style_index_1_lang-BDQcys0d.js} +2 -2
  65. package/dist/{index.vue_vue_type_style_index_1_lang-CwoxJbwS.cjs → index.vue_vue_type_style_index_1_lang-Bc10b8Mi.cjs} +1 -1
  66. package/dist/{index.vue_vue_type_style_index_1_lang-CeaEXypd.js → index.vue_vue_type_style_index_1_lang-DtRssJWg.js} +879 -879
  67. package/dist/{main-DGXvSAML.cjs → main-BpF0-mlu.cjs} +1 -1
  68. package/dist/{main-Dg2tI2uw.js → main-D8Dh7CUS.js} +4 -4
  69. package/dist/ss-component.cjs +1 -1
  70. package/dist/ss-component.js +10 -10
  71. package/dist/ss-component2.cjs +1 -1
  72. package/dist/ss-component2.js +11 -11
  73. package/dist/{threeModel-wyboz8GN.js → threeModel-B6Q20_0g.js} +2 -2
  74. package/dist/{threeModel-DR5HOavd.cjs → threeModel-WXskZd6Q.cjs} +1 -1
  75. package/dist/{threeSceneView-9bR4B421.cjs → threeSceneView-BFcPTomD.cjs} +1 -1
  76. package/dist/{threeSceneView-BBp0_Tq3.js → threeSceneView-YnHu8FUZ.js} +7 -7
  77. package/dist/{threeSceneViewForCPMPIP-BYI3fXA6.cjs → threeSceneViewForCPMPIP-fG4x8LLj.cjs} +1 -1
  78. package/dist/{threeSceneViewForCPMPIP-pDy7SQVJ.js → threeSceneViewForCPMPIP-p2-Ce2xO.js} +6 -6
  79. package/dist/{threeViewerHost-6YyhGjjJ.js → threeViewerHost-CDEn7FfB.js} +3 -3
  80. package/dist/{threeViewerHost-kHhK4tIS.cjs → threeViewerHost-rcqedja4.cjs} +1 -1
  81. package/dist/{useRayCaster-DENUSa5k.js → useRayCaster-CJaAi3t4.js} +1 -1
  82. package/dist/{useRayCaster-BhV1gz97.cjs → useRayCaster-Cz13xqg3.cjs} +1 -1
  83. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index-Cc_TW4OE.cjs"),i=require("./index-1z9RrjZc.cjs"),T=require("./index.vue_vue_type_style_index_1_lang-D2WqwMCZ.cjs"),Z=require("./index-CZs4OK7B.cjs"),G=require("./array-BnEzUAqG.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-lp8Qp4lU.cjs"),i=require("./index-1z9RrjZc.cjs"),T=require("./index.vue_vue_type_style_index_1_lang-0RaoPzBs.cjs"),Z=require("./index-C8W8SOHQ.cjs"),G=require("./array-CAYNJHAO.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-CgkhjQBg.js";
2
+ import { m as me, a as de, b as ye } from "./index-Cki2sYVE.js";
3
3
  import { p as E, s as ee, c as k } from "./index-CYp77kPp.js";
4
- import { a as te, u as fe } from "./index.vue_vue_type_style_index_1_lang-CeaEXypd.js";
5
- import { g as ge } from "./index-VAoviGiD.js";
6
- import { e as he, a as ke } from "./array-BzGprQMJ.js";
4
+ import { a as te, u as fe } from "./index.vue_vue_type_style_index_1_lang-DtRssJWg.js";
5
+ import { g as ge } from "./index--cSKDs-m.js";
6
+ import { e as he, a as ke } from "./array-DkjKZF8I.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-DDk9QivU.cjs");const C=require("./index.vue_vue_type_style_index_1_lang-D2WqwMCZ.cjs");require("./index-1z9RrjZc.cjs");const s=require("./ss-component2.cjs"),t=require("./index-9hspBVrQ.cjs"),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-DGXvSAML.cjs")));r.install=e=>{e.component("ssComponent",r)};const i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-B-78xMsr.cjs")).then(e=>e.index$1));i.install=e=>{e.component("ssTab",i)};const c=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-0s9a7Rpc.cjs")));c.install=e=>{e.component("ssMenu",c)};const l=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-b0_Sdvtc.cjs")));l.install=e=>{e.component("ssMenuComponent",l)};const m=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-CQ2og4VS.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-DIVlMcU8.cjs")).then(e=>e.index));a.install=e=>{e.component("ssAvatar",a)};const h=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeModel-DR5HOavd.cjs")));h.install=e=>{e.component("ssThree",h)};const f=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeViewerHost-kHhK4tIS.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-0YQ6oGXD.cjs");const C=require("./index.vue_vue_type_style_index_1_lang-0RaoPzBs.cjs");require("./index-1z9RrjZc.cjs");const s=require("./ss-component2.cjs"),t=require("./index-9hspBVrQ.cjs"),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-BpF0-mlu.cjs")));r.install=e=>{e.component("ssComponent",r)};const i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-HNf73U8z.cjs")).then(e=>e.index$1));i.install=e=>{e.component("ssTab",i)};const c=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-nldJ9Wpt.cjs")));c.install=e=>{e.component("ssMenu",c)};const l=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DORfWfLc.cjs")));l.install=e=>{e.component("ssMenuComponent",l)};const m=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DEwxTEA3.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-B2NWkIpp.cjs")).then(e=>e.index));a.install=e=>{e.component("ssAvatar",a)};const h=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeModel-WXskZd6Q.cjs")));h.install=e=>{e.component("ssThree",h)};const f=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeViewerHost-rcqedja4.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-DM8to6QE.js";
4
- import { u as C } from "./index.vue_vue_type_style_index_1_lang-CeaEXypd.js";
3
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CmdURFaC.js";
4
+ import { u as C } from "./index.vue_vue_type_style_index_1_lang-DtRssJWg.js";
5
5
  import "./index-CYp77kPp.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-Dg2tI2uw.js"));
8
+ const n = o(() => import("./main-D8Dh7CUS.js"));
9
9
  n.install = (t) => {
10
10
  t.component("ssComponent", n);
11
11
  };
12
- const s = o(() => import("./index-BtktIcJr.js").then((t) => t.k));
12
+ const s = o(() => import("./index-DZ9voZQn.js").then((t) => t.k));
13
13
  s.install = (t) => {
14
14
  t.component("ssTab", s);
15
15
  };
16
- const r = o(() => import("./index-Dtqc59Tk.js"));
16
+ const r = o(() => import("./index-JQmSnrnX.js"));
17
17
  r.install = (t) => {
18
18
  t.component("ssMenu", r);
19
19
  };
20
- const m = o(() => import("./index-0xuBTAzf.js"));
20
+ const m = o(() => import("./index-Byjao__A.js"));
21
21
  m.install = (t) => {
22
22
  t.component("ssMenuComponent", m);
23
23
  };
24
- const i = o(() => import("./index-BSt5BRu5.js"));
24
+ const i = o(() => import("./index-DxQj6FZE.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-MJGhXKrR.js").then((t) => t.i));
32
+ const a = o(() => import("./index-Bx9yQVlT.js").then((t) => t.i));
33
33
  a.install = (t) => {
34
34
  t.component("ssAvatar", a);
35
35
  };
36
- const l = o(() => import("./threeModel-wyboz8GN.js"));
36
+ const l = o(() => import("./threeModel-B6Q20_0g.js"));
37
37
  l.install = (t) => {
38
38
  t.component("ssThree", l);
39
39
  };
40
- const p = o(() => import("./threeViewerHost-6YyhGjjJ.js").then((t) => t.t));
40
+ const p = o(() => import("./threeViewerHost-CDEn7FfB.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-CcrmcbVW.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-DzKxXHO_.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-BBp-QrUN.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-C4KNN0N1.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-BN61mxV-.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-GPZD2ZHO.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-ly9ku1Ig.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-B1VERzBW.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-CTMVMsEw.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-i7c0i6cs.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-CF9Y_2xa.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-Br3NE3cv.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-CSrtwaZ6.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-CTbiBChu.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-DwDRdcnb.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-AmqN11m8.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-kJ1GNgTl.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-DvEGoB_c.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-ClK5MJAc.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-DZMLa6sl.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-BLdyKmTu.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-snrR_lCj.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-DKqiOVYm.js")
11
+ component: async () => import("./index-Bx7n6UDA.js")
12
12
  },
13
13
  {
14
14
  path: "/",
15
15
  name: "Model",
16
- component: async () => import("./index-DjlNkAz3.js"),
16
+ component: async () => import("./index-D8_S-Iuf.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-BWiorSLN.js")
34
+ component: async () => import("./index-DbiyWVzT.js")
35
35
  },
36
36
  {
37
37
  path: "平台管理/主菜单管理",
38
38
  name: "MainMenu",
39
- component: async () => import("./index-ClciGXhU.js")
39
+ component: async () => import("./index-DbmOtV2k.js")
40
40
  },
41
41
  {
42
42
  path: "系统管理/个人中心",
43
43
  name: "PersonalCenter",
44
- component: async () => import("./index-DMzjugA8.js")
44
+ component: async () => import("./index-BGLsERtf.js")
45
45
  },
46
46
  {
47
47
  path: "系统管理/职位管理",
48
48
  name: "Post",
49
- component: async () => import("./index-Dlqjb3Ae.js")
49
+ component: async () => import("./index-CVHse7As.js")
50
50
  },
51
51
  {
52
52
  path: "系统管理/用户管理",
53
53
  name: "User",
54
- component: async () => import("./index-Bog3Ps53.js")
54
+ component: async () => import("./index-B_pmpVvZ.js")
55
55
  },
56
56
  {
57
57
  path: "系统管理/角色管理",
58
58
  name: "Role",
59
- component: async () => import("./index-B775IA-h.js")
59
+ component: async () => import("./index-BU242fNk.js")
60
60
  },
61
61
  {
62
62
  path: "系统管理/部门管理",
63
63
  name: "Dept",
64
- component: async () => import("./index-DvS03o0x.js")
64
+ component: async () => import("./index-BgbkehBL.js")
65
65
  },
66
66
  {
67
67
  path: "系统维护/登录日志",
68
68
  name: "LoginLog",
69
- component: async () => import("./index-CDVTwJO1.js")
69
+ component: async () => import("./index-DNgeBOyL.js")
70
70
  },
71
71
  {
72
72
  path: "系统维护/操作日志",
73
73
  name: "OperateLog",
74
- component: async () => import("./index-DasYrMO9.js")
74
+ component: async () => import("./index-DXPIuRqL.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-Drtr5P6Z.js";
5
- import { u as pt } from "./index.vue_vue_type_style_index_1_lang-CrPsDsEY.js";
4
+ import { s as dt } from "./index-CU44LzPf.js";
5
+ import { u as pt } from "./index.vue_vue_type_style_index_1_lang-BDQcys0d.js";
6
6
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  import { c as Ge, E as Ie } from "./index-CYp77kPp.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-DBS-llYZ.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-CwoxJbwS.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-Dm9I-MGk.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-Bc10b8Mi.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"),J=require("./useRayCaster-BhV1gz97.cjs"),S=require("./iconfont-t5epssvu.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DDk9QivU.cjs");const T=require("./index-1z9RrjZc.cjs");require("./index.vue_vue_type_style_index_1_lang-D2WqwMCZ.cjs");require("./index-BpPyaNFa.cjs");const te=require("./index-D-aPtE2l.cjs");require("./index.vue_vue_type_style_index_1_lang-CwoxJbwS.cjs");const a=require("./three-viewport-gizmo-BV37JzRa.cjs");require("./index-BF5O3SKN.cjs");const Ne=require("./animationData-Gmqt1miw.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=require("./urdfTree-CCktg0FK.cjs"),q=.001,oe=a.MathUtils.degToRad,Ce=new a.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:a.DoubleSide});function Re(V=.005,v=64){const w=new a.CatmullRomCurve3([new a.Vector3(0,0,0),new a.Vector3(0,0,0)]),s=new a.TubeGeometry(w,v,V,16,!1),h=Ce;return new a.Mesh(s,h)}const Se=V=>V.reduce((v,w)=>{let s=0;const h=w.Y??0,E=w.C??0,d=w.R??0;return h>0&&(s+=h),E>0&&d>0&&(s+=d*oe(E)),v+s},0),ke=V=>{const v=[],w=V.Y??0,s=V.B??0,h=V.C??0,E=V.R??0,d={pos:new a.Vector3(0,0,0),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};if(!w&&!h)return v;if(v.push(d.pos.clone()),s!==0){const _=new a.Matrix4().makeRotationAxis(d.localY,oe(s));d.localX.applyMatrix4(_),d.localZ.applyMatrix4(_)}if(w>0&&(d.pos.add(d.localY.clone().multiplyScalar(w*q)),v.push(d.pos.clone())),h>0&&E>0){const _=oe(h),x=E*q,u=d.pos.clone().add(d.localX.clone().multiplyScalar(-x)),i=Math.max(16,Math.ceil(h/5));for(let f=1;f<=i;f++){const l=_*f/i,p=new a.Matrix4().makeRotationAxis(d.localZ,l),y=d.localX.clone().multiplyScalar(x).applyMatrix4(p),C=u.clone().add(y);v.push(C)}}return v};function De(V,v){const w=new a.Group;w.name="CompletePipe";const s={pos:new a.Vector3(0,0,0),localX:new a.Vector3(1,0,0),localY:new a.Vector3(0,1,0),localZ:new a.Vector3(0,0,1)};let h=0,E=1;for(let d=0;d<V.length;d++){const _=V[d],x=_.Y??0,u=_.B??0,i=_.C??0,f=_.R??0;if(u!==0){const l=new a.Matrix4().makeRotationAxis(s.localY,oe(u));s.localX.applyMatrix4(l),s.localZ.applyMatrix4(l)}if(x>0){const l=s.pos.clone();s.pos.add(s.localY.clone().multiplyScalar(x*q));const p=s.pos.clone(),c=Te(l,p,v*q);c.userData={segmentType:"straight",segmentIndex:h,frameIndex:d,length:x,frame:{Y:x,B:u,C:i,R:f}},c.name=`直段_${h}`,w.add(c);const y=l.clone();Pe(w,E,y,v*q),h++}if(i>0&&f>0){const l=oe(i),p=f*q,c=[];c.push(s.pos.clone());const y=s.pos.clone().add(s.localX.clone().multiplyScalar(-p)),C=Math.max(16,Math.ceil(i/5));for(let R=1;R<=C;R++){const F=l*R/C,k=new a.Matrix4().makeRotationAxis(s.localZ,F),L=s.localX.clone().multiplyScalar(p).applyMatrix4(k),W=y.clone().add(L);c.push(W)}const b=$e(c,v*q);b.userData={segmentType:"bend",segmentIndex:h,frameIndex:d,angle:i,radius:f,centerPoint:y.toArray(),frame:{Y:x,B:u,C:i,R:f}},b.name=`弯段_${h}`,w.add(b),Math.floor(c.length/2),c[0],s.pos=c[c.length-1].clone();const M=new a.Matrix4().makeRotationAxis(s.localZ,l);s.localY.applyMatrix4(M),s.localX.applyMatrix4(M),h++,E++}}return w}function Pe(V,v,w,s){const h=new a.Vector3(0,s*2,s*5),E=w.clone().add(h),d=[w,E],_=new a.BufferGeometry().setFromPoints(d),x=new a.LineDashedMaterial({color:16711680,dashSize:s*.5,gapSize:s*.3,linewidth:1}),u=new a.Line(_,x);u.computeLineDistances(),V.add(u);const i=document.createElement("canvas"),f=i.getContext("2d");i.width=128,i.height=128,f.clearRect(0,0,128,128),f.fillStyle="#FF0000",f.font="bold 80px Arial",f.textAlign="center",f.textBaseline="middle",f.fillText(v.toString(),64,64);const l=new a.CanvasTexture(i),p=new a.SpriteMaterial({map:l,transparent:!0,depthTest:!1,depthWrite:!1}),c=new a.Sprite(p),y=s*3;c.scale.set(y,y,1),c.position.copy(E),c.name=`Label_${v}`,c.userData={labelNumber:v},V.add(c)}function Te(V,v,w){const s=new a.LineCurve3(V,v),h=new a.TubeGeometry(s,2,w,18,!1);return new a.Mesh(h,Ce)}function $e(V,v){const w=new a.CatmullRomCurve3(V,!1,"catmullrom",.01),s=new a.TubeGeometry(w,Math.max(16,V.length*2),v,18,!1);return new a.Mesh(s,Ce)}function Ee(V,v,w,s,h,E=0){let d=v.slice(0,h+1);const _=v[h+1];if(_&&E>0){const c={..._,B:(_.B??0)*E,C:(_.C??0)*E};d.push(c)}const x=Se(d),u=Math.max(0,w-x),i=[];i.push(new a.Vector3(0,0,0));const f=new a.Vector3(0,u*q,0);u>0&&i.push(f);let l={pos:f.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const p=[];for(let c=d.length-1;c>=0;c--){const y=d[c],C=ke(y);if(C.length>0){const b=C.map(k=>{const D=k.clone(),L=new a.Matrix4;return L.makeBasis(l.localX,l.localY,l.localZ),D.applyMatrix4(L),D.add(l.pos)});p.push(b);const M=b[b.length-1];l.pos=M.clone();const R=y.B??0,F=y.C??0;if(R!==0){const k=new a.Matrix4().makeRotationAxis(l.localY,oe(R));l.localX.applyMatrix4(k),l.localZ.applyMatrix4(k)}if(F>0){const k=oe(F),D=new a.Matrix4().makeRotationAxis(l.localZ,k);l.localY.applyMatrix4(D),l.localX.applyMatrix4(D)}}}for(const c of p)c.length>1&&i.push(...c.slice(1));i.length<2&&i.push(new a.Vector3(0,.001,0));try{const c=new a.CatmullRomCurve3(i,!1,"catmullrom",.01),y=new a.TubeGeometry(c,Math.max(2,i.length*4),s*q,18,!1);V.geometry.dispose(),V.geometry=y}catch(c){console.error("管件更新失败",c)}}function xe(V,v,w,s=0){let h=V.slice(0,w+1);const E=V[w+1];if(E&&s>0){const l={...E,B:(E.B??0)*s,C:(E.C??0)*s};h.push(l)}const d=Se(h),_=Math.max(0,v-d),x=[];x.push(new a.Vector3(0,0,0));const u=new a.Vector3(0,_*q,0);_>0&&x.push(u);let i={pos:u.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const f=[];for(let l=h.length-1;l>=0;l--){const p=h[l],c=ke(p);if(c.length>0){const y=c.map(R=>{const F=R.clone(),k=new a.Matrix4;return k.makeBasis(i.localX,i.localY,i.localZ),F.applyMatrix4(k),F.add(i.pos)});f.push(y);const C=y[y.length-1];i.pos=C.clone();const b=p.B??0,M=p.C??0;if(b!==0){const R=new a.Matrix4().makeRotationAxis(i.localY,oe(b));i.localX.applyMatrix4(R),i.localZ.applyMatrix4(R)}if(M>0){const R=oe(M),F=new a.Matrix4().makeRotationAxis(i.localZ,R);i.localY.applyMatrix4(F),i.localX.applyMatrix4(F)}}}for(const l of f)l.length>1&&x.push(...l.slice(1));return x.length<2&&x.push(new a.Vector3(0,.001,0)),x}function Me(V,v,w,s,h,E,d,_=0,x=0){const u=h-x,i=xe(s,u,d,_);let l=xe(w,x,d,_);l.forEach(c=>c.y=-c.y),l.reverse();const p=[...l,...i];try{const c=new a.CatmullRomCurve3(p,!1,"catmullrom",.01),y=new a.TubeGeometry(c,Math.max(2,p.length*4),E*q,18,!1);v.geometry.dispose(),V.geometry.dispose(),v.parent&&v.parent.remove(v),V.geometry=y}catch(c){console.error("管件更新失败",c)}}const ze={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},Fe={class:"control-row"},Ye={class:"control-row"},Ie={class:"frame-info"},Le={class:"control-row"},je={class:"progress-bar"},Ue={class:"dialog-footer"},Oe=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:v,emit:w}){const s=V,h=w,E=e.ref(),d=e.ref(),_=e.ref();e.watch(()=>s.threeData,t=>{const o=t==null?void 0:t.data;_.value=o==null?void 0:o.type},{immediate:!0});const x=async()=>{if(!sessionStorage.getItem("systemKey")){h("getThreeData");return}let o={};_.value===J.robotMode.SINGLE&&(o=await Ne.fetchSingleRobotAnimationData()),_.value===J.robotMode.DOUBLE&&(o=await Ne.fetchDoubleRobotAnimationData());const{initialPipeLength:n=0,pipeRadius:N=0,clampLength:B=0,animationData:U}=o;k.value=n,D.value=N,L.value=B,E.value=U;const O=T.cloneDeep(E.value),ee=re(A.value),K=(O==null?void 0:O["输出(动画数据)"])||[];u.value=K.length?K:[ee];let ne=(O==null?void 0:O["输出(动画数据)Content"])??[];ne&&(d.value=ne)},u=e.ref([]),i=e.ref(!1),f=e.ref(""),l=e.ref(!1),p=e.ref(0),c=e.ref(0),y=e.ref(1e3);let C=!1;const b=e.ref(null),M=e.shallowRef(null),R=e.shallowRef(null),F=e.shallowRef(null),k=e.ref(0),D=e.ref(12.5),L=e.ref(30),W=e.ref([]),P=e.ref(null),g=e.computed(()=>s.model?Object.values(s.model.joints).filter(t=>t.jointType!=="fixed").map(t=>t.name):[]),I=e.ref(["Y","B","C","R"]),A=e.computed(()=>[...g.value,...I.value]),j=e.computed(()=>A.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),J=require("./useRayCaster-Cz13xqg3.cjs"),S=require("./iconfont-t5epssvu.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-0YQ6oGXD.cjs");const T=require("./index-1z9RrjZc.cjs");require("./index.vue_vue_type_style_index_1_lang-0RaoPzBs.cjs");require("./index-BpPyaNFa.cjs");const te=require("./index-BZtXRbEZ.cjs");require("./index.vue_vue_type_style_index_1_lang-Bc10b8Mi.cjs");const a=require("./three-viewport-gizmo-BV37JzRa.cjs");require("./index-Dg_l3ZIM.cjs");const Ne=require("./animationData-xvLbS7TE.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=require("./urdfTree-CCktg0FK.cjs"),q=.001,oe=a.MathUtils.degToRad,Ce=new a.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:a.DoubleSide});function Re(V=.005,v=64){const w=new a.CatmullRomCurve3([new a.Vector3(0,0,0),new a.Vector3(0,0,0)]),s=new a.TubeGeometry(w,v,V,16,!1),h=Ce;return new a.Mesh(s,h)}const Se=V=>V.reduce((v,w)=>{let s=0;const h=w.Y??0,E=w.C??0,d=w.R??0;return h>0&&(s+=h),E>0&&d>0&&(s+=d*oe(E)),v+s},0),ke=V=>{const v=[],w=V.Y??0,s=V.B??0,h=V.C??0,E=V.R??0,d={pos:new a.Vector3(0,0,0),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};if(!w&&!h)return v;if(v.push(d.pos.clone()),s!==0){const _=new a.Matrix4().makeRotationAxis(d.localY,oe(s));d.localX.applyMatrix4(_),d.localZ.applyMatrix4(_)}if(w>0&&(d.pos.add(d.localY.clone().multiplyScalar(w*q)),v.push(d.pos.clone())),h>0&&E>0){const _=oe(h),x=E*q,u=d.pos.clone().add(d.localX.clone().multiplyScalar(-x)),i=Math.max(16,Math.ceil(h/5));for(let f=1;f<=i;f++){const l=_*f/i,p=new a.Matrix4().makeRotationAxis(d.localZ,l),y=d.localX.clone().multiplyScalar(x).applyMatrix4(p),C=u.clone().add(y);v.push(C)}}return v};function De(V,v){const w=new a.Group;w.name="CompletePipe";const s={pos:new a.Vector3(0,0,0),localX:new a.Vector3(1,0,0),localY:new a.Vector3(0,1,0),localZ:new a.Vector3(0,0,1)};let h=0,E=1;for(let d=0;d<V.length;d++){const _=V[d],x=_.Y??0,u=_.B??0,i=_.C??0,f=_.R??0;if(u!==0){const l=new a.Matrix4().makeRotationAxis(s.localY,oe(u));s.localX.applyMatrix4(l),s.localZ.applyMatrix4(l)}if(x>0){const l=s.pos.clone();s.pos.add(s.localY.clone().multiplyScalar(x*q));const p=s.pos.clone(),c=Te(l,p,v*q);c.userData={segmentType:"straight",segmentIndex:h,frameIndex:d,length:x,frame:{Y:x,B:u,C:i,R:f}},c.name=`直段_${h}`,w.add(c);const y=l.clone();Pe(w,E,y,v*q),h++}if(i>0&&f>0){const l=oe(i),p=f*q,c=[];c.push(s.pos.clone());const y=s.pos.clone().add(s.localX.clone().multiplyScalar(-p)),C=Math.max(16,Math.ceil(i/5));for(let R=1;R<=C;R++){const F=l*R/C,k=new a.Matrix4().makeRotationAxis(s.localZ,F),L=s.localX.clone().multiplyScalar(p).applyMatrix4(k),W=y.clone().add(L);c.push(W)}const b=$e(c,v*q);b.userData={segmentType:"bend",segmentIndex:h,frameIndex:d,angle:i,radius:f,centerPoint:y.toArray(),frame:{Y:x,B:u,C:i,R:f}},b.name=`弯段_${h}`,w.add(b),Math.floor(c.length/2),c[0],s.pos=c[c.length-1].clone();const M=new a.Matrix4().makeRotationAxis(s.localZ,l);s.localY.applyMatrix4(M),s.localX.applyMatrix4(M),h++,E++}}return w}function Pe(V,v,w,s){const h=new a.Vector3(0,s*2,s*5),E=w.clone().add(h),d=[w,E],_=new a.BufferGeometry().setFromPoints(d),x=new a.LineDashedMaterial({color:16711680,dashSize:s*.5,gapSize:s*.3,linewidth:1}),u=new a.Line(_,x);u.computeLineDistances(),V.add(u);const i=document.createElement("canvas"),f=i.getContext("2d");i.width=128,i.height=128,f.clearRect(0,0,128,128),f.fillStyle="#FF0000",f.font="bold 80px Arial",f.textAlign="center",f.textBaseline="middle",f.fillText(v.toString(),64,64);const l=new a.CanvasTexture(i),p=new a.SpriteMaterial({map:l,transparent:!0,depthTest:!1,depthWrite:!1}),c=new a.Sprite(p),y=s*3;c.scale.set(y,y,1),c.position.copy(E),c.name=`Label_${v}`,c.userData={labelNumber:v},V.add(c)}function Te(V,v,w){const s=new a.LineCurve3(V,v),h=new a.TubeGeometry(s,2,w,18,!1);return new a.Mesh(h,Ce)}function $e(V,v){const w=new a.CatmullRomCurve3(V,!1,"catmullrom",.01),s=new a.TubeGeometry(w,Math.max(16,V.length*2),v,18,!1);return new a.Mesh(s,Ce)}function Ee(V,v,w,s,h,E=0){let d=v.slice(0,h+1);const _=v[h+1];if(_&&E>0){const c={..._,B:(_.B??0)*E,C:(_.C??0)*E};d.push(c)}const x=Se(d),u=Math.max(0,w-x),i=[];i.push(new a.Vector3(0,0,0));const f=new a.Vector3(0,u*q,0);u>0&&i.push(f);let l={pos:f.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const p=[];for(let c=d.length-1;c>=0;c--){const y=d[c],C=ke(y);if(C.length>0){const b=C.map(k=>{const D=k.clone(),L=new a.Matrix4;return L.makeBasis(l.localX,l.localY,l.localZ),D.applyMatrix4(L),D.add(l.pos)});p.push(b);const M=b[b.length-1];l.pos=M.clone();const R=y.B??0,F=y.C??0;if(R!==0){const k=new a.Matrix4().makeRotationAxis(l.localY,oe(R));l.localX.applyMatrix4(k),l.localZ.applyMatrix4(k)}if(F>0){const k=oe(F),D=new a.Matrix4().makeRotationAxis(l.localZ,k);l.localY.applyMatrix4(D),l.localX.applyMatrix4(D)}}}for(const c of p)c.length>1&&i.push(...c.slice(1));i.length<2&&i.push(new a.Vector3(0,.001,0));try{const c=new a.CatmullRomCurve3(i,!1,"catmullrom",.01),y=new a.TubeGeometry(c,Math.max(2,i.length*4),s*q,18,!1);V.geometry.dispose(),V.geometry=y}catch(c){console.error("管件更新失败",c)}}function xe(V,v,w,s=0){let h=V.slice(0,w+1);const E=V[w+1];if(E&&s>0){const l={...E,B:(E.B??0)*s,C:(E.C??0)*s};h.push(l)}const d=Se(h),_=Math.max(0,v-d),x=[];x.push(new a.Vector3(0,0,0));const u=new a.Vector3(0,_*q,0);_>0&&x.push(u);let i={pos:u.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const f=[];for(let l=h.length-1;l>=0;l--){const p=h[l],c=ke(p);if(c.length>0){const y=c.map(R=>{const F=R.clone(),k=new a.Matrix4;return k.makeBasis(i.localX,i.localY,i.localZ),F.applyMatrix4(k),F.add(i.pos)});f.push(y);const C=y[y.length-1];i.pos=C.clone();const b=p.B??0,M=p.C??0;if(b!==0){const R=new a.Matrix4().makeRotationAxis(i.localY,oe(b));i.localX.applyMatrix4(R),i.localZ.applyMatrix4(R)}if(M>0){const R=oe(M),F=new a.Matrix4().makeRotationAxis(i.localZ,R);i.localY.applyMatrix4(F),i.localX.applyMatrix4(F)}}}for(const l of f)l.length>1&&x.push(...l.slice(1));return x.length<2&&x.push(new a.Vector3(0,.001,0)),x}function Me(V,v,w,s,h,E,d,_=0,x=0){const u=h-x,i=xe(s,u,d,_);let l=xe(w,x,d,_);l.forEach(c=>c.y=-c.y),l.reverse();const p=[...l,...i];try{const c=new a.CatmullRomCurve3(p,!1,"catmullrom",.01),y=new a.TubeGeometry(c,Math.max(2,p.length*4),E*q,18,!1);v.geometry.dispose(),V.geometry.dispose(),v.parent&&v.parent.remove(v),V.geometry=y}catch(c){console.error("管件更新失败",c)}}const ze={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},Fe={class:"control-row"},Ye={class:"control-row"},Ie={class:"frame-info"},Le={class:"control-row"},je={class:"progress-bar"},Ue={class:"dialog-footer"},Oe=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:v,emit:w}){const s=V,h=w,E=e.ref(),d=e.ref(),_=e.ref();e.watch(()=>s.threeData,t=>{const o=t==null?void 0:t.data;_.value=o==null?void 0:o.type},{immediate:!0});const x=async()=>{if(!sessionStorage.getItem("systemKey")){h("getThreeData");return}let o={};_.value===J.robotMode.SINGLE&&(o=await Ne.fetchSingleRobotAnimationData()),_.value===J.robotMode.DOUBLE&&(o=await Ne.fetchDoubleRobotAnimationData());const{initialPipeLength:n=0,pipeRadius:N=0,clampLength:B=0,animationData:U}=o;k.value=n,D.value=N,L.value=B,E.value=U;const O=T.cloneDeep(E.value),ee=re(A.value),K=(O==null?void 0:O["输出(动画数据)"])||[];u.value=K.length?K:[ee];let ne=(O==null?void 0:O["输出(动画数据)Content"])??[];ne&&(d.value=ne)},u=e.ref([]),i=e.ref(!1),f=e.ref(""),l=e.ref(!1),p=e.ref(0),c=e.ref(0),y=e.ref(1e3);let C=!1;const b=e.ref(null),M=e.shallowRef(null),R=e.shallowRef(null),F=e.shallowRef(null),k=e.ref(0),D=e.ref(12.5),L=e.ref(30),W=e.ref([]),P=e.ref(null),g=e.computed(()=>s.model?Object.values(s.model.joints).filter(t=>t.jointType!=="fixed").map(t=>t.name):[]),I=e.ref(["Y","B","C","R"]),A=e.computed(()=>[...g.value,...I.value]),j=e.computed(()=>A.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${A.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),X=()=>u.value.map(t=>({Y:parseFloat(t.Y)||0,B:parseFloat(t.B)||0,C:parseFloat(t.C)||0,R:parseFloat(t.R)||0})),H=()=>{const t=[],o=[];return u.value.forEach(n=>{const{Y1:N,B1:B,C1:U,R1:O,Y2:ee,B2:K,C2:ne,R2:Y}=n;t.push({Y:parseFloat(N)||0,B:parseFloat(B)||0,C:parseFloat(U)||0,R:parseFloat(O)||0}),o.push({Y:parseFloat(ee)||0,B:parseFloat(K)||0,C:parseFloat(ne)||0,R:parseFloat(Y)||0})}),{posPipeYbcr:t,negPipeYbcr:o}},Q=(t=0,o=0)=>{if(M.value&&R.value){const n=H();Me(M.value,R.value,n.posPipeYbcr,n.negPipeYbcr,k.value,D.value,t,o,L.value)}else if(M.value){const n=X();Ee(M.value,n,k.value,D.value,t,o)}},G=t=>{if(t<0||t>=u.value.length){console.error(`帧索引 ${t} 超出范围`);return}const o=u.value[t];if(console.log(`应用第 ${t} 帧数据 ${o}`),p.value=t,b.value){const n={};g.value.forEach(N=>{const B=parseFloat(o[N]);isNaN(B)||(n[N]=B)}),b.value.setJointAngles(n)}Q(t,0)},$=async()=>{if(u.value.length===0){T.ElMessage.error("无法播放动画:无数据");return}if(!l.value){l.value=!0,C=!1,u.value.length-1===p.value&&(p.value=0);try{for(let t=p.value+1;t<u.value.length&&!C;t++){p.value=t;const o=u.value[t],n={};b.value&&g.value.forEach(N=>{const B=parseFloat(o[N]);isNaN(B)||(n[N]=B)}),b.value?await b.value.animateToState(n,y.value,N=>{c.value=(t+N)/u.value.length*100,Q(t-1,N)}):(await new Promise(N=>setTimeout(N,y.value)),c.value=(t+1)/u.value.length*100)}C||T.ElMessage.success("动画播放完成")}catch(t){console.error("动画播放出错:",t),T.ElMessage.error("动画播放出错")}finally{l.value=!1,c.value=0}}},Z=()=>{C=!0,l.value=!1,c.value=0,T.ElMessage.info("动画已停止")},z=()=>{p.value=0},ue=()=>{if(M.value&&R.value){const t=H();Me(M.value,R.value,t.posPipeYbcr,t.negPipeYbcr,k.value,D.value,-1,0,L.value)}else if(M.value){const t=X();Ee(M.value,t,k.value,D.value,-1,0)}},ie=()=>{b.value&&b.value.resetToZero(),ue(),z(),T.ElMessage.success("机器人和管件已重置")},de=t=>`第 ${t+1} 帧`,pe=t=>{l.value&&Z(),G(t)},me=()=>{l.value&&Z(),!(p.value+1>=u.value.length)&&G(p.value+1)},ve=()=>{l.value&&Z(),p.value!==0&&G(p.value-1)},fe=(t,o)=>{if(!o)return null;const n=t.joints[o];if(!n)return console.warn(`在模型中未找到名为 '${o}' 的 Joint`),null;let N=null;return n.traverse(B=>{B instanceof a.Mesh&&!N&&(N=B)}),N||console.warn(`在 Joint '${o}' 中未找到可用的 Mesh 对象`),N},ge=(t,o)=>{if(!o)return null;const n=t.joints[o];return n||(console.warn(`在模型中未找到名为 '${o}' 的 Joint`),console.log("可用的链接:",Object.keys(t.links)),null)},se=()=>{F.value&&(F.value.visible=!0),M.value&&M.value.parent&&M.value.parent.remove(M.value),F.value=null,M.value=null,R.value=null},re=t=>t==null?void 0:t.reduce((o,n)=>(o[n]="0",o),{});e.watch(A,(t,o)=>{if(JSON.stringify(t)!==JSON.stringify(o))if(t.length>0){const n=re(t);u.value=[n]}else u.value=[]},{immediate:!0});const le=e.ref(0),ae=t=>{le.value=t},he=(t,o)=>{if(!t||!o)return;const n=ge(t,o),N=Re();N.visible=!1,n==null||n.add(N)},Ve=t=>{b.value=new J.URDFRobotController(t),W.value=Object.keys(t.links),P.value="Pipe_Joint"},ye=()=>{b.value=null,W.value=[],P.value=null},be=t=>{Ve(t),he(t,P.value),ae(le.value+1),ie()};e.watch(()=>s.model,t=>{if(se(),t){be(t);return}ye()},{immediate:!0});const ce=t=>{var n,N;const o=new a.Mesh(t.geometry.clone(),t.material);return o.name="managed_pipe_clone",(N=(n=t==null?void 0:t.parent)==null?void 0:n.add)==null||N.call(n,o),o.position.copy(t.position),o.rotation.copy(t.rotation),o.scale.copy(t.scale),o};e.watch([P,L,k,le],([t,o])=>{if(se(),s.model&&t){const n=fe(s.model,t);if(console.log(n,"meshToReplace"),n&&n.parent){F.value=n,n.visible=!1;const N=ce(n);if(_.value===J.robotMode.SINGLE&&(N.position.y-=o*.001),M.value=N,_.value===J.robotMode.DOUBLE){const B=ce(n);R.value=B}Q(0,0)}else t&&console.warn(`在 link '${t}' 中未找到可替换的网格或其没有父级。`)}});const m=async()=>{if(A.value.length===0){T.ElMessage.warning("没有可导出的表头");return}const t=A.value.join(" ");try{await navigator.clipboard.writeText(t),T.ElMessage.success("表头已成功复制到剪贴板!")}catch(o){console.error("复制失败:",o),T.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},r=()=>{if(!f.value.trim()){T.ElMessage.warning("导入内容不能为空");return}const t=f.value.trim().split(`
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as Ze, ref as f, watch as de, shallowRef as he, computed as we, onUnmounted as et, resolveComponent as Z, createElementBlock as Ce, openBlock as ie, createElementVNode as o, createVNode as l, withCtx as V, createBlock as De, createCommentVNode as ge, unref as S, toDisplayString as ve, onBeforeUnmount as Ke, createTextVNode as tt, onMounted as lt, nextTick as ot, withDirectives as Q, vShow as me, renderSlot as _e, isRef as Re, vModelRadio as Me } from "vue";
2
- import { r as Ve, U as nt, s as Xe, u as at, a as st, W as it } from "./useRayCaster-DENUSa5k.js";
2
+ import { r as Ve, U as nt, s as Xe, u as at, a as st, W as it } from "./useRayCaster-CJaAi3t4.js";
3
3
  import { u as qe, a as rt, b as ut, S as F } from "./iconfont-pt17sMx3.js";
4
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DM8to6QE.js";
4
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CmdURFaC.js";
5
5
  import { a9 as ct, c as pt, E as X, a as dt, aM as mt, ao as vt } from "./index-CYp77kPp.js";
6
- import "./index.vue_vue_type_style_index_1_lang-CeaEXypd.js";
6
+ import "./index.vue_vue_type_style_index_1_lang-DtRssJWg.js";
7
7
  import "./index-BHtNKL1L.js";
8
- import { _ as pe, s as ft } from "./index-Bxj1NF8c.js";
9
- import "./index.vue_vue_type_style_index_1_lang-CrPsDsEY.js";
8
+ import { _ as pe, s as ft } from "./index-C3pD8VjA.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-BDQcys0d.js";
10
10
  import { m as Se, T as Pe, V as j, k as te, l as gt, n as ht, e as ke, o as bt, L as yt, p as _t, q as wt, r as Ct, s as kt, t as Pt, u as xt, i as Tt } from "./three-viewport-gizmo-CkQ98n-T.js";
11
- import "./index-0yieO8oJ.js";
12
- import { f as Rt, a as Mt } from "./animationData-BWw4kCRg.js";
11
+ import "./index-00LBNRcE.js";
12
+ import { f as Rt, a as Mt } from "./animationData-Qb9CDU4l.js";
13
13
  import { _ as Je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  import { U as Vt, J as Dt } from "./urdfTree-BuTtRGdl.js";
15
15
  const ee = 1e-3, re = gt.degToRad, Ge = new bt({
@@ -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-D2WqwMCZ.cjs"),R=require("./useRayCaster-BhV1gz97.cjs"),m=require("./iconfont-t5epssvu.cjs"),ne=require("./index-D-aPtE2l.cjs");require("./index.vue_vue_type_style_index_1_lang-CwoxJbwS.cjs");const de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./urdfTree-CCktg0FK.cjs"),Le=require("./animationData-Gmqt1miw.cjs"),Ue=require("./STLLoader-RU7KqloS.cjs"),ue=require("./index-CZs4OK7B.cjs"),Ae=require("./three-viewport-gizmo-BV37JzRa.cjs"),Oe={class:"panel-content"},Ie={class:"action-bar"},qe={key:0,class:"animation-controls"},Fe={class:"control-row"},Ge={class:"control-row"},Je={class:"frame-info"},He={class:"control-row"},Xe={key:1,class:"empty-state"},Ke={class:"dialog-footer"},We=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(L,{expose:J}){const w=L,a=e.ref([]),D=e.ref(!1),$=e.ref(""),h=e.ref("stopped"),b=e.ref(0),T=e.ref(0),U=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-0RaoPzBs.cjs"),R=require("./useRayCaster-Cz13xqg3.cjs"),m=require("./iconfont-t5epssvu.cjs"),ne=require("./index-BZtXRbEZ.cjs");require("./index.vue_vue_type_style_index_1_lang-Bc10b8Mi.cjs");const de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./urdfTree-CCktg0FK.cjs"),Le=require("./animationData-xvLbS7TE.cjs"),Ue=require("./STLLoader-RU7KqloS.cjs"),ue=require("./index-C8W8SOHQ.cjs"),Ae=require("./three-viewport-gizmo-BV37JzRa.cjs"),Oe={class:"panel-content"},Ie={class:"action-bar"},qe={key:0,class:"animation-controls"},Fe={class:"control-row"},Ge={class:"control-row"},Je={class:"frame-info"},He={class:"control-row"},Xe={key:1,class:"empty-state"},Ke={class:"dialog-footer"},We=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(L,{expose:J}){const w=L,a=e.ref([]),D=e.ref(!1),$=e.ref(""),h=e.ref("stopped"),b=e.ref(0),T=e.ref(0),U=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,U.value,r=>{s===f&&(T.value=(l+r)/a.value.length*100)});else{if(await new Promise(r=>setTimeout(r,U.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 ze, ref as u, computed as T, watch as H, onUnmounted as at, resolveComponent as K, createElementBlock as O, openBlock as j, 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 d, 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 ct } from "./index-CYp77kPp.js";
3
- import { j as dt, a as vt, u as pt, aG as mt } from "./index.vue_vue_type_style_index_1_lang-CeaEXypd.js";
4
- import { U as ft, s as ke, u as gt, a as ht, W as bt } from "./useRayCaster-DENUSa5k.js";
3
+ import { j as dt, a as vt, u as pt, aG as mt } from "./index.vue_vue_type_style_index_1_lang-DtRssJWg.js";
4
+ import { U as ft, s as ke, u as gt, a as ht, W as bt } from "./useRayCaster-CJaAi3t4.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-Bxj1NF8c.js";
7
- import "./index.vue_vue_type_style_index_1_lang-CrPsDsEY.js";
6
+ import { _ as Pe } from "./index-C3pD8VjA.js";
7
+ import "./index.vue_vue_type_style_index_1_lang-BDQcys0d.js";
8
8
  import { _ as Ue } 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-BWw4kCRg.js";
10
+ import { i as _t } from "./animationData-Qb9CDU4l.js";
11
11
  import { O as xt } from "./STLLoader-CiUjaQtA.js";
12
- import { t as Tt, h as $t } from "./index-VAoviGiD.js";
12
+ import { t as Tt, h as $t } from "./index--cSKDs-m.js";
13
13
  import { e as jt } from "./three-viewport-gizmo-CkQ98n-T.js";
14
14
  const zt = { class: "panel-content" }, Ut = { class: "action-bar" }, Vt = {
15
15
  key: 0,
@@ -1,7 +1,7 @@
1
1
  import { computed as _, defineComponent as W, 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, b$ as Y, p as I, s as O } from "./index-CYp77kPp.js";
3
- import { u as H } from "./index.vue_vue_type_style_index_1_lang-CeaEXypd.js";
4
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DM8to6QE.js";
3
+ import { u as H } from "./index.vue_vue_type_style_index_1_lang-DtRssJWg.js";
4
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CmdURFaC.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-BBp0_Tq3.js")), g = S(() => import("./threePreview-DFFjm93P.js")), p = S(() => import("./threeLatheView-Bp0kjo_V.js")), T = S(() => import("./threeSceneViewForCPMPIP-pDy7SQVJ.js")), o = {
140
+ const h = S(() => import("./threeSceneView-YnHu8FUZ.js")), g = S(() => import("./threePreview-DFFjm93P.js")), p = S(() => import("./threeLatheView-Bp0kjo_V.js")), T = S(() => import("./threeSceneViewForCPMPIP-p2-Ce2xO.js")), o = {
141
141
  ROBOT_SCENE: "robot",
142
142
  // 机器人场景
143
143
  LATHE_SCENE: "latheScene",
@@ -1 +1 @@
1
- "use strict";const t=require("vue"),m=require("./index-1z9RrjZc.cjs"),A=require("./index.vue_vue_type_style_index_1_lang-D2WqwMCZ.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DDk9QivU.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-9bR4B421.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-BYI3fXA6.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-0RaoPzBs.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-0YQ6oGXD.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-BFcPTomD.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-fG4x8LLj.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
  var de = Object.defineProperty;
2
2
  var me = (n, s, t) => s in n ? de(n, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[s] = t;
3
3
  var x = (n, s, t) => me(n, typeof s != "symbol" ? s + "" : s, t);
4
- import { U as pe } from "./index.vue_vue_type_style_index_1_lang-CrPsDsEY.js";
4
+ import { U as pe } from "./index.vue_vue_type_style_index_1_lang-BDQcys0d.js";
5
5
  import { S as ve, M as fe, O as be } from "./STLLoader-CiUjaQtA.js";
6
6
  import { ay as we, n as E, h as he, e as _e, B as ge, V as z, Q as Me, E as ye, az as Re, J as Se } from "./three-viewport-gizmo-CkQ98n-T.js";
7
7
  import { defineComponent as $e, ref as V, computed as D, watch as ue, resolveComponent as J, createElementBlock as j, openBlock as I, createVNode as F, createElementVNode as c, withCtx as L, createTextVNode as U, toDisplayString as C } from "vue";