ss-component-new 1.2.57 → 1.2.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animationData-CEkMmPAJ.js +111 -0
- package/dist/animationData-FLuoH13j.cjs +1 -0
- package/dist/{iconfont-Du5a0yIR.js → iconfont-Dp3iGl32.js} +318 -244
- package/dist/iconfont-ji7A-_XJ.cjs +1 -0
- package/dist/icons/svg/CopyAddMenu.svg +1 -0
- package/dist/icons/svg/DeleteMenu.svg +1 -0
- package/dist/icons/svg/FixedMenu.svg +1 -0
- package/dist/icons/svg//345/273/272/346/250/241/345/210/206/346/236/220.svg +1 -0
- package/dist/icons/svg//347/256/227/346/263/225.svg +1 -1
- package/dist/{index-BMMCYEsB.js → index--qwZeW47.js} +1 -1
- package/dist/{index-DtlFU8RR.cjs → index-B1U77nyf.cjs} +1 -1
- package/dist/index-BEfSpHE6.js +17 -0
- package/dist/{index-CEkY4nFt.js → index-BFHCLxvz.js} +1 -1
- package/dist/index-BN4opOSk.cjs +1 -0
- package/dist/{index-B55haWsS.js → index-BNES2eKm.js} +1 -1
- package/dist/{index-kXlrQUA8.js → index-BTwRUubF.js} +2 -2
- package/dist/{index-DmfzZIKw.cjs → index-BYIlecoJ.cjs} +1 -1
- package/dist/{index-D0NMKMU8.cjs → index-BgwYXT31.cjs} +1 -1
- package/dist/{index-hL7adbcf.js → index-BiUFu7a_.js} +1500 -1636
- package/dist/{index-DYopbovE.js → index-BooTgcW2.js} +1633 -1632
- package/dist/{index-CJVA_tHw.cjs → index-BxEjroD6.cjs} +1 -1
- package/dist/index-C14Eek69.js +32 -0
- package/dist/index-C8IFPtAJ.js +12233 -0
- package/dist/index-C9C84gkB.cjs +1 -0
- package/dist/{index-BO7R6DCb.cjs → index-CDW8XzWT.cjs} +1 -1
- package/dist/index-CHzlphv9.cjs +1 -0
- package/dist/{index-vrO7i-BX.cjs → index-CWG2zhJZ.cjs} +1 -1
- package/dist/{index-DURGsNBh.js → index-ChyicQIl.js} +1 -1
- package/dist/index-D57Bv8co.cjs +1 -0
- package/dist/{index-BPiXU1VF.js → index-DAJoy_Z5.js} +1 -1
- package/dist/{index-DhbAgrix.cjs → index-DIpWkFjh.cjs} +1 -1
- package/dist/index-DLU6Qv3w.cjs +15 -0
- package/dist/{index-BQWUpvXk.js → index-DN40xEbb.js} +2 -2
- package/dist/{index-HsZY-XbO.js → index-DNs7ujiq.js} +1 -1
- package/dist/{index-C8x2JQx7.cjs → index-DXGiAs1G.cjs} +1 -1
- package/dist/{index-D3cFqWf8.js → index-DZQjq0ZR.js} +1 -1
- package/dist/index-DkNldOC0.cjs +1 -0
- package/dist/{index-CgHWXZbW.cjs → index-DuamAhUi.cjs} +1 -1
- package/dist/index-DvgAOa6m.js +2858 -0
- package/dist/{index-By-PfzqJ.js → index-FUWILZwY.js} +16 -16
- package/dist/{index-C9QGZutp.cjs → index-JXXdn01K.cjs} +1 -1
- package/dist/{index-Du-GlV8c.cjs → index-LVKvj2hU.cjs} +1 -1
- package/dist/{index-D2vsFTnY.js → index-OLQpbvuS.js} +6 -6
- package/dist/{index-JGSZNtiO.js → index-YoJfAd5X.js} +1 -1
- package/dist/{index-BgLb2tvo.js → index-bcbWOGXs.js} +3 -3
- package/dist/{index-cOj9uZ5B.cjs → index-gcSJbApQ.cjs} +1 -1
- package/dist/index-lP-_9Gsb.cjs +1 -0
- package/dist/index-qDBAJZN2.cjs +1 -0
- package/dist/{index-GShz2NEi.js → index-rPWz6KHn.js} +2 -2
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Bff2sYnQ.cjs +37 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DkxmFS5P.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-D6uh0ooh.js} +10026 -10039
- package/dist/index.vue_vue_type_style_index_0_scoped_b00cbae2_lang-DlyCfLDJ.cjs +1 -0
- package/dist/index.vue_vue_type_style_index_0_scoped_b00cbae2_lang-Dt5lXvbN.js +195 -0
- package/dist/{index.vue_vue_type_style_index_1_lang-BEmLh6pe.js → index.vue_vue_type_style_index_1_lang-BUhvhTqt.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-Dsas9C9w.cjs → index.vue_vue_type_style_index_1_lang-DDYxgdQk.cjs} +1 -1
- package/dist/{main-B59ixZA7.js → main-ChUyYPuq.js} +2 -2
- package/dist/{main-B3gx12Xo.cjs → main-D-bdppOV.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +6 -6
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +10 -10
- package/dist/{threeModel-CxRJigCx.cjs → threeModel-CDFo3As-.cjs} +1 -1
- package/dist/{threeModel-ardn7Q2K.js → threeModel-DcuAlWjb.js} +2 -2
- package/dist/{threePreview-L8T-JdQL.js → threePreview-DhMkG1np.js} +350 -380
- package/dist/threePreview-q4R-oAs6.cjs +1 -0
- package/dist/threeSceneView-CAsVH82L.cjs +5 -0
- package/dist/threeSceneView-Dav7AGkH.js +1288 -0
- package/dist/threeSceneViewForCPMPIP-9__8NGa5.cjs +5 -0
- package/dist/threeSceneViewForCPMPIP-DxFYivgN.js +599 -0
- package/dist/threeTrackPathView-B7yrSLKq.cjs +370 -0
- package/dist/{threeTrackPathView-gTDb6Ckq.js → threeTrackPathView-DXCMl3aZ.js} +307 -376
- package/dist/{xlsx-ByPOQ6N_.js → threeViewerHost-BNnzz6WM.js} +4414 -4032
- package/dist/threeViewerHost-D70yS3z2.cjs +104 -0
- package/dist/{workpieceTreePanel-GlMrvoGI.js → workpieceTreePanel-CCbVIIlm.js} +92 -101
- package/dist/workpieceTreePanel-KdP9UaVe.cjs +1 -0
- package/package.json +1 -1
- package/public/icons/svg/CopyAddMenu.svg +1 -0
- package/public/icons/svg/DeleteMenu.svg +1 -0
- package/public/icons/svg/FixedMenu.svg +1 -0
- package/public/icons/svg//345/273/272/346/250/241/345/210/206/346/236/220.svg +1 -0
- package/public/icons/svg//347/256/227/346/263/225.svg +1 -1
- package/dist/animationData-CSjRG83z.cjs +0 -1
- package/dist/animationData-DgukZCiZ.js +0 -69
- package/dist/dataUtil-Bg8jgTaT.js +0 -52
- package/dist/dataUtil-CflXOlIl.cjs +0 -1
- package/dist/fileUtil-CVIZ039M.js +0 -99
- package/dist/fileUtil-DugRTZPB.cjs +0 -1
- package/dist/iconfont-BUDQryy4.cjs +0 -1
- package/dist/index-BAkz3vaY.js +0 -12229
- package/dist/index-BE76NHis.js +0 -2848
- package/dist/index-CXGkiovm.cjs +0 -1
- package/dist/index-CaV-J52G.cjs +0 -1
- package/dist/index-D4y4pCNq.cjs +0 -1
- package/dist/index-DKQuP1UM.cjs +0 -1
- package/dist/index-DhPNGzbc.cjs +0 -1
- package/dist/index-fw0RZg-d.cjs +0 -15
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-til9urRl.cjs +0 -37
- package/dist/index.vue_vue_type_style_index_0_scoped_92477073_lang-5Hi_RNl1.cjs +0 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_92477073_lang-DIFWhOl8.js +0 -212
- package/dist/threePreview-5-O-sZIc.cjs +0 -1
- package/dist/threeSceneView-BYl4rYgi.js +0 -1369
- package/dist/threeSceneView-igg9HZ8X.cjs +0 -5
- package/dist/threeSceneViewForCPMPIP-C-o-rOZ9.js +0 -662
- package/dist/threeSceneViewForCPMPIP-DfPj5iau.cjs +0 -5
- package/dist/threeTrackPathView-CgjLFXmL.cjs +0 -370
- package/dist/threeViewerHost-DvAkN_z-.js +0 -322
- package/dist/threeViewerHost-PGblwq3d.cjs +0 -1
- package/dist/workpieceTreePanel-Cr4nTOQE.cjs +0 -1
- package/dist/xlsx-BPHygxEf.cjs +0 -104
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Te=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-fAuSnfOH.cjs"),te=require("./threeViewerHost-D70yS3z2.cjs"),H=require("./iconfont-ji7A-_XJ.cjs"),G=require("./workpieceTreePanel-KdP9UaVe.cjs"),p=require("./index-C8qRkCgn.cjs"),ne=require("./index-B2xsH_Wl.cjs"),R=require("./urdfTree-CPEMi7wo.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),b=require("./svgIcon-CUM54R6L.cjs"),xe=require("./animationData-FLuoH13j.cjs"),De=require("./MTLLoader-BlLfoBce.cjs"),le=require("./index-lP-_9Gsb.cjs"),Be={class:"panel-content"},ze={key:0,class:"animation-controls"},Le={class:"control-row"},Me={class:"control-row"},je={class:"frame-info"},$e={class:"control-row"},Ae={key:1,class:"empty-state"},Ue={class:"dialog-footer"},Re=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(x,{expose:s}){const y=x,i=e.ref([]),C=e.ref(!1),V=e.ref(""),d=e.ref("stopped"),f=e.ref(0),D=e.ref(0),B=e.ref(10),_=e.ref(null);let v=0;const z=e.ref([]),L=e.computed(()=>y.model?R.getNonFixedJoints(y.model).map(r=>r.name):[]),S=e.computed(()=>[...L.value]),F=e.computed(()=>S.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
|
+
${S.value.join(" ")}
|
|
3
|
+
0 0 0 ...
|
|
4
|
+
1 2 3 ...`:"请先加载模型。"),M=e.computed(()=>i.value[f.value]||{});e.watch(()=>y.model,o=>{o?(_.value=new G.URDFRobotController(o),z.value=R.getAllLinkName(o),f.value=0):(_.value=null,z.value=[])},{immediate:!0});const E=o=>{if(o<0||o>=i.value.length){console.error(`帧索引 ${o} 超出范围`);return}const l=i.value[o];if(_.value){const r={};L.value.forEach(h=>{const c=parseFloat(l[h]);isNaN(c)||(r[h]=c)}),_.value.setJointAngles(r)}f.value=o,D.value=i.value.length>1?o/(i.value.length-1)*100:100},k=async o=>{try{for(let l=f.value;l<i.value.length;l++){if(o!==v)return;const r=i.value[l],h={};if(_.value)L.value.forEach(c=>{const m=parseFloat(r[c]);isNaN(m)||(h[c]=m)}),await _.value.animateToState(h,B.value,c=>{o===v&&(D.value=(l+c)/i.value.length*100)});else{if(await new Promise(c=>setTimeout(c,B.value)),o!==v)return;D.value=(l+1)/i.value.length*100}f.value=l}o===v&&(p.ElMessage.success("动画播放完成"),d.value="stopped",D.value=100)}catch(l){console.error("动画播放出错:",l),p.ElMessage.error("动画播放出错"),d.value="stopped"}},T=()=>{if(i.value.length===0){p.ElMessage.error("无动画数据");return}d.value==="stopped"&&(f.value=0,E(0)),d.value="playing",v++,k(v),p.ElMessage.info("动画播放中")},w=()=>{d.value==="playing"&&(v++,d.value="paused",p.ElMessage.info("动画已暂停"))},j=()=>{v++,d.value="stopped",f.value=0,D.value=0,E(0),p.ElMessage.info("动画已停止并重置")},I=()=>{d.value==="playing"?w():T()},P=o=>{v++,d.value="paused",E(o)},$=()=>{if(!V.value.trim()){p.ElMessage.warning("导入内容不能为空");return}const o=V.value.trim().split(`
|
|
5
|
+
`).filter(m=>m.trim()!=="");if(o.length<2){p.ElMessage.error("导入数据至少需要包含表头行和一行数据");return}const l=o[0].split(" ").map(m=>m.trim()),r={};if(l.forEach((m,u)=>{S.value.includes(m)&&(r[u]=m)}),Object.keys(r).length===0){p.ElMessage.error("没有找到匹配的表头,请检查表头名称是否正确");return}const c=o.slice(1).map(m=>{const u=m.split(" "),N={};return S.value.forEach(A=>{N[A]="0"}),Object.entries(r).forEach(([A,O])=>{const U=u[parseInt(A)];U!==void 0&&U.trim()!==""&&(N[O]=U.trim())}),N});c.length>0?(i.value=c,p.ElMessage.success(`成功导入 ${c.length} 行数据!`),C.value=!1,V.value="",j()):p.ElMessage.error("未能解析到有效数据,请检查格式。")};e.watch(()=>y.xyzbcList,()=>{y.xyzbcList&&(i.value=p.cloneDeep(y.xyzbcList))},{immediate:!0});const K=o=>`第 ${o+1} 帧`;return s({handlePlayPause:I,playAnimation:T,pauseAnimation:w,stopAnimation:j}),e.onUnmounted(()=>{v++}),(o,l)=>{const r=e.resolveComponent("el-input-number"),h=e.resolveComponent("el-slider"),c=e.resolveComponent("el-input"),m=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Be,[l[11]||(l[11]=e.createElementVNode("div",{class:"action-bar"},null,-1)),i.value.length>0?(e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",Le,[l[5]||(l[5]=e.createElementVNode("label",null,"帧间隔 (ms):",-1)),e.createVNode(r,{modelValue:B.value,"onUpdate:modelValue":l[0]||(l[0]=u=>B.value=u),min:10,max:5e3,step:100,size:"small",style:{width:"120px"}},null,8,["modelValue"])]),e.createElementVNode("div",Me,[l[6]||(l[6]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",je,e.toDisplayString(f.value+1)+" / "+e.toDisplayString(i.value.length),1)]),e.createElementVNode("div",$e,[l[7]||(l[7]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(h,{modelValue:f.value,"onUpdate:modelValue":l[1]||(l[1]=u=>f.value=u),min:0,max:i.value.length>0?i.value.length-1:0,step:1,"format-tooltip":K,onInput:P,disabled:i.value.length===0||d.value==="playing",style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",null,[l[8]||(l[8]=e.createElementVNode("label",null,"当前帧数据:",-1)),e.createElementVNode("div",null,[M.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(M.value,(u,N)=>(e.openBlock(),e.createElementBlock("div",{key:N},e.toDisplayString(N)+": "+e.toDisplayString(u),1))),128)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),i.value.length===0?(e.openBlock(),e.createElementBlock("div",Ae,l[9]||(l[9]=[e.createElementVNode("p",null,"请先创建数据",-1)]))):e.createCommentVNode("",!0),e.createVNode(m,{modelValue:C.value,"onUpdate:modelValue":l[4]||(l[4]=u=>C.value=u),title:"导入数据",width:"500px"},{footer:e.withCtx(()=>[e.createElementVNode("span",Ue,[e.createVNode(ne._sfc_main,{modelValue:"取消",onClick:l[3]||(l[3]=u=>C.value=!1)}),e.createVNode(ne._sfc_main,{modelValue:"确认导入",onClick:$,type:"primary"})])]),default:e.withCtx(()=>[l[10]||(l[10]=e.createElementVNode("p",{class:"import-instructions"}," 请从Excel或CSV中复制数据 (首行为表头, Tab分隔) ",-1)),e.createVNode(c,{modelValue:V.value,"onUpdate:modelValue":l[2]||(l[2]=u=>V.value=u),type:"textarea",rows:10,placeholder:F.value},null,8,["modelValue","placeholder"])]),_:1,__:[10]},8,["modelValue"])])}}}),ae=oe._export_sfc(Re,[["__scopeId","data-v-00d63f4b"]]),Fe=async x=>await new De.OBJLoader().loadAsync(x),Ie=async x=>await Fe(x),Oe={class:"obj-viewer-container"},qe={class:"buttonGroup-topLeft"},Je={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ge={class:"buttonGroup-bottom"},Ke={class:"top-panel"},Xe={class:"panel-header"},We={class:"panel-body"},Ye={class:"left-panel"},Ze={class:"panel-header"},Qe={class:"panel-body"},et={class:"right-panel"},tt={class:"panel-header"},nt={class:"panel-body"},lt={key:0,class:"loading-overlay"},at=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(x){const s=x,y=e.inject("setManagementPageTitle"),i=e.inject("setManagementPageVisible"),C=e.computed(()=>{var n,a;return(a=(n=s==null?void 0:s.threeData)==null?void 0:n.data)==null?void 0:a.machine}),V=e.computed(()=>{var n,a;return(a=(n=s==null?void 0:s.threeData)==null?void 0:n.data)==null?void 0:a.workpieceInfo}),d=e.computed(()=>{var n,a;return(a=(n=s==null?void 0:s.threeData)==null?void 0:n.data)==null?void 0:a.knife}),f=e.ref([]),D=async t=>{!t||!t.isExtra||(await B(t),y==null||y(t==null?void 0:t.pageName),i==null||i(!0))},B=le.debounce(async t=>{await le.onPageBack();const{mainKey:n,baseMenuPath:a}=t||{};Te.copyAdd(a,n)},500);e.watch(()=>[C.value,V.value,d.value],()=>{var g,Z,Q,ee;const t=[],n={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};C.value&&n.children.push({isExtra:!0,pageName:"机床",mainKey:C.value,label:C.value,baseMenuPath:"设备库/机床"});const a={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};V.value&&a.children.push({isExtra:!0,type:(g=V.value)==null?void 0:g.type,pageName:"工件",mainKey:(Z=V.value)==null?void 0:Z.name,label:(Q=V.value)==null?void 0:Q.name,baseMenuPath:`工件库/${(ee=V.value)==null?void 0:ee.type}`});const J={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};d.value&&J.children.push({isExtra:!0,pageName:"刀具",mainKey:d.value,label:d.value,baseMenuPath:"设备库/刀具"}),t.push(n,a,J),f.value=t},{immediate:!0});const _=e.ref([]),v=e.computed(()=>{var n,a;return(a=(n=s==null?void 0:s.threeData)==null?void 0:n.data)==null?void 0:a.csvUrl});e.watch(()=>v.value,async()=>{if(console.log("three data",s==null?void 0:s.threeData),console.log("csvUrl",v.value),v.value){const t=await xe.initXYZBCList(v.value);_.value=t}},{immediate:!0});const z=e.computed(()=>{var n,a;return(a=(n=s==null?void 0:s.threeData)==null?void 0:n.data)==null?void 0:a.bladeObjUrl}),L=e.ref(te.sceneType.ROBOT),S=e.ref(null),F=e.ref(!1),M=e.ref(""),E=e.ref(!1),k=e.ref(""),T=e.ref(!1),w=e.ref(""),j=e.ref(!1),I=e.ref(""),P=e.shallowRef(null),$=e.ref("叶片模型"),K=e.shallowRef(null),o=e.shallowRef(null),l=e.shallowRef(null),r=e.ref(ae),{currentModels:h,resetView:c,initThreeJS:m,handleResize:u,getThreeJSObjects:N,cleanup:A,setAndFitModels:O,axesHelperVisible:U,toggleAxesVisibility:se}=H.useThreeJS(S),{loadSceneFromFile:ie}=G.useUrdfLoader(N,h,F,M),{isAnimating:W,toggleAnimation:re,startAnimation:st,stopAnimation:ce}=H.useAnimation(N,h),{isClipping:ue,activeClippingAxis:Y,toggleClipping:de,updateClippingPlanes:ve}=H.useClipping(N,h),{initRaycaster:me,selectedObject3D:pe,setSelectedObjVisible:fe,updatePosition:he,updateRotation:ge,dispose:be}=G.useRaycaster(S,N,h),Ve=()=>{se()},Ne=t=>{Y.value=t,ve()},ye=e.computed(()=>L.value===te.sceneType.ROBOT),q=t=>{E.value=!0,k.value=t,t==="剖面视图"&&!ue.value&&de()},X=t=>{T.value=!0,w.value=t},ke=()=>{var t;(t=r.value)==null||t.handlePlayPause()},we=()=>{var t;(t=r.value)==null||t.pauseAnimation()},Ee=()=>{var t;(t=r.value)==null||t.stopAnimation()},Ce=(t,n)=>R.getMeshFromLink(t,n),_e=async t=>{const n=Ce(t,$.value);if(o.value=n,console.log("bladeObjUrl",z.value),n&&n.parent&&z.value){const a=await Ie(z.value);a.name="blade_clone",n.parent.add(a),a.position.copy(n.position),a.rotation.copy(n.rotation),a.scale.copy(n.scale),n.visible=!1,K.value=a}else $.value&&console.warn(`在 Blade '${$.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>s.fileBlobs,t=>{if(t&&t.length>0){const n=t[0];if(!n.name.toLowerCase().endsWith(".urdf"))return;ie(n).then(a=>{P.value=a,a&&_e(a)}).catch(a=>{console.error("加载URDF文件时发生错误:",a),p.ElMessage.error("加载urdf模型失败"),P.value=null})}else P.value=null},{immediate:!0,deep:!0}),e.watch(P,t=>{O(t?[t]:[]),me()});const Pe=()=>{m(),window.addEventListener("resize",u);const t=N();l.value=t.scene},Se=()=>{k.value="",w.value="",window.removeEventListener("resize",u),W.value&&ce(),A(),be()};return e.onMounted(async()=>{await e.nextTick();try{Pe()}catch(t){console.error("Three.js 初始化失败:",t),p.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Se()}),(t,n)=>{const a=e.resolveComponent("el-scrollbar"),J=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",Oe,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:S,class:"threejs-container"},null,512),[[e.vShow,ye.value]]),n[9]||(n[9]=e.createElementVNode("div",{class:"buttonGroup-top"},null,-1)),e.createElementVNode("div",qe,[e.createVNode(b.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:e.unref(c),title:"重置"},null,8,["onClick"]),e.createVNode(b.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),e.createVNode(b.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(b.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(re),title:e.unref(W)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(b.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(U),onClick:Ve,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",Je,[e.renderSlot(t.$slots,"button-left",{switchRightPanel:q},void 0,!0),e.createVNode(b.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:n[0]||(n[0]=g=>q("场景树")),active:E.value&&k.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(b.ThreeSvgIcon,{name:"clipping",size:"24",onClick:n[1]||(n[1]=g=>q("剖面视图")),active:E.value&&k.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(b.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:n[2]||(n[2]=g=>q("工件树")),active:E.value&&k.value==="工件树"},null,8,["active"])]),e.createElementVNode("div",He,[e.renderSlot(t.$slots,"button-right",{switchRightPanel:X},void 0,!0),e.createVNode(b.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:n[3]||(n[3]=g=>X("机床控制")),active:T.value&&w.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(b.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:n[4]||(n[4]=g=>X("动画仿真")),active:T.value&&w.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",Ge,[e.createVNode(b.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ke}),e.createVNode(b.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:we}),e.createVNode(b.ThreeSvgIcon,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:Ee})]),e.withDirectives(e.createElementVNode("div",Ke,[e.createElementVNode("div",Xe,[e.createElementVNode("span",null,e.toDisplayString(I.value),1),e.createElementVNode("span",{class:"close",onClick:n[5]||(n[5]=g=>j.value=!1)}," X ")]),e.createElementVNode("div",We,[e.createVNode(a,{height:"100%"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"top-panel",{topPanelType:I.value},void 0,!0)]),_:3})])],512),[[e.vShow,j.value]]),e.withDirectives(e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("span",null,e.toDisplayString(k.value),1),e.createElementVNode("span",{class:"close",onClick:n[6]||(n[6]=g=>E.value=!1)}," X ")]),e.createElementVNode("div",Qe,[e.createVNode(a,{height:"100%"},{default:e.withCtx(()=>{var g;return[k.value==="场景树"?(e.openBlock(),e.createBlock(R.UrdfTree,{key:0,model:P.value,extraNodes:f.value,onNodeClick:D},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),k.value==="剖面视图"?(e.openBlock(),e.createBlock(H.ClippingPanel,{key:1,value:e.unref(Y),onChange:Ne},null,8,["value"])):e.createCommentVNode("",!0),k.value==="工件树"?(e.openBlock(),e.createBlock(G.WorkpieceTreePanel,{key:2,model:(g=e.unref(pe))==null?void 0:g.obj,onVisibleChange:e.unref(fe),onUpdatePosition:e.unref(he),onUpdateRotation:e.unref(ge)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,E.value]]),e.withDirectives(e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",null,e.toDisplayString(w.value),1),e.createElementVNode("span",{class:"close",onClick:n[7]||(n[7]=g=>T.value=!1)}," X ")]),e.createElementVNode("div",nt,[e.createVNode(a,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(R.JointPanel,{model:P.value},null,8,["model"]),[[e.vShow,w.value==="机床控制"]]),e.withDirectives(e.createVNode(ae,{model:P.value,scene:l.value,xyzbcList:_.value,ref_key:"urdfAnimationPanelRef",ref:r},null,8,["model","scene","xyzbcList"]),[[e.vShow,w.value==="动画仿真"]]),e.renderSlot(t.$slots,"right-panel",{rightPanelType:w.value},void 0,!0)]),_:3})])],512),[[e.vShow,T.value]]),F.value?(e.openBlock(),e.createElementBlock("div",lt,[n[8]||(n[8]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(M.value),1)])):e.createCommentVNode("",!0),e.createVNode(J,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),ot=oe._export_sfc(at,[["__scopeId","data-v-1e73649d"]]);exports.default=ot;
|
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
import { defineComponent as be, ref as r, computed as L, watch as I, onUnmounted as Je, resolveComponent as G, createElementBlock as R, openBlock as T, createElementVNode as a, createCommentVNode as S, createVNode as s, toDisplayString as D, Fragment as Ie, renderList as Ge, withCtx as q, inject as me, shallowRef as ne, onMounted as He, nextTick as Ke, onBeforeUnmount as Xe, withDirectives as E, vShow as J, unref as A, renderSlot as oe, createBlock as re } from "vue";
|
|
2
|
+
import { b1 as We } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BZPnZF-N.js";
|
|
3
|
+
import { s as fe } from "./threeViewerHost-BNnzz6WM.js";
|
|
4
|
+
import { u as Ye, a as Ze, b as qe, C as Qe } from "./iconfont-Dp3iGl32.js";
|
|
5
|
+
import { U as et, u as tt, a as lt, W as at } from "./workpieceTreePanel-CCbVIIlm.js";
|
|
6
|
+
import { c as nt, E as k } from "./index-DsSA-OiE.js";
|
|
7
|
+
import { _ as he } from "./index-DlClEW8i.js";
|
|
8
|
+
import { g as ot, b as st, U as it, J as rt, d as ut } from "./urdfTree-3Jd59vvU.js";
|
|
9
|
+
import { _ as ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
|
+
import { T as y } from "./svgIcon-D-_fXUBL.js";
|
|
11
|
+
import { i as ct } from "./animationData-CEkMmPAJ.js";
|
|
12
|
+
import { O as dt } from "./MTLLoader-Bl6JMZD-.js";
|
|
13
|
+
import { L as vt, j as pt } from "./index-C8IFPtAJ.js";
|
|
14
|
+
const mt = { class: "panel-content" }, ft = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "animation-controls"
|
|
17
|
+
}, ht = { class: "control-row" }, gt = { class: "control-row" }, bt = { class: "frame-info" }, yt = { class: "control-row" }, kt = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "empty-state"
|
|
20
|
+
}, Pt = { class: "dialog-footer" }, wt = /* @__PURE__ */ be({
|
|
21
|
+
__name: "urdfAnimationPanel",
|
|
22
|
+
props: {
|
|
23
|
+
model: {},
|
|
24
|
+
scene: {},
|
|
25
|
+
xyzbcList: {}
|
|
26
|
+
},
|
|
27
|
+
setup(F, { expose: i }) {
|
|
28
|
+
const C = F, u = r([]), U = r(!1), P = r(""), p = r("stopped"), h = r(0), O = r(0), M = r(10), $ = r(null);
|
|
29
|
+
let m = 0;
|
|
30
|
+
const B = r([]), H = L(() => C.model ? ot(C.model).map((c) => c.name) : []), N = L(() => [...H.value]), Q = L(() => N.value.length > 0 ? `请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
31
|
+
${N.value.join(" ")}
|
|
32
|
+
0 0 0 ...
|
|
33
|
+
1 2 3 ...` : "请先加载模型。"), K = L(() => u.value[h.value] || {});
|
|
34
|
+
I(() => C.model, (o) => {
|
|
35
|
+
o ? ($.value = new et(o), B.value = st(o), h.value = 0) : ($.value = null, B.value = []);
|
|
36
|
+
}, { immediate: !0 });
|
|
37
|
+
const z = (o) => {
|
|
38
|
+
if (o < 0 || o >= u.value.length) {
|
|
39
|
+
console.error(`帧索引 ${o} 超出范围`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const l = u.value[o];
|
|
43
|
+
if ($.value) {
|
|
44
|
+
const c = {};
|
|
45
|
+
H.value.forEach((g) => {
|
|
46
|
+
const d = parseFloat(l[g]);
|
|
47
|
+
isNaN(d) || (c[g] = d);
|
|
48
|
+
}), $.value.setJointAngles(c);
|
|
49
|
+
}
|
|
50
|
+
h.value = o, O.value = u.value.length > 1 ? o / (u.value.length - 1) * 100 : 100;
|
|
51
|
+
}, _ = async (o) => {
|
|
52
|
+
try {
|
|
53
|
+
for (let l = h.value; l < u.value.length; l++) {
|
|
54
|
+
if (o !== m) return;
|
|
55
|
+
const c = u.value[l], g = {};
|
|
56
|
+
if ($.value)
|
|
57
|
+
H.value.forEach((d) => {
|
|
58
|
+
const f = parseFloat(c[d]);
|
|
59
|
+
isNaN(f) || (g[d] = f);
|
|
60
|
+
}), await $.value.animateToState(
|
|
61
|
+
g,
|
|
62
|
+
M.value,
|
|
63
|
+
(d) => {
|
|
64
|
+
o === m && (O.value = (l + d) / u.value.length * 100);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
else {
|
|
68
|
+
if (await new Promise((d) => setTimeout(d, M.value)), o !== m) return;
|
|
69
|
+
O.value = (l + 1) / u.value.length * 100;
|
|
70
|
+
}
|
|
71
|
+
h.value = l;
|
|
72
|
+
}
|
|
73
|
+
o === m && (k.success("动画播放完成"), p.value = "stopped", O.value = 100);
|
|
74
|
+
} catch (l) {
|
|
75
|
+
console.error("动画播放出错:", l), k.error("动画播放出错"), p.value = "stopped";
|
|
76
|
+
}
|
|
77
|
+
}, V = () => {
|
|
78
|
+
if (u.value.length === 0) {
|
|
79
|
+
k.error("无动画数据");
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
p.value === "stopped" && (h.value = 0, z(0)), p.value = "playing", m++, _(m), k.info("动画播放中");
|
|
83
|
+
}, x = () => {
|
|
84
|
+
p.value === "playing" && (m++, p.value = "paused", k.info("动画已暂停"));
|
|
85
|
+
}, X = () => {
|
|
86
|
+
m++, p.value = "stopped", h.value = 0, O.value = 0, z(0), k.info("动画已停止并重置");
|
|
87
|
+
}, ee = () => {
|
|
88
|
+
p.value === "playing" ? x() : V();
|
|
89
|
+
}, j = (o) => {
|
|
90
|
+
m++, p.value = "paused", z(o);
|
|
91
|
+
}, W = () => {
|
|
92
|
+
if (!P.value.trim()) {
|
|
93
|
+
k.warning("导入内容不能为空");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const o = P.value.trim().split(`
|
|
97
|
+
`).filter((f) => f.trim() !== "");
|
|
98
|
+
if (o.length < 2) {
|
|
99
|
+
k.error("导入数据至少需要包含表头行和一行数据");
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const l = o[0].split(" ").map((f) => f.trim()), c = {};
|
|
103
|
+
if (l.forEach((f, v) => {
|
|
104
|
+
N.value.includes(f) && (c[v] = f);
|
|
105
|
+
}), Object.keys(c).length === 0) {
|
|
106
|
+
k.error("没有找到匹配的表头,请检查表头名称是否正确");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const d = o.slice(1).map((f) => {
|
|
110
|
+
const v = f.split(" "), w = {};
|
|
111
|
+
return N.value.forEach((Y) => {
|
|
112
|
+
w[Y] = "0";
|
|
113
|
+
}), Object.entries(c).forEach(([Y, te]) => {
|
|
114
|
+
const Z = v[parseInt(Y)];
|
|
115
|
+
Z !== void 0 && Z.trim() !== "" && (w[te] = Z.trim());
|
|
116
|
+
}), w;
|
|
117
|
+
});
|
|
118
|
+
d.length > 0 ? (u.value = d, k.success(`成功导入 ${d.length} 行数据!`), U.value = !1, P.value = "", X()) : k.error("未能解析到有效数据,请检查格式。");
|
|
119
|
+
};
|
|
120
|
+
I(() => C.xyzbcList, () => {
|
|
121
|
+
C.xyzbcList && (u.value = nt(C.xyzbcList));
|
|
122
|
+
}, {
|
|
123
|
+
immediate: !0
|
|
124
|
+
});
|
|
125
|
+
const se = (o) => `第 ${o + 1} 帧`;
|
|
126
|
+
return i({
|
|
127
|
+
handlePlayPause: ee,
|
|
128
|
+
playAnimation: V,
|
|
129
|
+
pauseAnimation: x,
|
|
130
|
+
stopAnimation: X
|
|
131
|
+
}), Je(() => {
|
|
132
|
+
m++;
|
|
133
|
+
}), (o, l) => {
|
|
134
|
+
const c = G("el-input-number"), g = G("el-slider"), d = G("el-input"), f = G("el-dialog");
|
|
135
|
+
return T(), R("div", mt, [
|
|
136
|
+
l[11] || (l[11] = a("div", { class: "action-bar" }, null, -1)),
|
|
137
|
+
u.value.length > 0 ? (T(), R("div", ft, [
|
|
138
|
+
a("div", ht, [
|
|
139
|
+
l[5] || (l[5] = a("label", null, "帧间隔 (ms):", -1)),
|
|
140
|
+
s(c, {
|
|
141
|
+
modelValue: M.value,
|
|
142
|
+
"onUpdate:modelValue": l[0] || (l[0] = (v) => M.value = v),
|
|
143
|
+
min: 10,
|
|
144
|
+
max: 5e3,
|
|
145
|
+
step: 100,
|
|
146
|
+
size: "small",
|
|
147
|
+
style: { width: "120px" }
|
|
148
|
+
}, null, 8, ["modelValue"])
|
|
149
|
+
]),
|
|
150
|
+
a("div", gt, [
|
|
151
|
+
l[6] || (l[6] = a("label", null, "当前帧:", -1)),
|
|
152
|
+
a("span", bt, D(h.value + 1) + " / " + D(u.value.length), 1)
|
|
153
|
+
]),
|
|
154
|
+
a("div", yt, [
|
|
155
|
+
l[7] || (l[7] = a("label", null, "动画进度:", -1)),
|
|
156
|
+
s(g, {
|
|
157
|
+
modelValue: h.value,
|
|
158
|
+
"onUpdate:modelValue": l[1] || (l[1] = (v) => h.value = v),
|
|
159
|
+
min: 0,
|
|
160
|
+
max: u.value.length > 0 ? u.value.length - 1 : 0,
|
|
161
|
+
step: 1,
|
|
162
|
+
"format-tooltip": se,
|
|
163
|
+
onInput: j,
|
|
164
|
+
disabled: u.value.length === 0 || p.value === "playing",
|
|
165
|
+
style: { "flex-grow": "1", margin: "0 10px" }
|
|
166
|
+
}, null, 8, ["modelValue", "max", "disabled"])
|
|
167
|
+
]),
|
|
168
|
+
a("div", null, [
|
|
169
|
+
l[8] || (l[8] = a("label", null, "当前帧数据:", -1)),
|
|
170
|
+
a("div", null, [
|
|
171
|
+
K.value ? (T(!0), R(Ie, { key: 0 }, Ge(K.value, (v, w) => (T(), R("div", { key: w }, D(w) + ": " + D(v), 1))), 128)) : S("", !0)
|
|
172
|
+
])
|
|
173
|
+
])
|
|
174
|
+
])) : S("", !0),
|
|
175
|
+
u.value.length === 0 ? (T(), R("div", kt, l[9] || (l[9] = [
|
|
176
|
+
a("p", null, "请先创建数据", -1)
|
|
177
|
+
]))) : S("", !0),
|
|
178
|
+
s(f, {
|
|
179
|
+
modelValue: U.value,
|
|
180
|
+
"onUpdate:modelValue": l[4] || (l[4] = (v) => U.value = v),
|
|
181
|
+
title: "导入数据",
|
|
182
|
+
width: "500px"
|
|
183
|
+
}, {
|
|
184
|
+
footer: q(() => [
|
|
185
|
+
a("span", Pt, [
|
|
186
|
+
s(he, {
|
|
187
|
+
modelValue: "取消",
|
|
188
|
+
onClick: l[3] || (l[3] = (v) => U.value = !1)
|
|
189
|
+
}),
|
|
190
|
+
s(he, {
|
|
191
|
+
modelValue: "确认导入",
|
|
192
|
+
onClick: W,
|
|
193
|
+
type: "primary"
|
|
194
|
+
})
|
|
195
|
+
])
|
|
196
|
+
]),
|
|
197
|
+
default: q(() => [
|
|
198
|
+
l[10] || (l[10] = a("p", { class: "import-instructions" }, " 请从Excel或CSV中复制数据 (首行为表头, Tab分隔) ", -1)),
|
|
199
|
+
s(d, {
|
|
200
|
+
modelValue: P.value,
|
|
201
|
+
"onUpdate:modelValue": l[2] || (l[2] = (v) => P.value = v),
|
|
202
|
+
type: "textarea",
|
|
203
|
+
rows: 10,
|
|
204
|
+
placeholder: Q.value
|
|
205
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
206
|
+
]),
|
|
207
|
+
_: 1,
|
|
208
|
+
__: [10]
|
|
209
|
+
}, 8, ["modelValue"])
|
|
210
|
+
]);
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}), ge = /* @__PURE__ */ ye(wt, [["__scopeId", "data-v-00d63f4b"]]), Ct = async (F) => await new dt().loadAsync(F), _t = async (F) => await Ct(F), xt = { class: "obj-viewer-container" }, zt = { class: "buttonGroup-topLeft" }, Lt = { class: "buttonGroup-left" }, Tt = { class: "buttonGroup-right" }, Ut = { class: "buttonGroup-bottom" }, $t = { class: "top-panel" }, jt = { class: "panel-header" }, At = { class: "panel-body" }, Nt = { class: "left-panel" }, Vt = { class: "panel-header" }, Dt = { class: "panel-body" }, Ft = { class: "right-panel" }, Ot = { class: "panel-header" }, Rt = { class: "panel-body" }, St = {
|
|
214
|
+
key: 0,
|
|
215
|
+
class: "loading-overlay"
|
|
216
|
+
}, Mt = /* @__PURE__ */ be({
|
|
217
|
+
__name: "threeSceneViewForCPMPIP",
|
|
218
|
+
props: {
|
|
219
|
+
fileBlobs: { default: () => [] },
|
|
220
|
+
threeData: {}
|
|
221
|
+
},
|
|
222
|
+
setup(F) {
|
|
223
|
+
const i = F, C = me("setManagementPageTitle"), u = me("setManagementPageVisible"), U = L(() => {
|
|
224
|
+
var t, n;
|
|
225
|
+
return (n = (t = i == null ? void 0 : i.threeData) == null ? void 0 : t.data) == null ? void 0 : n.machine;
|
|
226
|
+
}), P = L(() => {
|
|
227
|
+
var t, n;
|
|
228
|
+
return (n = (t = i == null ? void 0 : i.threeData) == null ? void 0 : t.data) == null ? void 0 : n.workpieceInfo;
|
|
229
|
+
}), p = L(() => {
|
|
230
|
+
var t, n;
|
|
231
|
+
return (n = (t = i == null ? void 0 : i.threeData) == null ? void 0 : t.data) == null ? void 0 : n.knife;
|
|
232
|
+
}), h = r([]), O = async (e) => {
|
|
233
|
+
!e || !e.isExtra || (await M(e), C == null || C(e == null ? void 0 : e.pageName), u == null || u(!0));
|
|
234
|
+
}, M = vt(async (e) => {
|
|
235
|
+
await pt();
|
|
236
|
+
const { mainKey: t, baseMenuPath: n } = e || {};
|
|
237
|
+
We(n, t);
|
|
238
|
+
}, 500);
|
|
239
|
+
I(
|
|
240
|
+
() => [U.value, P.value, p.value],
|
|
241
|
+
() => {
|
|
242
|
+
var b, de, ve, pe;
|
|
243
|
+
const e = [], t = {
|
|
244
|
+
pageName: "机床",
|
|
245
|
+
name: "机床",
|
|
246
|
+
label: "机床",
|
|
247
|
+
type: "机床",
|
|
248
|
+
id: "机床",
|
|
249
|
+
path: "机床",
|
|
250
|
+
baseMenuPath: "设备库/机床",
|
|
251
|
+
children: [],
|
|
252
|
+
show: !0,
|
|
253
|
+
isPenultimate: !1
|
|
254
|
+
};
|
|
255
|
+
U.value && t.children.push({
|
|
256
|
+
isExtra: !0,
|
|
257
|
+
pageName: "机床",
|
|
258
|
+
mainKey: U.value,
|
|
259
|
+
label: U.value,
|
|
260
|
+
baseMenuPath: "设备库/机床"
|
|
261
|
+
});
|
|
262
|
+
const n = {
|
|
263
|
+
pageName: "工件",
|
|
264
|
+
name: "工件",
|
|
265
|
+
label: "工件",
|
|
266
|
+
type: "工件",
|
|
267
|
+
id: "工件",
|
|
268
|
+
path: "工件",
|
|
269
|
+
baseMenuPath: "设备库/机床",
|
|
270
|
+
children: [],
|
|
271
|
+
show: !0,
|
|
272
|
+
isPenultimate: !1
|
|
273
|
+
};
|
|
274
|
+
P.value && n.children.push({
|
|
275
|
+
isExtra: !0,
|
|
276
|
+
type: (b = P.value) == null ? void 0 : b.type,
|
|
277
|
+
pageName: "工件",
|
|
278
|
+
mainKey: (de = P.value) == null ? void 0 : de.name,
|
|
279
|
+
label: (ve = P.value) == null ? void 0 : ve.name,
|
|
280
|
+
baseMenuPath: `工件库/${(pe = P.value) == null ? void 0 : pe.type}`
|
|
281
|
+
});
|
|
282
|
+
const ae = {
|
|
283
|
+
pageName: "刀具",
|
|
284
|
+
name: "刀具",
|
|
285
|
+
label: "刀具",
|
|
286
|
+
type: "刀具",
|
|
287
|
+
id: "刀具",
|
|
288
|
+
path: "刀具",
|
|
289
|
+
children: [],
|
|
290
|
+
show: !0,
|
|
291
|
+
isPenultimate: !1
|
|
292
|
+
};
|
|
293
|
+
p.value && ae.children.push({
|
|
294
|
+
isExtra: !0,
|
|
295
|
+
pageName: "刀具",
|
|
296
|
+
mainKey: p.value,
|
|
297
|
+
label: p.value,
|
|
298
|
+
baseMenuPath: "设备库/刀具"
|
|
299
|
+
}), e.push(t, n, ae), h.value = e;
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
immediate: !0
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
const $ = r([]), m = L(() => {
|
|
306
|
+
var t, n;
|
|
307
|
+
return (n = (t = i == null ? void 0 : i.threeData) == null ? void 0 : t.data) == null ? void 0 : n.csvUrl;
|
|
308
|
+
});
|
|
309
|
+
I(() => m.value, async () => {
|
|
310
|
+
if (console.log("three data", i == null ? void 0 : i.threeData), console.log("csvUrl", m.value), m.value) {
|
|
311
|
+
const e = await ct(m.value);
|
|
312
|
+
$.value = e;
|
|
313
|
+
}
|
|
314
|
+
}, {
|
|
315
|
+
immediate: !0
|
|
316
|
+
});
|
|
317
|
+
const B = L(() => {
|
|
318
|
+
var t, n;
|
|
319
|
+
return (n = (t = i == null ? void 0 : i.threeData) == null ? void 0 : t.data) == null ? void 0 : n.bladeObjUrl;
|
|
320
|
+
}), H = r(fe.ROBOT), N = r(null), Q = r(!1), K = r(""), z = r(!1), _ = r(""), V = r(!1), x = r(""), X = r(!1), ee = r(""), j = ne(null), W = r("叶片模型"), se = ne(null), o = ne(null), l = ne(null), c = r(ge), {
|
|
321
|
+
currentModels: g,
|
|
322
|
+
resetView: d,
|
|
323
|
+
initThreeJS: f,
|
|
324
|
+
handleResize: v,
|
|
325
|
+
getThreeJSObjects: w,
|
|
326
|
+
cleanup: Y,
|
|
327
|
+
setAndFitModels: te,
|
|
328
|
+
axesHelperVisible: Z,
|
|
329
|
+
toggleAxesVisibility: ke
|
|
330
|
+
} = Ye(N), { loadSceneFromFile: Pe } = lt(
|
|
331
|
+
w,
|
|
332
|
+
g,
|
|
333
|
+
Q,
|
|
334
|
+
K
|
|
335
|
+
), { isAnimating: ue, toggleAnimation: we, startAnimation: Bt, stopAnimation: Ce } = Ze(w, g), { isClipping: _e, activeClippingAxis: ce, toggleClipping: xe, updateClippingPlanes: ze } = qe(w, g), { initRaycaster: Le, selectedObject3D: Te, setSelectedObjVisible: Ue, updatePosition: $e, updateRotation: je, dispose: Ae } = tt(N, w, g), Ne = () => {
|
|
336
|
+
ke();
|
|
337
|
+
}, Ve = (e) => {
|
|
338
|
+
ce.value = e, ze();
|
|
339
|
+
}, De = L(() => H.value === fe.ROBOT), le = (e) => {
|
|
340
|
+
z.value = !0, _.value = e, e === "剖面视图" && !_e.value && xe();
|
|
341
|
+
}, ie = (e) => {
|
|
342
|
+
V.value = !0, x.value = e;
|
|
343
|
+
}, Fe = () => {
|
|
344
|
+
var e;
|
|
345
|
+
(e = c.value) == null || e.handlePlayPause();
|
|
346
|
+
}, Oe = () => {
|
|
347
|
+
var e;
|
|
348
|
+
(e = c.value) == null || e.pauseAnimation();
|
|
349
|
+
}, Re = () => {
|
|
350
|
+
var e;
|
|
351
|
+
(e = c.value) == null || e.stopAnimation();
|
|
352
|
+
}, Se = (e, t) => ut(e, t), Me = async (e) => {
|
|
353
|
+
const t = Se(e, W.value);
|
|
354
|
+
if (o.value = t, console.log("bladeObjUrl", B.value), t && t.parent && B.value) {
|
|
355
|
+
const n = await _t(B.value);
|
|
356
|
+
n.name = "blade_clone", t.parent.add(n), n.position.copy(t.position), n.rotation.copy(t.rotation), n.scale.copy(t.scale), t.visible = !1, se.value = n;
|
|
357
|
+
} else
|
|
358
|
+
W.value && console.warn(`在 Blade '${W.value}' 中未找到可替换的网格或其没有父级。`);
|
|
359
|
+
};
|
|
360
|
+
I(() => i.fileBlobs, (e) => {
|
|
361
|
+
if (e && e.length > 0) {
|
|
362
|
+
const t = e[0];
|
|
363
|
+
if (!t.name.toLowerCase().endsWith(".urdf"))
|
|
364
|
+
return;
|
|
365
|
+
Pe(t).then((n) => {
|
|
366
|
+
j.value = n, n && Me(n);
|
|
367
|
+
}).catch((n) => {
|
|
368
|
+
console.error("加载URDF文件时发生错误:", n), k.error("加载urdf模型失败"), j.value = null;
|
|
369
|
+
});
|
|
370
|
+
} else
|
|
371
|
+
j.value = null;
|
|
372
|
+
}, {
|
|
373
|
+
immediate: !0,
|
|
374
|
+
deep: !0
|
|
375
|
+
}), I(j, (e) => {
|
|
376
|
+
te(e ? [e] : []), Le();
|
|
377
|
+
});
|
|
378
|
+
const Be = () => {
|
|
379
|
+
f(), window.addEventListener("resize", v);
|
|
380
|
+
const e = w();
|
|
381
|
+
l.value = e.scene;
|
|
382
|
+
}, Ee = () => {
|
|
383
|
+
_.value = "", x.value = "", window.removeEventListener("resize", v), ue.value && Ce(), Y(), Ae();
|
|
384
|
+
};
|
|
385
|
+
return He(async () => {
|
|
386
|
+
await Ke();
|
|
387
|
+
try {
|
|
388
|
+
Be();
|
|
389
|
+
} catch (e) {
|
|
390
|
+
console.error("Three.js 初始化失败:", e), k.error("渲染引擎初始化失败!");
|
|
391
|
+
}
|
|
392
|
+
}), Xe(() => {
|
|
393
|
+
Ee();
|
|
394
|
+
}), (e, t) => {
|
|
395
|
+
const n = G("el-scrollbar"), ae = G("PipeAnalysisPanel");
|
|
396
|
+
return T(), R("div", xt, [
|
|
397
|
+
E(a("div", {
|
|
398
|
+
ref_key: "threejsContainer",
|
|
399
|
+
ref: N,
|
|
400
|
+
class: "threejs-container"
|
|
401
|
+
}, null, 512), [
|
|
402
|
+
[J, De.value]
|
|
403
|
+
]),
|
|
404
|
+
t[9] || (t[9] = a("div", { class: "buttonGroup-top" }, null, -1)),
|
|
405
|
+
a("div", zt, [
|
|
406
|
+
s(y, {
|
|
407
|
+
name: "viewReset",
|
|
408
|
+
size: "24",
|
|
409
|
+
onClick: A(d),
|
|
410
|
+
title: "重置"
|
|
411
|
+
}, null, 8, ["onClick"]),
|
|
412
|
+
s(y, {
|
|
413
|
+
name: "fangda",
|
|
414
|
+
size: "24",
|
|
415
|
+
title: "放大"
|
|
416
|
+
}),
|
|
417
|
+
s(y, {
|
|
418
|
+
name: "suoxiao",
|
|
419
|
+
size: "24",
|
|
420
|
+
title: "缩小"
|
|
421
|
+
}),
|
|
422
|
+
s(y, {
|
|
423
|
+
name: "lookAround",
|
|
424
|
+
size: "24",
|
|
425
|
+
onClick: A(we),
|
|
426
|
+
title: A(ue) ? "停止动画" : "动画视图"
|
|
427
|
+
}, null, 8, ["onClick", "title"]),
|
|
428
|
+
s(y, {
|
|
429
|
+
name: "zuobiaoxi",
|
|
430
|
+
size: "24",
|
|
431
|
+
active: A(Z),
|
|
432
|
+
onClick: Ne,
|
|
433
|
+
title: "显隐坐标轴"
|
|
434
|
+
}, null, 8, ["active"])
|
|
435
|
+
]),
|
|
436
|
+
a("div", Lt, [
|
|
437
|
+
oe(e.$slots, "button-left", { switchRightPanel: le }, void 0, !0),
|
|
438
|
+
s(y, {
|
|
439
|
+
name: "jiegoushu",
|
|
440
|
+
size: "24",
|
|
441
|
+
onClick: t[0] || (t[0] = (b) => le("场景树")),
|
|
442
|
+
active: z.value && _.value === "场景树",
|
|
443
|
+
title: "场景树"
|
|
444
|
+
}, null, 8, ["active"]),
|
|
445
|
+
s(y, {
|
|
446
|
+
name: "clipping",
|
|
447
|
+
size: "24",
|
|
448
|
+
onClick: t[1] || (t[1] = (b) => le("剖面视图")),
|
|
449
|
+
active: z.value && _.value === "剖面视图",
|
|
450
|
+
title: "剖面视图"
|
|
451
|
+
}, null, 8, ["active"]),
|
|
452
|
+
s(y, {
|
|
453
|
+
name: "donghuafangzhen",
|
|
454
|
+
size: "24",
|
|
455
|
+
onClick: t[2] || (t[2] = (b) => le("工件树")),
|
|
456
|
+
active: z.value && _.value === "工件树"
|
|
457
|
+
}, null, 8, ["active"])
|
|
458
|
+
]),
|
|
459
|
+
a("div", Tt, [
|
|
460
|
+
oe(e.$slots, "button-right", { switchRightPanel: ie }, void 0, !0),
|
|
461
|
+
s(y, {
|
|
462
|
+
name: "jichuangxuanze",
|
|
463
|
+
size: "24",
|
|
464
|
+
onClick: t[3] || (t[3] = (b) => ie("机床控制")),
|
|
465
|
+
active: V.value && x.value === "机床控制",
|
|
466
|
+
title: "机床控制"
|
|
467
|
+
}, null, 8, ["active"]),
|
|
468
|
+
s(y, {
|
|
469
|
+
name: "donghuafangzhen",
|
|
470
|
+
size: "24",
|
|
471
|
+
title: "动画仿真",
|
|
472
|
+
onClick: t[4] || (t[4] = (b) => ie("动画仿真")),
|
|
473
|
+
active: V.value && x.value === "动画仿真"
|
|
474
|
+
}, null, 8, ["active"])
|
|
475
|
+
]),
|
|
476
|
+
a("div", Ut, [
|
|
477
|
+
s(y, {
|
|
478
|
+
name: "bofang",
|
|
479
|
+
size: "24",
|
|
480
|
+
backgroundColor: "#ffffff",
|
|
481
|
+
title: "播放",
|
|
482
|
+
onClick: Fe
|
|
483
|
+
}),
|
|
484
|
+
s(y, {
|
|
485
|
+
name: "zanting",
|
|
486
|
+
size: "24",
|
|
487
|
+
backgroundColor: "#ffffff",
|
|
488
|
+
title: "暂停",
|
|
489
|
+
onClick: Oe
|
|
490
|
+
}),
|
|
491
|
+
s(y, {
|
|
492
|
+
name: "zhongzhi",
|
|
493
|
+
size: "24",
|
|
494
|
+
backgroundColor: "#ffffff",
|
|
495
|
+
title: "停止",
|
|
496
|
+
onClick: Re
|
|
497
|
+
})
|
|
498
|
+
]),
|
|
499
|
+
E(a("div", $t, [
|
|
500
|
+
a("div", jt, [
|
|
501
|
+
a("span", null, D(ee.value), 1),
|
|
502
|
+
a("span", {
|
|
503
|
+
class: "close",
|
|
504
|
+
onClick: t[5] || (t[5] = (b) => X.value = !1)
|
|
505
|
+
}, " X ")
|
|
506
|
+
]),
|
|
507
|
+
a("div", At, [
|
|
508
|
+
s(n, { height: "100%" }, {
|
|
509
|
+
default: q(() => [
|
|
510
|
+
oe(e.$slots, "top-panel", { topPanelType: ee.value }, void 0, !0)
|
|
511
|
+
]),
|
|
512
|
+
_: 3
|
|
513
|
+
})
|
|
514
|
+
])
|
|
515
|
+
], 512), [
|
|
516
|
+
[J, X.value]
|
|
517
|
+
]),
|
|
518
|
+
E(a("div", Nt, [
|
|
519
|
+
a("div", Vt, [
|
|
520
|
+
a("span", null, D(_.value), 1),
|
|
521
|
+
a("span", {
|
|
522
|
+
class: "close",
|
|
523
|
+
onClick: t[6] || (t[6] = (b) => z.value = !1)
|
|
524
|
+
}, " X ")
|
|
525
|
+
]),
|
|
526
|
+
a("div", Dt, [
|
|
527
|
+
s(n, { height: "100%" }, {
|
|
528
|
+
default: q(() => {
|
|
529
|
+
var b;
|
|
530
|
+
return [
|
|
531
|
+
_.value === "场景树" ? (T(), re(it, {
|
|
532
|
+
key: 0,
|
|
533
|
+
model: j.value,
|
|
534
|
+
extraNodes: h.value,
|
|
535
|
+
onNodeClick: O
|
|
536
|
+
}, null, 8, ["model", "extraNodes"])) : S("", !0),
|
|
537
|
+
_.value === "剖面视图" ? (T(), re(Qe, {
|
|
538
|
+
key: 1,
|
|
539
|
+
value: A(ce),
|
|
540
|
+
onChange: Ve
|
|
541
|
+
}, null, 8, ["value"])) : S("", !0),
|
|
542
|
+
_.value === "工件树" ? (T(), re(at, {
|
|
543
|
+
key: 2,
|
|
544
|
+
model: (b = A(Te)) == null ? void 0 : b.obj,
|
|
545
|
+
onVisibleChange: A(Ue),
|
|
546
|
+
onUpdatePosition: A($e),
|
|
547
|
+
onUpdateRotation: A(je)
|
|
548
|
+
}, null, 8, ["model", "onVisibleChange", "onUpdatePosition", "onUpdateRotation"])) : S("", !0)
|
|
549
|
+
];
|
|
550
|
+
}),
|
|
551
|
+
_: 1
|
|
552
|
+
})
|
|
553
|
+
])
|
|
554
|
+
], 512), [
|
|
555
|
+
[J, z.value]
|
|
556
|
+
]),
|
|
557
|
+
E(a("div", Ft, [
|
|
558
|
+
a("div", Ot, [
|
|
559
|
+
a("span", null, D(x.value), 1),
|
|
560
|
+
a("span", {
|
|
561
|
+
class: "close",
|
|
562
|
+
onClick: t[7] || (t[7] = (b) => V.value = !1)
|
|
563
|
+
}, " X ")
|
|
564
|
+
]),
|
|
565
|
+
a("div", Rt, [
|
|
566
|
+
s(n, { height: "100%" }, {
|
|
567
|
+
default: q(() => [
|
|
568
|
+
E(s(rt, { model: j.value }, null, 8, ["model"]), [
|
|
569
|
+
[J, x.value === "机床控制"]
|
|
570
|
+
]),
|
|
571
|
+
E(s(ge, {
|
|
572
|
+
model: j.value,
|
|
573
|
+
scene: l.value,
|
|
574
|
+
xyzbcList: $.value,
|
|
575
|
+
ref_key: "urdfAnimationPanelRef",
|
|
576
|
+
ref: c
|
|
577
|
+
}, null, 8, ["model", "scene", "xyzbcList"]), [
|
|
578
|
+
[J, x.value === "动画仿真"]
|
|
579
|
+
]),
|
|
580
|
+
oe(e.$slots, "right-panel", { rightPanelType: x.value }, void 0, !0)
|
|
581
|
+
]),
|
|
582
|
+
_: 3
|
|
583
|
+
})
|
|
584
|
+
])
|
|
585
|
+
], 512), [
|
|
586
|
+
[J, V.value]
|
|
587
|
+
]),
|
|
588
|
+
Q.value ? (T(), R("div", St, [
|
|
589
|
+
t[8] || (t[8] = a("div", { class: "loading-spinner" }, null, -1)),
|
|
590
|
+
a("p", null, D(K.value), 1)
|
|
591
|
+
])) : S("", !0),
|
|
592
|
+
s(ae, { ref: "pipeAnalysisPanelRef" }, null, 512)
|
|
593
|
+
]);
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
}), tl = /* @__PURE__ */ ye(Mt, [["__scopeId", "data-v-1e73649d"]]);
|
|
597
|
+
export {
|
|
598
|
+
tl as default
|
|
599
|
+
};
|