ss-component-new 1.2.294 → 1.2.296

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 (94) hide show
  1. package/dist/{OBJLoader-CB9WJT82.cjs → OBJLoader-8gDmNV2i.cjs} +1 -1
  2. package/dist/{OBJLoader-BNv6XCtP.js → OBJLoader-Ck9W3Ir7.js} +1 -1
  3. package/dist/{OrbitControls-Csw6mD-P.js → OrbitControls-BIGKrhyi.js} +1 -1
  4. package/dist/{OrbitControls-R243A2UI.cjs → OrbitControls-BWF5w18E.cjs} +1 -1
  5. package/dist/{PCDLoader-cSzkUgjw.js → PCDLoader-CkJ5aJWh.js} +1 -1
  6. package/dist/{PCDLoader-BsFAYeJ2.cjs → PCDLoader-D-K96lwY.cjs} +1 -1
  7. package/dist/{animationData-BNWYvI2q.js → animationData-BlzkiZT-.js} +1 -1
  8. package/dist/{animationData-j8m9iee2.cjs → animationData-Dzb7SwCQ.cjs} +1 -1
  9. package/dist/{iconfont-CGucCJqY.js → iconfont-B8t8JT6z.js} +2 -2
  10. package/dist/{iconfont-BELvOiht.cjs → iconfont-Btynh8XG.cjs} +1 -1
  11. package/dist/{index-CHxAiQtk.js → index-0uGvrFMJ.js} +3 -3
  12. package/dist/{index-SnOaE90Y.js → index-8iIO_ocM.js} +3 -3
  13. package/dist/{index-Cvo0V0hW.cjs → index-B-SQuycq.cjs} +1 -1
  14. package/dist/{index-DBYidyLi.js → index-B-qFtrGT.js} +1 -1
  15. package/dist/{index-gW_IQxDq.cjs → index-B2nCv699.cjs} +1 -1
  16. package/dist/{index-w2CRXMRQ.js → index-B7DZXq3g.js} +6 -6
  17. package/dist/{index-79I_iorC.js → index-B8yivODj.js} +1 -1
  18. package/dist/{index-CZm0g4PU.js → index-BVXIOYWQ.js} +9 -7
  19. package/dist/{index-DQqCL4ju.cjs → index-B_qXEQkF.cjs} +1 -1
  20. package/dist/{index-Cuz9ELzW.js → index-Bgw0FBZB.js} +1 -1
  21. package/dist/{index-C0igWyW4.js → index-BsQ-qwMF.js} +13 -13
  22. package/dist/{index-71M6SFRc.js → index-BtwkxysC.js} +1 -1
  23. package/dist/{index-CmRzCos6.js → index-Bu1pHSKB.js} +843 -823
  24. package/dist/index-BwavyD4W.cjs +1 -0
  25. package/dist/{index-DKofIQfe.js → index-CIZi1SsV.js} +1 -1
  26. package/dist/{index-B0OE5_Ny.js → index-CJ-zljKi.js} +1 -1
  27. package/dist/{index-BkSFOSV8.cjs → index-CQn_Bk7v.cjs} +1 -1
  28. package/dist/{index-_yqtp0Dh.cjs → index-CSrPyW_f.cjs} +1 -1
  29. package/dist/{index-CZSaHDnf.js → index-CYPJ4mm3.js} +1 -1
  30. package/dist/{index-ByJJvmV6.js → index-CtbAPra-.js} +3 -3
  31. package/dist/{index-IClu4Xf8.cjs → index-D0jGNd-H.cjs} +1 -1
  32. package/dist/{index-9Nz7Dg2Z.js → index-D6bXtF73.js} +1 -1
  33. package/dist/{index-BC4uFre2.cjs → index-D9i7wZaC.cjs} +1 -1
  34. package/dist/{index-gHB9TMLI.cjs → index-DGVafVuW.cjs} +1 -1
  35. package/dist/{index-C5SNPyky.cjs → index-DKCWuetb.cjs} +1 -1
  36. package/dist/{index-LT5l3lP1.cjs → index-DO9bzS7t.cjs} +1 -1
  37. package/dist/{index-DU8A2Rcx.js → index-DOsxjhUA.js} +2 -2
  38. package/dist/{index-CkSlNi8L.js → index-DQTWAF7D.js} +2 -2
  39. package/dist/{index-BD9p0Xlt.js → index-DT0pnWzT.js} +2 -2
  40. package/dist/{index-D12kMfBu.cjs → index-DTjWhnIF.cjs} +1 -1
  41. package/dist/{index-C98tDP8u.cjs → index-DjaN4VhG.cjs} +1 -1
  42. package/dist/index-DvfqgYXo.cjs +1 -0
  43. package/dist/{index-DL8dLTof.cjs → index-DyDrPMvD.cjs} +1 -1
  44. package/dist/{index-_2EYJgni.cjs → index-K4Aol2cP.cjs} +1 -1
  45. package/dist/{index-CmcomRyN.js → index-_kvrccCu.js} +1 -1
  46. package/dist/{index-CvykFWHw.cjs → index-_wyT2-AA.cjs} +1 -1
  47. package/dist/{index-Dq3HNSET.js → index-dTA9hAgr.js} +3261 -3248
  48. package/dist/{index-CGoPD35H.cjs → index-hBEZJTBK.cjs} +1 -1
  49. package/dist/{index-DsOj_EOL.cjs → index-hKbFMqEu.cjs} +12 -12
  50. package/dist/{index-C4efuh6q.cjs → index-hORaVIHc.cjs} +1 -1
  51. package/dist/{index-D5O3A6Fx.js → index-jfKxOdn1.js} +1 -1
  52. package/dist/{index-xpsuJRYD.cjs → index-l7UB2yUy.cjs} +1 -1
  53. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BqQN_vwd.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BNPzwHXs.js} +6 -6
  54. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-B_3YixjC.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CNiwHtU5.cjs} +1 -1
  55. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bgts3--T.cjs} +59 -59
  56. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B8FQIQZU.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js} +1643 -1648
  57. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DRUxrXlC.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-BOzovrSr.cjs} +1 -1
  58. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-Dg0WsT5i.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-BuwJQ9eE.js} +19 -19
  59. package/dist/{index.vue_vue_type_style_index_1_lang-C-HS1nJI.cjs → index.vue_vue_type_style_index_1_lang-CDoOP6Aw.cjs} +1 -1
  60. package/dist/{index.vue_vue_type_style_index_1_lang--VeL916J.js → index.vue_vue_type_style_index_1_lang-ZmTqB1dO.js} +4 -4
  61. package/dist/{main-Dx_m6QdJ.cjs → main-CBor783N.cjs} +1 -1
  62. package/dist/{main-BKAAdzBm.js → main-Yx9pP1an.js} +2 -2
  63. package/dist/{pointTrack-05CcPzgf.cjs → pointTrack-BkpbGc8n.cjs} +1 -1
  64. package/dist/{pointTrack-BRZj2fRP.js → pointTrack-CMyadDzE.js} +2 -2
  65. package/dist/{robotUtil-DGZFmHa1.js → robotUtil-BAK-GNOJ.js} +1 -1
  66. package/dist/{robotUtil-_esgRFP3.cjs → robotUtil-BtBh1-GY.cjs} +1 -1
  67. package/dist/ss-component.cjs +1 -1
  68. package/dist/ss-component.css +1 -1
  69. package/dist/ss-component.js +31 -31
  70. package/dist/ss-component2.cjs +1 -1
  71. package/dist/ss-component2.js +10 -10
  72. package/dist/{threeModel-euHdSZWK.cjs → threeModel-C0vGemcj.cjs} +1 -1
  73. package/dist/{threeModel-WVUvmnEU.js → threeModel-C44vcdqj.js} +5 -5
  74. package/dist/{threePreview-BvzwkKZR.js → threePreview-CKjG0F-q.js} +4 -4
  75. package/dist/{threePreview-B3amehMf.cjs → threePreview-PffN5Aiq.cjs} +1 -1
  76. package/dist/{threeSceneView-BV580zYO.js → threeSceneView-4FffGfEx.js} +7 -7
  77. package/dist/{threeSceneView-BYYPjbrf.cjs → threeSceneView-BI__dTV5.cjs} +1 -1
  78. package/dist/{threeSceneViewForCPMPIP-BcL1uoBQ.js → threeSceneViewForCPMPIP-Bo1U2avY.js} +9 -9
  79. package/dist/{threeSceneViewForCPMPIP-CSKEFRk_.cjs → threeSceneViewForCPMPIP-DZddF3u8.cjs} +1 -1
  80. package/dist/{threeTrackPathView-BpunMIGZ.js → threeTrackPathView-DzU4AIwq.js} +5 -5
  81. package/dist/{threeTrackPathView-CGEH2zTP.cjs → threeTrackPathView-oMFtTDLX.cjs} +1 -1
  82. package/dist/{threeViewerHost-BPu_LZha.cjs → threeViewerHost-BcIsHd7R.cjs} +2 -2
  83. package/dist/{threeViewerHost-CiYZBM4H.js → threeViewerHost-DUzh9-TD.js} +2 -2
  84. package/dist/{urdfTree-CoHIn4kK.js → urdfTree-BVGBRI7Z.js} +1 -1
  85. package/dist/{urdfTree-BjckM2-i.cjs → urdfTree-C_RPoplj.cjs} +1 -1
  86. package/dist/{workpieceTreePanel-CbsK-tey.cjs → workpieceTreePanel-B1eC1Q8u.cjs} +1 -1
  87. package/dist/{workpieceTreePanel-CtLKTnWz.js → workpieceTreePanel-_Vo2EKuP.js} +6 -6
  88. package/package.json +1 -1
  89. package/dist/index-CslSvatz.cjs +0 -1
  90. package/dist/index-IvJ1OjwT.cjs +0 -1
  91. package/dist/obj/model.mtl +0 -42
  92. package/dist/obj/model.obj +0 -26110
  93. package/public/obj/model.mtl +0 -42
  94. package/public/obj/model.obj +0 -26110
@@ -1 +1 @@
1
- "use strict";var te=Object.defineProperty;var oe=(b,n,o)=>n in b?te(b,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):b[n]=o;var D=(b,n,o)=>oe(b,typeof n!="symbol"?n+"":n,o);const se=require("./index.vue_vue_type_style_index_1_lang-C-HS1nJI.cjs"),le=require("./OBJLoader-CB9WJT82.cjs"),ee=require("./PCDLoader-BsFAYeJ2.cjs"),S=require("./threeViewerHost-BPu_LZha.cjs"),R=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),e=require("vue"),j=require("./iconfont-BELvOiht.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function ie(b){const{mtlUrl:n,manager:o,resourcePath:l,onLoad:m,onProgress:r,onError:w}=b,p=new ee.MTLLoader(o);return l&&p.setResourcePath(l),p.load(n,m,r,w),p}function ae(b){const{objUrl:n,manager:o,materials:l,onLoad:m,onProgress:r,onError:w}=b,p=new le.OBJLoader(o);return l&&p.setMaterials(l),p.load(n,m,r,w),p}function ce(b){const{manager:n,baseFolderUrl:o,onFileProgress:l}=b,m=new se.URDFLoader(n);return m.packages=r=>`${o.endsWith("/")?o:o+"/"}${r}/`,m.loadMeshCb=(r,w,p)=>{const g=(()=>{const E=r.split("?")[0].split("#")[0],c=E.lastIndexOf(".");return c>=0?E.slice(c+1).toLowerCase():void 0})();switch(g){case"obj":{const E=(()=>{try{return new URL(".",r).toString()}catch{const a=r.lastIndexOf("/");return a>=0?r.slice(0,a+1):r}})(),c=(()=>{var d;return(((d=r.split("/").pop())==null?void 0:d.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${E}${c}.mtl`,h=a=>{ae({objUrl:r,manager:w,materials:a,onLoad:d=>p(d),onProgress:d=>l==null?void 0:l(r,d==null?void 0:d.loaded,d==null?void 0:d.total),onError:d=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${r}`,d),p(new R.Group)}})};ie({mtlUrl:f,manager:w,resourcePath:E,onLoad:a=>{try{a.preload()}catch{}h(a)},onProgress:a=>l==null?void 0:l(f,a==null?void 0:a.loaded,a==null?void 0:a.total),onError:a=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),h(void 0)}});break}case"stl":{new ee.STLLoader(w).load(r,c=>{const f=new R.MeshPhongMaterial({color:12303291,shininess:30}),h=new R.Mesh(c,f);h.castShadow=!0,h.receiveShadow=!0,p(h)},c=>l==null?void 0:l(r,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${r}`,c),p(new R.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${r})`),p(new R.Group)}},m}function de(b,n,o,l){return{loadSceneFromFile:r=>new Promise((w,p)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,E=0,c=null;const f=new R.LoadingManager;f.onStart=(a,d,V)=>{g=V||0,E=d||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(a,d,V)=>{E=d,g=V;const L=`正在加载 ${d} / ${V} 个文件: ${S.getFilenameFromUrl(a)}`;l.value=L,d===V&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(c){c.updateMatrixWorld(!0);const v=new R.Box3().setFromObject(c);v.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),c.userData.boundingBox=v,c.traverse(u=>{u.isMesh&&(u.castShadow=!0,u.receiveShadow=!0)}),w(c)}else p(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=a=>{console.warn(`LoadingManager 报告一个资源加载失败: ${a}。加载流程将继续。`)};const h=(a,d,V)=>{const L=S.getFilenameFromUrl(a);let v;V&&V>0?v=`${L}(${S.formatBytes(d)} / ${S.formatBytes(V)})`:d&&d>0?v=`${L}(已下载 ${S.formatBytes(d)})`:v=`${L}`,l.value=`正在下载第 ${E+1} / ${g} 个文件: ${v}`};try{const a=URL.createObjectURL(r);ce({manager:f,baseFolderUrl:ne,onFileProgress:h}).load(a,V=>{c=V},void 0,V=>{console.error(`加载 URDF 文件 (${r.name}) 时发生致命错误:`,V),l.value="URDF 文件解析失败",o.value=!1,p(new Error(`加载 URDF 文件失败: ${r.name}`))})}catch(a){console.error("初始化 URDF 加载时发生致命错误:",a),l.value="模型加载失败",o.value=!1,p(a)}})}}function ue(b,n,o,l=["URDFVisual"]){let m=null;const r=e.ref(null),w=new R.Raycaster,p=new R.Vector2,g=new Map;function E(){o.value.forEach(v=>{v.traverse(u=>{l!=null&&l.includes(u.type)&&g.set(u.id,{obj:u,axis:u.axis||new R.Vector3(1,0,0),limits:u.limits})})})}function c(v){r.value&&r.value.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(0))}),r.value=v,v.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(65280))})}function f(v){const u=b.value.getBoundingClientRect();p.x=(v.clientX-u.left)/u.width*2-1,p.y=-((v.clientY-u.top)/u.height)*2+1,w.setFromCamera(p,m);const t=w.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,_=null;for(;s;){if(g.has(s.id)){_=g.get(s.id);break}s=s.parent}_&&c(_)}function h(){b.value&&b.value.removeEventListener("click",f,!1)}function a(){const{scene:v,camera:u}=n();m=u,E(),b.value&&b.value.addEventListener("click",f,!1)}function d(v){r.value&&(r.value.obj.visible=v)}function V(v){var s;const{axis:u,value:t}=v;j.updateObjectPosition((s=r.value)==null?void 0:s.obj,u,t)}function L(v){var s;const{axis:u,value:t}=v;j.updateObjectRotation((s=r.value)==null?void 0:s.obj,u,t)}return{initRaycaster:a,dispose:h,selectedObject3D:r,setSelectedObjVisible:d,updatePosition:V,updateRotation:L}}const me={SINGLE:"单机",DOUBLE:"双机"},pe={ROBOT:1,PIPECOMPARSION:2};class ve{constructor(n){D(this,"robot");D(this,"movableJoints");this.robot=n,this.movableJoints=this.getMovableJoints()}getMovableJoints(){return Object.values(this.robot.joints).filter(n=>n.jointType!=="fixed")}getMovableJointNames(){return this.movableJoints.map(n=>n.name)}setJointAngle(n,o){const l=this.robot.joints[n];if(!l||l.jointType==="fixed")return console.warn(`关节 ${n} 不存在或不可动`),!1;if(l.limit){const m=Math.max(l.limit.lower,Math.min(l.limit.upper,o));m!==o&&console.warn(`关节 ${n} 角度被限制在 [${l.limit.lower}, ${l.limit.upper}]`),l.setJointValue(m)}else l.setJointValue(o);return!0}setJointAngles(n){Object.entries(n).forEach(([o,l])=>{typeof l=="number"&&!isNaN(l)&&this.setJointAngle(o,l)})}getCurrentJointStates(){const n={};return this.movableJoints.forEach(o=>{n[o.name]=o.angle||0}),n}resetToZero(){this.movableJoints.forEach(n=>{n.setJointValue(0)})}getJointLimits(n){const o=this.robot.joints[n];return!o||!o.limit?null:{lower:o.limit.lower,upper:o.limit.upper}}async animateToState(n,o=1e3,l){const m=this.getCurrentJointStates(),r=Date.now();return new Promise(w=>{const p=()=>{const g=Date.now()-r,E=Math.min(g/o,1),c=this.easeInOutCubic(E),f={};Object.keys(n).forEach(h=>{const a=m[h]||0,d=n[h];f[h]=a+(d-a)*c}),this.setJointAngles(f),l&&l(E),E<1?requestAnimationFrame(p):w()};p()})}easeInOutCubic(n){return n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2}async playSequence(n,o=1e3,l){for(let m=0;m<n.length;m++)await this.animateToState(n[m],o,r=>{l&&l(m,r)})}}const fe={class:"panel-content"},be={class:"obj"},_e={key:0,class:"obj-base"},we=["title"],Ee=["title"],he={key:1},Ve={class:"obj-position"},ge={class:"coord-item"},ye={class:"coord-item"},Ne={class:"coord-item"},Le={class:"obj-rotation"},Re={class:"coord-item"},Ce={class:"coord-item"},Se={class:"coord-item"},De={class:"world"},je={class:"coord-line"},Ue={class:"coord-text"},Fe={class:"world-position-item"},Me={class:"world-position-item"},Oe={class:"world-position-item"},$e={class:"coord-line"},xe={class:"coord-text"},Je={class:"world-rotation-item"},Te={class:"world-rotation-item"},ke={class:"world-rotation-item"},Pe=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(b,{emit:n}){const o=b,l=n,m=e.ref([]),r=e.ref({}),w=(t,s=0)=>{const _=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(i=>{if(!(i!=null&&i.isMesh)){const y={name:i==null?void 0:i.name,label:(i==null?void 0:i.name)||(i==null?void 0:i.type),show:!0,level:s+1,isPenultimate:!1,type:i==null?void 0:i.type,id:i==null?void 0:i.id,limit:(i==null?void 0:i.limit)??"",children:w(i==null?void 0:i.children,s+1),path:i==null?void 0:i.name};_.push(y)}}),_},p=t=>t?[{name:t==null?void 0:t.name,label:(t==null?void 0:t.name)||(t==null?void 0:t.type),show:!0,level: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:w(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const _=[],i=[...t];for(;i.length>0&&_.length<s;){const y=i.shift();y.children&&y.children.length>0&&(_.push(y.id),i.push(...y.children))}return _},E=(t,s)=>{const _=[];return t.forEach(i=>{if(i.children&&i.children.length>0){_.push(i.id);const y=i.children.filter(C=>C.children&&C.children.length>0).slice(0,s).map(C=>C.id);_.push(...y)}}),_.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?E(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const c=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,h=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},a=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},d=t=>{l("visibleChange",t)},V=e.computed(()=>o!=null&&o.model?p(o.model):[]),L=e.computed(()=>{var t,s;return((t=o==null?void 0:o.model)==null?void 0:t.name)||((s=o==null?void 0:o.model)==null?void 0:s.type)}),v=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),u=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(r.value=j.getObject3DData(o.model))},{deep:!0,immediate:!0}),e.watch(V,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var C,U,F,M,O,$,x,J,T,k,P,B,z,I,q,A,W,G,X,Y,Z,H,K,Q;const _=e.resolveComponent("el-divider"),i=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(_,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",be,[o.model?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",{class:"obj-name",title:L.value},e.toDisplayString(L.value),9,we),e.createElementVNode("div",{class:"obj-type",title:v.value},"["+e.toDisplayString(v.value)+"]",9,Ee)])):(e.openBlock(),e.createElementBlock("div",he,"空")),e.createVNode(i,{"model-value":u.value,onChange:d},null,8,["model-value"])]),e.createVNode(_,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",Ve,[e.createElementVNode("div",ge,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":c((U=(C=r.value)==null?void 0:C.position)==null?void 0:U.x),onChange:s[0]||(s[0]=N=>h(N,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ye,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":c((M=(F=r.value)==null?void 0:F.position)==null?void 0:M.y),onChange:s[1]||(s[1]=N=>h(N,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":c(($=(O=r.value)==null?void 0:O.position)==null?void 0:$.z),onChange:s[2]||(s[2]=N=>h(N,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(_,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((J=(x=r.value)==null?void 0:x.rotation)==null?void 0:J.x),onChange:s[3]||(s[3]=N=>a(N,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ce,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((k=(T=r.value)==null?void 0:T.rotation)==null?void 0:k.y),onChange:s[4]||(s[4]=N=>a(N,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Se,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((B=(P=r.value)==null?void 0:P.rotation)==null?void 0:B.z),onChange:s[5]||(s[5]=N=>a(N,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(_,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",De,[e.createElementVNode("div",je,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",Ue,[e.createElementVNode("div",Fe,e.toDisplayString(c((I=(z=r.value)==null?void 0:z.worldPosition)==null?void 0:I.x))+", ",1),e.createElementVNode("div",Me,e.toDisplayString(c((A=(q=r.value)==null?void 0:q.worldPosition)==null?void 0:A.y))+", ",1),e.createElementVNode("div",Oe,e.toDisplayString(c((G=(W=r.value)==null?void 0:W.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",$e,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",xe,[e.createElementVNode("div",Je,e.toDisplayString(f((Y=(X=r.value)==null?void 0:X.worldRotation)==null?void 0:Y.x))+"°, ",1),e.createElementVNode("div",Te,e.toDisplayString(f((H=(Z=r.value)==null?void 0:Z.worldRotation)==null?void 0:H.y))+"°, ",1),e.createElementVNode("div",ke,e.toDisplayString(f((Q=(K=r.value)==null?void 0:K.worldRotation)==null?void 0:Q.z))+"° ",1)])])])])}}}),Be=re._export_sfc(Pe,[["__scopeId","data-v-00d48931"]]);exports.URDFRobotController=ve;exports.WorkpieceTreePanel=Be;exports.robotMode=me;exports.sceneType=pe;exports.useRaycaster=ue;exports.useUrdfLoader=de;
1
+ "use strict";var te=Object.defineProperty;var oe=(b,n,o)=>n in b?te(b,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):b[n]=o;var D=(b,n,o)=>oe(b,typeof n!="symbol"?n+"":n,o);const se=require("./index.vue_vue_type_style_index_1_lang-CDoOP6Aw.cjs"),le=require("./OBJLoader-8gDmNV2i.cjs"),ee=require("./PCDLoader-D-K96lwY.cjs"),S=require("./threeViewerHost-BcIsHd7R.cjs"),R=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bgts3--T.cjs"),e=require("vue"),j=require("./iconfont-Btynh8XG.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function ie(b){const{mtlUrl:n,manager:o,resourcePath:l,onLoad:m,onProgress:r,onError:w}=b,p=new ee.MTLLoader(o);return l&&p.setResourcePath(l),p.load(n,m,r,w),p}function ae(b){const{objUrl:n,manager:o,materials:l,onLoad:m,onProgress:r,onError:w}=b,p=new le.OBJLoader(o);return l&&p.setMaterials(l),p.load(n,m,r,w),p}function ce(b){const{manager:n,baseFolderUrl:o,onFileProgress:l}=b,m=new se.URDFLoader(n);return m.packages=r=>`${o.endsWith("/")?o:o+"/"}${r}/`,m.loadMeshCb=(r,w,p)=>{const g=(()=>{const E=r.split("?")[0].split("#")[0],c=E.lastIndexOf(".");return c>=0?E.slice(c+1).toLowerCase():void 0})();switch(g){case"obj":{const E=(()=>{try{return new URL(".",r).toString()}catch{const a=r.lastIndexOf("/");return a>=0?r.slice(0,a+1):r}})(),c=(()=>{var d;return(((d=r.split("/").pop())==null?void 0:d.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${E}${c}.mtl`,h=a=>{ae({objUrl:r,manager:w,materials:a,onLoad:d=>p(d),onProgress:d=>l==null?void 0:l(r,d==null?void 0:d.loaded,d==null?void 0:d.total),onError:d=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${r}`,d),p(new R.Group)}})};ie({mtlUrl:f,manager:w,resourcePath:E,onLoad:a=>{try{a.preload()}catch{}h(a)},onProgress:a=>l==null?void 0:l(f,a==null?void 0:a.loaded,a==null?void 0:a.total),onError:a=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),h(void 0)}});break}case"stl":{new ee.STLLoader(w).load(r,c=>{const f=new R.MeshPhongMaterial({color:12303291,shininess:30}),h=new R.Mesh(c,f);h.castShadow=!0,h.receiveShadow=!0,p(h)},c=>l==null?void 0:l(r,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${r}`,c),p(new R.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${r})`),p(new R.Group)}},m}function de(b,n,o,l){return{loadSceneFromFile:r=>new Promise((w,p)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,E=0,c=null;const f=new R.LoadingManager;f.onStart=(a,d,V)=>{g=V||0,E=d||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(a,d,V)=>{E=d,g=V;const L=`正在加载 ${d} / ${V} 个文件: ${S.getFilenameFromUrl(a)}`;l.value=L,d===V&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(c){c.updateMatrixWorld(!0);const v=new R.Box3().setFromObject(c);v.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),c.userData.boundingBox=v,c.traverse(u=>{u.isMesh&&(u.castShadow=!0,u.receiveShadow=!0)}),w(c)}else p(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=a=>{console.warn(`LoadingManager 报告一个资源加载失败: ${a}。加载流程将继续。`)};const h=(a,d,V)=>{const L=S.getFilenameFromUrl(a);let v;V&&V>0?v=`${L}(${S.formatBytes(d)} / ${S.formatBytes(V)})`:d&&d>0?v=`${L}(已下载 ${S.formatBytes(d)})`:v=`${L}`,l.value=`正在下载第 ${E+1} / ${g} 个文件: ${v}`};try{const a=URL.createObjectURL(r);ce({manager:f,baseFolderUrl:ne,onFileProgress:h}).load(a,V=>{c=V},void 0,V=>{console.error(`加载 URDF 文件 (${r.name}) 时发生致命错误:`,V),l.value="URDF 文件解析失败",o.value=!1,p(new Error(`加载 URDF 文件失败: ${r.name}`))})}catch(a){console.error("初始化 URDF 加载时发生致命错误:",a),l.value="模型加载失败",o.value=!1,p(a)}})}}function ue(b,n,o,l=["URDFVisual"]){let m=null;const r=e.ref(null),w=new R.Raycaster,p=new R.Vector2,g=new Map;function E(){o.value.forEach(v=>{v.traverse(u=>{l!=null&&l.includes(u.type)&&g.set(u.id,{obj:u,axis:u.axis||new R.Vector3(1,0,0),limits:u.limits})})})}function c(v){r.value&&r.value.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(0))}),r.value=v,v.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(65280))})}function f(v){const u=b.value.getBoundingClientRect();p.x=(v.clientX-u.left)/u.width*2-1,p.y=-((v.clientY-u.top)/u.height)*2+1,w.setFromCamera(p,m);const t=w.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,_=null;for(;s;){if(g.has(s.id)){_=g.get(s.id);break}s=s.parent}_&&c(_)}function h(){b.value&&b.value.removeEventListener("click",f,!1)}function a(){const{scene:v,camera:u}=n();m=u,E(),b.value&&b.value.addEventListener("click",f,!1)}function d(v){r.value&&(r.value.obj.visible=v)}function V(v){var s;const{axis:u,value:t}=v;j.updateObjectPosition((s=r.value)==null?void 0:s.obj,u,t)}function L(v){var s;const{axis:u,value:t}=v;j.updateObjectRotation((s=r.value)==null?void 0:s.obj,u,t)}return{initRaycaster:a,dispose:h,selectedObject3D:r,setSelectedObjVisible:d,updatePosition:V,updateRotation:L}}const me={SINGLE:"单机",DOUBLE:"双机"},pe={ROBOT:1,PIPECOMPARSION:2};class ve{constructor(n){D(this,"robot");D(this,"movableJoints");this.robot=n,this.movableJoints=this.getMovableJoints()}getMovableJoints(){return Object.values(this.robot.joints).filter(n=>n.jointType!=="fixed")}getMovableJointNames(){return this.movableJoints.map(n=>n.name)}setJointAngle(n,o){const l=this.robot.joints[n];if(!l||l.jointType==="fixed")return console.warn(`关节 ${n} 不存在或不可动`),!1;if(l.limit){const m=Math.max(l.limit.lower,Math.min(l.limit.upper,o));m!==o&&console.warn(`关节 ${n} 角度被限制在 [${l.limit.lower}, ${l.limit.upper}]`),l.setJointValue(m)}else l.setJointValue(o);return!0}setJointAngles(n){Object.entries(n).forEach(([o,l])=>{typeof l=="number"&&!isNaN(l)&&this.setJointAngle(o,l)})}getCurrentJointStates(){const n={};return this.movableJoints.forEach(o=>{n[o.name]=o.angle||0}),n}resetToZero(){this.movableJoints.forEach(n=>{n.setJointValue(0)})}getJointLimits(n){const o=this.robot.joints[n];return!o||!o.limit?null:{lower:o.limit.lower,upper:o.limit.upper}}async animateToState(n,o=1e3,l){const m=this.getCurrentJointStates(),r=Date.now();return new Promise(w=>{const p=()=>{const g=Date.now()-r,E=Math.min(g/o,1),c=this.easeInOutCubic(E),f={};Object.keys(n).forEach(h=>{const a=m[h]||0,d=n[h];f[h]=a+(d-a)*c}),this.setJointAngles(f),l&&l(E),E<1?requestAnimationFrame(p):w()};p()})}easeInOutCubic(n){return n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2}async playSequence(n,o=1e3,l){for(let m=0;m<n.length;m++)await this.animateToState(n[m],o,r=>{l&&l(m,r)})}}const fe={class:"panel-content"},be={class:"obj"},_e={key:0,class:"obj-base"},we=["title"],Ee=["title"],he={key:1},Ve={class:"obj-position"},ge={class:"coord-item"},ye={class:"coord-item"},Ne={class:"coord-item"},Le={class:"obj-rotation"},Re={class:"coord-item"},Ce={class:"coord-item"},Se={class:"coord-item"},De={class:"world"},je={class:"coord-line"},Ue={class:"coord-text"},Fe={class:"world-position-item"},Me={class:"world-position-item"},Oe={class:"world-position-item"},$e={class:"coord-line"},xe={class:"coord-text"},Je={class:"world-rotation-item"},Te={class:"world-rotation-item"},ke={class:"world-rotation-item"},Pe=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(b,{emit:n}){const o=b,l=n,m=e.ref([]),r=e.ref({}),w=(t,s=0)=>{const _=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(i=>{if(!(i!=null&&i.isMesh)){const y={name:i==null?void 0:i.name,label:(i==null?void 0:i.name)||(i==null?void 0:i.type),show:!0,level:s+1,isPenultimate:!1,type:i==null?void 0:i.type,id:i==null?void 0:i.id,limit:(i==null?void 0:i.limit)??"",children:w(i==null?void 0:i.children,s+1),path:i==null?void 0:i.name};_.push(y)}}),_},p=t=>t?[{name:t==null?void 0:t.name,label:(t==null?void 0:t.name)||(t==null?void 0:t.type),show:!0,level: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:w(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const _=[],i=[...t];for(;i.length>0&&_.length<s;){const y=i.shift();y.children&&y.children.length>0&&(_.push(y.id),i.push(...y.children))}return _},E=(t,s)=>{const _=[];return t.forEach(i=>{if(i.children&&i.children.length>0){_.push(i.id);const y=i.children.filter(C=>C.children&&C.children.length>0).slice(0,s).map(C=>C.id);_.push(...y)}}),_.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?E(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const c=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,h=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},a=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},d=t=>{l("visibleChange",t)},V=e.computed(()=>o!=null&&o.model?p(o.model):[]),L=e.computed(()=>{var t,s;return((t=o==null?void 0:o.model)==null?void 0:t.name)||((s=o==null?void 0:o.model)==null?void 0:s.type)}),v=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),u=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(r.value=j.getObject3DData(o.model))},{deep:!0,immediate:!0}),e.watch(V,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var C,U,F,M,O,$,x,J,T,k,P,B,z,I,q,A,W,G,X,Y,Z,H,K,Q;const _=e.resolveComponent("el-divider"),i=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(_,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",be,[o.model?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",{class:"obj-name",title:L.value},e.toDisplayString(L.value),9,we),e.createElementVNode("div",{class:"obj-type",title:v.value},"["+e.toDisplayString(v.value)+"]",9,Ee)])):(e.openBlock(),e.createElementBlock("div",he,"空")),e.createVNode(i,{"model-value":u.value,onChange:d},null,8,["model-value"])]),e.createVNode(_,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",Ve,[e.createElementVNode("div",ge,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":c((U=(C=r.value)==null?void 0:C.position)==null?void 0:U.x),onChange:s[0]||(s[0]=N=>h(N,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ye,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":c((M=(F=r.value)==null?void 0:F.position)==null?void 0:M.y),onChange:s[1]||(s[1]=N=>h(N,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":c(($=(O=r.value)==null?void 0:O.position)==null?void 0:$.z),onChange:s[2]||(s[2]=N=>h(N,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(_,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((J=(x=r.value)==null?void 0:x.rotation)==null?void 0:J.x),onChange:s[3]||(s[3]=N=>a(N,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ce,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((k=(T=r.value)==null?void 0:T.rotation)==null?void 0:k.y),onChange:s[4]||(s[4]=N=>a(N,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Se,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((B=(P=r.value)==null?void 0:P.rotation)==null?void 0:B.z),onChange:s[5]||(s[5]=N=>a(N,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(_,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",De,[e.createElementVNode("div",je,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",Ue,[e.createElementVNode("div",Fe,e.toDisplayString(c((I=(z=r.value)==null?void 0:z.worldPosition)==null?void 0:I.x))+", ",1),e.createElementVNode("div",Me,e.toDisplayString(c((A=(q=r.value)==null?void 0:q.worldPosition)==null?void 0:A.y))+", ",1),e.createElementVNode("div",Oe,e.toDisplayString(c((G=(W=r.value)==null?void 0:W.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",$e,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",xe,[e.createElementVNode("div",Je,e.toDisplayString(f((Y=(X=r.value)==null?void 0:X.worldRotation)==null?void 0:Y.x))+"°, ",1),e.createElementVNode("div",Te,e.toDisplayString(f((H=(Z=r.value)==null?void 0:Z.worldRotation)==null?void 0:H.y))+"°, ",1),e.createElementVNode("div",ke,e.toDisplayString(f((Q=(K=r.value)==null?void 0:K.worldRotation)==null?void 0:Q.z))+"° ",1)])])])])}}}),Be=re._export_sfc(Pe,[["__scopeId","data-v-00d48931"]]);exports.URDFRobotController=ve;exports.WorkpieceTreePanel=Be;exports.robotMode=me;exports.sceneType=pe;exports.useRaycaster=ue;exports.useUrdfLoader=de;
@@ -1,13 +1,13 @@
1
1
  var ce = Object.defineProperty;
2
2
  var de = (b, l, o) => l in b ? ce(b, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : b[l] = o;
3
3
  var D = (b, l, o) => de(b, typeof l != "symbol" ? l + "" : l, o);
4
- import { U as me } from "./index.vue_vue_type_style_index_1_lang--VeL916J.js";
5
- import { O as ve } from "./OBJLoader-BNv6XCtP.js";
6
- import { S as pe, M as fe } from "./PCDLoader-cSzkUgjw.js";
7
- import { i as re, j as E } from "./threeViewerHost-CiYZBM4H.js";
8
- import { aV as be, F as J, u as we, r as he, B as _e, aW as ge, a2 as je, V as ye } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B8FQIQZU.js";
4
+ import { U as me } from "./index.vue_vue_type_style_index_1_lang-ZmTqB1dO.js";
5
+ import { O as ve } from "./OBJLoader-Ck9W3Ir7.js";
6
+ import { S as pe, M as fe } from "./PCDLoader-CkJ5aJWh.js";
7
+ import { i as re, j as E } from "./threeViewerHost-DUzh9-TD.js";
8
+ import { aV as be, F as J, u as we, r as he, B as _e, aW as ge, a2 as je, V as ye } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js";
9
9
  import { ref as V, defineComponent as Le, computed as O, watch as ue, resolveComponent as x, createElementBlock as P, openBlock as T, createVNode as S, createElementVNode as c, withCtx as $, createTextVNode as F, toDisplayString as C } from "vue";
10
- import { e as Re, g as Se, h as Ue } from "./iconfont-CGucCJqY.js";
10
+ import { e as Re, g as Se, h as Ue } from "./iconfont-B8t8JT6z.js";
11
11
  import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
12
  const Me = "http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";
13
13
  function Oe(b) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ss-component-new",
3
3
  "private": false,
4
- "version": "1.2.294",
4
+ "version": "1.2.296",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -1 +0,0 @@
1
- "use strict";const l=require("vue"),k=require("./index-CEwxrYB-.cjs"),Hl=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),Re=require("./index-DsOj_EOL.cjs"),Ve=require("./threeViewerHost-BPu_LZha.cjs"),ie=require("./index.vue_vue_type_style_index_1_lang-coQLbheN.cjs");require("./index.vue_vue_type_style_index_1_lang-C-HS1nJI.cjs");const Pl=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Dl=require("./index-Dmi6R0kU.cjs");require("./index-DrVAEV9j.cjs");const va=require("./isString-Cvx5mmsS.cjs"),Ql=O=>O.match(/\((.*)\)/)[1],ba={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200}},setup(O){const Z=O,Q=l.ref(null),P=l.ref(!1),U=l.ref(null);return l.watch(()=>Z==null?void 0:Z.isVisible,()=>{P.value=Z==null?void 0:Z.isVisible},{deep:!0,immediate:!0}),l.watch(()=>U.value,()=>{l.nextTick(()=>{var s,ee;(ee=(s=Q.value)==null?void 0:s.updatePopper)==null||ee.call(s)})},{deep:!0,immediate:!0}),(s,ee)=>{const ge=l.resolveComponent("el-popover");return l.openBlock(),l.createBlock(ge,{visible:P.value,title:Z==null?void 0:Z.title,placement:Z==null?void 0:Z.placement,width:Z==null?void 0:Z.width,ref_key:"popOverRef",ref:Q},{reference:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"reference",{ref_key:"referenceRef",ref:U})])]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"content")])]),_:3},8,["visible","title","placement","width"])}}},Er={key:0,class:"extra-button-content"},Nr={class:"table-operator-wrap"},Br={class:"extra-button-filter"},Ar={class:"form-content-value"},wr={key:0,class:"extra-header"},_r={class:"drop-menu",style:{width:"120px"}},Ur={key:0},Or={key:1},Lr={key:1,class:"extra-button-content tabs-button-wrapper"},Vr={class:"table-operator-wrap"},jr={class:"extra-button-filter"},Mr={class:"form-content-value"},Pr={key:0,class:"extra-header"},$r={class:"drop-menu",style:{width:"120px"}},Kr={key:0},Fr={key:1},zr={__name:"header",props:{pageLayout:{type:String,default:"vertical"},lockingPage:Boolean,level:{type:Number,default:1},compName:{type:String,default:"表格名称",required:!1},isDevMode:Boolean,selectNums:Number,dataNums:Number,filterValues:Array,buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter","getImportData"],setup(O,{emit:Z}){const Q=Z,P=O,U=l.ref(""),s=l.ref(!1),ee=l.ref([]),ge=l.ref([{label:"取消",background:"#999999"},{label:"清空",background:"#999999"},{label:"确认"}]),me=[{label:"新增",icon:"Plus"},{label:"导入",icon:"import"},{label:"导出",icon:"export"}],he=oe=>{const re=oe.raw;if(!re)return;const te=new FileReader;te.onload=V=>{try{const xe=new Uint8Array(V.target.result),Ee=Ve.readSync(xe,{type:"array"}),qe=Ee.SheetNames[0],Oe=Ee.Sheets[qe],Je=Ve.utils.decode_range(Oe["!ref"]).e.c+1,we=new Array(Je).fill(""),C=[];for(const J in Oe){if(J[0]==="!")continue;const{r:W,c:ke}=Ve.utils.decode_cell(J);let Ne=Oe[J].v;if(Oe[J].t==="n"&&Ne>0&&Ne<1e6&&(Ne=new Date((Ne-25569)*86400*1e3).toISOString().split("T")[0]),(Ne==null||Ne==="")&&(Ne=""),W===0)we[ke]=Ne;else{if(!C[W-1]){C[W-1]={};for(let We=0;We<Je;We++)C[W-1][`col_${We}`]=""}C[W-1][`col_${ke}`]=Ne}}for(let J=0;J<Je;J++)we[J]===void 0&&(we[J]="");const ye=C==null?void 0:C[0];if(!(ye!=null&&ye.hasOwnProperty("col_0")))return k.ElMessage.error("导入的数据列不匹配,请检查是否错位");Q("getImportData",we,C)}catch(xe){throw k.ElMessage.error(xe.message),new Error(xe.message)}},te.readAsArrayBuffer(re)},je=oe=>{var te;const re=(te=ee.value)==null?void 0:te.reduce((V,xe,Ee)=>(Ee===0?V[xe.label]=oe:V[xe.label]=xe==null?void 0:xe.value,V),{});Q("filter",re,oe,!0)},He=oe=>{Q("buttonClick",oe)},le=oe=>{var re,te;ee.value=(te=(re=ie.getColumnChild(k.cloneDeep(oe)))==null?void 0:re.filter(V=>(V==null?void 0:V.label)!==""&&(V==null?void 0:V.label)!=="操作"))==null?void 0:te.map(V=>({label:(V==null?void 0:V.label)??"",value:"",name:(V==null?void 0:V.label)??"",isFormColHidden:V==null?void 0:V.isTableColHidden,width:2}))},_e=l.ref(!1),Ue=oe=>{var re;if((oe==null?void 0:oe.buttonName)==="确认"&&(Q("filter",oe==null?void 0:oe.content),_e.value=(oe==null?void 0:oe.content)&&Object.values(oe==null?void 0:oe.content).length>0),(oe==null?void 0:oe.buttonName)==="清空"){const te=k.cloneDeep(oe==null?void 0:oe.content);for(const V in te)te[V]="";ee.value=(re=ee.value)==null?void 0:re.map(V=>({...V,value:""})),Q("filter",te),_e.value=!1}s.value=!1},pe=()=>{var re,te;ee.value=(re=ee.value)==null?void 0:re.map(V=>({...V,value:""}));const oe=(te=ee.value)==null?void 0:te.reduce((V,xe)=>(V[xe.label]=xe.value,V),{});Q("filter",oe)};return l.onMounted(()=>{le(P.columns)}),l.watch(()=>P.columns,()=>{le(P.columns)},{deep:!0,immediate:!0}),(oe,re)=>{var Oe,rl,Je,we;const te=l.resolveComponent("el-icon"),V=l.resolveComponent("svg-icon"),xe=l.resolveComponent("el-input"),Ee=l.resolveComponent("el-button"),qe=l.resolveComponent("el-upload");return O.pageLayout==="vertical"?(l.openBlock(),l.createElementBlock("div",Er,[l.createElementVNode("div",{class:l.normalizeClass(O.compName?"table-name-wrap":""),style:l.normalizeStyle({background:(P==null?void 0:P.level)>1?"transparent":"var(--ssgroup-background)",paddingLeft:(P==null?void 0:P.level)>1?"0px":"8px",fontWeight:600-((P==null?void 0:P.level)-1)*100>=400?600-((P==null?void 0:P.level)-1)*100:400,fontSize:15-(P==null?void 0:P.level)>=12?15-(P==null?void 0:P.level)+"px":"14px"})},l.toDisplayString(O.compName),7),l.createElementVNode("div",Nr,[l.createElementVNode("div",Br,[l.createVNode(ba,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var C,ye,J,W;return[l.createVNode(xe,{modelValue:U.value,"onUpdate:modelValue":re[1]||(re[1]=ke=>U.value=ke),style:{"min-width":"80px"},placeholder:_e.value?(J=(ye=(C=O.filterValues)==null?void 0:C.filter(ke=>ke))==null?void 0:ye.slice(0,3))==null?void 0:J.join("/"):"搜索","prefix-icon":l.unref(k.search_default),clearable:"",onInput:je,disabled:((W=ee.value)==null?void 0:W.length)===0},{suffix:l.withCtx(()=>{var ke,Ne;return[!U.value&&((Ne=(ke=O.filterValues)==null?void 0:ke.filter(We=>We))!=null&&Ne.join("/"))?(l.openBlock(),l.createBlock(te,{key:0,style:{cursor:"pointer"},onClick:pe},{default:l.withCtx(()=>[l.createVNode(l.unref(k.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:re[0]||(re[0]=ke=>s.value=!s.value)},[l.createVNode(V,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",Ar,[(l.openBlock(),l.createBlock(Re.ssForm,{rowContents:ee.value,buttonValue:ge.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:ge.value,isStartJustify:!1,onOnButtonClick:Ue},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),O.buttons&&((Oe=O.buttons)==null?void 0:Oe.length)>0?(l.openBlock(),l.createElementBlock("div",wr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((rl=O.buttons)==null?void 0:rl.filter(C=>O.isDevMode||(C==null?void 0:C.label)!=="修改模板"),(C,ye)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:ye},[(C==null?void 0:C.type)==="upload"?(l.openBlock(),l.createBlock(qe,{key:0,class:"upload-button-wrap","on-change":he,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1,disabled:!!O.lockingPage},{default:l.withCtx(()=>[l.createVNode(Ee,{disabled:!!O.lockingPage,style:l.normalizeStyle({background:(C==null?void 0:C.background)??"var(--ssbutton-theme-bg)",color:(C==null?void 0:C.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(C==null?void 0:C.label),1)]),_:2},1032,["disabled","style"])]),_:2},1032,["disabled"])):l.createCommentVNode("",!0),(C==null?void 0:C.type)==="popover"?(l.openBlock(),l.createBlock(Re._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(C==null?void 0:C.type)==="popover"?(l.openBlock(),l.createBlock(Ee,{key:0,disabled:!!O.lockingPage,style:l.normalizeStyle({background:(C==null?void 0:C.background)??"var(--ssbutton-theme-bg)",color:(C==null?void 0:C.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(C==null?void 0:C.label),1)]),_:2},1032,["disabled","style"])):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",_r,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C==null?void 0:C.contents,J=>(l.openBlock(),l.createBlock(Ee,{key:J==null?void 0:J.label,disabled:!!O.lockingPage,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:W=>He(J==null?void 0:J.label)},{default:l.withCtx(()=>{var W,ke;return[l.createTextVNode(l.toDisplayString(J==null?void 0:J.label),1),(W=J==null?void 0:J.label)!=null&&W.includes("选中")?(l.openBlock(),l.createElementBlock("span",Ur,"("+l.toDisplayString(O.selectNums)+")",1)):l.createCommentVNode("",!0),(ke=J==null?void 0:J.label)!=null&&ke.includes("全部")?(l.openBlock(),l.createElementBlock("span",Or,"("+l.toDisplayString(O.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["disabled","onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),C!=null&&C.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Ee,{key:2,id:"themeButton",disabled:!!O.lockingPage,style:l.normalizeStyle({background:(C==null?void 0:C.background)??"var(--ssbutton-theme-bg)",color:(C==null?void 0:C.color)??"var(--ssbutton-theme-color)"}),onClick:J=>He(C==null?void 0:C.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(C==null?void 0:C.label),1)]),_:2},1032,["disabled","style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])])):(l.openBlock(),l.createElementBlock("div",Lr,[l.createElementVNode("div",Vr,[l.createElementVNode("div",jr,[l.createVNode(ba,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var C,ye,J,W;return[l.createVNode(xe,{modelValue:U.value,"onUpdate:modelValue":re[3]||(re[3]=ke=>U.value=ke),style:{"min-width":"80px"},placeholder:_e.value?(J=(ye=(C=O.filterValues)==null?void 0:C.filter(ke=>ke))==null?void 0:ye.slice(0,3))==null?void 0:J.join("/"):"搜索","prefix-icon":l.unref(k.search_default),clearable:"",onInput:je,disabled:((W=ee.value)==null?void 0:W.length)===0},{suffix:l.withCtx(()=>{var ke,Ne;return[!U.value&&((Ne=(ke=O.filterValues)==null?void 0:ke.filter(We=>We))!=null&&Ne.join("/"))?(l.openBlock(),l.createBlock(te,{key:0,style:{cursor:"pointer"},onClick:pe},{default:l.withCtx(()=>[l.createVNode(l.unref(k.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:re[2]||(re[2]=ke=>s.value=!s.value)},[l.createVNode(V,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",Mr,[(l.openBlock(),l.createBlock(Re.ssForm,{rowContents:ee.value,buttonValue:ge.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:ge.value,isStartJustify:!1,onOnButtonClick:Ue},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),O.buttons&&((Je=O.buttons)==null?void 0:Je.length)>0?(l.openBlock(),l.createElementBlock("div",Pr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((we=O.buttons)==null?void 0:we.filter(C=>O.isDevMode||(C==null?void 0:C.label)!=="修改模板"),(C,ye)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:ye},[(C==null?void 0:C.type)==="upload"?(l.openBlock(),l.createBlock(qe,{key:0,class:"upload-button-wrap","on-change":he,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1},{default:l.withCtx(()=>[l.createVNode(Ee,{style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var J;return[l.createVNode(V,{name:(J=me==null?void 0:me.find(W=>(W==null?void 0:W.label)===(C==null?void 0:C.label)))==null?void 0:J.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(C==null?void 0:C.label),1)]),_:2},1024)]),_:2},1024)):l.createCommentVNode("",!0),(C==null?void 0:C.type)==="popover"?(l.openBlock(),l.createBlock(Re._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(C==null?void 0:C.type)==="popover"?(l.openBlock(),l.createBlock(Ee,{key:0,style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var J;return[l.createVNode(V,{name:(J=me==null?void 0:me.find(W=>(W==null?void 0:W.label)===(C==null?void 0:C.label)))==null?void 0:J.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(C==null?void 0:C.label),1)]),_:2},1024)):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",$r,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C==null?void 0:C.contents,J=>(l.openBlock(),l.createBlock(Ee,{key:J==null?void 0:J.label,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:W=>He(J==null?void 0:J.label)},{default:l.withCtx(()=>{var W,ke;return[l.createTextVNode(l.toDisplayString(J==null?void 0:J.label),1),(W=J==null?void 0:J.label)!=null&&W.includes("选中")?(l.openBlock(),l.createElementBlock("span",Kr,"("+l.toDisplayString(O.selectNums)+")",1)):l.createCommentVNode("",!0),(ke=J==null?void 0:J.label)!=null&&ke.includes("全部")?(l.openBlock(),l.createElementBlock("span",Fr,"("+l.toDisplayString(O.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),C!=null&&C.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Ee,{key:2,id:"themeButton",style:l.normalizeStyle({background:"transparent",color:(C==null?void 0:C.label)==="新增"?"var(--ssbutton-theme-bg)":"#666666"}),onClick:J=>He(C==null?void 0:C.label)},{icon:l.withCtx(()=>{var J;return[l.createVNode(V,{name:(J=me==null?void 0:me.find(W=>(W==null?void 0:W.label)===(C==null?void 0:C.label)))==null?void 0:J.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(C==null?void 0:C.label),1)]),_:2},1032,["style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])]))}}},Rr=Pl._export_sfc(zr,[["__scopeId","data-v-b0dbf278"]]),qr=l.defineComponent({__name:"batch",props:{lockingPage:Boolean,buttons:{type:Array,default:()=>[]},selectTableItems:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick"],setup(O,{emit:Z}){const Q=O,P=Z,U=ee=>{P("buttonClick",ee)},s=ee=>{var ge;return ee!=null&&ee.includes("删除")?((ge=Q.selectTableItems)==null?void 0:ge.length)>0?"warning-active-type":"warning-type":"default-type"};return(ee,ge)=>{const me=l.resolveComponent("el-button");return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(O.buttons,he=>(l.openBlock(),l.createBlock(me,{key:he==null?void 0:he.label,disabled:!!O.lockingPage,class:l.normalizeClass(s(he==null?void 0:he.label)),onClick:je=>U(he==null?void 0:he.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(he==null?void 0:he.label),1)]),_:2},1032,["disabled","class","onClick"]))),128))])}}}),Jr=Pl._export_sfc(qr,[["__scopeId","data-v-70b12973"]]),ma=k.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(O){this.selectArray=O},setSelectString(O){this.selectString=O}}}),Wr={class:"calculator-content"},Gr={class:"calculator-child"},Hr={class:"calculator-child"},Qr=l.defineComponent({__name:"calculator",setup(O){const Z=l.ref(),Q=l.ref();return l.onMounted(()=>{Z.value=[{type:"Upload",label:"输入",name:"input"}],Q.value=[{type:"Upload",label:"输出",name:"output"}]}),(P,U)=>(l.openBlock(),l.createElementBlock("div",Wr,[l.createElementVNode("div",Gr,[l.createVNode(Re.ssForm,{rowContents:Z.value,isRowFlex:!0},null,8,["rowContents"])]),l.createElementVNode("div",Hr,[l.createVNode(Re.ssForm,{rowContents:Q.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),Xr=Pl._export_sfc(Qr,[["__scopeId","data-v-73db0fe7"]]),ka=k.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(O){this.selectIndex=O},setSelectMenu(O){this.selectMenu=O},setSelectTitle(O){this.selectTitle=O}}}),Xl=(O,Z)=>{let Q=O,P=Z;return Array.isArray(Q)&&(Q=Q==null?void 0:Q.map((U,s)=>{if(Array.isArray(U)){let ee={};return U=U==null?void 0:U.forEach((ge,me)=>{var he;(he=P==null?void 0:P[me])!=null&&he.prop?ee[P[me].prop]=ge:Array.isArray(ge)&&(ee.children=Xl(ge,P))}),Object.assign(ee,{id:s})}else return U})),Q},Sa=(O,Z,Q)=>{let P=O,U=Z;return P=P==null?void 0:P.map((s,ee)=>{var ge,me;return!Array.isArray(s)||!((ge=U==null?void 0:U[ee])!=null&&ge.label)&&!Q||(s.unshift(((me=U==null?void 0:U[ee])==null?void 0:me.label)??""),s.some(he=>Array.isArray(he))&&(s=s==null?void 0:s.map(he=>{var je;return Array.isArray(he)&&(he=Sa(he,(je=U==null?void 0:U[ee])==null?void 0:je.children,Q)),he}))),s}),P},Yr=(O,Z,Q)=>{if(Z==="")return O==null?void 0:O.filter(P=>(P==null?void 0:P.id)!==Q);{const P=Z.split("-");return Zr(O,P,Q)}},Zr=(O,Z,Q)=>{let P=O,U=Z;return(U==null?void 0:U.length)===0?P=P==null?void 0:P.filter(s=>s.id!==Q):P=P==null?void 0:P.map(s=>(s.id.toString()===(U==null?void 0:U[0])&&(U==null||U.shift(),s=Ca(s,U,Q)),s)),P},Ca=(O,Z,Q)=>{var s,ee;let P=O,U=Z;return(U==null?void 0:U.length)===0?P.children=(s=P.children)==null?void 0:s.filter(ge=>ge.id!==Q):P.children=(ee=P.children)==null?void 0:ee.map(ge=>(ge.id.toString()===(U==null?void 0:U[0])&&(U==null||U.shift(),ge=Ca(ge,U,Q)),ge)),P},Ir=(O,Z,Q)=>{if(Z==="")return Q;{const P=Z.split("-");return en(O,P,Q)}},en=(O,Z,Q)=>{let P=O,U=Z;return(U==null?void 0:U.length)===0?P=Q:P=P==null?void 0:P.map(s=>(s.id.toString()===(U==null?void 0:U[0])&&(U==null||U.shift(),s=Da(s,U,Q)),s)),P},Da=(O,Z,Q)=>{var s;let P=O,U=Z;return(U==null?void 0:U.length)===0?P.children=Q:P.children=(s=P.children)==null?void 0:s.map(ee=>(ee.id.toString()===(U==null?void 0:U[0])&&(U==null||U.shift(),ee=Da(ee,U,Q)),ee)),P},xa=k.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(O){this.objUrl=O},setBlobUrls(O){this.blobUrls=O}}}),Yl=async O=>{var s,ee,ge,me,he,je,He;let Z=(ee=(s=k.cloneDeep(O))==null?void 0:s.optionUrl)==null?void 0:ee.menuSelect,Q=[];Z==null||Z.forEach(le=>{});let P="";const U=await ie.menuToParent(Z);if(U==null||U.forEach(le=>{var _e,Ue,pe,oe;(le==null?void 0:le.name)===(((oe=(pe=(Ue=(_e=k.cloneDeep(O))==null?void 0:_e.optionUrl)==null?void 0:Ue.groupSelect)==null?void 0:pe[0])==null?void 0:oe.replaceAll("'",""))??"")&&(P=le==null?void 0:le.id)}),P!==""){const le=(ge=U==null?void 0:U.find(pe=>{var oe,re,te,V;return(pe==null?void 0:pe.name)===(((re=(oe=O==null?void 0:O.groupSelect)==null?void 0:oe.split(":"))==null?void 0:re[0])||((V=(te=O==null?void 0:O.optionUrl)==null?void 0:te.groupSelect)==null?void 0:V[0]))}))==null?void 0:ge.compData;let _e=(he=(me=le==null?void 0:le.find(pe=>(pe==null?void 0:pe.key)==="header"))==null?void 0:me.contents)==null?void 0:he.map(pe=>pe==null?void 0:pe.label),Ue=(He=(je=le==null?void 0:le.find(pe=>(pe==null?void 0:pe.key)==="tableContents"))==null?void 0:je.contents)==null?void 0:He.map(pe=>(pe=pe==null?void 0:pe.filter(oe=>!(oe!=null&&oe.id)),pe));Ue==null||Ue.forEach(pe=>{Q.push(ie.getValueToObjectValue(pe,_e))})}return Q},ln={class:"table-content"},an={class:"menu-config-wrap"},rn=["onClick"],nn={key:0,class:"viewport-wrap"},on=["onClick"],tn={title:"选择显示列信息"},sn={class:"menu-config-wrap",style:{padding:"0 0 0 16px","box-sizing":"border-box","min-height":"200px",width:"400px",overflow:"auto",position:"relative"}},un=["title"],cn={class:"col-operate-wrap"},dn={title:"拖拽排序列",style:{cursor:"move",color:"grey",position:"absolute",right:"15px"}},pn={class:"pop-view"},fn={class:"pop-wrapper"},gn={class:"file-list-pop"},hn=["title","onClick"],yn=["onClick"],vn=["onClick"],bn={class:"form-content"},mn={key:0,class:"dialog-footer"},kn={class:"dialog-footer"},Sn={class:"form-content"},Cn={__name:"index",props:{pageLayout:{type:String,default:"vertical"},level:{type:Number,default:1},compName:{type:String,default:"",required:!1},compNames:{type:Array,default:()=>[],required:!1},compItem:{type:Object,default:()=>{}},operatingForm:{type:Object,default:()=>{}},cacheNewData:{type:Object,default:()=>{}},config:Object,parentTableId:{type:Number,default:0},itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,isDevMode:Boolean,changedContent:{type:Object,default:()=>{}},showHeader:{type:Boolean,default:!0},allowSelect:{type:Boolean,default:!1},allowOperate:{type:Boolean,default:!0},allMapContents:{type:Object,default:()=>{}}},emits:["getSliceContLength","clickMainKey","change","contentChange","onButtonClick","contentClick","pageChange","rowClick","routeUrl"],setup(O,{emit:Z}){var ya;const Q=l.ref([]),P=xa(k.pinia),U=l.ref(null),s=O,ee=l.ref(s==null?void 0:s.allowSelect),ge=l.ref((ya=s==null?void 0:s.config)==null?void 0:ya.showIndex),me=l.ref(),he=l.ref([{label:"排序",value:"sortable",checked:!1},{label:"筛选",value:"filterable",checked:!1},{label:"合计",value:"showSummary",checked:!1},{label:"编辑",value:"operable",checked:!1}]),je=ie.useOriginalState(k.pinia),{originalPath:He}=k.storeToRefs(je),le=He.value,_e=l.ref(!1),Ue=l.ref(!1),pe=l.ref(!1),oe=l.reactive({column:{},status:!1,text:"合计"}),re=l.reactive({currentPage:1,pageSize:10,total:0,pageSizes:[5,10,20,50,100]}),te=Z,V=l.ref([]),xe=l.reactive({prop:"",order:null}),Ee=l.ref([]),qe=l.ref(!1),Oe=l.ref(!1),rl=l.ref(null);Ve.useThreeSystem();const Je=l.ref([]),we=l.ref(!1),C=l.ref(),ye=ie.useMenuState(),{importLoading:J,activeMenuPath:W,contentLoading:ke,linkMenuInfo:Ne}=k.storeToRefs(ye),We=ie.useTableComp(k.pinia),Te=ie.useModelComp(k.pinia),{extraContents:be,cacheUpdatingData:il,tableViewContents:ul,tableLoading:xn,pageMapState:Ze,lockingPage:xl}=k.storeToRefs(Te),Y=l.ref([]),Tl=l.ref([]),El=l.ref(new Map);l.ref(!1);const Ge=l.ref("");l.ref();const Nl=l.ref(!0),nl=l.ref(0),Zl=l.ref(!0),Me=l.ref(""),Qe=l.ref(!1),Ta=l.ref({label:"查看三维模型"}),Bl=l.ref(!1),$l=l.ref(),Le=l.ref([]),Ie=l.ref([]),Al=l.ref(!1),cl=l.ref([]),ol=l.ref([]),el=l.ref([]),Xe=l.ref([]),Pe=l.ref(),Be=l.ref(),Ea=ma(k.pinia),wl=l.ref(),Kl=l.ref(0),_l=ka(k.pinia),{selectIndex:Na,selectMenu:Ye,selectTitle:Fl}=k.storeToRefs(_l),{selectString:ll}=k.storeToRefs(Ea),Ba=k.useLoginState(k.pinia),{loginUserInfo:fe}=k.storeToRefs(Ba),Aa=l.ref(720),$e=l.ref(!1),Ul=l.ref(!1),Ke=l.ref([]),al=l.ref(),dl=l.ref(!0),Il=l.ref(!0),Ol=l.ref([]),wa=l.inject("contentRef");l.provide("contentRef",wa),l.watch(()=>{var e;return(e=Y.value)==null?void 0:e.length},e=>{re.total=e}),l.watch(()=>ul.value,async()=>{var i,p,d,f,m,t,E,M,v,B,_,S,F,x,L,D,g,h;if(((i=ul.value)==null?void 0:i.length)===0||!((p=s==null?void 0:s.itemData)!=null&&p.find(u=>(u==null?void 0:u.key)==="columnPath"))||!((d=s==null?void 0:s.itemData)!=null&&d.find(u=>(u==null?void 0:u.key)==="pageColumn")))return;let e=(v=(M=(E=(t=(m=(f=s==null?void 0:s.itemData)==null?void 0:f.find(u=>(u==null?void 0:u.key)==="pageColumn"))==null?void 0:m.contents)==null?void 0:t.split("["))==null?void 0:E[1])==null?void 0:M.split("]"))==null?void 0:v[0],a=((F=(S=(_=(B=s==null?void 0:s.itemData)==null?void 0:B.find(u=>(u==null?void 0:u.key)==="pageColumn"))==null?void 0:_.contents)==null?void 0:S.split("["))==null?void 0:F[0])+((L=(x=ul.value)==null?void 0:x.find(u=>(u==null?void 0:u.key)===e))==null?void 0:L.value),n=((g=(D=s==null?void 0:s.itemData)==null?void 0:D.find(u=>(u==null?void 0:u.key)==="pageGroup"))==null?void 0:g.contents)??"",r=await ie.getItemData(a,sessionStorage.getItem("systemKey"),""),o=(h=r==null?void 0:r.find(u=>(u==null?void 0:u.name)===(n===""?s==null?void 0:s.compName:n)))==null?void 0:h.compData;ga(o,s.allMapContents)},{deep:!0});const _a=async(e,a)=>{var n,r,o,i,p;try{const d=await k.getInsofDataApi({id:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index)});let f;((n=d==null?void 0:d.data)==null?void 0:n.code)===200&&(f=((o=(r=d==null?void 0:d.data)==null?void 0:r.result)==null?void 0:o[0])||null);const m={type:"data",pageKey:s!=null&&s.parentTableId?(i=f==null?void 0:f.key)==null?void 0:i.pageKey:W.value,tableId:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index),systemKey:sessionStorage.getItem("systemKey")},t=a==null?void 0:a.map(v=>{const B=Object.keys(v),_={};return B.forEach((S,F)=>{_[e[F]]=v[S]}),_}),E=t==null?void 0:t.map(v=>({key:m,value:{tableData:v}})),M=await k.batchAddInsofDataApi({dataList:E});((p=M==null?void 0:M.data)==null?void 0:p.code)===200?(Te.setRefreshCurStructure(!0),k.ElMessage.success("导入数据成功")):k.ElMessage.error("导入数据响应失败")}catch(d){throw k.ElMessage.error("导入数据处理失败"),new Error(d)}},Ua=async e=>{var a,n;if(e!=null&&e.includes(".txt")||e!=null&&e.includes(".cpt")||e!=null&&e.includes(".cyd")){const r=await k.axios.get(e,{responseType:"blob",headers:{"Content-Type":"application/json"}}),o=new Blob([r.data],{type:"application/octet-stream;charset=UTF-8"});let i=URL.createObjectURL(o);C.value=[{name:(n=e==null?void 0:e.split("/"))==null?void 0:n[((a=e==null?void 0:e.split("/"))==null?void 0:a.length)-1],blobUrl:i}],we.value=!0}};l.onBeforeUnmount(()=>{Il.value=!1;let e=Kl.value;Kl.value=e+1});const ea=l.computed(()=>{var r,o;const e=(re.currentPage-1)*re.pageSize,a=e+re.pageSize,n=(r=V.value)==null?void 0:r.find(i=>{var p;return(i==null?void 0:i.sortable)&&((p=i==null?void 0:i.label)==null?void 0:p.includes("时间"))});return n&&(xe.order="descending",xe.prop=n==null?void 0:n.prop),te("getSliceContLength",re),(o=Y.value)==null?void 0:o.slice(e,a)}),Oa=e=>{re.currentPage=e,te("getSliceContLength",re)},La=e=>{var a;re.pageSize=e,e*re.currentPage>((a=Y.value)==null?void 0:a.length)&&(re.currentPage=1,re.pageSize=10,k.ElMessage.warning("分页无效,返回第一页")),te("getSliceContLength",re)},Va=(e,a)=>{var p,d;const n=(d=(p=V.value)==null?void 0:p.map(f=>f==null?void 0:f.prop))==null?void 0:d.filter(f=>f!=="operate");let r;const o=(e==null?void 0:e.length)===(n==null?void 0:n.length);if(e!=null&&e.includes("序号"))return k.ElMessage.error("导入的数据不需要包含序号列");if(r=o?e:e.slice(0,n==null?void 0:n.length),!(r==null?void 0:r.every(f=>n==null?void 0:n.find(m=>f===m))))return k.ElMessage.error("导入的数据表头不匹配");_a(r,a)},ja=(e,a)=>{var n;Te.setRefreshCurStructure(!1),((n=V.value)==null?void 0:n.length)===0||Va(e,a)},Ma=(e,a,n,r)=>{const o=[],i=[],p=m=>Object.keys(m).length;for(const m in e)if(e[m]!==void 0){const t=e[m],E=[];for(const[M,v]of Object.entries(t))E.push(v),i.length<p(t)&&i.push(M);o.push(E)}o.unshift(i);const d=Ve.utils.aoa_to_sheet(o),f=Ve.utils.book_new();Ve.utils.book_append_sheet(f,d,r),Ve.writeFileSync(f,`${a}.xlsx`),Ke.value=[]},Ll=async(e,a,n,r=!1,o)=>{var i,p,d,f,m,t,E,M;try{Te.setRefreshCurStructure(!1);const v=await k.getInsofDataApi({id:s==null?void 0:s.index});if(((i=v==null?void 0:v.data)==null?void 0:i.code)===200){let B=(m=(f=(d=(p=v==null?void 0:v.data)==null?void 0:p.result)==null?void 0:d[0])==null?void 0:f.value)==null?void 0:m.pageData;r?B={...B,compData:(E=B==null?void 0:B.compData)==null?void 0:E.map(S=>{var F;return(S==null?void 0:S.key)==="header"?{...S,contents:(F=S==null?void 0:S.contents)==null?void 0:F.map(x=>({...x,[e]:n}))}:S})}:B={...B,compData:(t=B==null?void 0:B.compData)==null?void 0:t.map(S=>{var F,x;return(S==null?void 0:S.key)==="header"?{...S,contents:(F=S==null?void 0:S.contents)==null?void 0:F.map(L=>(L==null?void 0:L.prop)===(a==null?void 0:a.prop)?{...L,[e]:n}:L)}:(S==null?void 0:S.key)==="tableToForm"&&o?{...S,contents:(x=S==null?void 0:S.contents)==null?void 0:x.map(L=>(L==null?void 0:L.prop)===(a==null?void 0:a.prop)?{...L,[o]:n}:L)}:S})};const _=await k.updateInsofDataApi({id:s==null?void 0:s.index,value:{pageData:B}});((M=_==null?void 0:_.data)==null?void 0:M.code)===200?(k.ElMessage.success("编辑成功"),Te.setRefreshCurStructure(!0)):k.ElMessage.error("编辑响应失败")}}catch(v){k.ElMessage.error(v)}},Pa=async(e,a)=>{await Ll("label",a,e)},$a=async(e,a)=>{await Ll("columnType",a,e,!1,"type")},Ka=()=>{il.value?$e.value=!1:ha()},Fa=e=>{Ke.value=e},za=(e,a)=>{al.value===a?dl.value=!1:dl.value=!0,al.value=a==null?void 0:a.changeProp},pl=l.computed(()=>{var n,r,o;const e=(n=V.value)==null?void 0:n.some(i=>i==null?void 0:i.filterable);return document.documentElement.style.setProperty("--ssTable-header-filter-display",e?"inline-block":"none"),(o=(r=V.value)==null?void 0:r.filter(i=>(i==null?void 0:i.label)!=="操作"))==null?void 0:o.map(i=>({...i,filterable:!!(i!=null&&i.filterable),showSummary:!!(i!=null&&i.showSummary),operable:!!(i!=null&&i.operable)}))}),Ra=async(e,a,n)=>{const r=k.cloneDeep(V.value);await l.nextTick(),V.value=r==null?void 0:r.map(o=>(n==null?void 0:n.label)===(o==null?void 0:o.label)?{...o,[a]:e}:o),await Ll(a,n,e)},zl=async(e,a)=>{await Ll(a,null,e,!0)},qa=()=>{Qe.value=!1},Ja=e=>{te("clickTrigger",e)},Rl=async e=>{var i,p,d,f,m,t,E,M,v,B,_,S,F,x,L;let a,n,r;if(typeof e=="string"?(a=e,n=null,r=null):(a=e==null?void 0:e.row,n=e==null?void 0:e.rowData,r=e==null?void 0:e.suffix),(i=a==null?void 0:a.toString())!=null&&i.includes(".urdf")||e!=null&&e.isUrdf||r!=null&&r.includes(".urdf")){if(a.includes(",")){k.ElMessage.error("当前版本仅允许单个urdf预览!");return}cl.value=[a],Oe.value=!0,rl.value={data:k.cloneDeep(n)},qe.value=!0;return}let o=[];if((p=a==null?void 0:a.toString())!=null&&p.includes(".stl")||(d=a==null?void 0:a.toString())!=null&&d.includes(".STL")||(f=a==null?void 0:a.toString())!=null&&f.includes(".obj")||(m=a==null?void 0:a.toString())!=null&&m.includes(".mtl")){cl.value=(t=a==null?void 0:a.toString())==null?void 0:t.split(","),Oe.value=!1,qe.value=!0;return}if((E=a==null?void 0:a.toString())!=null&&E.includes(".stl")||(M=a==null?void 0:a.toString())!=null&&M.includes(".STL")||(v=a==null?void 0:a.toString())!=null&&v.includes(".obj")||(B=a==null?void 0:a.toString())!=null&&B.includes(".mtl")||r!=null&&r.includes(".stl")||r!=null&&r.includes(".STL")||r!=null&&r.includes(".obj")||r!=null&&r.includes(".mtl")){let D,g=[],h={};if(Array.isArray(a)?D=a:D=a==null?void 0:a.split(","),D==null||D.forEach(u=>{u.includes(".mtl")?g.push(u):h.blob=h.blob?h.blob+","+u:u}),(g==null?void 0:g.length)>0&&(h.mtlBlobs=g),r&&(h.suffix=r),(S=(_=Object.values(h))==null?void 0:_[0])!=null&&S.includes("http:"))o.push(h);else{const u=new Blob([h.blob],{type:"application/octet-stream;charset=UTF-8"});let b=URL.createObjectURL(u),$="";(F=a==null?void 0:a.split("/"))==null||F.forEach((N,G)=>{var ae;G===((ae=a==null?void 0:a.split("/"))==null?void 0:ae.length)-1&&($=N)}),(x=h.blob)!=null&&x.includes(".stl")&&($=($==null?void 0:$.replaceAll(">",""))+".urdf"),C.value=[{name:$,blobUrl:b}],we.value=!0}}else{const D=await k.axios.get(a,{responseType:"blob",headers:{"Content-Type":"application/json"}}),g=new Blob([D.data],{type:"application/octet-stream;charset=UTF-8"});let h=URL.createObjectURL(g),u="";(L=a==null?void 0:a.split("/"))==null||L.forEach((b,$)=>{var N;$===((N=a==null?void 0:a.split("/"))==null?void 0:N.length)-1&&(u=b)}),C.value=[{name:u,blobUrl:h}],we.value=!0}(o==null?void 0:o.length)>0&&P.setBlobUrls(o)},Vl=e=>{var r,o,i,p;if(e!=null&&e.downloadUrl)return e==null?void 0:e.name;const a=(p=(r=e==null?void 0:e.url)==null?void 0:r.split("."))==null?void 0:p[((i=(o=e==null?void 0:e.url)==null?void 0:o.split("."))==null?void 0:i.length)-1];return(e==null?void 0:e.name)+"."+a},Wa=async e=>{let a=null,n=null,r=null;if(e!=null&&e.downloadUrl){const i=await ql(),p=Re.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),d=await k.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:i,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}).finally(()=>{p.close()}),f=new Blob([d.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(f),n=e==null?void 0:e.name;const m=n==null?void 0:n.lastIndexOf(".");r=n==null?void 0:n.slice(m)}else{const i=await Ve.downloadAvatarApi({url:e==null?void 0:e.url});!e.url.toUpperCase().includes(".OBJ")&&!e.url.toUpperCase().includes(".STL")&&!e.url.toUpperCase().includes(".MTL")&&!e.url.toUpperCase().includes(".URDF")?(a=URL.createObjectURL(i.data),n=Vl(e)):a=e==null?void 0:e.url}if(r!=null&&r.includes(".urdf")||r!=null&&r.includes(".stl")||r!=null&&r.includes(".STL")||r!=null&&r.includes(".obj")||r!=null&&r.includes(".mtl")){const i={row:`${a}`,suffix:r};Rl(i);return}const o={name:n,blobUrl:a};C.value=[o],we.value=!0},Ga=async e=>{let a=null,n=null;if(e!=null&&e.downloadUrl){const i=await ql(),p=await k.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:i,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}),d=new Blob([p.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(d),n=e==null?void 0:e.name}else{const i=await Ve.downloadAvatarApi({url:e==null?void 0:e.url});a=URL.createObjectURL(i.data),n=Vl(e)}const r={name:n,blobUrl:a},o=document.createElement("a");o.href=r.blobUrl,o.download=r.name,o.style.display="none",document.body.appendChild(o),o.click(),setTimeout(()=>{document.body.removeChild(o)},100)},Ha=(e,a)=>{var n;if(Object.values(a).length!==0)return Object.values(a).find(r=>{var o,i,p;return((o=r==null?void 0:r.toString())==null?void 0:o.includes(".txt"))||((i=r==null?void 0:r.toString())==null?void 0:i.includes(".cpt"))||((p=r==null?void 0:r.toString())==null?void 0:p.includes(".obj"))})?[...e,Ta.value]:(n=s==null?void 0:s.config)!=null&&n.allowMove?[...e,{label:"迁移"}]:e},Qa=(e,a={})=>[...e==null?void 0:e.values()].filter(n=>Object.keys(a).every(r=>{var p;const o=n[r],i=(p=a[r])==null?void 0:p.toLowerCase();return i&&o&&typeof o=="string"?o.toLowerCase().includes(i):!0})),la=l.ref([]),Xa=async(e,a,n=!1)=>{var r;if(e){if(Te.setTableLoading(!0),la.value=Object.values(e),e&&((r=Object.values(e))!=null&&r.every(o=>!o)))return Y.value=Tl.value;if(n){Y.value=[...El.value.values()].filter(o=>Object.values(o).some(i=>typeof i=="string"?i==null?void 0:i.toLowerCase().includes(a==null?void 0:a.toLowerCase()):!1));return}Y.value=Qa(El.value,e),Te.setTableLoading(!1)}},Ya=async e=>{var p,d,f,m,t,E,M,v,B,_,S,F,x,L,D;const a=await k.getInsofDataApi({keyLikes:{pageKey:`loading${((p=fe.value)==null?void 0:p.account)||((d=fe.value)==null?void 0:d.账号)}`,systemKey:sessionStorage.getItem("systemKey")}}),n=await k.getInsofDataApi({keyLikes:{pageKey:`updateLoading${((f=fe.value)==null?void 0:f.account)||((m=fe.value)==null?void 0:m.账号)}`,systemKey:sessionStorage.getItem("systemKey")}});let r=(E=(t=a==null?void 0:a.data)==null?void 0:t.result)==null?void 0:E.map(g=>g==null?void 0:g.id);const o=(v=(M=n==null?void 0:n.data)==null?void 0:M.result)==null?void 0:v.map(g=>g==null?void 0:g.id);r=[...k.cloneDeep(r),...o],(r==null?void 0:r.length)>0&&(r!=null&&r.every(g=>g!==null&&g))&&await k.batchDeleteInsofDataApi({ids:r});let i=await ie.getItemData(W.value,sessionStorage.getItem("systemKey"),e.id);if(i=i==null?void 0:i.filter(g=>g.comp!=="methodButton"),i&&i.length>0){const g=!Array.isArray(Fl.value)&&((B=Fl.value)==null?void 0:B.key)!=="main"?[]:Fl.value;g.push({key:Ye.value===""?(_=e==null?void 0:e.id)==null?void 0:_.toString():Ye.value+"-"+((S=e==null?void 0:e.id)==null?void 0:S.toString()),value:e[(F=Object.keys(e))==null?void 0:F.filter(h=>h!=="index"&&h!=="id")[0]]}),_l.setSelectMenu(Ye.value===""?(x=e==null?void 0:e.id)==null?void 0:x.toString():Ye.value+"-"+((L=e==null?void 0:e.id)==null?void 0:L.toString())),_l.setSelectTitle(g),_l.setSelectIndex((D=e==null?void 0:e.id)==null?void 0:D.toString()),te("pageChange",i)}},aa=async(e,a,n,r)=>{var i,p,d,f,m,t,E,M,v,B,_,S,F,x,L,D,g,h,u,b,$,N,G,ae,X;if(te("clickMainKey",n),(r==null?void 0:r.isExistChild)===!0){let q=(p=(i=V.value)==null?void 0:i.find(R=>(R==null?void 0:R.isMainKey)===!0))==null?void 0:p.prop,H=(d=r==null?void 0:r.rowContent)==null?void 0:d[q],A=(m=(f=r==null?void 0:r.columnType)==null?void 0:f.childPath)==null?void 0:m.split(le),j=[];A==null||A.forEach((R,c)=>{(A==null?void 0:A.length)-1===c&&j.push(H),j.push(R)}),j=j.join(le);let z=await ie.getItemData(j,sessionStorage.getItem("systemKey"),""),I=await ie.getItemData((t=r==null?void 0:r.columnType)==null?void 0:t.childPath,sessionStorage.getItem("systemKey"),"");if(!z||(z==null?void 0:z.length)===0){let R=[];I==null||I.forEach(K=>{var ve,ce,T,y;let w={type:"structure",pageKey:j,version:1,systemKey:sessionStorage.getItem("systemKey"),parentTable:"",createUserId:(ve=fe.value)==null?void 0:ve.id,parentPageKey:"",createUserLayer:((ce=fe.value)==null?void 0:ce.dept)||((T=fe.value)==null?void 0:T.部门名称)},ne={pageData:{comp:K==null?void 0:K.comp,compData:(y=K==null?void 0:K.compData)==null?void 0:y.filter(se=>(se==null?void 0:se.key)!=="tableContents"),name:K==null?void 0:K.name,isShow:K==null?void 0:K.isShow}};R.push({key:w,value:ne})}),(R==null?void 0:R.length)>0&&await k.batchAddInsofDataApi({dataList:R});let c=await ie.getItemData(j,sessionStorage.getItem("systemKey"),"");Ol.value=c}else{let R=I==null?void 0:I.map(c=>{var K,w;return(c==null?void 0:c.comp)==="Form"?c.compData=(K=c.compData)==null?void 0:K.map(ne=>{var ve;return(ne==null?void 0:ne.key)==="formContent"&&(ne.contents=(ve=ne==null?void 0:ne.contents)==null?void 0:ve.map(ce=>{var y,se,ue,de,Ce;let T=(Ce=(de=(ue=(se=(y=z==null?void 0:z.find(Se=>(Se==null?void 0:Se.name)===(c==null?void 0:c.name)))==null?void 0:y.compData)==null?void 0:se.find(Se=>(Se==null?void 0:Se.key)==="formContent"))==null?void 0:ue.contents)==null?void 0:de.find(Se=>(Se==null?void 0:Se.prop)===(ce==null?void 0:ce.prop)))==null?void 0:Ce.value;return ce.value=T,ce})),ne}):c=z==null?void 0:z.find(ne=>(ne==null?void 0:ne.name)===(c==null?void 0:c.name)),c.id=(w=z==null?void 0:z.find(ne=>(ne==null?void 0:ne.name)===(c==null?void 0:c.name)))==null?void 0:w.id,c});Ol.value=R}te("routeUrl",Ol.value,{isEdit:!0,routerUrl:j});return}if((r==null?void 0:r.data)==="查看"&&(e!=null&&e.every(q=>(q==null?void 0:q.url)&&(q==null?void 0:q.name)))){let q=k.cloneDeep(e);q=await((E=k.cloneDeep(q))==null?void 0:E.map(async A=>{var I,R,c,K;const j=await Ve.downloadAvatarApi({url:A==null?void 0:A.url});let z=URL.createObjectURL(j.data);return{name:(A==null?void 0:A.name)+"."+((K=(I=A==null?void 0:A.url)==null?void 0:I.split("."))==null?void 0:K[((c=(R=A==null?void 0:A.url)==null?void 0:R.split("."))==null?void 0:c.length)-1]),blobUrl:z}}));let H=await Promise.all(q);C.value=H,we.value=!0}const o=k.cloneDeep(V.value);if((r==null?void 0:r.isMainKey)===!0&&(o==null?void 0:o.length)>0){(M=o==null?void 0:o[0])==null||M.prop;let q=k.cloneDeep(W).value+le+(r==null?void 0:r.data),H=k.cloneDeep(W).value,A=(B=(v=Ze.value[q])==null?void 0:v.filter(R=>{var c,K;return((c=R==null?void 0:R.key)==null?void 0:c.type)==="structure"&&((K=R==null?void 0:R.key)==null?void 0:K.parentTable)===""}))==null?void 0:B.map(R=>{var c;return(c=R==null?void 0:R.value)==null?void 0:c.pageData}),j={};(_=V.value)==null||_.forEach(R=>{(R==null?void 0:R.label)!=="操作"&&(j[R.label]=n[R.prop]??n[R.label])});let z=(F=(S=s==null?void 0:s.itemData)==null?void 0:S.find(R=>(R==null?void 0:R.key)==="mainRouters"))==null?void 0:F.contents,I;if((z==null?void 0:z.length)>0){let R=q==null?void 0:q.split(le)[((x=q==null?void 0:q.split(le))==null?void 0:x.length)-1],c=z==null?void 0:z.find(K=>(K==null?void 0:K.key)===R);I=(c==null?void 0:c.routerContent)+le+(c==null?void 0:c.key)}if((A==null?void 0:A.length)>0)await ie.getItemData(q+le+`updateLoading${((L=fe.value)==null?void 0:L.account)||((D=fe.value)==null?void 0:D.账号)}`,sessionStorage.getItem("systemKey"),"")||await ie.loadingConstruct(q,q+le+`updateLoading${((g=fe.value)==null?void 0:g.account)||((h=fe.value)==null?void 0:h.账号)}`,j,I),Te.setRouteToChildPath(H),ye.setActiveMenuPath(q+le+`updateLoading${((u=fe.value)==null?void 0:u.account)||((b=fe.value)==null?void 0:b.账号)}`);else{($=o==null?void 0:o[0])==null||$.prop;let R=k.cloneDeep(W).value+le+(r==null?void 0:r.data),c=k.cloneDeep(W).value;await ie.getItemData(c+le,sessionStorage.getItem("systemKey"),""),await ie.loadingConstruct(c+le,R,j),await ie.loadingConstruct(R,R+le+`updateLoading${((N=fe.value)==null?void 0:N.account)||((G=fe.value)==null?void 0:G.账号)}`,j,I),Te.setRouteToChildPath(c),ye.setActiveMenuPath(R+le+`updateLoading${((ae=fe.value)==null?void 0:ae.account)||((X=fe.value)==null?void 0:X.账号)}`)}}},Za=()=>{we.value=!1},Ia=e=>{te("rowClick",e)};l.watch(()=>s.changedContent,()=>{var n,r;if(!s.changedContent)return;let e=(n=Y.value)==null?void 0:n.map(o=>{var i;return o.id===((i=s.changedContent)==null?void 0:i.id)&&(o={...s.changedContent,id:s.changedContent.newId?s.changedContent.newId:s.changedContent.id},delete o.newId),o});const a=(r=s.itemData)==null?void 0:r.map(o=>((o==null?void 0:o.key)==="tableContents"&&(o.contents=e),o));Y.value=e,te("contentChange",{contents:a,index:s.index}),te("change",{content:e,index:s==null?void 0:s.index,buttonName:"",id:s==null?void 0:s.index})},{deep:!0,immediate:!0});const er=()=>{},lr=async()=>{const e=W.value,a=sessionStorage.getItem("systemKey"),n=await ie.getItemData(e,a,""),r=n==null?void 0:n.find(d=>(d==null?void 0:d.name)==="方法明细"),o=(r==null?void 0:r.compData)||[],i=o==null?void 0:o.find(d=>(d==null?void 0:d.key)==="formContent");return i==null?void 0:i.contents},ql=async()=>`Bearer ${k.Local.get("access-token")}`,ar=async(e,{token:a,inputData:n}={})=>await k.axios.post(e,n,{headers:{Authorization:a}}).catch(o=>(ye.setImportLoading(!1),Promise.reject(o))),rr=e=>{var r;let a={};const n=[];return a.form={},(r=k.cloneDeep(e))==null||r.forEach((o,i)=>{var p,d,f,m,t,E,M,v,B,_,S,F,x,L;if((o==null?void 0:o.comp)==="Table"){(d=(p=o==null?void 0:o.compData)==null?void 0:p.find(u=>(u==null?void 0:u.key)==="header"))==null||d.contents;let D=(t=(m=(f=o==null?void 0:o.compData)==null?void 0:f.find(u=>(u==null?void 0:u.key)==="tableContents"))==null?void 0:m.contents)==null?void 0:t.map(u=>u.slice(1));(_=(B=(v=(M=(E=o==null?void 0:o.compData)==null?void 0:E.find(u=>(u==null?void 0:u.key)==="header"))==null?void 0:M.contents)==null?void 0:v[0])==null?void 0:B[0])==null||_.label;let g=(F=(S=o==null?void 0:o.compData)==null?void 0:S.find(u=>(u==null?void 0:u.key)==="header"))==null?void 0:F.contents,h=[];D==null||D.forEach(u=>{let b=[];u==null||u.forEach(($,N)=>{var ae;let G={};((ae=g[N])==null?void 0:ae.label)!=="操作"&&(G[g[N].label]=$,b.push(G))}),h.push(b)}),a[o.name]=h}else{const D=(L=(x=o.compData)==null?void 0:x.find(g=>(g==null?void 0:g.key)==="formContent"))==null?void 0:L.contents;D==null||D.forEach(g=>{var h,u;if(g.prop!==""){let b=g==null?void 0:g.value;Array.isArray(b)?b=((h=b==null?void 0:b[0])==null?void 0:h.oldUrl)||(b??"http://222.92.178.198:62001/"+((u=b==null?void 0:b[0])==null?void 0:u.url)):b=b.toString(),g={key:(g==null?void 0:g.prop)??(g==null?void 0:g.label),value:b},n.push(g)}})}}),a.form=ie.getFormContents(n),a};let jl=null;const nr=()=>{ye.setLoadingPercent(0)},ra=()=>{clearInterval(jl),jl=null},or=()=>{ra(),nr()},fl=()=>{ye.setImportLoading(!1),or()},tr=()=>{jl=setInterval(()=>{const e=ye.getLoadingPercent();if(e==99){ra();return}ye.setLoadingPercent(e+1)},100)},sr=async(e,a,n)=>{var $,N,G,ae,X,q,H,A,j,z,I,R;ye.setImportLoading(!0,ie.loadingTypeConstants.PROGRESS),jl||tr();const r=await lr().catch(c=>(fl(),Promise.reject(c))),o=r==null?void 0:r.find(c=>(c==null?void 0:c.key)==="算法体"),i=o==null?void 0:o.value;if(!i){console.log("未搜索到isMain, 缺少算法执行接口"),fl();return}const p=V.value||[],d=p.find(c=>(c==null?void 0:c.prop)==="输入"),f=d==null?void 0:d.prop;let m=a==null?void 0:a[f];const t=await ql().catch(c=>(fl(),Promise.reject(c)));let E=!1,M="";($=V.value)==null||$.forEach(c=>{(c==null?void 0:c.prop)===f&&(E=!!(c!=null&&c.childPath),M=c==null?void 0:c.childPath)});let v="",B="";if(E){let c=(G=(N=V.value)==null?void 0:N.find(ve=>(ve==null?void 0:ve.isMainKey)===!0))==null?void 0:G.prop;B=a==null?void 0:a[c];let K=M==null?void 0:M.split(le),w=[];K==null||K.forEach((ve,ce)=>{(K==null?void 0:K.length)-1===ce&&w.push(B),w.push(ve)}),w=w.join(le),v=w;let ne=await ie.getItemData(w,sessionStorage.getItem("systemKey"),"");m=rr(ne)}const _=await ar(i,{token:t,inputData:m}).catch(c=>(fl(),Promise.reject(c))),S=(ae=_==null?void 0:_.data)==null?void 0:ae.data,F=r==null?void 0:r.find(c=>(c==null?void 0:c.prop)==="算法名称");F==null||F.value;const x=p.find(c=>(c==null?void 0:c.prop)==="输出"),L=x==null?void 0:x.directiveLabel;v=v==null?void 0:v.replaceAll(d==null?void 0:d.directiveLabel,L);const D=(X=k.cloneDeep(v))==null?void 0:X.replaceAll(le+B,"");let g=await ie.getItemData(v,sessionStorage.getItem("systemKey"),""),h=await ie.getItemData(D,sessionStorage.getItem("systemKey"),"");if(g){let c=[],K=[];g==null||g.forEach(w=>{var ne,ve;if((w==null?void 0:w.comp)==="Table")(ne=w==null?void 0:w.compData)==null||ne.forEach(ce=>{var T;(ce==null?void 0:ce.key)==="tableContents"&&((T=ce==null?void 0:ce.contents)==null||T.forEach(y=>{var se,ue;(se=y==null?void 0:y[0])!=null&&se.id&&c.push((ue=y==null?void 0:y[0])==null?void 0:ue.id)}))});else if((w==null?void 0:w.comp)==="Form"){w.compData=(ve=w==null?void 0:w.compData)==null?void 0:ve.map(T=>{var y;return(T==null?void 0:T.key)==="formContent"&&(T.contents=(y=T==null?void 0:T.contents)==null?void 0:y.map(se=>{var ue,de;return(ue=S==null?void 0:S.form)!=null&&ue[se.prop]&&(se.value=(de=S==null?void 0:S.form)==null?void 0:de[se.prop]),se})),T});let ce={pageData:{comp:w==null?void 0:w.comp,name:w==null?void 0:w.name,isShow:w==null?void 0:w.isShow,compData:w==null?void 0:w.compData}};K.push({id:w==null?void 0:w.id,value:ce})}}),(K==null?void 0:K.length)>0&&await k.batchUpdateInsofDataApi({dataList:K}),c=[...new Set(c)],(c==null?void 0:c.length)>0&&await k.batchDeleteInsofDataApi({ids:c})}else{let c=[];if(S!=null&&S.table){let K={type:"structure",systemKey:sessionStorage.getItem("systemKey"),pageKey:v,parentTable:"",createUserId:(q=fe.value)==null?void 0:q.id,createUserOrg:((H=fe.value)==null?void 0:H.dept)||((A=fe.value)==null?void 0:A.部门名称)};h==null||h.forEach(w=>{let ve={pageData:{comp:w==null?void 0:w.comp,name:w==null?void 0:w.name,isShow:w==null?void 0:w.isShow,compData:w==null?void 0:w.compData}};c.push({key:K,value:ve})})}if(S!=null&&S.form){let K={type:"structure",pageKey:v,systemKey:sessionStorage.getItem("systemKey"),parentTable:"",createUserId:(j=fe.value)==null?void 0:j.id,parentPageKey:"",createUserLayer:((z=fe.value)==null?void 0:z.dept)||((I=fe.value)==null?void 0:I.部门名称)};h==null||h.forEach(w=>{var T;let ne=(T=w==null?void 0:w.compData)==null?void 0:T.map(y=>{var se;return(y==null?void 0:y.key)==="formContent"&&(y.contents=(se=y.contents)==null?void 0:se.map(ue=>{var de,Ce;return(de=S==null?void 0:S.form)!=null&&de[ue.prop]&&(ue.value=(Ce=S==null?void 0:S.form)==null?void 0:Ce[ue.prop]),ue})),y}),ce={pageData:{comp:w==null?void 0:w.comp,name:w==null?void 0:w.name,isShow:w==null?void 0:w.isShow,compData:ne}};c.push({key:K,value:ce})})}(c==null?void 0:c.length)>0&&await k.batchAddInsofDataApi({dataList:c})}let u=await ie.getItemData(v,sessionStorage.getItem("systemKey"),""),b=[];S!=null&&S.table&&((R=S==null?void 0:S.table)==null||R.forEach(c=>{var ne,ve,ce,T;let K={type:"data",pageKey:v,tableId:(ne=u==null?void 0:u[0])==null?void 0:ne.id,systemKey:sessionStorage.getItem("systemKey"),createUserId:(ve=fe.value)==null?void 0:ve.id,createUserOrg:((ce=fe.value)==null?void 0:ce.dept)||((T=fe.value)==null?void 0:T.部门名称)},w={tableData:c};b.push({key:K,value:w})})),(b==null?void 0:b.length)>0&&await k.batchAddInsofDataApi({dataList:b}),yl(!0),fl()},na=(e,a)=>(e=e==null?void 0:e.map(n=>{var r,o;return n!=null&&n.children&&((r=n.children)!=null&&r.find(i=>i.id===(a==null?void 0:a.id))?n.children=(o=n.children)==null?void 0:o.filter(i=>(i==null?void 0:i.id)!==(a==null?void 0:a.id)):n.children=na(n.children,a)),n}),e),De=l.reactive({title:"迁移至",show:!1,width:"20%",selectRow:null,from:s==null?void 0:s.index,to:null,contents:[],formRules:{groupName:[{required:!0,message:"输入不能为空",trigger:"blur"},{validator:(e,a,n)=>{a===(s==null?void 0:s.index)?n(new Error("选择源不能和目标源一致")):n()}}]},buttonValue:[{label:"取消",background:"#999999",color:"var(--ssbutton-theme-color)"},{label:"确认",background:"var(--ssbutton-theme-bg)",color:"var(--ssbutton-theme-color)"}]}),ir=()=>{De.show=!1},ur=e=>{var a,n;if((e==null?void 0:e.buttonName)==="取消")return De.show=!1;De.to=e==null?void 0:e.content,!(!(s!=null&&s.index)||!((a=De.to)!=null&&a.groupName))&&(s==null?void 0:s.index)!==((n=De.to)==null?void 0:n.groupName)&&(te("change",{buttonName:"迁移",value:{from:De.from,to:De.to,data:De.selectRow}}),De.show=!1)},Ml=async(e,a,n)=>{var r,o,i,p,d,f,m,t,E,M,v,B,_,S,F;if(Ge.value="",Al.value=!0,Nl.value=!0,te("onButtonClick",e,a),e==="删除")ie.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var x,L;(x=Y.value)!=null&&x.find(D=>(D==null?void 0:D.id)===(a==null?void 0:a.id))?Y.value=(L=k.cloneDeep(Y.value))==null?void 0:L.filter(D=>(D==null?void 0:D.id)!==(a==null?void 0:a.id)):Y.value=na(k.cloneDeep(Y.value),a),Yr(wl.value,Ye.value,a==null?void 0:a.id),Te.setTableLoading(s==null?void 0:s.index),te("change",{content:Y.value,singleContent:a,index:s==null?void 0:s.index,type:"delete",buttonName:e,column:V.value})});else if(e==="批量删除"){if(((r=Ke.value)==null?void 0:r.length)===0)return k.ElMessage.warning("请先勾选操作的数据");ie.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var L,D;const x=(L=Ke.value)==null?void 0:L.map(g=>g.id);Y.value=(D=k.cloneDeep(Y.value))==null?void 0:D.filter(g=>!(x!=null&&x.includes(g.id))),Te.setTableLoading(s==null?void 0:s.index),te("change",{content:Y.value,singleContent:null,selectItems:Ke.value,index:s==null?void 0:s.index,type:"batchDelete",buttonName:e,column:V.value})})}else if(e==="复制新增"){Me.value="新增";const x=k.cloneDeep(a),L=(o=V.value)==null?void 0:o.find(h=>h==null?void 0:h.isMainKey),D=L||((i=V.value)==null?void 0:i[0]),g=(p=el.value)==null?void 0:p.find(h=>(h==null?void 0:h.label)==="新建");await ta(!0,g,{data:x,firstCol:D})}else if(e==="新增")Me.value="新增",hl(""),Qe.value=!0;else if(e==="编辑")Me.value="编辑",hl(a),Qe.value=!0;else if(e==="查看")Me.value="查看",hl(a),Al.value=!1,Nl.value=!1,Qe.value=!0;else if(e==="查看三维模型"){const x={};for(let D in a)D!=="id"&&(x[D]=a[D]);let L=(d=Object.values(x))==null?void 0:d[1];We.setTableShowThree(L)}else if(((f=n==null?void 0:n.extra)==null?void 0:f.type)==="modelExample")Me.value=e,Bl.value=!0;else if(e==="新建"){let x=Ze.value,L=[];for(let b in x)b!=null&&b.includes(`loading${((m=fe.value)==null?void 0:m.account)||((t=fe.value)==null?void 0:t.账号)}`)&&(L=[...L,...b]);let D=[];for(let b in x)b!=null&&b.includes(`updateLoading${((E=fe.value)==null?void 0:E.account)||((M=fe.value)==null?void 0:M.账号)}`)&&(D=[...D,...b]);let g=L==null?void 0:L.map(b=>b==null?void 0:b.id);const h=D==null?void 0:D.map(b=>b==null?void 0:b.id);g=[...k.cloneDeep(g),...h],(g==null?void 0:g.length)>0&&(g!=null&&g.every(b=>b!==null&&b))&&await k.batchDeleteInsofDataApi({ids:g});const u=(v=el.value)==null?void 0:v.find(b=>(b==null?void 0:b.label)==="新建");await ta(!1,u)}else if(e==="修改模板"){let x=k.cloneDeep(W).value;Te.setRouteToChildPath(x),ye.setActiveMenuPath(x+le)}else if(e==="执行")sr(e,a);else if(e!=null&&e.includes("导出")){if(e==="导出选中"&&((B=Ke.value)==null?void 0:B.length)===0)return k.ElMessage.warning(`请先勾选${e}的数据`);if(e==="导出全部"&&((_=Y.value)==null?void 0:_.length)===0)return k.ElMessage.warning("暂无数据导出");const x=(F=(S=V.value)==null?void 0:S.map(D=>D==null?void 0:D.label))==null?void 0:F.filter(D=>D!=="操作"),L=e==="导出全部"?k.cloneDeep(Y.value):k.cloneDeep(Ke.value);L==null||L.forEach(D=>{D==null||delete D.id}),Ma(L,s==null?void 0:s.compName,x,s==null?void 0:s.compName)}else e==="迁移"&&(De.selectRow=a,De.show=!0)},cr=async e=>{var n,r,o,i,p,d;const a=await k.getInsofDataApi({key:{pageKey:e,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});if(((n=a==null?void 0:a.data)==null?void 0:n.code)===200)return Array.isArray((r=a==null?void 0:a.data)==null?void 0:r.result)&&((i=(o=a==null?void 0:a.data)==null?void 0:o.result)==null?void 0:i.length)>0?(d=(p=a==null?void 0:a.data)==null?void 0:p.result)==null?void 0:d.map(f=>{var m;return{id:f==null?void 0:f.id,...(m=f==null?void 0:f.value)==null?void 0:m.pageData}}):[]},dr=async(e,a)=>{var n,r,o,i,p,d,f,m,t,E,M,v,B,_,S,F,x,L,D,g;try{let h,u;const b=(n=Ze.value[W.value+le])==null?void 0:n.filter(A=>{var j;return((j=A==null?void 0:A.key)==null?void 0:j.type)==="structureMethod"}),$=(r=Ze.value[W.value+le])==null?void 0:r.filter(A=>{var j;return((j=A==null?void 0:A.key)==null?void 0:j.type)==="structure"}),N=b==null?void 0:b.find(A=>{var j,z;return((z=(j=A==null?void 0:A.value)==null?void 0:j.pageData)==null?void 0:z.method)==="保存"});if(!N)return;const G=(d=(p=Ze.value[(i=(o=N==null?void 0:N.value)==null?void 0:o.pageData)==null?void 0:i.path])==null?void 0:p.filter(A=>{var j;return((j=A==null?void 0:A.key)==null?void 0:j.type)==="data"}))==null?void 0:d.find(A=>{var j,z,I,R;return((z=(j=A==null?void 0:A.value)==null?void 0:j.tableData)==null?void 0:z.算法名称)===((R=(I=N==null?void 0:N.value)==null?void 0:I.pageData)==null?void 0:R.method)});if(!G)return;const ae={buttonName:(m=(f=N==null?void 0:N.value)==null?void 0:f.pageData)==null?void 0:m.method,api:(E=(t=G==null?void 0:G.value)==null?void 0:t.tableData)==null?void 0:E.算法体,content:$==null?void 0:$.map(A=>{var j;return(j=A==null?void 0:A.value)==null?void 0:j.pageData}),extraContent:[],extraValues:(v=(M=N==null?void 0:N.value)==null?void 0:M.pageData)==null?void 0:v.data,methodName:(_=(B=N==null?void 0:N.value)==null?void 0:B.pageData)==null?void 0:_.path};if(!e)return;const X={...e,compData:(S=e==null?void 0:e.compData)==null?void 0:S.map(A=>{var j;return(A==null?void 0:A.key)==="formContent"?{...A,contents:(j=A==null?void 0:A.contents)==null?void 0:j.map(z=>(z==null?void 0:z.prop)===a?{...z,value:""}:z)}:A})},q={key:{pageKey:W.value+le,parentTable:"",systemKey:sessionStorage.getItem("systemKey"),type:"structure"},value:{pageData:X}},H=await k.axios.post(ae.api,q,{headers:{"Content-Type":"application/json"}});return((F=H==null?void 0:H.data)==null?void 0:F.code)===200&&(h=(L=(x=H==null?void 0:H.data)==null?void 0:x.result)==null?void 0:L.latestReportCode,u=(g=(D=H==null?void 0:H.data)==null?void 0:D.result)==null?void 0:g.status),{newMainKeyValue:h,newStatus:u}}catch(h){throw k.ElMessage.error(h),new Error(h)}},oa=(e,a,n,r)=>{var o;te("contentChange",{contents:(o=e==null?void 0:e.compData)==null?void 0:o.map(i=>{var p;return(i==null?void 0:i.key)==="formContent"?{...i,contents:(p=i==null?void 0:i.contents)==null?void 0:p.map(d=>(d==null?void 0:d.key)===a?{...d,value:n}:gl.value&&(d==null?void 0:d.prop)===gl.prop?{...d,value:gl.value}:d)}:i}),index:e==null?void 0:e.id},r)},gl=l.reactive({prop:"状态",value:""}),pr=l.ref(["系统自动生成信息","审批意见"]),fr=async(e,a,n)=>{var f,m;let r=e==null?void 0:e[a==null?void 0:a.prop],o=1,i,p;const d=k.cloneDeep(W).value+le+r;if(d){gl.value="",i=(f=Ze.value[d])==null?void 0:f.filter(M=>{var v;return((v=M==null?void 0:M.key)==null?void 0:v.type)==="structure"});const t=i==null?void 0:i.find(M=>{var v,B,_;return((_=(B=(v=M==null?void 0:M.value)==null?void 0:v.pageData)==null?void 0:B.comp)==null?void 0:_.toUpperCase())==="FORM"});p={...(m=t==null?void 0:t.value)==null?void 0:m.pageData,id:t==null?void 0:t.id};const E=await dr(p,a==null?void 0:a.prop);if(gl.value=E==null?void 0:E.newStatus,E!=null&&E.newMainKeyValue)return E==null?void 0:E.newMainKeyValue}if(Y.value.some(t=>(t==null?void 0:t[a==null?void 0:a.prop])===r)){const t=r;for(;Y.value.some(E=>(E==null?void 0:E[a==null?void 0:a.prop])===`${t}(${o})`);)o++;r=`${t}(${o})`}return r},ta=async(e,a,n)=>{var p,d,f,m,t,E,M,v;let r,o;const i=await fr(n==null?void 0:n.data,n==null?void 0:n.firstCol);if(e?(r=k.cloneDeep(W).value+le+((m=n==null?void 0:n.data)==null?void 0:m[(f=n==null?void 0:n.firstCol)==null?void 0:f.prop]),o=k.cloneDeep(W).value+le+i):(r=k.cloneDeep(W).value+le,o=k.cloneDeep(r)+`loading${((p=fe.value)==null?void 0:p.account)||((d=fe.value)==null?void 0:d.账号)}`),a){const B=(E=(t=Ze.value[o])==null?void 0:t.filter(_=>{var S;return((S=_==null?void 0:_.key)==null?void 0:S.parentTable)===""}))==null?void 0:E.map(_=>{var S;return{id:_==null?void 0:_.id,...(S=_==null?void 0:_.value)==null?void 0:S.pageData}});if((B==null?void 0:B.length)>0)if(e){const _=B==null?void 0:B.find(S=>{var F;return((F=S==null?void 0:S.comp)==null?void 0:F.toUpperCase())==="FORM"});_&&oa(_,(M=n==null?void 0:n.firstCol)==null?void 0:M.label,i,W.value)}else Te.setRouteToChildPath(k.cloneDeep(W).value),ye.setActiveMenuPath(o);else if(await ie.loadingConstruct(r,o,null,null,e?pr.value:null),e){const _=await cr(o);if((_==null?void 0:_.length)>0){const S=_==null?void 0:_.find(F=>{var x;return((x=F==null?void 0:F.comp)==null?void 0:x.toUpperCase())==="FORM"});S&&oa(S,(v=n==null?void 0:n.firstCol)==null?void 0:v.label,i,W.value)}}else Te.setRouteToChildPath(k.cloneDeep(W).value),ye.setActiveMenuPath(o)}else e?(Ge.value="",Be.value=n==null?void 0:n.data,yl(!0,n==null?void 0:n.firstCol,i)):(Te.setRouteToChildPath(k.cloneDeep(W).value),ye.setActiveMenuPath(o))},gr=()=>{qe.value=!1,cl.value=[],Oe.value=!1},hl=e=>{var o,i,p,d,f,m;const a=[];let n=[];for(let t in e)Array.isArray(e==null?void 0:e[t])&&n.push(t);Ee.value=k.cloneDeep(V.value),(i=ie.getColumnChild((o=k.cloneDeep(V.value))==null?void 0:o.filter(t=>(t==null?void 0:t.label)!=="操作")))==null||i.forEach((t,E)=>{var M;n.find(v=>v===(t==null?void 0:t.prop))||(t!=null&&t.formType&&((M=t==null?void 0:t.formType)==null?void 0:M.toUpperCase())==="SELECT"?a.push({label:(t==null?void 0:t.prop)||(t==null?void 0:t.label)||"",name:(t==null?void 0:t.prop)??"t"+E,prop:t==null?void 0:t.prop,type:!(t!=null&&t.formType)||(t==null?void 0:t.formType)===""?"Input":t==null?void 0:t.formType,value:(e==null?void 0:e[t==null?void 0:t.prop])??(t==null?void 0:t.value)??"",id:(t==null?void 0:t.id)??E,contents:(t==null?void 0:t.options)??[],width:1,isFormColHidden:t==null?void 0:t.isFormColHidden,disabled:t==null?void 0:t.disabled,optionUrl:{groupSelect:t==null?void 0:t.groupSelect,menuSelect:t==null?void 0:t.formMenuSelect,type:"Select",selectRelateType:t==null?void 0:t.selectRelateType}}):a.push({label:(t==null?void 0:t.prop)||(t==null?void 0:t.label)||"",prop:t==null?void 0:t.prop,name:(t==null?void 0:t.prop)??"t"+E,type:!(t!=null&&t.formType)||(t==null?void 0:t.formType)===""?"Input":t==null?void 0:t.formType,value:(e==null?void 0:e[t==null?void 0:t.prop])??(t==null?void 0:t.value)??"",id:(t==null?void 0:t.id)??E,contents:(t==null?void 0:t.options)??[],width:1,isFormColHidden:t==null?void 0:t.isFormColHidden,disabled:t==null?void 0:t.disabled}))}),e===""||!e||(Ge.value=(e==null?void 0:e.id)??"");let r=ie.getColumnChild((p=k.cloneDeep(V.value))==null?void 0:p.filter(t=>(t==null?void 0:t.label)!=="操作"));Le.value&&((d=Le.value)==null?void 0:d.length)>0&&(Le.value=(f=k.cloneDeep(Le).value)==null?void 0:f.map(t=>{var M;let E=(t==null?void 0:t.prop)||((M=r==null?void 0:r.find(v=>(v==null?void 0:v.label)===(t==null?void 0:t.label)))==null?void 0:M.prop);return E&&(t.value=e[E]),t})),Xe.value=Le.value&&((m=Le.value)==null?void 0:m.length)>0?ie.getTableFormToForm(Le.value):a},hr=()=>{var a;const e=(a=U.value)==null?void 0:a.$el;e&&Hl.Sortable.create(e,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:n=>{var p;const{oldIndex:r,newIndex:o}=n;if(r===o)return;const i=pl.value.splice(r,1)[0];pl.value.splice(o,0,i),V.value=(p=V.value)==null?void 0:p.slice().sort((d,f)=>{if(d.label==="操作")return 1;if(f.label==="操作")return-1;const m=pl.value.findIndex(E=>E.label===d.label),t=pl.value.findIndex(E=>E.label===f.label);return m-t})}})};l.onMounted(()=>{$l.value=window.innerWidth-240*2});const yr=()=>{l.nextTick(()=>{hr()})},Jl=(e,a)=>{var r;if(!e&&!(e!=null&&e.children))return{contents:e,currentSelectContents:void 0};let n;return e.children=(r=e.children)==null?void 0:r.map(o=>{var i,p;if((o==null?void 0:o.id)===Ge.value){let d={};for(let f in o){let m=(i=a==null?void 0:a.find(t=>(t==null?void 0:t.prop)===f))==null?void 0:i.label;m?d[f]=(p=Be.value)==null?void 0:p[m]:d[f]=o[f]}o=Object.assign(d,Be.value),n=o}else{let d=Jl(o,a);o=d==null?void 0:d.contents,n=d==null?void 0:d.currentSelectContents}return o}),{contents:e,currentSelectContents:n}},sa=(e,a)=>{let n,r;return e!=null&&e.find(o=>(o==null?void 0:o.id)===Ge.value)?n=e==null?void 0:e.map(o=>{var i,p;if((o==null?void 0:o.id)===Ge.value){let d={};for(let f in o){let m=(i=a==null?void 0:a.find(t=>(t==null?void 0:t.prop)===f))==null?void 0:i.label;m?d[f]=(p=Be.value)==null?void 0:p[m]:d[f]=o[f]}o=Object.assign(d,Be.value),r=o}return o}):n=e==null?void 0:e.map(o=>{var i,p,d,f;if((o==null?void 0:o.id)===Ge.value){let m={};for(let t in o){let E=(i=a==null?void 0:a.find(M=>(M==null?void 0:M.prop)===t))==null?void 0:i.label;E?m[t]=(p=Be.value)==null?void 0:p[E]:m[t]=o[t]}o=Object.assign(m,Be.value),r=o}else o=(d=Jl(o,a))==null?void 0:d.contents,r=(f=Jl(o,a))==null?void 0:f.currentSelectContents;return o}),{newContents:n,currentSelectContents:r}},ia=(e,a,n)=>{var r,o;return e[a==null?void 0:a.prop]=n,typeof e.id=="number"&&(e.id=(r=e.id)==null?void 0:r.toString()),e.children&&((o=e.children)==null?void 0:o.length)>0&&(e.children=e.children.map(ia)),e},Wl=e=>{var n;const a=[];return a.push({...e}),e!=null&&e.children&&Array.isArray(e.children)&&((n=e.children)==null||n.forEach(r=>{a.push(...Wl(r))})),(a==null?void 0:a.length)>0?a==null?void 0:a.map(r=>{const o={...r};return delete o.children,o}):[]},yl=(e=!0,a,n)=>{var m,t,E,M,v,B,_,S,F;let r=ie.getColumnChild((m=k.cloneDeep(V.value))==null?void 0:m.filter(x=>(x==null?void 0:x.label)!=="操作")),o,i=k.cloneDeep(Y.value);if(!Be.value){Qe.value=!1;return}if(Ge.value===""){nl.value++;let x;a&&n?x={id:nl.value.toString(),[a==null?void 0:a.prop]:n,children:Be.value.children}:x={id:nl.value.toString()},x!=null&&x.children&&(x={...x,children:(t=x.children)==null?void 0:t.map(L=>ia(L,a,n))}),i.push(Object.assign(Be.value,x)),o=Object.assign(Be.value,x)}else i=(E=sa(i,r))==null?void 0:E.newContents,o=(M=sa(i,r))==null?void 0:M.currentSelectContents;const p=(v=s.itemData)==null?void 0:v.filter(x=>(x==null?void 0:x.key)==="childTree")[0];if(((B=p==null?void 0:p.contents)==null?void 0:B.length)>0){Me.value="编辑";const x=[];i==null||i.forEach((L,D)=>{var h;let g={};if(Array.isArray(L)){let u=[];L==null||L.filter(b=>!(b!=null&&b.id)).forEach((b,$)=>{var N,G,ae,X,q,H,A;if((G=(N=Pe.value)==null?void 0:N[$])!=null&&G.prop&&!Array.isArray(b)){let j={};j[Pe.value[$].column]=b,be!=null&&be.value&&((ae=be==null?void 0:be.value)==null?void 0:ae.length)>0&&((X=be==null?void 0:be.value)!=null&&X.find(z=>JSON.stringify(z==null?void 0:z[0])===JSON.stringify(j)))&&(u=(q=be==null?void 0:be.value)==null?void 0:q.find(z=>JSON.stringify(z==null?void 0:z[0])===JSON.stringify(j))),u&&u.length>0?g[Pe.value[$].prop]=u!=null&&u.find(z=>{var I;return((I=Object.keys(z))==null?void 0:I[0])===Pe.value[$].column})?(H=u==null?void 0:u.find(z=>{var I;return((I=Object.keys(z))==null?void 0:I[0])===Pe.value[$].column}))==null?void 0:H[Pe.value[$].column]:b:g[Pe.value[$].prop]=b}else Array.isArray(b)&&((A=Pe.value[$])!=null&&A.prop?g[Pe.value[$].prop]=b:g.children=Xl(b,Pe.value))})}else g=L;Array.isArray(L)&&L.some(u=>u==null?void 0:u.id)?x.push(Object.assign(g,{id:(h=L==null?void 0:L.find(u=>u.id))==null?void 0:h.id})):g.id?x.push(g):x.push(Object.assign(g,{id:D.toString()}))}),Y.value=fa(x,p,V.value)}else Y.value=i;da(Y.value),wl.value=Y.value;const d=Ir(wl.value,Ye.value,i);let f=[];if(il.value?(f=(_=k.cloneDeep(il).value.singleContent)==null?void 0:_.filter(x=>(x==null?void 0:x.id)!==(o==null?void 0:o.id)),f.push(o)):f=[o],$e.value){const x={content:d,singleContent:((S=p==null?void 0:p.contents)==null?void 0:S.length)>0?f==null?void 0:f.flatMap(Wl):f,index:s==null?void 0:s.index,buttonName:"编辑",column:V.value,parentTableId:s==null?void 0:s.parentTableId};Te.setCacheUpdatingData(x)}if(e){const x={content:d,singleContent:((F=p==null?void 0:p.contents)==null?void 0:F.length)>0?Wl(o):o,index:s==null?void 0:s.index,buttonName:Me.value,column:V.value,parentTableId:s==null?void 0:s.parentTableId};Te.setTableLoading(s==null?void 0:s.index),Qe.value=!1,Be.value=void 0,te("change",x)}};l.onUnmounted(()=>{V.value=[],Y.value=[],Ee.value=[],Je.value=[],Le.value=[],Ie.value=[],cl.value=[],ol.value=[],Xe.value=[],Ke.value=[],U.value=null});const ua=async(e,a,n)=>{var m,t,E,M,v,B,_,S,F,x,L;al.value=n==null?void 0:n.prop;const r=k.cloneDeep(s.itemData),o=r==null?void 0:r.map(D=>{var g;return(D==null?void 0:D.key)==="header"&&((g=D.contents)==null||g.map((h,u)=>{var b,$,N,G,ae,X,q,H,A,j,z,I,R,c,K,w,ne,ve,ce;return h.type=h!=null&&h.type?h.type:(G=(N=($=(b=h==null?void 0:h.key)==null?void 0:b.split("$"))==null?void 0:$[1])==null?void 0:N.split("("))!=null&&G[0]?(X=(ae=ie.FormType)==null?void 0:ae.find(T=>{var y,se,ue,de;return(T==null?void 0:T.key)===((de=(ue=(se=(y=h==null?void 0:h.key)==null?void 0:y.split("$"))==null?void 0:se[1])==null?void 0:ue.split("("))==null?void 0:de[0])}))==null?void 0:X.value:"Input",h.options=h!=null&&h.options?h.options:((A=(H=(q=h==null?void 0:h.key)==null?void 0:q.split("$"))==null?void 0:H[1])==null?void 0:A.length)>0?(R=(I=Ql((z=(j=h==null?void 0:h.key)==null?void 0:j.split("$"))==null?void 0:z[1]))==null?void 0:I.split(","))==null?void 0:R.map(T=>({label:T,value:T})):[],(c=h==null?void 0:h.key)!=null&&c.includes("$")&&(h.key=(w=(K=h==null?void 0:h.key)==null?void 0:K.split("$"))==null?void 0:w[0]),h.value=(ne=Object.values(a))==null?void 0:ne[u],h.optionUrl=h!=null&&h.formMenuSelect&&((ve=h==null?void 0:h.formMenuSelect)==null?void 0:ve.length)>0?{groupSelect:(ce=h==null?void 0:h.groupSelect)==null?void 0:ce.split(/[::]/).map(T=>T.trim()),menuSelect:h==null?void 0:h.formMenuSelect,selectRelateType:"",type:(h==null?void 0:h.formType)??(h!=null&&h.groupSelect?"Select":"")}:null,h})),D});let i=k.cloneDeep(Xe.value),p=(t=(m=k.cloneDeep(o))==null?void 0:m.find(D=>(D==null?void 0:D.key)==="header"))==null?void 0:t.contents;i=i==null?void 0:i.map(D=>{var g;return D.value=(g=p==null?void 0:p.find((h,u)=>u===(D==null?void 0:D.id)))==null?void 0:g.value,D});let d="",f=(v=(M=(E=k.cloneDeep(o))==null?void 0:E.find(D=>(D==null?void 0:D.key)==="header"))==null?void 0:M.contents)==null?void 0:v.find((D,g)=>{var h,u,b;return(D==null?void 0:D.label)===al.value||(g==null?void 0:g.toString())===((b=(u=(h=al.value)==null?void 0:h.split("a"))==null?void 0:u[1])==null?void 0:b.toString())});if((S=(_=(B=k.cloneDeep(o))==null?void 0:B.find(D=>(D==null?void 0:D.key)==="header"))==null?void 0:_.contents)==null||S.forEach(D=>{var g,h,u,b,$;d===""&&((u=(h=(g=D==null?void 0:D.optionUrl)==null?void 0:g.groupSelect)==null?void 0:h[1])!=null&&u.includes("["))&&(d=($=(b=D==null?void 0:D.optionUrl)==null?void 0:b.groupSelect)==null?void 0:$[1])}),(F=f==null?void 0:f.optionUrl)!=null&&F.menuSelect){let D=await Yl(f),g;if(D==null||D.forEach(h=>{var u,b,$,N,G,ae,X,q,H,A;d===((b=(u=f==null?void 0:f.optionUrl)==null?void 0:u.groupSelect)==null?void 0:b[1])&&((G=(N=($=f==null?void 0:f.optionUrl)==null?void 0:$.groupSelect)==null?void 0:N[1])!=null&&G.includes("["))&&((A=k.cloneDeep(h))==null?void 0:A[(H=(q=(X=(ae=f==null?void 0:f.optionUrl)==null?void 0:ae.groupSelect)==null?void 0:X[1])==null?void 0:q.replaceAll("[",""))==null?void 0:H.replaceAll("]","")])===(f==null?void 0:f.value)&&(g=h)}),g){let h=k.cloneDeep(i);h=h==null?void 0:h.map(b=>{var $,N,G,ae,X,q,H,A,j,z,I;return(g!=null&&g[b==null?void 0:b.label]||g!=null&&g[(ae=(G=(N=($=b==null?void 0:b.optionUrl)==null?void 0:$.groupSelect)==null?void 0:N[1])==null?void 0:G.replaceAll("[",""))==null?void 0:ae.replaceAll("]","")])&&((H=(q=(X=b==null?void 0:b.optionUrl)==null?void 0:X.groupSelect)==null?void 0:q[1])!=null&&H.includes("["))&&(b.value=(g==null?void 0:g[b==null?void 0:b.label])||(g==null?void 0:g[(I=(z=(j=(A=b==null?void 0:b.optionUrl)==null?void 0:A.groupSelect)==null?void 0:j[1])==null?void 0:z.replaceAll("[",""))==null?void 0:I.replaceAll("]","")])),b}),Y.value=(x=k.cloneDeep(Y.value))==null?void 0:x.map(b=>{if((b==null?void 0:b.id)===(a==null?void 0:a.id)){const $={};return h==null||h.forEach(N=>{$[N.name]=N.value}),$.id=b==null?void 0:b.id,$}return b});let u=k.cloneDeep(h);u=u==null?void 0:u.map(b=>{var $,N,G,ae;return(N=($=b==null?void 0:b.optionUrl)==null?void 0:$.menuSelect)!=null&&N.some(X=>X==null?void 0:X.includes)&&(b.optionUrl.menuSelect=(ae=(G=b==null?void 0:b.optionUrl)==null?void 0:G.menuSelect)==null?void 0:ae.map(X=>{var q,H,A,j;if(X!=null&&X.includes("[")){let z=(H=(q=X==null?void 0:X.replaceAll("[","").replaceAll("]",""))==null?void 0:q.split(":"))==null?void 0:H[1];X=(j=(A=k.cloneDeep(h))==null?void 0:A.find(I=>(I==null?void 0:I.label)===z))==null?void 0:j.value}return X})),b}),Y.value=(L=k.cloneDeep(Y.value))==null?void 0:L.map(b=>{if((b==null?void 0:b.id)===(a==null?void 0:a.id)){const $={};return u==null||u.forEach(N=>{$[N.name]=N.value}),$.id=b==null?void 0:b.id,$}return b})}}},vr=async e=>{var m,t,E,M,v,B,_,S,F,x,L,D;if(!e)return;Be.value=e;const a=k.cloneDeep(s.itemData);let n=a==null?void 0:a.map(g=>{var h;return(g==null?void 0:g.key)==="header"&&((h=g.contents)==null||h.map((u,b)=>{var $,N,G,ae,X,q,H,A,j,z,I,R,c,K,w,ne,ve,ce,T;return u.type=u!=null&&u.type?u.type:(ae=(G=(N=($=u==null?void 0:u.key)==null?void 0:$.split("$"))==null?void 0:N[1])==null?void 0:G.split("("))!=null&&ae[0]?(q=(X=ie.FormType)==null?void 0:X.find(y=>{var se,ue,de,Ce;return(y==null?void 0:y.key)===((Ce=(de=(ue=(se=u==null?void 0:u.key)==null?void 0:se.split("$"))==null?void 0:ue[1])==null?void 0:de.split("("))==null?void 0:Ce[0])}))==null?void 0:q.value:"Input",u.options=u!=null&&u.options?u.options:((j=(A=(H=u==null?void 0:u.key)==null?void 0:H.split("$"))==null?void 0:A[1])==null?void 0:j.length)>0?(c=(R=Ql((I=(z=u==null?void 0:u.key)==null?void 0:z.split("$"))==null?void 0:I[1]))==null?void 0:R.split(","))==null?void 0:c.map(y=>({label:y,value:y})):[],(K=u==null?void 0:u.key)!=null&&K.includes("$")&&(u.key=(ne=(w=u==null?void 0:u.key)==null?void 0:w.split("$"))==null?void 0:ne[0]),u.value=(ve=Object.values(e))==null?void 0:ve[b],u.optionUrl=u!=null&&u.formMenuSelect&&((ce=u==null?void 0:u.formMenuSelect)==null?void 0:ce.length)>0?{groupSelect:(T=u==null?void 0:u.groupSelect)==null?void 0:T.split(/[::]/).map(y=>y.trim()),menuSelect:u==null?void 0:u.formMenuSelect,selectRelateType:"",type:(u==null?void 0:u.formType)??(u!=null&&u.groupSelect?"Select":"")}:null,u})),g}),r=Xe.value,o=(t=(m=k.cloneDeep(n))==null?void 0:m.find(g=>(g==null?void 0:g.key)==="header"))==null?void 0:t.contents;if(r=r==null?void 0:r.map(g=>{var h;return g.value=(h=o==null?void 0:o.find((u,b)=>(u==null?void 0:u.prop)===(g==null?void 0:g.name)))==null?void 0:h.value,g}),!dl.value)return;let i="",p=(v=(M=(E=k.cloneDeep(n))==null?void 0:E.find(g=>(g==null?void 0:g.key)==="header"))==null?void 0:M.contents)==null?void 0:v.find((g,h)=>{var u,b,$;return(g==null?void 0:g.label)===al.value||(h==null?void 0:h.toString())===(($=(b=(u=al.value)==null?void 0:u.split("a"))==null?void 0:b[1])==null?void 0:$.toString())}),d=(B=p==null?void 0:p.optionUrl)==null?void 0:B.menuSelect,f=!0;if((F=(S=(_=k.cloneDeep(n))==null?void 0:_.find(g=>(g==null?void 0:g.key)==="header"))==null?void 0:S.contents)==null||F.forEach(g=>{var h,u,b,$,N,G;f&&((b=(u=(h=g==null?void 0:g.optionUrl)==null?void 0:h.groupSelect)==null?void 0:u[1])!=null&&b.includes("["))&&(i=(N=($=g==null?void 0:g.optionUrl)==null?void 0:$.groupSelect)==null?void 0:N[1],JSON.stringify(d)===JSON.stringify((G=g==null?void 0:g.optionUrl)==null?void 0:G.menuSelect)&&(f=!1))}),(x=p==null?void 0:p.optionUrl)!=null&&x.menuSelect&&dl.value){let g=await Yl(p),h;if((L=p==null?void 0:p.optionUrl)==null||L.menuSelect,g==null||g.forEach(u=>{var b,$,N,G,ae,X,q,H,A,j;i===(($=(b=p==null?void 0:p.optionUrl)==null?void 0:b.groupSelect)==null?void 0:$[1])&&((ae=(G=(N=p==null?void 0:p.optionUrl)==null?void 0:N.groupSelect)==null?void 0:G[1])!=null&&ae.includes("["))&&((j=k.cloneDeep(u))==null?void 0:j[(A=(H=(q=(X=p==null?void 0:p.optionUrl)==null?void 0:X.groupSelect)==null?void 0:q[1])==null?void 0:H.replaceAll("[",""))==null?void 0:A.replaceAll("]","")])===(p==null?void 0:p.value)&&(h=u)}),h){let u=k.cloneDeep(r);u=u==null?void 0:u.map(N=>{var G,ae,X,q,H,A,j,z,I,R,c;return(h!=null&&h[N==null?void 0:N.label]||h!=null&&h[(q=(X=(ae=(G=N==null?void 0:N.optionUrl)==null?void 0:G.groupSelect)==null?void 0:ae[1])==null?void 0:X.replaceAll("[",""))==null?void 0:q.replaceAll("]","")])&&((j=(A=(H=N==null?void 0:N.optionUrl)==null?void 0:H.groupSelect)==null?void 0:A[1])!=null&&j.includes("["))&&(N.value=(h==null?void 0:h[N==null?void 0:N.label])||(h==null?void 0:h[(c=(R=(I=(z=N==null?void 0:N.optionUrl)==null?void 0:z.groupSelect)==null?void 0:I[1])==null?void 0:R.replaceAll("[",""))==null?void 0:c.replaceAll("]","")])),N}),Xe.value=k.cloneDeep(u);let b=k.cloneDeep(u);b=b==null?void 0:b.map(N=>{var G,ae,X,q,H,A;return(ae=(G=N==null?void 0:N.optionUrl)==null?void 0:G.menuSelect)!=null&&ae.some(j=>j==null?void 0:j.includes("["))&&(N.optionUrl.oldMenuSelect=(q=(X=k.cloneDeep(N))==null?void 0:X.optionUrl)==null?void 0:q.menuSelect,N.optionUrl.menuSelect=(A=(H=N==null?void 0:N.optionUrl)==null?void 0:H.menuSelect)==null?void 0:A.map(j=>{var z,I,R,c;if(j!=null&&j.includes("[")){let K=(I=(z=j==null?void 0:j.replaceAll("[","").replaceAll("]",""))==null?void 0:z.split(":"))==null?void 0:I[1];j=(c=(R=k.cloneDeep(u))==null?void 0:R.find(w=>(w==null?void 0:w.label)===K))==null?void 0:c.value}return j})),N}),Xe.value=b;let $={};(D=Xe.value)==null||D.forEach(N=>{$[N.prop]=N==null?void 0:N.value}),Be.value=$}}dl.value=!1},br=e=>e?(e==null?void 0:e.toUpperCase())==="INPUT"?"TEXTAREA":e:"TEXTAREA",mr=e=>{var i,p;const a=(p=(i=Le.value)==null?void 0:i.find(d=>(d==null?void 0:d.label)===(e==null?void 0:e.label)))==null?void 0:p.multiple,n=e==null?void 0:e.prop;if((e==null?void 0:e.formType)!="Select")return;Y.value.forEach(d=>{const f=d==null?void 0:d[n];a&&va.isString(f)&&(d[n]=[f]),!a&&!va.isString(f)&&(d[n]="")})},ca=(e,a)=>{var n;return a==null||a.forEach(r=>{e[r==null?void 0:r.prop]=r==null?void 0:r.value}),e.children&&((n=e.children)==null?void 0:n.length)>0&&(e.children=e.children.map(r=>ca(r,a))),e},Gl=e=>{var n,r,o,i,p,d;hl("");const a=(n=Xe.value)==null?void 0:n.reduce((f,m)=>(f[m.name]=m.value,f),{});if(((r=Object.keys(a))==null?void 0:r.length)>0){Be.value=a,Ge.value="",nl.value=(o=Y.value)==null?void 0:o.length,ol.value=(i=el.value)==null?void 0:i.filter(m=>(m==null?void 0:m.label)!=="新增");const f=(d=(p=Ee.value)==null?void 0:p.filter(m=>(m==null?void 0:m.label)!=="操作"))==null?void 0:d.map(m=>{var E,M,v;const t=(M=(E=Le.value)==null?void 0:E.find(B=>(B==null?void 0:B.label)===(m==null?void 0:m.label)))==null?void 0:M.multiple;return mr(m),{...m,contents:(m==null?void 0:m.options)??[],optionUrl:m!=null&&m.formMenuSelect&&((v=m==null?void 0:m.formMenuSelect)==null?void 0:v.length)>0?{groupSelect:m==null?void 0:m.groupSelect,menuSelect:m==null?void 0:m.formMenuSelect,selectRelateType:"",type:m==null?void 0:m.formType,multiple:t}:null}});V.value=f==null?void 0:f.map(m=>ca(m,[{prop:"type",value:"edit"},{prop:"columnType",value:br(m==null?void 0:m.formType)||(m==null?void 0:m.columnType)}])),e==="createClick"&&yl(!1)}},tl={START:"开始时间",END:"结束时间",HOURS:"工时"},kr=(e,a)=>Number(Hl.dayjs(a).diff(Hl.dayjs(e),"day",!0).toFixed(1)),da=e=>{var i;const a=s.itemData,n=(i=a==null?void 0:a.find(p=>(p==null?void 0:p.key)==="header"))==null?void 0:i.contents,r=new Map;return n==null||n.forEach((p,d)=>{const{label:f}=p;r.set(f,d)}),!r.has(tl.START)||!r.has(tl.END)||!r.has(tl.HOURS)?e:e==null?void 0:e.map(p=>{const d=p==null?void 0:p[tl.START],f=p==null?void 0:p[tl.END],m=kr(d,f);return d&&f&&(p[tl.HOURS]=`${m}天`),p})},pa=(e,a,n=0)=>{if(n>((a==null?void 0:a.length)??""))return e;const r=a==null?void 0:a[n],o=new Map;for(const p of e){const d=p[r];o.has(d)||o.set(d,[]),o.get(d)&&o.get(d).push(p)}const i=[];for(const[p,d]of o){const[f,...m]=d,t={...f};n+1===((a==null?void 0:a.length)??"")?t.children=d==null?void 0:d.map(E=>(E.level=k.cloneDeep(n)+1,E)).filter((E,M)=>M!==0):m.length>0&&(t.children=pa(m,a,n+1)),t.level=n,i.push(t)}return i},fa=(e,a,n)=>{var o;if(!(a!=null&&a.contents)||((o=a==null?void 0:a.contents)==null?void 0:o.length)===0)return e;let r=[];return r=pa(e,a==null?void 0:a.contents,0),r},ga=(e,a)=>{var M,v,B,_,S,F,x,L,D,g,h,u,b,$,N,G,ae,X,q,H,A,j,z,I,R;const n=e==null?void 0:e.filter(c=>(c==null?void 0:c.key)==="header");e==null||e.filter(c=>(c==null?void 0:c.key)==="tableIndexColumn")[0];const r=e==null?void 0:e.filter(c=>(c==null?void 0:c.key)==="childTree")[0];let o=a;const i=e==null?void 0:e.find(c=>(c==null?void 0:c.key)==="page"),p=e==null?void 0:e.find(c=>(c==null?void 0:c.key)==="rowButton"),d=e==null?void 0:e.find(c=>(c==null?void 0:c.key)==="extraButton"),f=e==null?void 0:e.filter(c=>(c==null?void 0:c.key)==="tableContents"),m=e==null?void 0:e.filter(c=>(c==null?void 0:c.key)==="tableIndex");Le.value=(v=(M=e==null?void 0:e.filter(c=>(c==null?void 0:c.key)==="tableToForm"))==null?void 0:M[0])==null?void 0:v.contents,Zl.value=(i==null?void 0:i.contents)??!0;let t=[];ll.value===""?t=n==null?void 0:n[0]:t=(n==null?void 0:n.find(c=>(c==null?void 0:c.selectLabel)==="("+ll.value+")"))??(n==null?void 0:n.find(c=>!(c!=null&&c.selectLabel)));let E=[];if(ll.value===""?E=m==null?void 0:m[0]:E=(m==null?void 0:m.find(c=>(c==null?void 0:c.selectLabel)==="("+ll.value+")"))??(m==null?void 0:m.find(c=>!(c!=null&&c.selectLabel))),((B=t==null?void 0:t.contents)==null?void 0:B.length)>0){let c=[];if(t!=null&&t.contents.some(T=>Array.isArray(T)&&(T==null?void 0:T.find(y=>y.children))))Ye.value===""?c=(S=(_=ie.getGradeColumns(t==null?void 0:t.contents))==null?void 0:_[0])==null?void 0:S.filter(T=>!Array.isArray(T)):(Ye.value.split("-"),c=(F=ie.getGradeColumns(t==null?void 0:t.contents))==null?void 0:F[0]);else{let T=t!=null&&t.contents.some(y=>Array.isArray(y))?(x=t==null?void 0:t.contents)==null?void 0:x[0]:t==null?void 0:t.contents;T==null||T.forEach((y,se)=>{var Ce,Se,vl,bl;let ue="";(Se=(Ce=W.value)==null?void 0:Ce.split("/"))==null||Se.forEach(Fe=>{var ml,kl,Sl;if(Fe!==""){let sl=(Sl=(kl=(ml=Fe==null?void 0:Fe.split(le+"updateLoading"))==null?void 0:ml[0])==null?void 0:kl.split(le+"loading"))==null?void 0:Sl[0];ue=ue===""?ue+sl:ue+"/"+sl}}),ue=ue+le+(y==null?void 0:y.directiveLabel);const de=(vl=Le.value)==null?void 0:vl.find(Fe=>(Fe==null?void 0:Fe.prop)===(y==null?void 0:y.prop));c.push({label:(y==null?void 0:y.label)??"",prop:(y==null?void 0:y.label)==="操作"?"operate":(y==null?void 0:y.prop)??"a"+se,width:y!=null&&y.width?parseInt(y.width):"",fixed:(y==null?void 0:y.fixed)??void 0,sortable:(y==null?void 0:y.sortable)??!1,filterable:(y==null?void 0:y.filterable)??!1,operable:(y==null?void 0:y.operable)??!1,showSummary:(y==null?void 0:y.showSummary)??!1,align:(y==null?void 0:y.align)??"left",showOverflowTooltip:(y==null?void 0:y.showOverflowTooltip)??!0,isNotDrag:(y==null?void 0:y.isNotDrag)??!1,isEditCol:(y==null?void 0:y.isEditCol)??!1,isOperate:(y==null?void 0:y.isOperate)??!1,id:(y==null?void 0:y.id)??se,type:(y==null?void 0:y.label)==="操作"?"operate":void 0,formType:(y==null?void 0:y.formType)??(y!=null&&y.groupSelect?"Select":""),isTableColHidden:y==null?void 0:y.isTableColHidden,isFormColHidden:y==null?void 0:y.isFormColHidden,disabled:y==null?void 0:y.disabled,options:(y==null?void 0:y.options)??[],value:(y==null?void 0:y.value)??"",formMenuSelect:(y==null?void 0:y.formMenuSelect)??[],isRoute:(y==null?void 0:y.isRoute)??!1,groupSelect:y!=null&&y.groupSelect?(bl=y==null?void 0:y.groupSelect)==null?void 0:bl.replaceAll('"',"").split(":"):[],isMainKey:(y==null?void 0:y.isMainKey)||(y==null?void 0:y.directiveLabel)&&!o[ue],columnType:(de==null?void 0:de.type)||(y==null?void 0:y.columnType)||"TEXTAREA",directiveLabel:y==null?void 0:y.directiveLabel,isExistChild:!!(y!=null&&y.directiveLabel&&o[ue]),childPath:ue})})}V.value=ie.getNewColumnChild(c),Je.value=ie.getNewColumnChild(c),Q.value=(L=V.value)==null?void 0:L.map(T=>T==null?void 0:T.label),Ue.value=(D=V.value)==null?void 0:D.every(T=>T==null?void 0:T.filterable),pe.value=(g=V.value)==null?void 0:g.every(T=>T==null?void 0:T.operable),_e.value=(h=V.value)==null?void 0:h.every(T=>T==null?void 0:T.sortable);let K=(b=(u=ie.getAllLeafNodes(V.value))==null?void 0:u.filter(T=>(T==null?void 0:T.type)!=="operate"))==null?void 0:b.map((T,y)=>({prop:(T==null?void 0:T.prop)??"a"+y,column:T.label}));Pe.value=K;let w=[];ll.value===""?w=f==null?void 0:f[0]:w=(f==null?void 0:f.find(T=>(T==null?void 0:T.selectLabel)==="("+ll.value+")"))??(f==null?void 0:f.find(T=>!(T!=null&&T.selectLabel)));let ne=Array.isArray(($=w==null?void 0:w.contents)==null?void 0:$[0])&&((N=w==null?void 0:w.contents)!=null&&N[0].every(T=>Array.isArray(T)))?(G=w==null?void 0:w.contents)==null?void 0:G[0]:w==null?void 0:w.contents;E!=null&&E.contents&&((ae=E==null?void 0:E.contents)==null?void 0:ae.length)!==0&&(ne=(X=k.cloneDeep(ne))==null?void 0:X.map((T,y)=>{if(!Array.isArray(T)){let se={};for(let ue in T)ue!=="id"&&ue!=="index"&&(se[ue]=T[ue]);T=Object.values(se)}return T}));const ve=!!((q=V.value)!=null&&q.find(T=>T.prop==="index"));ne=Sa(ne,E==null?void 0:E.contents,ve);const ce=[];ne==null||ne.forEach((T,y)=>{var ue;let se={};if(Array.isArray(T)){let de=[];T==null||T.filter(Ce=>!(Ce!=null&&Ce.id)).forEach((Ce,Se)=>{var vl,bl,Fe,ml,kl,Sl;if((vl=K==null?void 0:K[Se])!=null&&vl.prop&&!Array.isArray(Ce)){let sl={};sl[K[Se].column]=Ce,be!=null&&be.value&&((bl=be==null?void 0:be.value)==null?void 0:bl.length)>0&&((Fe=be==null?void 0:be.value)!=null&&Fe.find(ze=>JSON.stringify(ze==null?void 0:ze[0])===JSON.stringify(sl)))&&(de=(ml=be==null?void 0:be.value)==null?void 0:ml.find(ze=>JSON.stringify(ze==null?void 0:ze[0])===JSON.stringify(sl))),de&&de.length>0?se[K[Se].prop]=de!=null&&de.find(ze=>{var Cl;return((Cl=Object.keys(ze))==null?void 0:Cl[0])===K[Se].column})?(kl=de==null?void 0:de.find(ze=>{var Cl;return((Cl=Object.keys(ze))==null?void 0:Cl[0])===K[Se].column}))==null?void 0:kl[K[Se].column]:Ce:se[K[Se].prop]=Ce}else Array.isArray(Ce)&&((Sl=K[Se])!=null&&Sl.prop?se[K[Se].prop]=Ce:se.children=Xl(Ce,K))})}else se=T;Array.isArray(T)&&T.some(de=>de==null?void 0:de.id)?ce.push(Object.assign(se,{id:(ue=T==null?void 0:T.find(de=>de.id))==null?void 0:ue.id})):se.id?ce.push(se):ce.push(Object.assign(se,{id:y.toString()}))}),Y.value=fa(ce,r,V.value),Tl.value=ce,(H=Tl.value)==null||H.forEach(T=>{var y;(y=El.value)==null||y.set(T.id,T)})}else V.value=[],Ee.value=[],Y.value=[],Tl.value=[],El.value=new Map;((A=p==null?void 0:p.contents)==null?void 0:A.length)>0?Ie.value=p==null?void 0:p.contents:Ie.value=[],((j=d==null?void 0:d.contents)==null?void 0:j.length)>0?(ol.value=d==null?void 0:d.contents,el.value=d==null?void 0:d.contents):(ol.value=[],el.value=[]),nl.value=((z=Y==null?void 0:Y.value)==null?void 0:z.length)??0,da(Y.value),wl.value=Y.value,$e.value&&(V.value=(R=(I=Ee.value)==null?void 0:I.filter(c=>(c==null?void 0:c.label)!=="操作"))==null?void 0:R.map(c=>{var K;return{...c,type:"edit",optionUrl:c!=null&&c.formMenuSelect&&((K=c==null?void 0:c.formMenuSelect)==null?void 0:K.length)>0?{groupSelect:c==null?void 0:c.groupSelect,menuSelect:c==null?void 0:c.formMenuSelect,selectRelateType:"",type:c==null?void 0:c.formType}:null}}),Gl())};l.watch(()=>[s.itemData,ll.value,Na.value,Ye.value,be==null?void 0:be.value],async()=>{var e,a,n,r,o,i;if((e=s==null?void 0:s.itemData)!=null&&e.find(p=>(p==null?void 0:p.key)==="columnPath")&&!((a=ul.value)!=null&&a.find(p=>{var d,f;return(p==null?void 0:p.key)===((f=(d=s==null?void 0:s.itemData)==null?void 0:d.find(m=>(m==null?void 0:m.key)==="columnPath"))==null?void 0:f.contents)}))){let p=ul.value,d={key:(r=(n=s==null?void 0:s.itemData)==null?void 0:n.find(f=>(f==null?void 0:f.key)==="columnPath"))==null?void 0:r.contents,value:(i=(o=s==null?void 0:s.itemData)==null?void 0:o.find(f=>(f==null?void 0:f.key)==="columnUsingPath"))==null?void 0:i.contents};p!=null&&p.find(f=>(f==null?void 0:f.key)===(d==null?void 0:d.key))?p=p==null?void 0:p.map(f=>((f==null?void 0:f.key)===(d==null?void 0:d.key)&&(f.value=d.value),f)):p.push(d),Te.setTableViewContents(p)}ga(s.itemData,s.allMapContents)},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.operatingForm,e=>{e!=null&&e.form&&(hl(e==null?void 0:e.form),Me.value=e==null?void 0:e.dialogTitle,Al.value=!0,Qe.value=!0)},{immediate:!0,deep:!0});const ha=()=>{var e;(e=me.value)!=null&&e.includes("read")&&($e.value=!$e.value)},Sr=()=>{Ul.value=!Ul.value};l.watch(()=>{var e;return(e=s==null?void 0:s.config)==null?void 0:e.viewport},e=>{var a;me.value=e,(e==null?void 0:e.length)===0?$e.value=!1:(e!=null&&e.includes("read")||($e.value=!0),e!=null&&e.includes("edit")||($e.value=!1)),ge.value=((a=s==null?void 0:s.config)==null?void 0:a.showIndex)||$e.value},{immediate:!0}),l.watch(()=>$e.value,e=>{var a;e?(Gl("viewChange"),Te.setCacheUpdatingData(null)):(ol.value=el.value,V.value=Je.value,il.value&&(Te.setTableLoading(s==null?void 0:s.index),te("change",il.value))),ee.value=e,ge.value=e||((a=s==null?void 0:s.config)==null?void 0:a.showIndex)},{immediate:!0}),l.watch(()=>{var e;return(e=ea.value)==null?void 0:e.length},e=>{e===0&&(re.currentPage=1)}),l.watch(()=>s==null?void 0:s.compNames,e=>{De.contents=[{label:"列表名",prop:"groupName",name:"列表名",type:"select",value:"",id:0,contents:e||[],width:1}]},{immediate:!0}),l.ref(!1);const Cr=(e,a)=>{var n;Gl("createClick"),a===re.pageSize&&(re.currentPage=Math.ceil(((n=Y.value)==null?void 0:n.length)/re.pageSize))},Dr=(e,a,n)=>{var r;ua(n,e,a),Be.value=k.cloneDeep(e),Ge.value=e==null?void 0:e.id,nl.value=(r=Y.value)==null?void 0:r.length,Me.value=typeof(e==null?void 0:e.id)=="string"?"新增":"编辑",yl(!1)},Ae=e=>{var f,m,t,E,M,v,B,_,S,F;const{row:a,column:n,item:r,slotData:o}=e;let i=a!=null&&a[n==null?void 0:n.prop]||(a==null?void 0:a[n==null?void 0:n.prop])===0?((m=(f=a==null?void 0:a[n==null?void 0:n.prop])==null?void 0:f[0])==null?void 0:m.contents)??((a==null?void 0:a[n==null?void 0:n.prop])===0?"0":a==null?void 0:a[n==null?void 0:n.prop]):((E=(t=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:t[0])==null?void 0:E.contents)??(a==null?void 0:a[r==null?void 0:r.prop])??((v=(M=o==null?void 0:o[r==null?void 0:r.prop])==null?void 0:M[0])==null?void 0:v.contents)??(o==null?void 0:o[r==null?void 0:r.prop])??((S=(_=a==null?void 0:a[(B=r==null?void 0:r.child)==null?void 0:B.prop])==null?void 0:_[0])==null?void 0:S.contents)??(a==null?void 0:a[(F=r==null?void 0:r.child)==null?void 0:F.prop]),d=Array.isArray(i)&&!(i!=null&&i.every(x=>typeof x=="string"||typeof x=="number"))?"查看":i;return d=Array.isArray(d)?d.join(","):d,d},xr=e=>{var m,t,E,M,v,B,_,S,F,x;const{row:a,column:n,item:r,slotData:o}=e;let i=a!=null&&a[n==null?void 0:n.prop]?((t=(m=a==null?void 0:a[n==null?void 0:n.prop])==null?void 0:m[0])==null?void 0:t.contents)??(a==null?void 0:a[n==null?void 0:n.prop]):((M=(E=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:E[0])==null?void 0:M.contents)??(a==null?void 0:a[r==null?void 0:r.prop])??((B=(v=o==null?void 0:o[r==null?void 0:r.prop])==null?void 0:v[0])==null?void 0:B.contents)??(o==null?void 0:o[r==null?void 0:r.prop])??((F=(S=a==null?void 0:a[(_=r==null?void 0:r.child)==null?void 0:_.prop])==null?void 0:S[0])==null?void 0:F.contents)??(a==null?void 0:a[(x=r==null?void 0:r.child)==null?void 0:x.prop]);const d=Array.isArray(i)&&!(i!=null&&i.every(L=>typeof L=="string"||typeof L=="number")),f=Array.isArray(i)&&(i==null?void 0:i.find(L=>L==null?void 0:L.url));return d&&f},Tr=(e,a)=>e.find(n=>Object.values(n).some(r=>r===a));return l.watch(()=>Ne.value,async e=>{if(e){ye.setContentLoading(!0),await l.nextTick();const a=Tr(Y.value,e==null?void 0:e.data);if(!a)return ye.setContentLoading(!1);await aa(e==null?void 0:e.data,null,a,{data:e==null?void 0:e.data,isMainKey:!0}),ye.setContentLoading(!1)}},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.cacheNewData,e=>{var a;e&&(Array.isArray(e)||(e==null?void 0:e.compId)===(s==null?void 0:s.index)&&(Y.value=(a=Y.value)==null?void 0:a.map(n=>{var r;return(n==null?void 0:n.id)===((r=e==null?void 0:e.data)==null?void 0:r.id)?{...n,id:e==null?void 0:e.resId}:n})))},{immediate:!0,deep:!0}),(e,a)=>{var m,t,E,M;const n=l.resolveComponent("svg-icon"),r=l.resolveComponent("el-popover"),o=l.resolveComponent("el-switch"),i=l.resolveComponent("el-checkbox"),p=l.resolveComponent("el-checkbox-group"),d=l.resolveComponent("el-button"),f=l.resolveComponent("LookComponent");return l.openBlock(),l.createElementBlock("div",ln,[Il.value?(l.openBlock(),l.createBlock(Re.ssTable,{id:"excel-table",pageObj:re,showIndex:ge.value,isTree:(m=O.compItem)==null?void 0:m.isTree,summaryInfo:oe,columns:V.value,defaultSort:xe,isCardViewport:Ul.value,checkedColumns:Q.value,key:Kl.value+JSON.stringify(V.value),tableData:ea.value,isEditViewport:$e.value,isShowPagination:Zl.value,isShowEdit:!1,isShowDelete:!1,allowSelect:ee.value,onDbClickRow:Ya,extraButton:ol.value,rowButton:Ie.value,cacheExtraButtons:el.value,isClearSelection:((t=Ke.value)==null?void 0:t.length)===0,onDoCurrentChange:Oa,onDoSizeChange:La,onContentClick:aa,onRowClick:Ia,onSelectChange:Fa,onCellChange:Dr,onChange:ua,onPreview:Rl,onSubmitEditingTable:Ka,onHandleColEditChange:Pa,onHandleColTypeChange:$a,onClickButton:Ml},l.createSlots({headerButton:l.withCtx(v=>{var B,_;return[O.showHeader?(l.openBlock(),l.createBlock(Rr,{key:0,pageLayout:O.pageLayout,lockingPage:l.unref(xl)===l.unref(W),filterValues:la.value,selectNums:(B=Ke.value)==null?void 0:B.length,dataNums:(_=Y.value)==null?void 0:_.length,compName:O.compName,isDevMode:O.isDevMode,buttons:v.buttons,onButtonClick:a[0]||(a[0]=S=>Ml(S,"",{})),columns:V.value,onFilter:Xa,onGetImportData:ja,level:O.level},null,8,["pageLayout","lockingPage","filterValues","selectNums","dataNums","compName","isDevMode","buttons","columns","level"])):l.createCommentVNode("",!0)]}),viewport:l.withCtx(()=>{var v,B,_,S;return[((v=Y.value)==null?void 0:v.length)>0&&O.allowOperate?(l.openBlock(),l.createElementBlock("div",nn,[(B=me.value)!=null&&B.includes("read")&&((_=me.value)!=null&&_.includes("edit"))&&((S=Ie.value)!=null&&S.some(F=>(F==null?void 0:F.label)==="编辑"))&&!Ul.value&&l.unref(xl)!==l.unref(W)?(l.openBlock(),l.createElementBlock("span",{key:0,title:"编辑表格",onClick:ha},[l.createVNode(n,{name:"editTable",class:"view-icon"})])):l.createCommentVNode("",!0),l.createElementVNode("span",{title:"卡片视图",onClick:Sr},[l.createVNode(n,{name:"cardViewport",class:"view-icon"})])])):l.createCommentVNode("",!0)]}),rowCreate:l.withCtx(({row:v,index:B})=>[l.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:_=>Cr(v,B)},[l.createVNode(n,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,on)]),operateCol:l.withCtx(()=>[l.createVNode(r,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"hover",onShow:yr},{reference:l.withCtx(()=>[l.createElementVNode("span",tn,[l.createVNode(n,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:l.withCtx(()=>[l.createElementVNode("div",sn,[a[11]||(a[11]=l.createElementVNode("div",{class:"group-title"},"表格操作",-1)),l.createVNode(o,{"model-value":_e.value,"active-text":"排序","inactive-text":"",style:{"margin-right":"8px"},onChange:a[2]||(a[2]=v=>zl(v,"sortable"))},null,8,["model-value"]),l.createVNode(o,{"model-value":Ue.value,"active-text":"筛选","inactive-text":"",style:{"margin-right":"8px"},onChange:a[3]||(a[3]=v=>zl(v,"filterable"))},null,8,["model-value"]),l.createVNode(o,{"model-value":pe.value,"active-text":"编辑所有表头","inactive-text":"",onChange:a[4]||(a[4]=v=>zl(v,"operable"))},null,8,["model-value"]),a[12]||(a[12]=l.createElementVNode("div",{class:"group-title"},"表格列操作",-1)),l.createVNode(p,{modelValue:Q.value,"onUpdate:modelValue":a[5]||(a[5]=v=>Q.value=v),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:U},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(pl.value,v=>(l.openBlock(),l.createElementBlock("div",{style:{display:"flex","align-items":"center"},key:v.label},[l.createVNode(i,{value:v.label,style:{width:"100%",marginRight:0}},{default:l.withCtx(()=>[l.createElementVNode("span",{title:v.label,style:{display:"inline-block",width:"250px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},l.toDisplayString(v.label),9,un)]),_:2},1032,["value"]),l.createVNode(r,{title:"列操作",placement:"left",teleported:!1,trigger:"hover"},{reference:l.withCtx(()=>[l.createVNode(n,{name:"colOperate",style:{width:"15px",height:"15px",cursor:"pointer",color:"grey",position:"absolute",right:"40px"}})]),default:l.withCtx(()=>{var B;return[l.createElementVNode("div",cn,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((B=Object.keys(v))==null?void 0:B.filter(_=>{var S;return(S=he.value)==null?void 0:S.find(F=>(F==null?void 0:F.value)===_)}),_=>{var S,F;return l.openBlock(),l.createElementBlock("div",{key:_},[l.createVNode(o,{"model-value":v==null?void 0:v[_],"active-text":(F=(S=he.value)==null?void 0:S.find(x=>(x==null?void 0:x.value)===_))==null?void 0:F.label,onChange:x=>Ra(x,_,v)},null,8,["model-value","active-text","onChange"])])}),128))])]}),_:2},1024),l.createElementVNode("span",dn,[l.createVNode(n,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px"}})])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),content:l.withCtx(v=>{var B,_,S,F,x,L,D,g,h,u,b,$,N,G,ae,X,q,H;return[xr(v)?(l.openBlock(),l.createBlock(r,{key:0,"popper-class":"file-popover",placement:"right",trigger:"hover",effect:"light",width:"auto"},{reference:l.withCtx(()=>[l.createElementVNode("span",pn,l.toDisplayString(Ae(v)),1)]),default:l.withCtx(()=>{var A;return[l.createElementVNode("div",fn,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(v==null?void 0:v.row[(A=v==null?void 0:v.column)==null?void 0:A.prop],j=>(l.openBlock(),l.createElementBlock("div",gn,[l.createElementVNode("div",{class:"prop-url",title:Vl(j),onClick:z=>Wa(j)},l.toDisplayString(Vl(j)),9,hn),l.createElementVNode("div",{class:"prop-download",onClick:z=>Ga(j)}," 下载 ",8,yn)]))),256))])]}),_:2},1024)):(l.openBlock(),l.createElementBlock("div",{key:1,style:l.normalizeStyle({color:!Array.isArray(Ae(v))&&((_=(B=Ae(v))==null?void 0:B.toString())!=null&&_.includes(".txt")||(F=(S=Ae(v))==null?void 0:S.toString())!=null&&F.includes(".cpt")||(L=(x=Ae(v))==null?void 0:x.toString())!=null&&L.includes(".cyd"))?"var(--vertical-menuitem-active-bg)":"",textDecoration:!Array.isArray(Ae(v))&&((g=(D=Ae(v))==null?void 0:D.toString())!=null&&g.includes(".txt")||(u=(h=Ae(v))==null?void 0:h.toString())!=null&&u.includes(".cpt")||($=(b=Ae(v))==null?void 0:b.toString())!=null&&$.includes(".cyd"))?"underline":"",cursor:!Array.isArray(Ae(v))&&((G=(N=Ae(v))==null?void 0:N.toString())!=null&&G.includes(".txt")||(X=(ae=Ae(v))==null?void 0:ae.toString())!=null&&X.includes(".cpt")||(H=(q=Ae(v))==null?void 0:q.toString())!=null&&H.includes(".cyd"))?"pointer":"",marginLeft:(v==null?void 0:v.colIndex)===0?`${((v==null?void 0:v.level)??0)*20}px`:0}),onClick:A=>Ua(Ae(v))},l.toDisplayString(Ae(v)===0?"0":Ae(v)),13,vn))]}),_:2},[((E=Ie.value)==null?void 0:E.length)>0&&l.unref(xl)!==l.unref(W)?{name:"actions",fn:l.withCtx(({item:v})=>[l.createVNode(r,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:l.withCtx(()=>[l.createVNode(n,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"}})]),default:l.withCtx(()=>[l.createElementVNode("div",an,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Ha(Ie.value,v),(B,_)=>(l.openBlock(),l.createElementBlock("div",{class:"menu-config-item",key:_,onClick:S=>Ml(B==null?void 0:B.label,v,{extra:B})},[l.createElementVNode("div",{style:l.normalizeStyle({color:B==null?void 0:B.textColor}),class:"extra-button-label"},l.toDisplayString(B==null?void 0:B.label),5)],8,rn))),128))])]),_:2},1024)]),key:"0"}:void 0,((M=Y.value)==null?void 0:M.length)>0?{name:"batchButton",fn:l.withCtx(v=>[l.withDirectives(l.createVNode(Jr,{lockingPage:l.unref(xl)===l.unref(W),buttons:v.buttons,selectTableItems:Ke.value,onButtonClick:a[1]||(a[1]=B=>Ml(B,"",{}))},null,8,["lockingPage","buttons","selectTableItems"]),[[l.vShow,ee.value]]),l.withDirectives(l.createElementVNode("div",null,null,512),[[l.vShow,!ee.value]])]),key:"1"}:void 0]),1032,["pageObj","showIndex","isTree","summaryInfo","columns","defaultSort","isCardViewport","checkedColumns","tableData","isEditViewport","isShowPagination","allowSelect","extraButton","rowButton","cacheExtraButtons","isClearSelection"])):l.createCommentVNode("",!0),l.createVNode(Dl.ssDialog,{title:Me.value,visible:Qe.value,width:Aa.value,onBeforeDestroy:qa,style:{height:"74%"}},{default:l.withCtx(()=>[l.createElementVNode("div",bn,[l.createVNode(Re.ssForm,{rowContents:Xe.value,isEnableWrap:!1,showOperator:!1,onChange:vr,onClickTrigger:Ja,isEdit:Nl.value,onBlurChange:za,onPreview:Rl},null,8,["rowContents","isEdit"])])]),footer:l.withCtx(()=>[Al.value?(l.openBlock(),l.createElementBlock("div",mn,[l.createVNode(d,{onClick:a[6]||(a[6]=v=>Qe.value=!1),id:"themeBorderButton"},{default:l.withCtx(()=>a[13]||(a[13]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[13]}),l.createVNode(d,{class:"ok-button",onClick:a[7]||(a[7]=v=>yl(!0)),id:"themeButton"},{default:l.withCtx(()=>a[14]||(a[14]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[14]})])):l.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),l.createVNode(Dl.ssDialog,{title:Me.value,visible:Bl.value,width:$l.value,onBeforeDestroy:a[9]||(a[9]=v=>Bl.value=!1)},{default:l.withCtx(()=>[l.createVNode(Xr)]),footer:l.withCtx(()=>[l.createElementVNode("div",kn,[l.createVNode(d,{onClick:a[8]||(a[8]=v=>Bl.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:l.withCtx(()=>a[15]||(a[15]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[15]}),l.createVNode(d,{class:"ok-button",onClick:er,id:"themeButton"},{default:l.withCtx(()=>a[16]||(a[16]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[16]})])]),_:1},8,["title","visible","width"]),we.value?(l.openBlock(),l.createBlock(Re.ssFilePreview,{key:1,fileDataList:C.value,onDestroy:Za},null,8,["fileDataList"])):l.createCommentVNode("",!0),qe.value?(l.openBlock(),l.createBlock(Dl.ssDialog,{key:2,visible:qe.value,onBeforeDestroy:gr,style:{height:"80vh",width:"80vw"},"body-class":"three-dialog-body","footer-class":"three-dialog-footer"},{default:l.withCtx(()=>[l.createVNode(Ve.ThreeViewerHost,{"file-urls":cl.value,isThreeScene:Oe.value,isSelfWindow:!0,threeData:rl.value},null,8,["file-urls","isThreeScene","threeData"])]),_:1},8,["visible"])):l.createCommentVNode("",!0),l.createVNode(Dl.ssDialog,{visible:e.componentVisible,onBeforeDestroy:a[10]||(a[10]=v=>e.componentVisible=!1),width:$l.value,style:{height:"70vh"}},{default:l.withCtx(()=>[l.createVNode(f,{dialogItem:Ol.value},null,8,["dialogItem"])]),_:1},8,["visible","width"]),l.createVNode(Dl.ssDialog,{title:De.title,visible:De.show,width:De.width,onBeforeDestroy:ir},{default:l.withCtx(()=>[l.createElementVNode("div",Sn,[l.createVNode(Re.ssForm,{rowContents:De==null?void 0:De.contents,formRules:De==null?void 0:De.formRules,showOperator:!1,buttonValue:De.buttonValue,isEdit:Nl.value,isStartJustify:!1,isEnableWrap:!1,onOnButtonClick:ur},null,8,["rowContents","formRules","buttonValue","isEdit"])])]),_:1},8,["title","visible","width"])])}}},Dn=Pl._export_sfc(Cn,[["__scopeId","data-v-9fdf12f8"]]);exports.formGetOptions=Ql;exports.getSelectRow=Yl;exports.ssTable=Dn;exports.useFormComp=xa;exports.useFormToTableComp=ma;exports.useUnit=ka;