ss-component-new 1.3.477 → 1.3.478
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/{array-CT50xH3_.js → array-CdymP2Bv.js} +2 -2
- package/dist/{array-DLCrWhLk.cjs → array-Dig7BYmd.cjs} +1 -1
- package/dist/{index-Bb3lZIu8.js → index-4dupsHwD.js} +8 -8
- package/dist/{index-B1v2-GVC.cjs → index-BAsHBLV9.cjs} +1 -1
- package/dist/{index-nNoZ_LmT.cjs → index-BBoQVqN7.cjs} +1 -1
- package/dist/{index-Cwoe3CVm.js → index-BC7q-_1x.js} +2 -2
- package/dist/{index-9xwjCDdC.cjs → index-BIarUBh3.cjs} +1 -1
- package/dist/{index-CLCAJp3r.js → index-BJiZQ7II.js} +6 -5
- package/dist/{index-BRlo6hEo.cjs → index-BPNwGIHv.cjs} +1 -1
- package/dist/{index-BTsZZITH.cjs → index-BT6bHqwx.cjs} +1 -1
- package/dist/{index-D6i5AAfI.cjs → index-C1CYcu7q.cjs} +1 -1
- package/dist/{index-OtAdp5I3.cjs → index-C1kHWH8t.cjs} +1 -1
- package/dist/{index-DCFSkaq3.js → index-CUifMLL3.js} +2 -2
- package/dist/{index-bx2qkTcB.js → index-CeP6fhJc.js} +1 -1
- package/dist/{index-CagXBqkS.cjs → index-CsRZ0i07.cjs} +1 -1
- package/dist/{index-DanpISJC.cjs → index-D-4qtOLZ.cjs} +1 -1
- package/dist/{index-By3nE_MX.js → index-D2eCwes8.js} +1 -1
- package/dist/index-D8TN_LEZ.cjs +1 -0
- package/dist/{index-PodRwgKA.cjs → index-DIukLdKX.cjs} +1 -1
- package/dist/{index-CPu7VjGs.js → index-DLCA5vqn.js} +1 -1
- package/dist/{index-ckHrJ9I8.js → index-DPecDRMu.js} +1 -1
- package/dist/{index-eZEQVS4o.cjs → index-DhYB0JA5.cjs} +1 -1
- package/dist/{index-B7Y6ZTSl.js → index-HfmR8WSM.js} +2 -2
- package/dist/{index-Zyl3KK85.js → index-JW1bo4Ef.js} +27 -27
- package/dist/{index-B3IeyAe9.js → index-XhTww7Yz.js} +1 -1
- package/dist/{index-w9yld9mA.js → index-jIB-S19a.js} +1 -1
- package/dist/{main-SXWy3Tpb.js → main-55wPj31J.js} +2 -2
- package/dist/{main-DnJrebVO.cjs → main-DUkp4ZQk.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.js +5 -5
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-iUcTQUiB.cjs → threeModel-Boe7qRNS.cjs} +1 -1
- package/dist/{threeModel-DlTttqQQ.js → threeModel-D4XUjqeo.js} +1 -1
- package/dist/{threeSceneView-DsBYR79k.cjs → threeSceneView-C8X9qGmq.cjs} +1 -1
- package/dist/{threeSceneView-OFwfu78i.js → threeSceneView-Q1x-IsSk.js} +3 -3
- package/dist/{threeSceneViewForCPMPIP-BGWt8zEz.js → threeSceneViewForCPMPIP-CEeuM1ZH.js} +1 -1
- package/dist/{threeSceneViewForCPMPIP-BHkUWgu0.cjs → threeSceneViewForCPMPIP-DCTKrIm1.cjs} +1 -1
- package/dist/{threeViewerHost-BNhhR6FK.js → threeViewerHost-DQichI1a.js} +1 -1
- package/dist/{threeViewerHost-4LZV9Vmj.cjs → threeViewerHost-eV1nqK_z.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-BFYPJp0M.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-eV1nqK_z.cjs"),pe=require("./iconfont-Cle12c12.cjs"),fe=require("./workpieceTreePanel-o9WH_Qrq.cjs"),Te=require("./index-CMUsYepp.cjs"),B=require("./request-Dl8yi2iS.cjs");;/* empty css */const s=require("./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-Byr5bNn8.cjs");require("./index-C1kHWH8t.cjs");require("./index-BpPyaNFa.cjs");const le=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),me=require("./index-B7964G2F.cjs");require("./index-BT6bHqwx.cjs");require("./index-DXiuTpL6.cjs");const he=require("./animationData-BcPlDaUu.cjs"),ie=require("./urdfTree-Bys_2Khv.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ee=require("./index-B-pflqKE.cjs"),R=require("./svgIcon-CDPAgQbj.cjs"),G=.001,W=s.MathUtils.degToRad,_e=new s.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:s.DoubleSide});function Se(V=.005,v=64){const p=new s.CatmullRomCurve3([new s.Vector3(0,0,0),new s.Vector3(0,0,0)]),n=new s.TubeGeometry(p,v,V,16,!1),m=_e;return new s.Mesh(n,m)}const ke=V=>V.reduce((v,p)=>{let n=0;const m=p.Y??0,b=p.C??0,r=p.R??0;return m>0&&(n+=m),b>0&&r>0&&(n+=r*W(b)),v+n},0),Me=V=>{const v=[],p=V.Y??0,n=V.B??0,m=V.C??0,b=V.R??0,r={pos:new s.Vector3(0,0,0),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};if(!p&&!m)return v;if(v.push(r.pos.clone()),n!==0){const g=new s.Matrix4().makeRotationAxis(r.localY,W(n));r.localX.applyMatrix4(g),r.localZ.applyMatrix4(g)}if(p>0&&(r.pos.add(r.localY.clone().multiplyScalar(p*G)),v.push(r.pos.clone())),m>0&&b>0){const g=W(m),f=b*G,w=r.pos.clone().add(r.localX.clone().multiplyScalar(-f)),a=Math.max(16,Math.ceil(m/5));for(let y=1;y<=a;y++){const d=g*y/a,_=new s.Matrix4().makeRotationAxis(r.localZ,d),u=r.localX.clone().multiplyScalar(f).applyMatrix4(_),k=w.clone().add(u);v.push(k)}}return v};function Pe(V,v){const p=new s.Group;p.name="CompletePipe";const n={pos:new s.Vector3(0,0,0),localX:new s.Vector3(1,0,0),localY:new s.Vector3(0,1,0),localZ:new s.Vector3(0,0,1)};let m=0,b=1;for(let r=0;r<V.length;r++){const g=V[r],f=g.Y??0,w=g.B??0,a=g.C??0,y=g.R??0;if(w!==0){const d=new s.Matrix4().makeRotationAxis(n.localY,W(w));n.localX.applyMatrix4(d),n.localZ.applyMatrix4(d)}if(f>0){const d=n.pos.clone();n.pos.add(n.localY.clone().multiplyScalar(f*G));const _=n.pos.clone(),c=Re(d,_,v*G);c.userData={segmentType:"straight",segmentIndex:m,frameIndex:r,length:f,frame:{Y:f,B:w,C:a,R:y}},c.name=`直段_${m}`,p.add(c);const u=d.clone();De(p,b,u,v*G),m++}if(a>0&&y>0){const d=W(a),_=y*G,c=[];c.push(n.pos.clone());const u=n.pos.clone().add(n.localX.clone().multiplyScalar(-_)),k=Math.max(16,Math.ceil(a/5));for(let h=1;h<=k;h++){const M=d*h/k,A=new s.Matrix4().makeRotationAxis(n.localZ,M),L=n.localX.clone().multiplyScalar(_).applyMatrix4(A),X=u.clone().add(L);c.push(X)}const E=Be(c,v*G);E.userData={segmentType:"bend",segmentIndex:m,frameIndex:r,angle:a,radius:y,centerPoint:u.toArray(),frame:{Y:f,B:w,C:a,R:y}},E.name=`弯段_${m}`,p.add(E),Math.floor(c.length/2),c[0],n.pos=c[c.length-1].clone();const S=new s.Matrix4().makeRotationAxis(n.localZ,d);n.localY.applyMatrix4(S),n.localX.applyMatrix4(S),m++,b++}}return p}function De(V,v,p,n){const m=new s.Vector3(0,n*2,n*5),b=p.clone().add(m),r=[p,b],g=new s.BufferGeometry().setFromPoints(r),f=new s.LineDashedMaterial({color:16711680,dashSize:n*.5,gapSize:n*.3,linewidth:1}),w=new s.Line(g,f);w.computeLineDistances(),V.add(w);const a=document.createElement("canvas"),y=a.getContext("2d");a.width=128,a.height=128,y.clearRect(0,0,128,128),y.fillStyle="#FF0000",y.font="bold 80px Arial",y.textAlign="center",y.textBaseline="middle",y.fillText(v.toString(),64,64);const d=new s.CanvasTexture(a),_=new s.SpriteMaterial({map:d,transparent:!0,depthTest:!1,depthWrite:!1}),c=new s.Sprite(_),u=n*3;c.scale.set(u,u,1),c.position.copy(b),c.name=`Label_${v}`,c.userData={labelNumber:v},V.add(c)}function Re(V,v,p){const n=new s.LineCurve3(V,v),m=new s.TubeGeometry(n,2,p,18,!1);return new s.Mesh(m,_e)}function Be(V,v){const p=new s.CatmullRomCurve3(V,!1,"catmullrom",.01),n=new s.TubeGeometry(p,Math.max(16,V.length*2),v,18,!1);return new s.Mesh(n,_e)}function Ce(V,v,p,n,m,b=0){let r=v.slice(0,m+1);const g=v[m+1];if(g&&b>0){const c={...g,B:(g.B??0)*b,C:(g.C??0)*b};r.push(c)}const f=ke(r),w=Math.max(0,p-f),a=[];a.push(new s.Vector3(0,0,0));const y=new s.Vector3(0,w*G,0);w>0&&a.push(y);let d={pos:y.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const _=[];for(let c=r.length-1;c>=0;c--){const u=r[c],k=Me(u);if(k.length>0){const E=k.map(A=>{const $=A.clone(),L=new s.Matrix4;return L.makeBasis(d.localX,d.localY,d.localZ),$.applyMatrix4(L),$.add(d.pos)});_.push(E);const S=E[E.length-1];d.pos=S.clone();const h=u.B??0,M=u.C??0;if(h!==0){const A=new s.Matrix4().makeRotationAxis(d.localY,W(h));d.localX.applyMatrix4(A),d.localZ.applyMatrix4(A)}if(M>0){const A=W(M),$=new s.Matrix4().makeRotationAxis(d.localZ,A);d.localY.applyMatrix4($),d.localX.applyMatrix4($)}}}for(const c of _)c.length>1&&a.push(...c.slice(1));a.length<2&&a.push(new s.Vector3(0,.001,0));try{const c=new s.CatmullRomCurve3(a,!1,"catmullrom",.01),u=new s.TubeGeometry(c,Math.max(2,a.length*4),n*G,18,!1);V.geometry.dispose(),V.geometry=u}catch(c){console.error("管件更新失败",c)}}function Ne(V,v,p,n=0){let m=V.slice(0,p+1);const b=V[p+1];if(b&&n>0){const d={...b,B:(b.B??0)*n,C:(b.C??0)*n};m.push(d)}const r=ke(m),g=Math.max(0,v-r),f=[];f.push(new s.Vector3(0,0,0));const w=new s.Vector3(0,g*G,0);g>0&&f.push(w);let a={pos:w.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const y=[];for(let d=m.length-1;d>=0;d--){const _=m[d],c=Me(_);if(c.length>0){const u=c.map(h=>{const M=h.clone(),A=new s.Matrix4;return A.makeBasis(a.localX,a.localY,a.localZ),M.applyMatrix4(A),M.add(a.pos)});y.push(u);const k=u[u.length-1];a.pos=k.clone();const E=_.B??0,S=_.C??0;if(E!==0){const h=new s.Matrix4().makeRotationAxis(a.localY,W(E));a.localX.applyMatrix4(h),a.localZ.applyMatrix4(h)}if(S>0){const h=W(S),M=new s.Matrix4().makeRotationAxis(a.localZ,h);a.localY.applyMatrix4(M),a.localX.applyMatrix4(M)}}}for(const d of y)d.length>1&&f.push(...d.slice(1));return f.length<2&&f.push(new s.Vector3(0,.001,0)),f}function xe(V,v,p,n,m,b,r,g=0,f=0){const w=m-f,a=Ne(n,w,r,g);let d=Ne(p,f,r,g);d.forEach(c=>c.y=-c.y),d.reverse();const _=[...d,...a];try{const c=new s.CatmullRomCurve3(_,!1,"catmullrom",.01),u=new s.TubeGeometry(c,Math.max(2,_.length*4),b*G,18,!1);v.geometry.dispose(),V.geometry.dispose(),v.parent&&v.parent.remove(v),V.geometry=u}catch(c){console.error("管件更新失败",c)}}const Ae={class:"panel-content"},$e={class:"action-bar"},Fe={class:"animation-controls"},ze={class:"control-row"},Ye={class:"control-row"},Le={class:"frame-info"},Ue={class:"control-row"},Ie={class:"progress-bar"},je={class:"dialog-footer"},Ge=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},setup(V,{expose:v}){const p=V,n=e.ref(),m=e.ref();e.watch(()=>p.threeData,t=>{const l=t==null?void 0:t.data;m.value=l==null?void 0:l.type},{immediate:!0});const b=async()=>{let t={};m.value===ne.robotMode.SINGLE&&(t=await he.fetchSingleRobotAnimationData()),m.value===ne.robotMode.DOUBLE&&(t=await he.fetchDoubleRobotAnimationData());const{initialPipeLength:l=0,pipeRadius:o=0,clampLength:i=0,animationData:x}=t;S.value=l,h.value=o,M.value=i,n.value=x;const N=Te.cloneDeep(n.value),J=re(Y.value),q=(N==null?void 0:N["输出(动画数据)"])||[];r.value=q.length?q:[J]},r=e.ref([]),g=e.ref(!1),f=e.ref(""),w=e.ref(!1),a=e.ref(0),y=e.ref(0),d=e.ref(1e3);let _=!1;const c=e.ref(null),u=e.shallowRef(null),k=e.shallowRef(null),E=e.shallowRef(null),S=e.ref(0),h=e.ref(12.5),M=e.ref(30),A=e.ref([]),$=e.ref(null),L=e.computed(()=>p.model?ie.getNonFixedJoints(p.model).map(o=>o.name):[]),X=e.ref(["Y","B","C","R"]),Y=e.computed(()=>[...L.value,...X.value]),ce=e.computed(()=>Y.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${Y.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),ae=()=>r.value.map(t=>({Y:parseFloat(t.Y)||0,B:parseFloat(t.B)||0,C:parseFloat(t.C)||0,R:parseFloat(t.R)||0})),K=()=>{const t=[],l=[];return r.value.forEach(o=>{const{Y1:i,B1:x,C1:N,R1:J,Y2:q,B2:oe,C2:de,R2:D}=o;t.push({Y:parseFloat(i)||0,B:parseFloat(x)||0,C:parseFloat(N)||0,R:parseFloat(J)||0}),l.push({Y:parseFloat(q)||0,B:parseFloat(oe)||0,C:parseFloat(de)||0,R:parseFloat(D)||0})}),{posPipeYbcr:t,negPipeYbcr:l}},T=(t=0,l=0)=>{if(u.value&&k.value){const o=K();xe(u.value,k.value,o.posPipeYbcr,o.negPipeYbcr,S.value,h.value,t,l,M.value)}else if(u.value){const o=ae();Ce(u.value,o,S.value,h.value,t,l)}},C=t=>{if(t<0||t>=r.value.length){console.error(`帧索引 ${t} 超出范围`);return}const l=r.value[t];if(console.log(`应用第 ${t} 帧数据 ${l}`),a.value=t,c.value){const o={};L.value.forEach(i=>{const x=parseFloat(l[i]);isNaN(x)||(o[i]=x)}),c.value.setJointAngles(o)}T(t,0)},U=async()=>{if(r.value.length===0){B.ElMessage.error("无法播放动画:无数据");return}if(!w.value){w.value=!0,_=!1,r.value.length-1===a.value&&(a.value=0);try{for(let t=a.value+1;t<r.value.length&&!_;t++){a.value=t;const l=r.value[t],o={};c.value&&L.value.forEach(i=>{const x=parseFloat(l[i]);isNaN(x)||(o[i]=x)}),c.value?await c.value.animateToState(o,d.value,i=>{y.value=(t+i)/r.value.length*100,T(t-1,i)}):(await new Promise(i=>setTimeout(i,d.value)),y.value=(t+1)/r.value.length*100)}_||B.ElMessage.success("动画播放完成")}catch(t){console.error("动画播放出错:",t),B.ElMessage.error("动画播放出错")}finally{w.value=!1,y.value=0}}},F=()=>{_=!0,w.value=!1,y.value=0,B.ElMessage.info("动画已停止")},I=()=>{a.value=0},z=()=>{if(u.value&&k.value){const t=K();xe(u.value,k.value,t.posPipeYbcr,t.negPipeYbcr,S.value,h.value,-1,0,M.value)}else if(u.value){const t=ae();Ce(u.value,t,S.value,h.value,-1,0)}},Z=()=>{c.value&&c.value.resetToZero(),z(),I(),B.ElMessage.success("机器人和管件已重置")},O=t=>`第 ${t+1} 帧`,j=t=>{w.value&&F(),C(t)},Q=()=>{w.value&&F(),!(a.value+1>=r.value.length)&&C(a.value+1)},P=()=>{w.value&&F(),a.value!==0&&C(a.value-1)},H=()=>{E.value&&(E.value.visible=!0),u.value&&u.value.parent&&u.value.parent.remove(u.value),E.value=null,u.value=null,k.value=null},re=t=>t==null?void 0:t.reduce((l,o)=>(l[o]="0",l),{});e.watch(Y,(t,l)=>{if(JSON.stringify(t)!==JSON.stringify(l))if(t.length>0){const o=re(t);r.value=[o]}else r.value=[]},{immediate:!0});const ee=e.ref(0),ue=t=>{ee.value=t},ge=(t,l)=>{if(!t||!l)return;const o=ie.getTargetJoint(t,l),i=Se();i.visible=!1,o==null||o.add(i)},Ve=t=>{c.value=new fe.URDFRobotController(t),A.value=ie.getAllLinkName(t),$.value="Pipe_Joint"},te=()=>{c.value=null,A.value=[],$.value=null},se=t=>{Ve(t),ge(t,$.value),ue(ee.value+1),Z()};e.watch(()=>p.model,t=>{if(H(),t){se(t);return}te()},{immediate:!0});const ve=t=>{var o,i;const l=new s.Mesh(t.geometry.clone(),t.material);return l.name="managed_pipe_clone",(i=(o=t==null?void 0:t.parent)==null?void 0:o.add)==null||i.call(o,l),l.position.copy(t.position),l.rotation.copy(t.rotation),l.scale.copy(t.scale),l};e.watch([$,M,S,ee],([t,l])=>{if(H(),p.model&&t){const o=ie.getMeshFromJoint(p.model,t);if(console.log(o,"meshToReplace"),o&&o.parent){E.value=o,o.visible=!1;const i=ve(o);if(m.value===ne.robotMode.SINGLE&&(i.position.y-=l*.001),u.value=i,m.value===ne.robotMode.DOUBLE){const x=ve(o);k.value=x}T(0,0)}else t&&console.warn(`在 link '${t}' 中未找到可替换的网格或其没有父级。`)}});const be=async()=>{if(Y.value.length===0){B.ElMessage.warning("没有可导出的表头");return}const t=Y.value.join(" ");try{await navigator.clipboard.writeText(t),B.ElMessage.success("表头已成功复制到剪贴板!")}catch(l){console.error("复制失败:",l),B.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},we=()=>{if(!f.value.trim()){B.ElMessage.warning("导入内容不能为空");return}const t=f.value.trim().split(`
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent as Le, ref as h, watch as ae, shallowRef as be, computed as Pe, onUnmounted as Ie, resolveComponent as U, createElementBlock as Ve, openBlock as Q, createElementVNode as u, createVNode as l, withCtx as M, createBlock as ye, createCommentVNode as ke, unref as X, toDisplayString as he, onMounted as Ge, onBeforeUnmount as Ze, Fragment as qe, renderList as He, nextTick as Ke, withDirectives as pe, vShow as de, renderSlot as Me } from "vue";
|
|
2
|
-
import { r as Te, s as Ye } from "./threeViewerHost-
|
|
2
|
+
import { r as Te, s as Ye } from "./threeViewerHost-DQichI1a.js";
|
|
3
3
|
import { u as Je, a as Qe, b as et, C as tt } from "./iconfont-BrZ_AJm3.js";
|
|
4
4
|
import { U as lt, u as ot, a as nt, W as at } from "./workpieceTreePanel-C7Ktiu4o.js";
|
|
5
5
|
import { c as st } from "./index-CwJwXVns.js";
|
|
6
6
|
import { a9 as it, E as j, ap as rt, aq as ct } from "./request-XJsZ4h2T.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import { p as De, T as xe, V as D, n as q, o as ut, s as pt, h as Se, t as dt, L as mt, u as vt, v as ft, w as gt, x as ht, y as bt, z as yt, l as _t, F as wt } from "./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-CxgD2Ymu.js";
|
|
9
|
-
import "./index-
|
|
9
|
+
import "./index-BJiZQ7II.js";
|
|
10
10
|
import "./index-BHtNKL1L.js";
|
|
11
11
|
import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
|
|
12
12
|
import { y as Be, z as Ct, A as kt } from "./index-CrbJ9-F1.js";
|
|
13
|
-
import "./index-
|
|
13
|
+
import "./index-XhTww7Yz.js";
|
|
14
14
|
import "./index-BXZZXCDb.js";
|
|
15
15
|
import { f as Pt, a as xt, g as Rt, b as Mt } from "./animationData-ByJHwdT4.js";
|
|
16
16
|
import { g as Tt, a as Vt, b as Dt, c as St, U as At, J as $t } from "./urdfTree-BI4GYRDL.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as ge, ref as r, computed as k, watch as X, onUnmounted as De, resolveComponent as G, createElementBlock as x, openBlock as g, createElementVNode as n, createCommentVNode as U, createVNode as s, toDisplayString as L, Fragment as Be, renderList as Je, withCtx as le, shallowRef as te, onMounted as Me, nextTick as me, onBeforeUnmount as Ee, withDirectives as I, vShow as W, unref as z, renderSlot as ve, createBlock as de } from "vue";
|
|
2
|
-
import { s as pe } from "./threeViewerHost-
|
|
2
|
+
import { s as pe } from "./threeViewerHost-DQichI1a.js";
|
|
3
3
|
import { u as Ge, a as He, b as Ie, C as We } from "./iconfont-BrZ_AJm3.js";
|
|
4
4
|
import { U as Xe, u as Ye, a as Ze, W as qe } from "./workpieceTreePanel-C7Ktiu4o.js";
|
|
5
5
|
import { c as Ke } from "./index-CwJwXVns.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./threeViewerHost-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./threeViewerHost-eV1nqK_z.cjs"),q=require("./iconfont-Cle12c12.cjs"),J=require("./workpieceTreePanel-o9WH_Qrq.cjs"),Ce=require("./index-CMUsYepp.cjs");require("./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-Byr5bNn8.cjs");const te=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),U=require("./urdfTree-Bys_2Khv.cjs"),h=require("./request-Dl8yi2iS.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),g=require("./svgIcon-CDPAgQbj.cjs"),_e=require("./animationData-BcPlDaUu.cjs"),we=require("./MTLLoader-BV8-OAj_.cjs"),Se={class:"panel-content"},Pe={key:0,class:"animation-controls"},Te={class:"control-row"},Be={class:"control-row"},xe={class:"frame-info"},ze={class:"control-row"},De={key:1,class:"empty-state"},Le={class:"dialog-footer"},je=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(P,{expose:m}){const y=P,s=e.ref([]),_=e.ref(!1),T=e.ref(""),i=e.ref("stopped"),f=e.ref(0),w=e.ref(0),b=e.ref(10),u=e.ref(null);let c=0;const V=e.ref([]),N=e.computed(()=>y.model?U.getNonFixedJoints(y.model).map(p=>p.name):[]),S=e.computed(()=>[...N.value]),H=e.computed(()=>S.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${S.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),M=e.computed(()=>s.value[f.value]||{});e.watch(()=>y.model,o=>{o?(u.value=new J.URDFRobotController(o),V.value=U.getAllLinkName(o),f.value=0):(u.value=null,V.value=[])},{immediate:!0});const D=o=>{if(o<0||o>=s.value.length){console.error(`帧索引 ${o} 超出范围`);return}const n=s.value[o];if(u.value){const p={};N.value.forEach(k=>{const r=parseFloat(n[k]);isNaN(r)||(p[k]=r)}),u.value.setJointAngles(p)}f.value=o,w.value=s.value.length>1?o/(s.value.length-1)*100:100},L=async o=>{try{for(let n=f.value;n<s.value.length;n++){if(o!==c)return;const p=s.value[n],k={};if(u.value)N.value.forEach(r=>{const d=parseFloat(p[r]);isNaN(d)||(k[r]=d)}),await u.value.animateToState(k,b.value,r=>{o===c&&(w.value=(n+r)/s.value.length*100)});else{if(await new Promise(r=>setTimeout(r,b.value)),o!==c)return;w.value=(n+1)/s.value.length*100}f.value=n}o===c&&(h.ElMessage.success("动画播放完成"),i.value="stopped",w.value=100)}catch(n){console.error("动画播放出错:",n),h.ElMessage.error("动画播放出错"),i.value="stopped"}},B=()=>{if(s.value.length===0){h.ElMessage.error("无动画数据");return}i.value==="stopped"&&(f.value=0,D(0)),i.value="playing",c++,L(c),h.ElMessage.info("动画播放中")},$=()=>{i.value==="playing"&&(c++,i.value="paused",h.ElMessage.info("动画已暂停"))},R=()=>{c++,i.value="stopped",f.value=0,w.value=0,D(0),h.ElMessage.info("动画已停止并重置")},G=()=>{i.value==="playing"?$():B()},x=o=>{c++,i.value="paused",D(o)},X=()=>{if(!T.value.trim()){h.ElMessage.warning("导入内容不能为空");return}const o=T.value.trim().split(`
|
|
@@ -112,7 +112,7 @@ const Y = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
112
112
|
height: { default: "100%" }
|
|
113
113
|
},
|
|
114
114
|
setup(E) {
|
|
115
|
-
const O = b(() => import("./threeSceneView-
|
|
115
|
+
const O = b(() => import("./threeSceneView-Q1x-IsSk.js")), y = b(() => import("./threePreview-BX4TE3wq.js")), i = b(() => import("./threeTrackPathView-CvMBrwin.js")), p = b(() => import("./threeSceneViewForCPMPIP-CEeuM1ZH.js")), n = E, P = A(D), { platName: f } = $(P), { isUrdf: _, isTrackPathFile: g } = z(), c = I(() => {
|
|
116
116
|
var t;
|
|
117
117
|
return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
|
|
118
118
|
const { url: e } = s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),d=require("./index-CMUsYepp.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-Byr5bNn8.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),F={SINGLE:"单机",DOUBLE:"双机"},R={ROBOT:1,PIPECOMPARSION:2},i={ROBOT_SCENE:"robot",TRACK_PATH:"trackPath",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},b=d.defineStore("threeState",{state:()=>({data:{files:[],data:{}}}),actions:{setData(v){this.data=v},getData(){return this.data}}});function I(){const v=d.useMenuState(d.pinia),{platform:g}=d.storeToRefs(v),P=b(d.pinia),c=["uv","cyd","nc"],m=["urdf"],r=["obj","stl"],T=[...c,...m,...r],f=t=>{if(!C())throw new Error("不是三维系统");P.setData(t)},y=()=>P.getData(),C=()=>g.value==="three",l=t=>S.getFileExtension(t),p=t=>{if(!t)return!1;const o=l(t);return T==null?void 0:T.includes(o)},E=t=>{if(!t)return!1;const o=l(t);return r==null?void 0:r.includes(o)},h=t=>{if(!t)return!1;const o=l(t);return c==null?void 0:c.includes(o)},u=t=>{if(!t)return{isCpt:!1,isCyd:!1,isUv:!1,isNc:!1};const o=l(t),a=c==null?void 0:c.find(k=>k===o);return{isCpt:a==="cpt",isCyd:a==="cyd",isUv:a==="uv",isNc:a==="nc"}},_=t=>{if(!t)return!1;const o=l(t);return m==null?void 0:m.includes(o)},B=t=>C()&&p(t),n=t=>({url:t,extension:l(t)});return{getData:y,setData:f,isThreeSystem:C,isUrdf:_,isGeneralFile:E,isTrackPathFile:h,isThreeFile:p,isUseBackdrop:B,initTrackFileType:u,getFileExtension:l,getFileInfo:n,getFilesInfo:t=>{const o=[];for(let a=0;a<t.length;a++){const w=t[a],k=n(w);o.push(k)}return o}}}const N={class:"three-platform mv-inline"},V={class:"top-menu"},A={key:4,class:"loading"},M=e.defineComponent({__name:"threeViewerHost",props:{files:{default:()=>[]},threeData:{},componentType:{},width:{default:"100%"},height:{default:"100%"}},setup(v){const g=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-
|
|
1
|
+
"use strict";const e=require("vue"),d=require("./index-CMUsYepp.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-Byr5bNn8.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),F={SINGLE:"单机",DOUBLE:"双机"},R={ROBOT:1,PIPECOMPARSION:2},i={ROBOT_SCENE:"robot",TRACK_PATH:"trackPath",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},b=d.defineStore("threeState",{state:()=>({data:{files:[],data:{}}}),actions:{setData(v){this.data=v},getData(){return this.data}}});function I(){const v=d.useMenuState(d.pinia),{platform:g}=d.storeToRefs(v),P=b(d.pinia),c=["uv","cyd","nc"],m=["urdf"],r=["obj","stl"],T=[...c,...m,...r],f=t=>{if(!C())throw new Error("不是三维系统");P.setData(t)},y=()=>P.getData(),C=()=>g.value==="three",l=t=>S.getFileExtension(t),p=t=>{if(!t)return!1;const o=l(t);return T==null?void 0:T.includes(o)},E=t=>{if(!t)return!1;const o=l(t);return r==null?void 0:r.includes(o)},h=t=>{if(!t)return!1;const o=l(t);return c==null?void 0:c.includes(o)},u=t=>{if(!t)return{isCpt:!1,isCyd:!1,isUv:!1,isNc:!1};const o=l(t),a=c==null?void 0:c.find(k=>k===o);return{isCpt:a==="cpt",isCyd:a==="cyd",isUv:a==="uv",isNc:a==="nc"}},_=t=>{if(!t)return!1;const o=l(t);return m==null?void 0:m.includes(o)},B=t=>C()&&p(t),n=t=>({url:t,extension:l(t)});return{getData:y,setData:f,isThreeSystem:C,isUrdf:_,isGeneralFile:E,isTrackPathFile:h,isThreeFile:p,isUseBackdrop:B,initTrackFileType:u,getFileExtension:l,getFileInfo:n,getFilesInfo:t=>{const o=[];for(let a=0;a<t.length;a++){const w=t[a],k=n(w);o.push(k)}return o}}}const N={class:"three-platform mv-inline"},V={class:"top-menu"},A={key:4,class:"loading"},M=e.defineComponent({__name:"threeViewerHost",props:{files:{default:()=>[]},threeData:{},componentType:{},width:{default:"100%"},height:{default:"100%"}},setup(v){const g=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-C8X9qGmq.cjs"))),P=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-tq95fMu4.cjs"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeTrackPathView-BCPPOYou.cjs"))),m=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-DCTKrIm1.cjs"))),r=v,T=d.useMenuState(d.pinia),{platName:f}=d.storeToRefs(T),{isUrdf:y,isTrackPathFile:C}=I(),l=e.computed(()=>{var n;return(n=r==null?void 0:r.files)==null?void 0:n.map(s=>{const{url:t}=s;return t})}),p=e.computed(()=>{var t;const n=(t=r==null?void 0:r.files)==null?void 0:t[0];return(n==null?void 0:n.extension)||""}),E=e.computed(()=>{var n,s;return(s=(n=r==null?void 0:r.threeData)==null?void 0:n.data)==null?void 0:s.trackFileType}),h=e.computed(()=>{if(r.componentType)switch(r.componentType){case"robot":return i.ROBOT_SCENE;case"track":return i.TRACK_PATH;case"cpmpip":return i.CPMPIP_SCENE;case"preview":return i.PREVIEW}return(f==null?void 0:f.value)===S.platNameConstants.CPMPIP&&y(p.value)?i.CPMPIP_SCENE:(f==null?void 0:f.value)===S.platNameConstants.ROBOT&&y(p.value)?i.ROBOT_SCENE:C(p.value)&&E.value?i.TRACK_PATH:i.PREVIEW}),u=e.ref([]),_=e.ref(!1);async function B(n){if(!n||!n.length){u.value=[];return}_.value=!0;try{const s=await Promise.all(n.map(t=>S.downloadFile(t)));u.value=s}catch(s){console.error("文件下载时发生错误:",s),u.value=[]}finally{_.value=!1}}return e.watch(()=>l.value,async n=>{await B(n||[])},{immediate:!0,deep:!0}),(n,s)=>(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",V,[e.renderSlot(n.$slots,"top-menu",{},void 0,!0)]),h.value===e.unref(i).ROBOT_SCENE?(e.openBlock(),e.createBlock(e.unref(g),{key:0,fileBlobs:u.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData"])):h.value===e.unref(i).TRACK_PATH?(e.openBlock(),e.createBlock(e.unref(c),{key:1,fileBlobs:u.value,threeData:r.threeData,trackFileType:E.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData","trackFileType"])):h.value===e.unref(i).CPMPIP_SCENE?(e.openBlock(),e.createBlock(e.unref(m),{key:2,fileBlobs:u.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData"])):h.value===e.unref(i).PREVIEW?(e.openBlock(),e.createBlock(e.unref(P),{key:3,fileBlobs:u.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",A," 文件下载中,请稍候... ")):e.createCommentVNode("",!0)]))}}),O=D._export_sfc(M,[["__scopeId","data-v-9798f55b"]]),H=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=O;exports.robotMode=F;exports.sceneType=R;exports.threeViewerHost=H;exports.useThreeState=b;exports.useThreeSystem=I;
|
package/package.json
CHANGED
package/dist/index-BFYPJp0M.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),w=require("./index-CMUsYepp.cjs"),He=require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-Byr5bNn8.cjs");const me=require("./request-Dl8yi2iS.cjs"),et=require("./index-B-pflqKE.cjs"),tt=require("./index-B1v2-GVC.cjs"),ot=require("vue-router"),ke=require("./index-DKh4EyHV.cjs"),K=require("./index-DmwxzDGW.cjs"),lt=require("./index-OtAdp5I3.cjs"),st=require("./menuIndex-CBqMx085.cjs"),ue=require("./index-B7964G2F.cjs"),it=require("./index-DXiuTpL6.cjs"),at=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-B1v2-GVC.cjs")).then(r=>r.index));Se.install=r=>{r.component("ssMenu",Se)};const Ee={__name:"index",props:{name:String},setup(r){const c=r,S=t.computed(()=>me.Icons[c.name]);return t.onMounted(()=>{}),(h,a)=>{const l=t.resolveComponent("el-icon");return t.openBlock(),t.createBlock(l,null,{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(S.value)))]),_:1})}}},xe=(r,c,S=0)=>{let h=r;return h!=null&&h.every(a=>Array.isArray(a))&&(h!=null&&h.every(a=>Array.isArray(a)&&a.length===1)?h=h==null?void 0:h.filter(a=>(a==null?void 0:a[0])!==(c==null?void 0:c[S])):h=h==null?void 0:h.map(a=>{if(a!=null&&a.find(l=>l===(c==null?void 0:c[S]))&&(c==null?void 0:c.length)!==1){let l=w.cloneDeep(c),n=a==null?void 0:a.filter(C=>C!==(l==null?void 0:l[S])),I=S+1,M=xe(n,l,I),b=[];b.push(a==null?void 0:a[0]),M==null||M.forEach(C=>{b.push(C)}),a=b}return a})),h},qe=(r,c,S,h=0)=>{let a=r;return a!=null&&a.every(l=>Array.isArray(l))&&(a!=null&&a.every(l=>Array.isArray(l)&&l.length===1)?a.push([S]):a=a==null?void 0:a.map(l=>{if(l!=null&&l.find(n=>n===(c==null?void 0:c[h]))&&(c==null?void 0:c.length)!==1){let n=w.cloneDeep(c),I=l==null?void 0:l.filter(E=>E!==(n==null?void 0:n[h])),M=h+1,b=qe(I,n,S,M),C=[];C.push(l==null?void 0:l[0]),b==null||b.forEach(E=>{C.push(E)}),l=C}return l})),a},be=(r,c,S,h,a=0)=>{let l=r;return l!=null&&l.every(n=>Array.isArray(n))&&(l!=null&&l.every(n=>Array.isArray(n)&&n.length===1)?l=l==null?void 0:l.map(n=>((n==null?void 0:n[0])===S&&(n=[h]),n)):l=l==null?void 0:l.map(n=>{if(n!=null&&n.find(I=>I===(c==null?void 0:c[a]))&&(c==null?void 0:c.length)!==1){let I=w.cloneDeep(c),M=n==null?void 0:n.filter(L=>L!==(I==null?void 0:I[a])),b=a+1,C=be(M,I,S,h,b),E=[];E.push(n==null?void 0:n[0]),C==null||C.forEach(L=>{E.push(L)}),n=E}return n})),l};function Ve(r="menu"){return{name:r,components:{SvgIcon:He.SvgIcon,ssMenu:Se,DynamicIcon:Ee,ssDialog:et.ssDialog,ssInput:tt.ssInput},setup(c,{emit:S}){const h=t.defineProps({mode:{type:String,default:"vertical"}}),a=t.ref([{allowInherit:!1,operateType:"复制新增",operateIcon:"CopyAddMenu"},{allowInherit:!1,operateType:"删除",operateIcon:"DeleteMenu"},{allowInherit:!1,operateType:"修改菜单名",operateIcon:"FixedMenu"}]),l=w.useMenuState(),n=w.useModelComp(w.pinia),I=w.useLoginState(w.pinia),{loginUserInfo:M}=w.storeToRefs(I),b=t.ref(0),C=ot.useRouter(),E=t.ref(),{asideMenus:L,menuTriggerType:i,platform:De,jumpMenuInform:z}=w.storeToRefs(l),{fixMenuStatus:_e}=w.storeToRefs(n),{isSuperAdmin:Ie}=it.useRole(),q=t.computed(()=>h==null?void 0:h.mode),Be=o=>o==null?void 0:o.map(e=>{var p,v;return!(e!=null&&e.children)||((p=e==null?void 0:e.children)==null?void 0:p.length)===0?e.config=a.value:e!=null&&e.children&&((v=e==null?void 0:e.children)==null?void 0:v.length)>0&&(e.children=Be(e.children)),e}),we=t.computed(()=>{let o=[...L.value];if((o==null?void 0:o.length)===0)return C.push("/"),[];const s=Ue(o,Le.value);return s.isFlag||(o=s==null?void 0:s.data),o=o==null?void 0:o.map(e=>{var p,v;return!(e!=null&&e.children)||((p=e==null?void 0:e.children)==null?void 0:p.length)===0?e.config=a.value:e!=null&&e.children&&((v=e==null?void 0:e.children)==null?void 0:v.length)>0&&(e.children=Be(e.children)),e}),o}),Fe=async(o,s)=>{n.setRouteToChildPath(""),l.setMenuTriggerType("click"),l.setActiveMenuPath(o==null?void 0:o.path),l.setActiveAsideMenu(o),o.isRouter?C.push(o.path):C.push("/"),S("node-click",o,s)},Ne=async o=>{const s=st.findNodeByPropInTree(we.value,"path",o);l.setActiveAsideMenu(s),n.setRouteToChildPath(""),_e.value?n.setFixMenuStatus(!1):(G.value&&(i.value="open"),i.value==="click"?l.setActiveMenuPath(o):G.value||(l.setMenuTriggerType("click"),l.setActiveMenuPath(o))),o!=null&&o.startsWith("/")?C.push(o):C.push("/"),b.value++},$e=o=>{G.value||l.setActiveMenuPath(o)},J=o=>{const s=document.documentElement;o==null||o.forEach(e=>{s.style.setProperty(e.name,e.value)})};t.onMounted(()=>{b.value=1});const Le=t.computed(()=>{const o=sessionStorage.getItem("authority");return o?JSON.parse(o):[]});t.watch(()=>De.value,o=>{o==="browser"?J(ke.browserVerticalMenuClasses):o==="client"?(J(ke.clientHorizontalMenuClasses),J(ke.clientVerticalMenuClasses)):o==="three"&&(J(ke.threeHorizontalMenuClasses),J(ke.threeVerticalMenuClasses))},{immediate:!0});const Ue=(o,s)=>({isFlag:!0}),U=t.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),Re=o=>lt.getComponent(o),je=t.ref({}),Pe=t.ref([]),Z=t.ref({}),W=t.ref({}),Oe=o=>{switch(o){case"复制新增":return"create";case"修改菜单名":return"update";case"删除":return"delete"}},Me=t.ref({}),Ke=o=>{l.setCacheInputMenu({type:U.type,data:o}),l.setIsRefreshMenus(!0)},ze=async(o,s,e)=>{var p,v,k,j,B,Q,A,H,m,ee,te,oe,le,se,ie,ae,re,ne,ce,pe,de,he,fe,ve,ye,Ce,ge;if(s==="create"){let F=(e==null?void 0:e.title)+"(1)",$=(v=(p=e==null?void 0:e.path)==null?void 0:p.split("/"))==null?void 0:v.filter((D,y)=>{var u,T;return y!==((T=(u=e==null?void 0:e.path)==null?void 0:u.split("/"))==null?void 0:T.length)-1}),N=await ue.getItemData((B=(j=(k=e==null?void 0:e.path)==null?void 0:k.split("/"))==null?void 0:j.filter((D,y)=>{var u,T;return y!==((T=(u=e==null?void 0:e.path)==null?void 0:u.split("/"))==null?void 0:T.length)-1}))==null?void 0:B.join("/"),sessionStorage.getItem("systemKey"),"");if($.push(F),$=$==null?void 0:$.join("/"),(N==null?void 0:N.length)>0){let D=N==null?void 0:N[0],y=(A=(Q=D==null?void 0:D.compData)==null?void 0:Q.find(u=>(u==null?void 0:u.key)==="header"))==null?void 0:A.contents;if(((H=y==null?void 0:y[0])==null?void 0:H.directiveLabel)==="#isMain"){let u=(m=y==null?void 0:y[0])==null?void 0:m.prop,T=(te=(ee=D==null?void 0:D.compData)==null?void 0:ee.find(_=>(_==null?void 0:_.key)==="tableContents"))==null?void 0:te.contents,P;T==null||T.forEach(_=>{var O,R;if(_.length===1)((O=_==null?void 0:_[0])==null?void 0:O[u])===(e==null?void 0:e.title)&&(P=_==null?void 0:_[0],P[u]=F);else{let d=(R=y==null?void 0:y.filter(f=>f!=="操作"))==null?void 0:R.map(f=>f==null?void 0:f.prop),V=_==null?void 0:_.filter(f=>!(f!=null&&f.id)),x=ue.getValueToObjectValue(V,d);x[u]=F,P=x}}),await K.createInsofDataApi({key:{type:"data",pageKey:(se=(le=(oe=e==null?void 0:e.path)==null?void 0:oe.split("/"))==null?void 0:le.filter((_,O)=>{var R,d;return O!==((d=(R=e==null?void 0:e.path)==null?void 0:R.split("/"))==null?void 0:d.length)-1}))==null?void 0:se.join("/"),tableId:D==null?void 0:D.id,systemKey:sessionStorage.getItem("systemKey"),createUserId:(ie=M.value)==null?void 0:ie.id,createUserLayer:((ae=M.value)==null?void 0:ae.dept)||((re=M.value)==null?void 0:re.部门名称)},value:{tableData:P}})}}await ue.newLoadingConstruct(e==null?void 0:e.path,$),l.setUpdateMenuStatus(!1),await w.verifyStructureDataToStore(),l.setActiveMenuPath((pe=(ce=(ne=e==null?void 0:e.path)==null?void 0:ne.split("/"))==null?void 0:ce.filter((D,y)=>{var u,T;return y!==((T=(u=e==null?void 0:e.path)==null?void 0:u.split("/"))==null?void 0:T.length)-1}))==null?void 0:pe.join("/")),l.setActiveTopMenuPath((he=(de=e==null?void 0:e.path)==null?void 0:de.split("/"))==null?void 0:he[0]),l.setIsRefreshMenus(!1),l.setIsRefreshMenus(!0)}else if(s==="update")E.value=e;else if(s==="delete"){let F=[];(F==null?void 0:F.length)>0&&await K.batchDeleteInsofDataApi({ids:F}),l.setUpdateMenuStatus(!1),await w.verifyStructureDataToStore(),l.setActiveMenuPath((ye=(ve=(fe=e==null?void 0:e.path)==null?void 0:fe.split("/"))==null?void 0:ve.filter(($,N)=>{var D,y;return N!==((y=(D=e==null?void 0:e.path)==null?void 0:D.split("/"))==null?void 0:y.length)-1}))==null?void 0:ye.join("/")),l.setActiveTopMenuPath((ge=(Ce=e==null?void 0:e.path)==null?void 0:Ce.split("/"))==null?void 0:ge[0]),l.setIsRefreshMenus(!1),l.setIsRefreshMenus(!0)}},Je=async(o,s)=>{var H,m,ee,te,oe,le,se,ie,ae,re,ne,ce,pe,de,he,fe,ve,ye,Ce,ge,F,$,N,D,y,u,T,P,_,O,R;let e=await K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),p=(m=(H=e==null?void 0:e.data)==null?void 0:H.result)==null?void 0:m[0],v=(ee=p==null?void 0:p.value)==null?void 0:ee.pageData;v.compData=(te=v.compData)==null?void 0:te.map(d=>{var V,x;return(d==null?void 0:d.key)==="menuContents"&&(d.contents=be(d.contents,(V=s==null?void 0:s.path)==null?void 0:V.split("/"),s==null?void 0:s.title,(x=o==null?void 0:o.target)==null?void 0:x.value)),d}),p!=null&&p.id&&await K.updateInsofDataApi({id:p==null?void 0:p.id,value:{pageData:v}});let k=(le=(oe=s==null?void 0:s.path)==null?void 0:oe.split("/"))==null?void 0:le.filter((d,V)=>{var x,f;return V!==((f=(x=s==null?void 0:s.path)==null?void 0:x.split("/"))==null?void 0:f.length)-1}),j=k==null?void 0:k.join("/");k.push((se=o==null?void 0:o.target)==null?void 0:se.value),k=k==null?void 0:k.join("/");let B=await ue.getItemData(j,sessionStorage.getItem("systemKey"),"");if(((ce=(ne=(re=(ae=(ie=B==null?void 0:B[0])==null?void 0:ie.compData)==null?void 0:ae.find(d=>(d==null?void 0:d.key)==="header"))==null?void 0:re.contents)==null?void 0:ne[0])==null?void 0:ce.directiveLabel)==="#isMain"){let d=(ve=(fe=(he=(de=(pe=B==null?void 0:B[0])==null?void 0:pe.compData)==null?void 0:de.find(g=>(g==null?void 0:g.key)==="header"))==null?void 0:he.contents)==null?void 0:fe[0])==null?void 0:ve.prop,V=(ge=(Ce=(ye=B==null?void 0:B[0])==null?void 0:ye.compData)==null?void 0:Ce.find(g=>(g==null?void 0:g.key)==="tableContents"))==null?void 0:ge.contents,x=(D=(N=($=(F=B==null?void 0:B[0])==null?void 0:F.compData)==null?void 0:$.find(g=>(g==null?void 0:g.key)==="header"))==null?void 0:N.contents)==null?void 0:D.map(g=>g==null?void 0:g.prop),f;if(V==null||V.forEach(g=>{var Y;let X=ue.getValueToObjectValue(g,x);(X==null?void 0:X[d])===s.title&&(f=X,f[d]=(Y=o==null?void 0:o.target)==null?void 0:Y.value)}),f){let g={};for(let Y in f)Y!=="id"&&(g[Y]=f==null?void 0:f[Y]);let X=[{id:f==null?void 0:f.id,value:{tableData:g}}];await K.batchUpdateInsofDataApi({dataList:X})}}let Q=await K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:s==null?void 0:s.path}}),A=(u=(y=Q==null?void 0:Q.data)==null?void 0:y.result)==null?void 0:u.map(d=>({id:d==null?void 0:d.id,key:d==null?void 0:d.key}));A=A==null?void 0:A.map(d=>(d.key.pageKey=k,d)),(A==null?void 0:A.length)>0&&await K.batchUpdateInsofDataApi({dataList:A}),l.setUpdateMenuStatus(!1),await w.verifyStructureDataToStore(),l.setActiveMenuPath((_=(P=(T=s==null?void 0:s.path)==null?void 0:T.split("/"))==null?void 0:P.filter((d,V)=>{var x,f;return V!==((f=(x=s==null?void 0:s.path)==null?void 0:x.split("/"))==null?void 0:f.length)-1}))==null?void 0:_.join("/")),l.setActiveTopMenuPath((R=(O=s==null?void 0:s.path)==null?void 0:O.split("/"))==null?void 0:R[0]),l.setIsRefreshMenus(!1),l.setIsRefreshMenus(!0),E.value=void 0},We=async(o,s)=>{U.type=Oe(s==null?void 0:s.operateType),await ze(s,U.type,o),W.value=o,Me.value=s},Ge=()=>{U.show=!1},Qe=o=>o==null?void 0:o.filter(s=>s.allowInherit),Xe=()=>{var e,p,v,k,j;let o;U.type==="create"&&(o=((e=W.value)==null?void 0:e.path)+"/"+Z.value[(p=Z.value)==null?void 0:p.prop]),U.type==="update"&&(o=(v=W.value)==null?void 0:v.path);const s={...W.value,config:Qe((k=W.value)==null?void 0:k.config),children:[],childMenus:[],title:Z.value[(j=Z.value)==null?void 0:j.prop],path:o};console.log("clickSubmitForm",Me.value,W.value,s),Ke(s),U.show=!1},Ye=o=>{var e,p;const s=(e=o==null?void 0:o.contents)==null?void 0:e.find(v=>v.key==="formContent");s&&(Z.value=(p=s==null?void 0:s.contents)==null?void 0:p.reduce((v,k)=>(v[k.key]=k.value,v.prop=k.key,v),{}))},G=t.ref(!1),Ze=()=>{G.value=!G.value},Te=t.ref(null);return t.watch(()=>L.value,async o=>{var s,e;if(o){await t.nextTick();const p=o==null?void 0:o[0];if(((s=p==null?void 0:p.children)==null?void 0:s.length)>0){const v=p==null?void 0:p.path;Te.value&&((e=Te.value)==null||e.openMenuRefByIndex(v))}else z!=null&&z.value?l.setJumpMenuInform(!1):l.setActiveMenuPath((p==null?void 0:p.path)??"")}},{immediate:!0}),{menuRef:Te,isCollapse:G,handleMenuCollapse:Ze,handleCompChange:Ye,dialogForm:je,dialogRenderComps:Pe,getComponents:Re,clickSubmitForm:Xe,dialogInfo:U,beforeDialogDestroy:Ge,clickMenuIcon:We,mode:q,renderMenuList:we,clickMenu:Fe,openMenu:Ne,closeMenu:$e,changeMenuStyle:J,fixElement:E,onBlur:Je,isSuperAdmin:Ie}}}}const rt=t.defineComponent(Ve()),nt=["title"],ct={key:1,class:"menu-title",style:{display:"flex",width:"100px"}},pt={key:2,class:"menu-operate-icon"},dt={class:"menu-config-wrap"},ht=["onClick"],ft={class:"module-dialog-content"};function vt(r,c,S,h,a,l){var L;const n=t.resolveComponent("ss-input"),I=t.resolveComponent("svg-icon"),M=t.resolveComponent("el-popover"),b=t.resolveComponent("ss-menu"),C=t.resolveComponent("el-button"),E=t.resolveComponent("ss-dialog");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(b,{ref:"menuRef",class:"vertical-menu",mode:r.mode,menuList:r.renderMenuList,isCollapse:r.isCollapse,uniqueOpened:!0,onClickMenu:r.clickMenu,onOpenMenu:r.openMenu,onCloseMenu:r.closeMenu},{title:t.withCtx(({menu:i})=>{var De,z,_e,Ie;return[!r.fixElement||(i==null?void 0:i.path)!==((De=r.fixElement)==null?void 0:De.path)?(t.openBlock(),t.createElementBlock("span",{key:0,title:i.title,class:"menu-title",style:t.normalizeStyle({marginRight:i!=null&&i.config&&((z=i==null?void 0:i.config)==null?void 0:z.length)>0?"25px":"1px"})},t.toDisplayString(i.title??""),13,nt)):t.createCommentVNode("",!0),r.fixElement&&(i==null?void 0:i.path)===((_e=r.fixElement)==null?void 0:_e.path)?(t.openBlock(),t.createElementBlock("span",ct,[t.createVNode(n,{value:i.title,onBlur:q=>r.onBlur(q,i)},null,8,["value","onBlur"])])):t.createCommentVNode("",!0),i!=null&&i.config&&((Ie=i==null?void 0:i.config)==null?void 0:Ie.length)>0&&r.isSuperAdmin?(t.openBlock(),t.createElementBlock("span",pt,[t.createVNode(M,{title:"",placement:"bottom-start",trigger:"hover","popper-class":"menu-operate-popover"},{reference:t.withCtx(()=>[t.createVNode(I,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"}})]),default:t.withCtx(()=>[t.createElementVNode("div",dt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i==null?void 0:i.config,q=>(t.openBlock(),t.createElementBlock("div",{class:"menu-config-item",key:q.id,onClick:Be=>r.clickMenuIcon(i,q)},[t.createVNode(I,{name:q==null?void 0:q.operateIcon,style:{width:"15px",height:"15px","margin-right":"8px"}},null,8,["name"]),t.createElementVNode("span",null,t.toDisplayString(q==null?void 0:q.operateType),1)],8,ht))),128))])]),_:2},1024)])):t.createCommentVNode("",!0)]}),_:1},8,["mode","menuList","isCollapse","onClickMenu","onOpenMenu","onCloseMenu"]),((L=r.renderMenuList)==null?void 0:L.length)>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"fold-icon",onClick:c[0]||(c[0]=(...i)=>r.handleMenuCollapse&&r.handleMenuCollapse(...i))},[t.createVNode(I,{name:r.isCollapse?"expand":"pack",style:{width:"15px",height:"15px"}},null,8,["name"])])):t.createCommentVNode("",!0),t.createVNode(E,{class:"module-dialog",title:r.dialogInfo.title,visible:r.dialogInfo.show,width:r.dialogInfo.width,onBeforeDestroy:r.beforeDialogDestroy},{default:t.withCtx(()=>[t.createElementVNode("div",ft,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.dialogRenderComps,i=>(t.openBlock(),t.createElementBlock("div",{key:i.id},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getComponents((i==null?void 0:i.comp)??"Input")),{itemData:i==null?void 0:i.compData,key:i==null?void 0:i.id,content:(i==null?void 0:i.contents)??[],config:i==null?void 0:i.config,onContentChange:r.handleCompChange},null,40,["itemData","content","config","onContentChange"]))]))),128))])]),footer:t.withCtx(()=>[t.createElementVNode("div",null,[t.createVNode(C,{id:"themeBorderButton",onClick:r.beforeDialogDestroy},{default:t.withCtx(()=>c[1]||(c[1]=[t.createTextVNode("取消")])),_:1,__:[1]},8,["onClick"]),t.createVNode(C,{id:"themeButton",onClick:r.clickSubmitForm},{default:t.withCtx(()=>c[2]||(c[2]=[t.createTextVNode(" 确认 ")])),_:1,__:[2]},8,["onClick"])])]),_:1},8,["title","visible","width","onBeforeDestroy"])],64)}const Ae=at._export_sfc(rt,[["render",vt],["__scopeId","data-v-a385ba2f"]]),yt=Object.freeze(Object.defineProperty({__proto__:null,addSelectMenu:qe,default:Ae,deleteSelectMenu:xe,fixSelectMenu:be,setComponent:Ve},Symbol.toStringTag,{value:"Module"}));exports._sfc_main=Ee;exports.index=yt;exports.ssMenu=Se;exports.ssVMenu=Ae;
|