ss-component-new 1.2.232 → 1.2.233

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 (87) hide show
  1. package/dist/{MTLLoader-C3xQp_vJ.js → MTLLoader-DFmlwzU3.js} +1 -1
  2. package/dist/{MTLLoader-Dk-MlPss.cjs → MTLLoader-Dg86upjK.cjs} +1 -1
  3. package/dist/{OrbitControls-BnbRrGfp.js → OrbitControls-BXYb3_Wa.js} +1 -1
  4. package/dist/{OrbitControls-BOp7rIAh.cjs → OrbitControls-DAhFMmy7.cjs} +1 -1
  5. package/dist/{URDFLoader-CSyotBHA.js → URDFLoader-DzkYZoIc.js} +2 -2
  6. package/dist/{URDFLoader-DNvmeMBm.cjs → URDFLoader-Gcme0UFg.cjs} +1 -1
  7. package/dist/{animationData-CAQjhH7u.cjs → animationData-BxcjkWxj.cjs} +1 -1
  8. package/dist/{animationData-UswWiNrs.js → animationData-DkNnqZXc.js} +1 -1
  9. package/dist/{array-TtWDWrDw.cjs → array-ByF_XgIy.cjs} +1 -1
  10. package/dist/{array-B6rjrXeo.js → array-VJrnCffW.js} +1 -1
  11. package/dist/{iconfont-DlRa38zY.cjs → iconfont-BeXGhE0A.cjs} +1 -1
  12. package/dist/{iconfont-D05r7RjP.js → iconfont-GwBDM4P-.js} +2 -2
  13. package/dist/{index-B2ZoOHys.js → index-5VzXINKa.js} +3 -3
  14. package/dist/{index-BWQsJVZu.js → index-8jMRAO6m.js} +5 -5
  15. package/dist/{index-6jEXQDCu.js → index-B5qOPVlo.js} +1 -1
  16. package/dist/{index-CaCc1PMv.cjs → index-BAUsMLAh.cjs} +1 -1
  17. package/dist/{index-K5yAn3DM.js → index-BDwelfih.js} +1 -1
  18. package/dist/{index-Dlmo2bzh.cjs → index-BNCWQG3z.cjs} +1 -1
  19. package/dist/{index-Ct0pyThR.js → index-BNyhLyvx.js} +1 -1
  20. package/dist/{index-BSAGUVzl.cjs → index-Bfd2Vvap.cjs} +1 -1
  21. package/dist/{index-BfyfYMgU.js → index-Bl-OXFAJ.js} +4 -4
  22. package/dist/{index-RzsDXFU5.cjs → index-Bulpr4-m.cjs} +1 -1
  23. package/dist/{index-BaxEKenW.js → index-C0H9xNgM.js} +1 -1
  24. package/dist/{index-CP3Q8Vwz.cjs → index-C0r2mQkF.cjs} +1 -1
  25. package/dist/{index--eG1HuEk.js → index-C1wdEbD-.js} +4 -4
  26. package/dist/{index-B5xqjn4H.cjs → index-C5Y11t9J.cjs} +1 -1
  27. package/dist/{index-BDfjc4pg.js → index-C6A8VCcn.js} +1 -1
  28. package/dist/{index-DhNbyjlZ.cjs → index-CAclztw7.cjs} +1 -1
  29. package/dist/{index-DOXFyGxN.js → index-CCYpPNcp.js} +1 -1
  30. package/dist/{index-M3Uy2ESr.cjs → index-CTqZlnyv.cjs} +1 -1
  31. package/dist/{index-B8v18Ew-.js → index-CV1aGQ53.js} +1 -1
  32. package/dist/{index-Cn6b-ZJb.js → index-CYw8cTK2.js} +4 -4
  33. package/dist/{index-nyXDmWkk.cjs → index-CgW0z-iB.cjs} +1 -1
  34. package/dist/{index-NNuPPUyS.cjs → index-ClBKQUzO.cjs} +1 -1
  35. package/dist/{index-BnBXAVZg.js → index-Cw8mXG1v.js} +3 -3
  36. package/dist/{index-DZ6QQf1F.cjs → index-DBj1VTrx.cjs} +1 -1
  37. package/dist/{index-DBe7pvvC.js → index-DDFkG6h6.js} +8 -8
  38. package/dist/{index-La79nsoq.cjs → index-DDG4LYuA.cjs} +1 -1
  39. package/dist/{index-C4nuCUKA.js → index-DES6EMQI.js} +2 -2
  40. package/dist/{index-Bh3Dxpbs.cjs → index-DjA4WahR.cjs} +1 -1
  41. package/dist/{index-tATIUpSX.cjs → index-DkKX_obc.cjs} +1 -1
  42. package/dist/{index-Cv7afxtj.cjs → index-DmAak3cB.cjs} +1 -1
  43. package/dist/{index-HfkvgdGf.cjs → index-DoCpY7PD.cjs} +1 -1
  44. package/dist/{index-B064aY3c.cjs → index-Dq-QTXZW.cjs} +1 -1
  45. package/dist/{index-CRa7ul-H.cjs → index-DtIw-cQA.cjs} +1 -1
  46. package/dist/{index-C93uGAcW.js → index-Du6m3eDM.js} +1 -1
  47. package/dist/{index-Do0IEThs.js → index-Dw543awg.js} +1 -1
  48. package/dist/{index-CCb2IsOh.js → index-DwWzpRNP.js} +1 -1
  49. package/dist/{index-4wmnBS8T.js → index-JwmGwJwl.js} +2 -2
  50. package/dist/{index-BuGQO6fe.cjs → index-Y4lmOoY_.cjs} +1 -1
  51. package/dist/{index-D5q83XXJ.js → index-ZuzPyc7Y.js} +16 -16
  52. package/dist/{index-C5XK7IH1.js → index-cK3MryRN.js} +1 -1
  53. package/dist/{index-CjUlZM1I.cjs → index-joILVedy.cjs} +1 -1
  54. package/dist/{index-Ofyhj_ri.js → index-wPFvJWqr.js} +7 -7
  55. package/dist/{index-BJsTBv81.cjs → index-x7CrVTb8.cjs} +1 -1
  56. package/dist/{index-taTFobG0.cjs → index-yYIitsIH.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-9pTg9CEf.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BjLvDgBT.js} +6 -6
  58. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DQquN7Pt.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CQaB3IQv.cjs} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cogr4AVk.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B9srMPKb.js} +5120 -5118
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-r5pjOM-O.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C-Z-yYuH.cjs} +158 -158
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_3d3811e8_lang-CdWS_tx_.js → index.vue_vue_type_style_index_0_scoped_3d3811e8_lang-BK_Svg48.js} +4 -4
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_3d3811e8_lang-C6Uj52bB.cjs → index.vue_vue_type_style_index_0_scoped_3d3811e8_lang-vsdezytw.cjs} +1 -1
  63. package/dist/{index.vue_vue_type_style_index_1_lang-90ExziY1.cjs → index.vue_vue_type_style_index_1_lang-DkCwPTKt.cjs} +1 -1
  64. package/dist/{index.vue_vue_type_style_index_1_lang-Dq2o3oBR.js → index.vue_vue_type_style_index_1_lang-DpVhYcxo.js} +3 -3
  65. package/dist/{main-DOjkDfvY.cjs → main-CXj4XB41.cjs} +1 -1
  66. package/dist/{main-1JkcLvHt.js → main-DYyjODd4.js} +3 -3
  67. package/dist/ss-component.cjs +1 -1
  68. package/dist/ss-component.js +9 -9
  69. package/dist/ss-component2.cjs +1 -1
  70. package/dist/ss-component2.js +10 -10
  71. package/dist/{threeModel-BIvFMjeE.cjs → threeModel-BM2_oBay.cjs} +1 -1
  72. package/dist/{threeModel-tXPE6Ot9.js → threeModel-CrJwO5O6.js} +4 -4
  73. package/dist/{threePreview-Bhh2zRHt.js → threePreview-CKrx32qh.js} +3 -3
  74. package/dist/{threePreview-CLpIdYu2.cjs → threePreview-qeQiWPpC.cjs} +1 -1
  75. package/dist/{threeSceneView-oww3pt3m.js → threeSceneView-BaIDEnnr.js} +8 -8
  76. package/dist/{threeSceneView-g8BSZvdw.cjs → threeSceneView-takCqm8_.cjs} +1 -1
  77. package/dist/{threeSceneViewForCPMPIP-DUXZLgeo.js → threeSceneViewForCPMPIP-8vLzpEoJ.js} +7 -7
  78. package/dist/{threeSceneViewForCPMPIP-BX7RvwA3.cjs → threeSceneViewForCPMPIP-DWUrSXVU.cjs} +1 -1
  79. package/dist/{threeTrackPathView-DerCUycx.cjs → threeTrackPathView-B86w9mLO.cjs} +1 -1
  80. package/dist/{threeTrackPathView-CJRNBNt5.js → threeTrackPathView-Bgw4wfPf.js} +3 -3
  81. package/dist/{threeViewerHost-DEDhdk2E.cjs → threeViewerHost-BjJ4CzrA.cjs} +1 -1
  82. package/dist/{threeViewerHost-CSKYiso6.js → threeViewerHost-CaeheL5H.js} +2 -2
  83. package/dist/{urdfTree-D8NxjBg1.cjs → urdfTree-Bv2qbbfC.cjs} +1 -1
  84. package/dist/{urdfTree--fZfiIPN.js → urdfTree-dlxsPsTa.js} +1 -1
  85. package/dist/{workpieceTreePanel-Ddc1zyuZ.js → workpieceTreePanel-CPWsDEnC.js} +4 -4
  86. package/dist/{workpieceTreePanel-CuFyeGwc.cjs → workpieceTreePanel-DyzXsGKC.cjs} +1 -1
  87. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";const l=require("vue"),D=require("./index-DOItJqcJ.cjs"),ce=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-r5pjOM-O.cjs"),bl=require("./index-Bh3Dxpbs.cjs"),Sr=require("./threeViewerHost-DEDhdk2E.cjs"),Ta=require("./index-CXC0u8pm.cjs"),Qo=require("./index.vue_vue_type_style_index_1_lang-90ExziY1.cjs"),Oa=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Zl=require("./index-B5xqjn4H.cjs");require("./index-KaxOq1_-.cjs");const Cr=require("./isString-Do5yyRUw.cjs"),wa=W=>W.match(/\((.*)\)/)[1],xr={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200}},setup(W){const te=W,oe=l.ref(null),z=l.ref(!1),V=l.ref(null);return l.watch(()=>te==null?void 0:te.isVisible,()=>{z.value=te==null?void 0:te.isVisible},{deep:!0,immediate:!0}),l.watch(()=>V.value,()=>{l.nextTick(()=>{var s,de;(de=(s=oe.value)==null?void 0:s.updatePopper)==null||de.call(s)})},{deep:!0,immediate:!0}),(s,de)=>{const we=l.resolveComponent("el-popover");return l.openBlock(),l.createBlock(we,{visible:z.value,title:te==null?void 0:te.title,placement:te==null?void 0:te.placement,width:te==null?void 0:te.width,ref_key:"popOverRef",ref:oe},{reference:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"reference",{ref_key:"referenceRef",ref:V})])]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"content")])]),_:3},8,["visible","title","placement","width"])}}},Xo={key:0,class:"extra-button-content"},Yo={class:"table-operator-wrap"},Zo={key:0,class:"extra-button-filter"},Io={class:"form-content-value"},en={key:1,class:"extra-header"},ln={class:"drop-menu",style:{width:"120px"}},an={key:0},rn={key:1},on={key:1,class:"extra-button-content tabs-button-wrapper"},nn={class:"table-operator-wrap"},sn={class:"extra-button-filter"},un={class:"form-content-value"},cn={key:0,class:"extra-header"},tn={class:"drop-menu",style:{width:"120px"}},dn={key:0},pn={key:1},fn={__name:"header",props:{pageLayout:{type:String,default:"vertical"},lockingPage:Boolean,level:{type:Number,default:1},compName:{type:String,default:"表格名称",required:!1},filterShow:{type:Boolean,default:!1},isDevMode:Boolean,selectNums:Number,dataNums:Number,filterValues:Array,buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter","getImportData"],setup(W,{emit:te}){const oe=te,z=W,V=l.ref(""),s=l.ref(!1),de=l.ref([]),we=l.ref([{label:"取消",background:"#999999"},{label:"清空",background:"#999999"},{label:"确认"}]),Je=[{label:"新增",icon:"Plus"},{label:"导入",icon:"import"},{label:"导出",icon:"export"},{label:"OCR识别",icon:"ocr"}],Be=fe=>{const $e=fe.raw;if(!$e)return;const He=new FileReader;He.onload=he=>{try{const Xe=new Uint8Array(he.target.result),Qe=ce.readSync(Xe,{type:"array"}),Rl=Qe.SheetNames[0],ne=Qe.Sheets[Rl],Q=ce.utils.decode_range(ne["!ref"]).e.c+1,X=new Array(Q).fill(""),E=[];for(const H in ne){if(H[0]==="!")continue;const{r:be,c:Ke}=ce.utils.decode_cell(H);let Ie=ne[H].v;if(ne[H].t==="n"&&Ie>0&&Ie<1e6&&(Ie=new Date((Ie-25569)*86400*1e3).toISOString().split("T")[0]),(Ie==null||Ie==="")&&(Ie=""),be===0)X[Ke]=Ie;else{if(!E[be-1]){E[be-1]={};for(let Ol=0;Ol<Q;Ol++)E[be-1][`col_${Ol}`]=""}E[be-1][`col_${Ke}`]=Ie}}for(let H=0;H<Q;H++)X[H]===void 0&&(X[H]="");const qe=E==null?void 0:E[0];if(!(qe!=null&&qe.hasOwnProperty("col_0")))return D.ElMessage.error("导入的数据列不匹配,请检查是否错位");oe("getImportData",X,E)}catch(Xe){throw D.ElMessage.error(Xe.message),new Error(Xe.message)}},He.readAsArrayBuffer($e)},kl=fe=>{var He;const $e=(He=de.value)==null?void 0:He.reduce((he,Xe,Qe)=>(Qe===0?he[Xe.label]=fe:he[Xe.label]=Xe==null?void 0:Xe.value,he),{});oe("filter",$e,fe,!0)},Bl=fe=>{oe("buttonClick",fe)},$l=fe=>{var $e,He;de.value=(He=($e=ce.getColumnChild(D.cloneDeep(fe)))==null?void 0:$e.filter(he=>(he==null?void 0:he.label)!==""&&(he==null?void 0:he.label)!=="操作"))==null?void 0:He.map(he=>({label:(he==null?void 0:he.label)??"",value:"",name:(he==null?void 0:he.label)??"",isFormColHidden:he==null?void 0:he.isTableColHidden,width:2}))},Ml=l.ref(!1),ql=fe=>{var $e;if((fe==null?void 0:fe.buttonName)==="确认"&&(oe("filter",fe==null?void 0:fe.content),Ml.value=(fe==null?void 0:fe.content)&&Object.values(fe==null?void 0:fe.content).length>0),(fe==null?void 0:fe.buttonName)==="清空"){const He=D.cloneDeep(fe==null?void 0:fe.content);for(const he in He)He[he]="";de.value=($e=de.value)==null?void 0:$e.map(he=>({...he,value:""})),oe("filter",He),Ml.value=!1}s.value=!1},Gl=()=>{var $e,He;de.value=($e=de.value)==null?void 0:$e.map(he=>({...he,value:""}));const fe=(He=de.value)==null?void 0:He.reduce((he,Xe)=>(he[Xe.label]=Xe.value,he),{});oe("filter",fe)};return l.onMounted(()=>{$l(z.columns)}),l.watch(()=>z.columns,()=>{$l(z.columns)},{deep:!0,immediate:!0}),(fe,$e)=>{var ne,Ue,Q,X;const He=l.resolveComponent("el-icon"),he=l.resolveComponent("svg-icon"),Xe=l.resolveComponent("el-input"),Qe=l.resolveComponent("el-button"),Rl=l.resolveComponent("el-upload");return W.pageLayout==="vertical"?(l.openBlock(),l.createElementBlock("div",Xo,[l.createElementVNode("div",{class:l.normalizeClass(W.compName?"table-name-wrap":""),style:l.normalizeStyle({background:(z==null?void 0:z.level)>1?"transparent":"var(--ssgroup-background)",paddingLeft:((z==null?void 0:z.level)-1)*12+"px",fontWeight:600-((z==null?void 0:z.level)-1)*100>=400?600-((z==null?void 0:z.level)-1)*100:400,fontSize:17-(z==null?void 0:z.level)>=14?17-(z==null?void 0:z.level)+"px":"14px"})},l.toDisplayString(W.compName),7),l.createElementVNode("div",Yo,[z!=null&&z.filterShow?(l.openBlock(),l.createElementBlock("div",Zo,[l.createVNode(xr,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var E,qe,H,be;return[l.createVNode(Xe,{modelValue:V.value,"onUpdate:modelValue":$e[1]||($e[1]=Ke=>V.value=Ke),style:{"min-width":"80px"},placeholder:Ml.value?(H=(qe=(E=W.filterValues)==null?void 0:E.filter(Ke=>Ke))==null?void 0:qe.slice(0,3))==null?void 0:H.join("/"):"搜索","prefix-icon":l.unref(D.search_default),clearable:"",onInput:kl,disabled:((be=de.value)==null?void 0:be.length)===0},{suffix:l.withCtx(()=>{var Ke,Ie;return[!V.value&&((Ie=(Ke=W.filterValues)==null?void 0:Ke.filter(Ol=>Ol))!=null&&Ie.join("/"))?(l.openBlock(),l.createBlock(He,{key:0,style:{cursor:"pointer"},onClick:Gl},{default:l.withCtx(()=>[l.createVNode(l.unref(D.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:$e[0]||($e[0]=Ke=>s.value=!s.value)},[l.createVNode(he,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",Io,[(l.openBlock(),l.createBlock(bl.ssForm,{rowContents:de.value,buttonValue:we.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:we.value,isStartJustify:!1,onOnButtonClick:ql},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])])):l.createCommentVNode("",!0),W.buttons&&((ne=W.buttons)==null?void 0:ne.length)>0?(l.openBlock(),l.createElementBlock("div",en,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((Ue=W.buttons)==null?void 0:Ue.filter(E=>W.isDevMode||(E==null?void 0:E.label)!=="修改模板"),(E,qe)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:qe},[(E==null?void 0:E.type)==="upload"?(l.openBlock(),l.createBlock(Rl,{key:0,class:"upload-button-wrap","on-change":Be,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1,disabled:!!W.lockingPage},{default:l.withCtx(()=>[l.createVNode(Qe,{disabled:!!W.lockingPage,style:l.normalizeStyle({background:(E==null?void 0:E.background)??"var(--ssbutton-theme-bg)",color:(E==null?void 0:E.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1032,["disabled","style"])]),_:2},1032,["disabled"])):l.createCommentVNode("",!0),(E==null?void 0:E.type)==="popover"?(l.openBlock(),l.createBlock(bl._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(E==null?void 0:E.type)==="popover"?(l.openBlock(),l.createBlock(Qe,{key:0,disabled:!!W.lockingPage,style:l.normalizeStyle({background:(E==null?void 0:E.background)??"var(--ssbutton-theme-bg)",color:(E==null?void 0:E.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1032,["disabled","style"])):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",ln,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(E==null?void 0:E.contents,H=>(l.openBlock(),l.createBlock(Qe,{key:H==null?void 0:H.label,disabled:!!W.lockingPage,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:be=>Bl(H==null?void 0:H.label)},{default:l.withCtx(()=>{var be,Ke;return[l.createTextVNode(l.toDisplayString(H==null?void 0:H.label),1),(be=H==null?void 0:H.label)!=null&&be.includes("选中")?(l.openBlock(),l.createElementBlock("span",an,"("+l.toDisplayString(W.selectNums)+")",1)):l.createCommentVNode("",!0),(Ke=H==null?void 0:H.label)!=null&&Ke.includes("全部")?(l.openBlock(),l.createElementBlock("span",rn,"("+l.toDisplayString(W.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["disabled","onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),E!=null&&E.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Qe,{key:2,id:"themeButton",disabled:!!W.lockingPage,style:l.normalizeStyle({background:(E==null?void 0:E.background)??"var(--ssbutton-theme-bg)",color:(E==null?void 0:E.color)??"var(--ssbutton-theme-color)"}),onClick:H=>Bl(E==null?void 0:E.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1032,["disabled","style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])])):(l.openBlock(),l.createElementBlock("div",on,[l.createElementVNode("div",nn,[l.createElementVNode("div",sn,[l.createVNode(xr,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var E,qe,H,be;return[l.createVNode(Xe,{modelValue:V.value,"onUpdate:modelValue":$e[3]||($e[3]=Ke=>V.value=Ke),style:{"min-width":"80px"},placeholder:Ml.value?(H=(qe=(E=W.filterValues)==null?void 0:E.filter(Ke=>Ke))==null?void 0:qe.slice(0,3))==null?void 0:H.join("/"):"搜索","prefix-icon":l.unref(D.search_default),clearable:"",onInput:kl,disabled:((be=de.value)==null?void 0:be.length)===0},{suffix:l.withCtx(()=>{var Ke,Ie;return[!V.value&&((Ie=(Ke=W.filterValues)==null?void 0:Ke.filter(Ol=>Ol))!=null&&Ie.join("/"))?(l.openBlock(),l.createBlock(He,{key:0,style:{cursor:"pointer"},onClick:Gl},{default:l.withCtx(()=>[l.createVNode(l.unref(D.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:$e[2]||($e[2]=Ke=>s.value=!s.value)},[l.createVNode(he,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",un,[(l.openBlock(),l.createBlock(bl.ssForm,{rowContents:de.value,buttonValue:we.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:we.value,isStartJustify:!1,onOnButtonClick:ql},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),W.buttons&&((Q=W.buttons)==null?void 0:Q.length)>0?(l.openBlock(),l.createElementBlock("div",cn,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((X=W.buttons)==null?void 0:X.filter(E=>W.isDevMode||(E==null?void 0:E.label)!=="修改模板"),(E,qe)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:qe},[(E==null?void 0:E.type)==="upload"?(l.openBlock(),l.createBlock(Rl,{key:0,class:"upload-button-wrap","on-change":Be,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1},{default:l.withCtx(()=>[l.createVNode(Qe,{style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var H;return[l.createVNode(he,{name:(H=Je==null?void 0:Je.find(be=>(be==null?void 0:be.label)===(E==null?void 0:E.label)))==null?void 0:H.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1024)]),_:2},1024)):l.createCommentVNode("",!0),(E==null?void 0:E.type)==="popover"?(l.openBlock(),l.createBlock(bl._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(E==null?void 0:E.type)==="popover"?(l.openBlock(),l.createBlock(Qe,{key:0,style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var H;return[l.createVNode(he,{name:(H=Je==null?void 0:Je.find(be=>(be==null?void 0:be.label)===(E==null?void 0:E.label)))==null?void 0:H.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1024)):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",tn,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(E==null?void 0:E.contents,H=>(l.openBlock(),l.createBlock(Qe,{key:H==null?void 0:H.label,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:be=>Bl(H==null?void 0:H.label)},{default:l.withCtx(()=>{var be,Ke;return[l.createTextVNode(l.toDisplayString(H==null?void 0:H.label),1),(be=H==null?void 0:H.label)!=null&&be.includes("选中")?(l.openBlock(),l.createElementBlock("span",dn,"("+l.toDisplayString(W.selectNums)+")",1)):l.createCommentVNode("",!0),(Ke=H==null?void 0:H.label)!=null&&Ke.includes("全部")?(l.openBlock(),l.createElementBlock("span",pn,"("+l.toDisplayString(W.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),E!=null&&E.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Qe,{key:2,id:"themeButton",style:l.normalizeStyle({background:"transparent",color:(E==null?void 0:E.label)==="新增"?"var(--ssbutton-theme-bg)":"#666666"}),onClick:H=>Bl(E==null?void 0:E.label)},{icon:l.withCtx(()=>{var H;return[l.createVNode(he,{name:(H=Je==null?void 0:Je.find(be=>(be==null?void 0:be.label)===(E==null?void 0:E.label)))==null?void 0:H.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1032,["style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])]))}}},hn=Oa._export_sfc(fn,[["__scopeId","data-v-03b0d8fa"]]),yn=l.defineComponent({__name:"batch",props:{lockingPage:Boolean,buttons:{type:Array,default:()=>[]},selectTableItems:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick"],setup(W,{emit:te}){const oe=W,z=te,V=de=>{z("buttonClick",de)},s=de=>{var we;return de!=null&&de.includes("删除")?((we=oe.selectTableItems)==null?void 0:we.length)>0?"warning-active-type":"warning-type":"default-type"};return(de,we)=>{const Je=l.resolveComponent("el-button");return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(W.buttons,Be=>(l.openBlock(),l.createBlock(Je,{key:Be==null?void 0:Be.label,disabled:!!W.lockingPage,class:l.normalizeClass(s(Be==null?void 0:Be.label)),onClick:kl=>V(Be==null?void 0:Be.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(Be==null?void 0:Be.label),1)]),_:2},1032,["disabled","class","onClick"]))),128))])}}}),vn=Oa._export_sfc(yn,[["__scopeId","data-v-70b12973"]]),_r=D.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(W){this.selectArray=W},setSelectString(W){this.selectString=W}}}),gn={class:"calculator-content"},bn={class:"calculator-child"},kn={class:"calculator-child"},mn=l.defineComponent({__name:"calculator",setup(W){const te=l.ref(),oe=l.ref();return l.onMounted(()=>{te.value=[{type:"Upload",label:"输入",name:"input"}],oe.value=[{type:"Upload",label:"输出",name:"output"}]}),(z,V)=>(l.openBlock(),l.createElementBlock("div",gn,[l.createElementVNode("div",bn,[l.createVNode(bl.ssForm,{rowContents:te.value,isRowFlex:!0},null,8,["rowContents"])]),l.createElementVNode("div",kn,[l.createVNode(bl.ssForm,{rowContents:oe.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),Sn=Oa._export_sfc(mn,[["__scopeId","data-v-73db0fe7"]]),Ha=(W,te)=>{let oe=W,z=te;return Array.isArray(oe)&&(oe=oe==null?void 0:oe.map((V,s)=>{if(Array.isArray(V)){let de={};return V=V==null?void 0:V.forEach((we,Je)=>{var Be;(Be=z==null?void 0:z[Je])!=null&&Be.prop?de[z[Je].prop]=we:Array.isArray(we)&&(de.children=Ha(we,z))}),Object.assign(de,{id:s})}else return V})),oe},Nr=(W,te,oe)=>{let z=W,V=te;return z=z==null?void 0:z.map((s,de)=>{var we,Je;return!Array.isArray(s)||!((we=V==null?void 0:V[de])!=null&&we.label)&&!oe||(s.unshift(((Je=V==null?void 0:V[de])==null?void 0:Je.label)??""),s.some(Be=>Array.isArray(Be))&&(s=s==null?void 0:s.map(Be=>{var kl;return Array.isArray(Be)&&(Be=Nr(Be,(kl=V==null?void 0:V[de])==null?void 0:kl.children,oe)),Be}))),s}),z},Cn=(W,te,oe)=>{if(te==="")return W==null?void 0:W.filter(z=>(z==null?void 0:z.id)!==oe);{const z=te.split("-");return xn(W,z,oe)}},xn=(W,te,oe)=>{let z=W,V=te;return(V==null?void 0:V.length)===0?z=z==null?void 0:z.filter(s=>s.id!==oe):z=z==null?void 0:z.map(s=>(s.id.toString()===(V==null?void 0:V[0])&&(V==null||V.shift(),s=Dr(s,V,oe)),s)),z},Dr=(W,te,oe)=>{var s,de;let z=W,V=te;return(V==null?void 0:V.length)===0?z.children=(s=z.children)==null?void 0:s.filter(we=>we.id!==oe):z.children=(de=z.children)==null?void 0:de.map(we=>(we.id.toString()===(V==null?void 0:V[0])&&(V==null||V.shift(),we=Dr(we,V,oe)),we)),z},_n=(W,te,oe)=>{if(te==="")return oe;{const z=te.split("-");return Nn(W,z,oe)}},Nn=(W,te,oe)=>{let z=W,V=te;return(V==null?void 0:V.length)===0?z=oe:z=z==null?void 0:z.map(s=>(s.id.toString()===(V==null?void 0:V[0])&&(V==null||V.shift(),s=Ar(s,V,oe)),s)),z},Ar=(W,te,oe)=>{var s;let z=W,V=te;return(V==null?void 0:V.length)===0?z.children=oe:z.children=(s=z.children)==null?void 0:s.map(de=>(de.id.toString()===(V==null?void 0:V[0])&&(V==null||V.shift(),de=Ar(de,V,oe)),de)),z},Er=D.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(W){this.objUrl=W},setBlobUrls(W){this.blobUrls=W}}}),Ba=async(W,te)=>{var de,we,Je,Be,kl,Bl,$l,Ml,ql,Gl,fe,$e,He,he,Xe,Qe,Rl;let oe=(we=(de=D.cloneDeep(W))==null?void 0:de.optionUrl)==null?void 0:we.menuSelect,z=[];oe==null||oe.forEach(ne=>{});let V="",s=await ce.menuToParent(oe);if(s==null||s.forEach(ne=>{var Ue,Q,X,E;(ne==null?void 0:ne.name)===(((E=(X=(Q=(Ue=D.cloneDeep(W))==null?void 0:Ue.optionUrl)==null?void 0:Q.groupSelect)==null?void 0:X[0])==null?void 0:E.replaceAll("'",""))??"")&&(V=ne==null?void 0:ne.id)}),te){V=te;const ne=await D.getInsofDataApi({id:V}),Ue=(Bl=(kl=(Be=(Je=ne==null?void 0:ne.data)==null?void 0:Je.result)==null?void 0:Be[0])==null?void 0:kl.key)==null?void 0:Bl.pageKey;s=await ce.getItemData(Ue,sessionStorage.getItem("systemKey"),"")}if(V!==""){let ne;te?ne=($l=s==null?void 0:s.find(X=>(X==null?void 0:X.id)===te))==null?void 0:$l.compData:ne=(Ml=s==null?void 0:s.find(X=>{var E,qe,H,be;return(X==null?void 0:X.name)===(((qe=(E=W==null?void 0:W.groupSelect)==null?void 0:E.split(":"))==null?void 0:qe[0])||((be=(H=W==null?void 0:W.optionUrl)==null?void 0:H.groupSelect)==null?void 0:be[0]))}))==null?void 0:Ml.compData;let Ue=(Gl=(ql=ne==null?void 0:ne.find(X=>(X==null?void 0:X.key)==="header"))==null?void 0:ql.contents)==null?void 0:Gl.map(X=>X==null?void 0:X.label);($e=(fe=ne==null?void 0:ne.find(X=>(X==null?void 0:X.key)==="header"))==null?void 0:fe.contents)!=null&&$e.every(X=>Array.isArray(X))&&(Ue=(Xe=ce.getColumnChild((he=(He=ne==null?void 0:ne.find(X=>(X==null?void 0:X.key)==="header"))==null?void 0:He.contents)==null?void 0:he[0]))==null?void 0:Xe.map(X=>X==null?void 0:X.prop));let Q=(Rl=(Qe=ne==null?void 0:ne.find(X=>(X==null?void 0:X.key)==="tableContents"))==null?void 0:Qe.contents)==null?void 0:Rl.map(X=>{if(Array.isArray(X))X=X==null?void 0:X.filter(E=>!(E!=null&&E.id));else{let E={};for(let qe in X)qe!=="id"&&(E[qe]=X==null?void 0:X[qe]);X=E}return X});Q==null||Q.forEach(X=>{Array.isArray(X)?z.push(ce.getValueToObjectValue(X,Ue)):z.push(X)})}return z},Dn={class:"table-content"},An={class:"menu-config-wrap"},En=["onClick"],Tn={key:0,class:"viewport-wrap"},wn=["onClick"],Bn={title:"选择显示列信息"},On={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"],Ln={class:"col-operate-wrap"},jn={key:0,class:"col-operate-radio-wrapper"},Pn={title:"拖拽排序列",style:{cursor:"move",color:"grey",position:"absolute",right:"15px"}},$n={key:0,style:{display:"flex","justify-content":"center","align-items":"center"}},Mn={class:"pop-view"},Rn={class:"pop-wrapper"},Fn={class:"file-list-pop"},Kn=["title","onClick"],zn=["onClick"],Vn=["onClick"],qn={class:"form-content"},Jn={key:0,class:"dialog-footer"},Wn={class:"dialog-footer"},Gn={"element-loading-text":"正在识别中 请稍后"},Hn={style:{display:"flex","justify-content":"space-between",width:"100%","align-items":"center"}},Qn=["title"],Xn={class:"icon",style:{display:"flex",gap:"8px"}},Yn={class:"dialog-footer"},Zn={class:"ocr-preview-content"},In={class:"ocr-preview-tip"},ei={class:"ocr-preview-table"},li={style:{display:"flex","align-items":"center",gap:"8px"}},ai={class:"dialog-footer"},ri={class:"form-content"},oi={__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(W,{emit:te}){var mr;const oe=l.ref([]),z=Er(D.pinia),V=l.ref(null),s=W,de=l.ref(s==null?void 0:s.allowSelect),we=l.ref((mr=s==null?void 0:s.config)==null?void 0:mr.showIndex),Je=l.ref(),Be=l.ref(!0),kl=l.ref(!1),Bl={sortable:"switch",filterable:"switch",showSummary:"switch",operable:"switch",fixed:"radio"},$l=l.ref([{label:"排序",value:"sortable",checked:!1},{label:"合计",value:"showSummary",checked:!1},{type:"radio",label:"固定",value:"fixed",checked:"",options:[{label:"无",value:!1},{label:"左",value:"left"},{label:"右",value:"right"}]}]),Ml=ce.useOriginalState(D.pinia);let ql="$R";const{originalPath:Gl}=D.storeToRefs(Ml),fe=Gl.value,$e=l.ref(!1),He=l.ref(!1),he=l.ref(!1),Xe=l.ref(!0),Qe=l.ref([]),Rl=l.reactive({column:{},status:!1,text:"合计"}),ne=l.reactive({currentPage:1,pageSize:10,total:0,pageSizes:[5,10,20,50,100]}),Ue=te,Q=l.ref([]),X=l.ref([]),E=l.reactive({prop:"",order:null}),qe=l.ref([]),H=l.ref(!1),be=l.ref(!1),Ke=l.ref(null),{isUseBackdrop:Ie,initTrackFileType:Ol,getFileExtension:Qa,setData:Ua,getFileInfo:Xa,getFilesInfo:Tr}=Sr.useThreeSystem(),La=l.ref([]),Hl=l.ref(!1),Il=l.ref(),sl=Ta.useMenuState(),{importLoading:ii,activeMenuPath:Me,contentLoading:si,linkMenuInfo:wr}=D.storeToRefs(sl),Br=ce.useTableComp(D.pinia),Ye=Ta.useModelComp(D.pinia),{extraContents:ze,cacheUpdatingData:ia,tableViewContents:sa,tableLoading:ui,pageMapState:ea,lockingPage:ka}=D.storeToRefs(Ye),Y=l.ref([]),Ul=l.ref([]),Cl=l.ref(new Map);l.ref(!1);const Ll=l.ref("");l.ref();const ma=l.ref(!0),la=l.ref(0),Ya=l.ref(!0),ml=l.ref(""),jl=l.ref(!1),Or=l.ref({label:"查看三维模型"}),Sa=l.ref(!1),ja=l.ref(),Dl=l.ref([]),Jl=l.ref([]),Ca=l.ref(!1),ua=l.ref([]),xl=l.ref([]),_l=l.ref([]),ke=l.ref([]),xa=l.ref(!1),Ql=l.ref(!1),Fl=l.ref([]),Ur=l.ref(null),_a=l.ref(!1),Na=l.ref([]),Za=l.ref(""),Pa=l.ref(""),$a=l.ref(!1),aa=l.ref([]),Ma=l.ref([]),Ra=l.ref([]),Fa=l.ref(null),Kl=l.ref([]),ca=Qo.createOCRService(),Lr=l.computed(()=>ca.getConfig()),Al=l.ref(),hl=l.ref(),jr=_r(D.pinia),ta=l.ref(),Ka=l.ref(0),Pr=ce.useUnit(D.pinia),{selectIndex:$r,selectMenu:da,selectTitle:ci}=D.storeToRefs(Pr),{selectString:Xl}=D.storeToRefs(jr),Mr=D.useLoginState(D.pinia),{loginUserInfo:ra}=D.storeToRefs(Mr),Rr=l.ref(720),El=l.ref(!1),Da=l.ref(!1),Tl=l.ref([]),wl=l.ref(),pa=l.ref(!0),Ia=l.ref(!0),Yl=l.ref([]),Fr=l.inject("contentRef");l.provide("contentRef",Fr),l.watch(()=>{var e;return(e=Y.value)==null?void 0:e.length},e=>{ne.total=e}),l.watch(()=>sa.value,async()=>{var c,t,i,p,k,x,v,N,U,P,$,S,M,R,L,_,w,u;if(((c=sa.value)==null?void 0:c.length)===0||!((t=s==null?void 0:s.itemData)!=null&&t.find(y=>(y==null?void 0:y.key)==="columnPath"))||!((i=s==null?void 0:s.itemData)!=null&&i.find(y=>(y==null?void 0:y.key)==="pageColumn")))return;let e=(U=(N=(v=(x=(k=(p=s==null?void 0:s.itemData)==null?void 0:p.find(y=>(y==null?void 0:y.key)==="pageColumn"))==null?void 0:k.contents)==null?void 0:x.split("["))==null?void 0:v[1])==null?void 0:N.split("]"))==null?void 0:U[0],a=((M=(S=($=(P=s==null?void 0:s.itemData)==null?void 0:P.find(y=>(y==null?void 0:y.key)==="pageColumn"))==null?void 0:$.contents)==null?void 0:S.split("["))==null?void 0:M[0])+((L=(R=sa.value)==null?void 0:R.find(y=>(y==null?void 0:y.key)===e))==null?void 0:L.value),r=((w=(_=s==null?void 0:s.itemData)==null?void 0:_.find(y=>(y==null?void 0:y.key)==="pageGroup"))==null?void 0:w.contents)??"",o=await ce.getItemData(a,sessionStorage.getItem("systemKey"),""),n=(u=o==null?void 0:o.find(y=>(y==null?void 0:y.name)===(r===""?s==null?void 0:s.compName:r)))==null?void 0:u.compData;br(n,s.allMapContents)},{deep:!0});const Kr=async(e,a)=>{var r,o,n,c,t;try{const i=await D.getInsofDataApi({id:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index)});let p;((r=i==null?void 0:i.data)==null?void 0:r.code)===200&&(p=((n=(o=i==null?void 0:i.data)==null?void 0:o.result)==null?void 0:n[0])||null);const k={type:"data",pageKey:s!=null&&s.parentTableId?(c=p==null?void 0:p.key)==null?void 0:c.pageKey:Me.value,tableId:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index),systemKey:sessionStorage.getItem("systemKey")},x=a==null?void 0:a.map(U=>{const P=Object.keys(U),$={};return P.forEach((S,M)=>{$[e[M]]=U[S]}),$}),v=x==null?void 0:x.map(U=>({key:k,value:{tableData:U}})),N=await D.batchAddInsofDataApi({dataList:v});((t=N==null?void 0:N.data)==null?void 0:t.code)===200?(Ye.setRefreshCurStructure(!0),D.ElMessage.success("导入数据成功")):D.ElMessage.error("导入数据响应失败")}catch(i){throw D.ElMessage.error("导入数据处理失败"),new Error(i)}},zr=async e=>{var c,t,i,p,k,x,v;let a=X.value;a!=null&&a.find(N=>(e==null?void 0:e.key)===(N==null?void 0:N.key))&&(a=a==null?void 0:a.filter(N=>(e==null?void 0:e.key)!==(N==null?void 0:N.key))),a.push({key:e==null?void 0:e.key,value:[(t=e==null?void 0:e.value)==null?void 0:t[((c=e==null?void 0:e.value)==null?void 0:c.length)-1]]});let r=ke.value;r=r==null?void 0:r.map(N=>{var U,P;return(N==null?void 0:N.type)==="Select"&&(e==null?void 0:e.key)===(N==null?void 0:N.prop)&&Array.isArray(N.value)&&(U=N.value)!=null&&U.every($=>typeof $=="string")&&(N.selectValue=(P=a==null?void 0:a.find($=>($==null?void 0:$.key)===(N==null?void 0:N.prop)))==null?void 0:P.value),N});let o=(p=(i=r==null?void 0:r.find(N=>(N==null?void 0:N.prop)===(e==null?void 0:e.key)))==null?void 0:i.optionUrl)==null?void 0:p.menuId,n=r==null?void 0:r.find(N=>(N==null?void 0:N.prop)===(e==null?void 0:e.key));if(o){let N=await Ba(n==null?void 0:n.optionUrl,o),U,P=Qe.value,$=(v=(x=(k=ke.value)==null?void 0:k.find(S=>{var M;return(M=n==null?void 0:n.optionUrl)==null?void 0:M.menuId}))==null?void 0:x.selectValue)==null?void 0:v[0];if(N==null||N.forEach(S=>{var M,R,L,_,w,u,y,h,K,O;if(o){let J=(R=(M=ke.value)==null?void 0:M.find(T=>{var ie,F;return((ie=n==null?void 0:n.optionUrl)==null?void 0:ie.menuId)===((F=T==null?void 0:T.optionUrl)==null?void 0:F.menuId)}))==null?void 0:R.prop,d=(_=(L=r==null?void 0:r.find(T=>(T==null?void 0:T.prop)===J))==null?void 0:L.selectValue)==null?void 0:_[0];J!=null&&J.includes("·")&&(J=(w=J==null?void 0:J.split("·"))==null?void 0:w[0],d=(K=(h=(y=e==null?void 0:e.value)==null?void 0:y[((u=e==null?void 0:e.value)==null?void 0:u.length)-1])==null?void 0:h.split(" "))==null?void 0:K[0]),P!=null&&P.find(T=>(T==null?void 0:T.value)===$)?U=(O=P==null?void 0:P.find(T=>(T==null?void 0:T.value)===$))==null?void 0:O.objectValue:S[J]===d&&(U=S)}}),U){let S=r;S=S==null?void 0:S.map(M=>{var R,L,_,w,u,y;return o&&(U!=null&&U[M==null?void 0:M.prop])&&ml.value==="新增"&&(M==null?void 0:M.prop)!==(n==null?void 0:n.prop)?M.value=(U==null?void 0:U[M==null?void 0:M.prop])||(U==null?void 0:U[(w=(_=(L=(R=M==null?void 0:M.optionUrl)==null?void 0:R.groupSelect)==null?void 0:L[1])==null?void 0:_.replaceAll("[",""))==null?void 0:w.replaceAll("]","")]):M.value=(y=(u=ke.value)==null?void 0:u.find(h=>(h==null?void 0:h.prop)===(M==null?void 0:M.prop)))==null?void 0:y.value,M}),ke.value=S}}X.value=a},Vr=async e=>{var a,r,o,n,c;if((a=e==null?void 0:e.toString())!=null&&a.includes(".txt")||(r=e==null?void 0:e.toString())!=null&&r.includes(".cpt")||(o=e==null?void 0:e.toString())!=null&&o.includes(".cyd")){const t=await D.axios.get(e,{responseType:"blob",headers:{"Content-Type":"application/json"}}),i=new Blob([t.data],{type:"application/octet-stream;charset=UTF-8"});let p=URL.createObjectURL(i);Il.value=[{name:(c=e==null?void 0:e.split("/"))==null?void 0:c[((n=e==null?void 0:e.split("/"))==null?void 0:n.length)-1],blobUrl:p}],Hl.value=!0}};l.onBeforeUnmount(()=>{Ia.value=!1;let e=Ka.value;Ka.value=e+1});const er=l.computed(()=>{var o,n;const e=(ne.currentPage-1)*ne.pageSize,a=e+ne.pageSize,r=(o=Q.value)==null?void 0:o.find(c=>{var t;return(c==null?void 0:c.sortable)&&((t=c==null?void 0:c.label)==null?void 0:t.includes("时间"))});return r&&(E.order="descending",E.prop=r==null?void 0:r.prop),Ue("getSliceContLength",ne),(n=Y.value)==null?void 0:n.slice(e,a)}),qr=e=>{ne.currentPage=e,Ue("getSliceContLength",ne)},Jr=e=>{var a;ne.pageSize=e,e*ne.currentPage>((a=Y.value)==null?void 0:a.length)&&(ne.currentPage=1,ne.pageSize=10,D.ElMessage.warning("分页无效,返回第一页")),Ue("getSliceContLength",ne)},Wr=(e,a)=>{var t,i;const r=(i=(t=Q.value)==null?void 0:t.map(p=>p==null?void 0:p.prop))==null?void 0:i.filter(p=>p!=="operate");let o;const n=(e==null?void 0:e.length)===(r==null?void 0:r.length);if(e!=null&&e.includes("序号"))return D.ElMessage.error("导入的数据不需要包含序号列");if(o=n?e:e.slice(0,r==null?void 0:r.length),!(o==null?void 0:o.every(p=>r==null?void 0:r.find(k=>p===k))))return D.ElMessage.error("导入的数据表头不匹配");Kr(o,a)},Gr=(e,a)=>{var r;Ye.setRefreshCurStructure(!1),((r=Q.value)==null?void 0:r.length)===0||Wr(e,a)},Hr=(e,a,r,o)=>{const n=[],c=[],t=k=>Object.keys(k).length;for(const k in e)if(e[k]!==void 0){const x=e[k],v=[];for(const[N,U]of Object.entries(x))v.push(U),c.length<t(x)&&c.push(N);n.push(v)}n.unshift(c);const i=ce.utils.aoa_to_sheet(n),p=ce.utils.book_new();ce.utils.book_append_sheet(p,i,o),ce.writeFileSync(p,`${a}.xlsx`),Tl.value=[]},Aa=async(e,a,r,o=!1,n)=>{var c,t,i,p,k,x,v,N;try{Ye.setRefreshCurStructure(!1);const U=await D.getInsofDataApi({id:s==null?void 0:s.index});if(((c=U==null?void 0:U.data)==null?void 0:c.code)===200){let P=(k=(p=(i=(t=U==null?void 0:U.data)==null?void 0:t.result)==null?void 0:i[0])==null?void 0:p.value)==null?void 0:k.pageData;o?P={...P,compData:(v=P==null?void 0:P.compData)==null?void 0:v.map(S=>{var M;return(S==null?void 0:S.key)==="header"?{...S,contents:(M=S==null?void 0:S.contents)==null?void 0:M.map(R=>({...R,[e]:r}))}:S})}:P={...P,compData:(x=P==null?void 0:P.compData)==null?void 0:x.map(S=>{var M,R;return(S==null?void 0:S.key)==="header"?{...S,contents:(M=S==null?void 0:S.contents)==null?void 0:M.map(L=>(L==null?void 0:L.prop)===(a==null?void 0:a.prop)?{...L,[e]:r}:L)}:(S==null?void 0:S.key)==="tableToForm"&&n?{...S,contents:(R=S==null?void 0:S.contents)==null?void 0:R.map(L=>(L==null?void 0:L.prop)===(a==null?void 0:a.prop)?{...L,[n]:r}:L)}:S})};const $=await D.updateInsofDataApi({id:s==null?void 0:s.index,value:{pageData:P}});((N=$==null?void 0:$.data)==null?void 0:N.code)===200?(D.ElMessage.success("编辑成功"),Ye.setRefreshCurStructure(!0)):D.ElMessage.error("编辑响应失败")}}catch(U){D.ElMessage.error(U)}},Qr=async(e,a)=>{await Aa("label",a,e)},Xr=async(e,a)=>{await Aa("columnType",a,e,!1,"type")},Yr=()=>{ia.value?El.value=!1:kr()},Zr=e=>{Tl.value=e},Ir=(e,a)=>{wl.value===a?pa.value=!1:pa.value=!0,wl.value=a==null?void 0:a.changeProp},eo=e=>{if(!e)return;const{item:a,value:r}=e,o=ke.value.find(n=>n.prop==a.prop);o&&o.contents.push({label:r,value:r})},fa=l.computed(()=>{var r,o,n;const e=(r=Q.value)==null?void 0:r.some(c=>c==null?void 0:c.filterable);return document.documentElement.style.setProperty("--ssTable-header-filter-display",e?"inline-block":"none"),(n=(o=Q.value)==null?void 0:o.filter(c=>(c==null?void 0:c.label)!=="操作"))==null?void 0:n.map(c=>({...c,filterable:!!(c!=null&&c.filterable),showSummary:!!(c!=null&&c.showSummary),operable:!!(c!=null&&c.operable),fixed:c==null?void 0:c.fixed}))}),lr=async(e,a,r)=>{const o=D.cloneDeep(Q.value);await l.nextTick(),Q.value=o==null?void 0:o.map(n=>(r==null?void 0:r.label)===(n==null?void 0:n.label)?{...n,[a]:e}:n),await Aa(a,r,e)},lo=async(e,a)=>{await Aa(a,null,e,!0)},ao=()=>{jl.value=!1},ro=e=>{Ue("clickTrigger",e)},ar=async e=>{var c,t,i,p,k,x,v,N,U,P,$,S,M,R,L;const a=e==null?void 0:e.row,r=e==null?void 0:e.rowData,o=e==null?void 0:e.suffix;if((c=a==null?void 0:a.toString())!=null&&c.includes(".urdf")||e!=null&&e.isUrdf||o!=null&&o.includes(".urdf")){if(a.includes(",")){D.ElMessage.error("当前版本仅允许单个urdf预览!");return}if(Ie(a)){const w={files:[Xa(a)],data:{}};Ua(w);return}ua.value=[{url:a,extension:Qa(a)}],be.value=!0,Ke.value={data:D.cloneDeep(r)},H.value=!0;return}let n=[];if((t=a==null?void 0:a.toString())!=null&&t.includes(".stl")||(i=a==null?void 0:a.toString())!=null&&i.includes(".STL")||(p=a==null?void 0:a.toString())!=null&&p.includes(".obj")||(k=a==null?void 0:a.toString())!=null&&k.includes(".mtl")){const _=(x=a==null?void 0:a.toString())==null?void 0:x.split(","),w=Tr(_),u=w==null?void 0:w[0];if(Ie(u==null?void 0:u.extension)){Ua({files:w,data:{}});return}ua.value=w,be.value=!1,H.value=!0;return}if((v=a==null?void 0:a.toString())!=null&&v.includes(".stl")||(N=a==null?void 0:a.toString())!=null&&N.includes(".STL")||(U=a==null?void 0:a.toString())!=null&&U.includes(".obj")||(P=a==null?void 0:a.toString())!=null&&P.includes(".mtl")||o!=null&&o.includes(".stl")||o!=null&&o.includes(".STL")||o!=null&&o.includes(".obj")||o!=null&&o.includes(".mtl")){let _,w=[],u={};if(Array.isArray(a)?_=a:_=a==null?void 0:a.split(","),_==null||_.forEach(y=>{y.includes(".mtl")?w.push(y):u.blob=u.blob?u.blob+","+y:y}),(w==null?void 0:w.length)>0&&(u.mtlBlobs=w),o&&(u.suffix=o),(S=($=Object.values(u))==null?void 0:$[0])!=null&&S.includes("http:"))n.push(u);else{const y=new Blob([u.blob],{type:"application/octet-stream;charset=UTF-8"});let h=URL.createObjectURL(y),K="";(M=a==null?void 0:a.split("/"))==null||M.forEach((O,J)=>{var d;J===((d=a==null?void 0:a.split("/"))==null?void 0:d.length)-1&&(K=O)}),(R=u.blob)!=null&&R.includes(".stl")&&(K=(K==null?void 0:K.replaceAll(">",""))+".urdf"),Il.value=[{name:K,blobUrl:h}],Hl.value=!0}}else{const _=await D.axios.get(a,{responseType:"blob",headers:{"Content-Type":"application/json"}}),w=new Blob([_.data],{type:"application/octet-stream;charset=UTF-8"});let u=URL.createObjectURL(w),y="";if((L=a==null?void 0:a.split("/"))==null||L.forEach((h,K)=>{var O;K===((O=a==null?void 0:a.split("/"))==null?void 0:O.length)-1&&(y=h)}),Ie(y)){const h=Ol(y),K=Xa(a);Ua({files:[K],data:{trackFileType:h}});return}Il.value=[{name:y,blobUrl:u}],Hl.value=!0}(n==null?void 0:n.length)>0&&z.setBlobUrls(n)},ha=e=>{var o,n,c,t;if(e!=null&&e.downloadUrl)return e==null?void 0:e.name;const a=(t=(o=e==null?void 0:e.url)==null?void 0:o.split("."))==null?void 0:t[((c=(n=e==null?void 0:e.url)==null?void 0:n.split("."))==null?void 0:c.length)-1];return(e==null?void 0:e.name)+"."+a},za=e=>{if(!e)return"未知文件";try{const o=ha(e);if(typeof o=="string"&&o.includes("."))return o}catch{}const a=(e==null?void 0:e.fileName)||(e==null?void 0:e.name)||"未知文件",r=(e==null?void 0:e.suffix)||"";return a.includes(".")?a:`${a}${r}`},rr=e=>{if(e==null||typeof e=="number"||typeof e!="string")return e;const a=e.match(/^(\d+)\_(\d+)$/);if(!a)return e;const r=Number(a[1]),o=Number(a[2]);return!Number.isFinite(r)||!Number.isFinite(o)?e:String(r*1e3+o)},or=async e=>{let a=null,r=null;if(e!=null&&e.id){const n=bl.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"});try{const c=await ce.downloadAvatarApi(e);a=URL.createObjectURL(c.data),r=za(e)}finally{n.close()}}else if(e!=null&&e.downloadUrl){const n=await Va(),c=bl.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),t=await D.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:n,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}).finally(()=>{c.close()}),i=new Blob([t.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(i),r=e==null?void 0:e.name}else{const n=await ce.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(n.data),r=ha(e)):a=e==null?void 0:e.url}if(Ie(a)){const n={row:`${a}`,suffix:Qa(r)};ar(n);return}const o={name:r,blobUrl:a};Il.value=[o],Hl.value=!0},oo=async e=>{let a=null,r=null;if(e!=null&&e.id){const c=await ce.downloadAvatarApi(e);a=URL.createObjectURL(c.data),r=za(e)}else if(e!=null&&e.downloadUrl){const c=await Va(),t=await D.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:c,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}),i=new Blob([t.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(i),r=e==null?void 0:e.name}else{const c=await ce.downloadAvatarApi({url:e==null?void 0:e.url});a=URL.createObjectURL(c.data),r=ha(e)}const o={name:r,blobUrl:a},n=document.createElement("a");n.href=o.blobUrl,n.download=o.name,n.style.display="none",document.body.appendChild(n),n.click(),setTimeout(()=>{document.body.removeChild(n)},100)},no=(e,a)=>{var o;if(Object.values(a).length===0)return;let r=e;return Object.values(a).find(n=>{var c,t,i;return((c=n==null?void 0:n.toString())==null?void 0:c.includes(".txt"))||((t=n==null?void 0:n.toString())==null?void 0:t.includes(".cpt"))||((i=n==null?void 0:n.toString())==null?void 0:i.includes(".obj"))})?r=[...e,Or.value]:(o=s==null?void 0:s.config)!=null&&o.allowMove&&(r=[...e,{label:"迁移"}]),r},io=(e,a={})=>[...e==null?void 0:e.values()].filter(r=>Object.keys(a).every(o=>{var t;const n=r[o],c=(t=a[o])==null?void 0:t.toLowerCase();return c&&n&&typeof n=="string"?n.toLowerCase().includes(c):!0})),so=()=>{kl.value=!0},nr=l.ref([]),uo=async(e,a,r=!1)=>{var o;if(e){if(Ye.setTableLoading(!0),nr.value=Object.values(e),e&&((o=Object.values(e))!=null&&o.every(n=>!n)))return Y.value=Ul.value;if(r){Y.value=[...Cl.value.values()].filter(n=>Object.values(n).some(c=>typeof c=="string"?c==null?void 0:c.toLowerCase().includes(a==null?void 0:a.toLowerCase()):!1));return}Y.value=io(Cl.value,e),Ye.setTableLoading(!1)}},co=async e=>{},ir=async(e,a,r,o)=>{var n,c,t,i,p,k,x,v,N,U,P,$,S,M,R,L,_,w,u,y;if(Ue("clickMainKey",r),(o==null?void 0:o.isExistChild)===!0){let h=(n=o==null?void 0:o.columnType)==null?void 0:n.prop,K=o==null?void 0:o.data;if(Yl.value=await ce.getItemData(Me.value,sessionStorage.getItem("systemKey"),""),!Yl.value){let J=(i=(t=(c=Me.value)==null?void 0:c.split("/"))==null?void 0:t.filter((d,T)=>{var ie,F;return T!==((F=(ie=Me.value)==null?void 0:ie.split("/"))==null?void 0:F.length)-1}))==null?void 0:i.join("/");Yl.value=await ce.getItemData(J,sessionStorage.getItem("systemKey"),"")}let O=(p=Yl.value)==null?void 0:p.filter(J=>(J==null?void 0:J.name)===h);Yl.value=O==null?void 0:O.map(J=>{var d;return J.compData=(d=J.compData)==null?void 0:d.map(T=>{var ie,F;return(T==null?void 0:T.key)==="tableContents"&&(ie=T==null?void 0:T.contents)!=null&&ie.every(C=>C==null?void 0:C.find(j=>j==null?void 0:j.id))&&(T.contents=(F=T==null?void 0:T.contents)==null?void 0:F.filter(C=>(C==null?void 0:C[1])===K)),T}),J}),Ue("routeUrl",Yl.value,{isEdit:!0,routerUrl:Me.value});return}if((o==null?void 0:o.data)==="查看"&&(e!=null&&e.every(h=>(h==null?void 0:h.url)&&(h==null?void 0:h.name)))){let h=D.cloneDeep(e);h=await((k=D.cloneDeep(h))==null?void 0:k.map(async O=>{var T,ie,F,C;const J=await ce.downloadAvatarApi({url:O==null?void 0:O.url});let d=URL.createObjectURL(J.data);return{name:(O==null?void 0:O.name)+"."+((C=(T=O==null?void 0:O.url)==null?void 0:T.split("."))==null?void 0:C[((F=(ie=O==null?void 0:O.url)==null?void 0:ie.split("."))==null?void 0:F.length)-1]),blobUrl:d}}));let K=await Promise.all(h);Il.value=K,Hl.value=!0}if(D.cloneDeep(Q.value),(o==null?void 0:o.isMainKey)===!0){sl.setActiveMenuPath(void 0),Ye.setRouteToChildPath(void 0),Ye.setFixMenuStatus(!0);let h=(v=(x=s.itemData)==null?void 0:x.find(O=>(O==null?void 0:O.key)==="contentTableId"))==null?void 0:v.contents,K=(U=(N=s.itemData)==null?void 0:N.find(O=>(O==null?void 0:O.key)==="relatedFilter"))==null?void 0:U.index;if(K!==0){let O=($=(P=Q.value)==null?void 0:P[K])==null?void 0:$.prop;if((r==null?void 0:r[O])===(o==null?void 0:o.data)){let J=await D.getInsofDataApi({id:h}),d=(L=(R=(M=(S=J==null?void 0:J.data)==null?void 0:S.result)==null?void 0:M[0])==null?void 0:R.key)==null?void 0:L.pageKey;sl.setActiveMenuPath(d+"/"+(o==null?void 0:o.data))}else{let J=await D.getInsofDataApi({key:{pageKey:D.cloneDeep(Me).value+"/"+(o==null?void 0:o.data),systemKey:sessionStorage.getItem("systemKey")}});((w=(_=J==null?void 0:J.data)==null?void 0:_.result)==null?void 0:w.length)>0&&sl.setActiveMenuPath(D.cloneDeep(Me).value+"/"+(o==null?void 0:o.data))}}else{let O=await D.getInsofDataApi({key:{pageKey:D.cloneDeep(Me).value+"/"+(o==null?void 0:o.data),systemKey:sessionStorage.getItem("systemKey")}});((y=(u=O==null?void 0:O.data)==null?void 0:u.result)==null?void 0:y.length)>0&&sl.setActiveMenuPath(D.cloneDeep(Me).value+"/"+(o==null?void 0:o.data))}}},to=()=>{Hl.value=!1},po=e=>{Ue("rowClick",e)};l.watch(()=>s.changedContent,()=>{var r,o;if(!s.changedContent)return;let e=(r=Y.value)==null?void 0:r.map(n=>{var c;return n.id===((c=s.changedContent)==null?void 0:c.id)&&(n={...s.changedContent,id:s.changedContent.newId?s.changedContent.newId:s.changedContent.id},delete n.newId),n});const a=(o=s.itemData)==null?void 0:o.map(n=>((n==null?void 0:n.key)==="tableContents"&&(n.contents=e),n));Y.value=e,Ue("contentChange",{contents:a,index:s.index}),Ue("change",{content:e,index:s==null?void 0:s.index,buttonName:"",id:s==null?void 0:s.index})},{deep:!0,immediate:!0});const fo=()=>{},ho=async()=>{const e=Me.value,a=sessionStorage.getItem("systemKey"),r=await ce.getItemData(e,a,""),o=(r==null?void 0:r.find(i=>(i==null?void 0:i.name)==="方法明细"))||(r==null?void 0:r[0]),n=(o==null?void 0:o.compData)||[],c=n==null?void 0:n.find(i=>{const p=i==null?void 0:i.key;return p==="formContent"||p==="tableContents"});return c==null?void 0:c.contents},Va=async()=>`Bearer ${D.Local.get("access-token")}`,yo=async(e,{token:a,inputData:r}={})=>await D.axios.post(e,r,{headers:{Authorization:a}}).catch(n=>(sl.setImportLoading(!1),Promise.reject(n))),vo=e=>{var o;let a={};const r=[];return a.form={},(o=D.cloneDeep(e))==null||o.forEach((n,c)=>{var t,i,p,k,x,v,N,U,P,$,S,M,R,L;if((n==null?void 0:n.comp)==="Table"){(i=(t=n==null?void 0:n.compData)==null?void 0:t.find(y=>(y==null?void 0:y.key)==="header"))==null||i.contents;let _=(x=(k=(p=n==null?void 0:n.compData)==null?void 0:p.find(y=>(y==null?void 0:y.key)==="tableContents"))==null?void 0:k.contents)==null?void 0:x.map(y=>y.slice(1));($=(P=(U=(N=(v=n==null?void 0:n.compData)==null?void 0:v.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:N.contents)==null?void 0:U[0])==null?void 0:P[0])==null||$.label;let w=(M=(S=n==null?void 0:n.compData)==null?void 0:S.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:M.contents,u=[];_==null||_.forEach(y=>{let h=[];y==null||y.forEach((K,O)=>{var d;let J={};((d=w[O])==null?void 0:d.label)!=="操作"&&(J[w[O].label]=K,h.push(J))}),u.push(h)}),a[n.name]=u}else{const _=(L=(R=n.compData)==null?void 0:R.find(w=>(w==null?void 0:w.key)==="formContent"))==null?void 0:L.contents;_==null||_.forEach(w=>{var u,y;if(w.prop!==""){let h=w==null?void 0:w.value;Array.isArray(h)?h=((u=h==null?void 0:h[0])==null?void 0:u.oldUrl)||"http://222.92.178.198:62001/"+((y=h==null?void 0:h[0])==null?void 0:y.url):h=h.toString(),w={key:(w==null?void 0:w.prop)??(w==null?void 0:w.label),value:h},r.push(w)}})}}),a.form=ce.getFormContents(r),a},go=e=>{const a=[],r=o=>{o&&typeof o=="object"&&!Array.isArray(o)?Object.values(o).forEach(r):a.push(o)};return r(e),a},bo=async(e,a,r)=>{var w,u,y,h,K,O,J,d,T,ie,F;sl.setImportLoading(!0),Ye.setFreshContent(!1);let o=await ho().catch(C=>(sl.setImportLoading(!1),Promise.reject(C)));o=o==null?void 0:o.filter(C=>{var j;return((j=C==null?void 0:C.find(le=>le==null?void 0:le.id))==null?void 0:j.id)===(a==null?void 0:a.id)});let n=ce.getEqualChild([(w=Q.value)==null?void 0:w.filter(C=>(C==null?void 0:C.label)!=="操作")]);const c=(y=(u=ce.tableToForm(o,n))==null?void 0:u[0])==null?void 0:y.find(C=>{const j=C==null?void 0:C.key;return j==="Interface"||j==="方法体"}),t=c==null?void 0:c.value;if(!t){console.log("未搜索到isMain, 缺少算法执行接口"),sl.setImportLoading(!1);return}const i=Q.value?ce.getEqualChild([Q.value]):[],p=i.find(C=>{const j=C==null?void 0:C.prop;return j==="Input1"||j==="输入数据.输入1"||j==="样本输入数据"}),k=p==null?void 0:p.prop;let x=a==null?void 0:a[k];const v=await Va().catch(C=>(sl.setImportLoading(!1),Promise.reject(C)));let N=!0,U="";(h=Q.value)==null||h.forEach(C=>{(C==null?void 0:C.prop)===k&&(N=!!(C!=null&&C.childPath),U=C==null?void 0:C.childPath)});let P="";if(N){let C=(O=(K=Q.value)==null?void 0:K.find(ve=>(ve==null?void 0:ve.isMainKey)===!0))==null?void 0:O.prop;P=a==null?void 0:a[C];let j=U==null?void 0:U.split(fe),le=[];j==null||j.forEach((ve,Ne)=>{(j==null?void 0:j.length)-1===Ne&&le.push(P),le.push(ve)}),le=le==null?void 0:le[0];let ee=await ce.getItemData(le,sessionStorage.getItem("systemKey"),""),Z=ee==null?void 0:ee.filter(ve=>(ve==null?void 0:ve.name)===k);Z=Z==null?void 0:Z.map(ve=>{var Ne;return ve.compData=(Ne=ve==null?void 0:ve.compData)==null?void 0:Ne.map(G=>{var re;return(G==null?void 0:G.key)==="tableContents"&&(G.contents=(re=G==null?void 0:G.contents)==null?void 0:re.filter(Le=>(Le==null?void 0:Le[1])===(a==null?void 0:a[k]))),G}),ve}),(!Z||(Z==null?void 0:Z.length)===0)&&(Z=ee,Z=Z==null?void 0:Z.map(ve=>{var Ne;return ve.compData=(Ne=ve==null?void 0:ve.compData)==null?void 0:Ne.map(G=>{var re;return(G==null?void 0:G.key)==="tableContents"&&(G.contents=(re=G==null?void 0:G.contents)==null?void 0:re.filter(Le=>{var se,pe;return(Le==null?void 0:Le[1])===(a==null?void 0:a[(pe=(se=Q==null?void 0:Q.value)==null?void 0:se[0])==null?void 0:pe.prop])})),G}),ve})),x=vo(Z)}const $=await yo(t,{token:v,inputData:x}).catch(C=>(sl.setImportLoading(!1),Promise.reject(C))),S=(J=$==null?void 0:$.data)==null?void 0:J.data,M=i.find(C=>(C==null?void 0:C.prop)==="Output1"),R=M==null?void 0:M.prop;let L=[],_=[];if(S&&((d=Object.values(S))==null?void 0:d.length)>0){let C=[];const j=new FormData,le=(T=go(S))==null?void 0:T.map(async Z=>{var ve,Ne;if(!Array.isArray(Z)&&(Z!=null&&Z.includes("http"))){let G=await D.axios.get(Z,{responseType:"blob"}),re=(Ne=Z==null?void 0:Z.split("/"))==null?void 0:Ne[((ve=Z==null?void 0:Z.split("/"))==null?void 0:ve.length)-1];j.append("files",G.data,re)}else C.push(Z)});if(await Promise.all(le),!ce.isFormDataEmpty(j)){let Z=await ce.uploadAmountApi(j),ve=(F=(ie=Z==null?void 0:Z.data)==null?void 0:ie.result)==null?void 0:F.map(Ne=>{var G,re,Le,se,pe,xe;return{name:(xe=(pe=(se=(G=Ne==null?void 0:Ne.url)==null?void 0:G.split("/"))==null?void 0:se[((Le=(re=Ne==null?void 0:Ne.url)==null?void 0:re.split("/"))==null?void 0:Le.length)-1])==null?void 0:pe.split("."))==null?void 0:xe[0],url:Ne==null?void 0:Ne.url}});C=[...C,...ve]}let ee={};for(let Z in a)Z!=="id"&&(ee[Z]=a[Z]);ee[R]=C,_.push({id:a==null?void 0:a.id,value:{tableData:ee}})}(_==null?void 0:_.length)>0&&await D.batchUpdateInsofDataApi({dataList:_}),(L==null?void 0:L.length)>0&&await D.batchAddInsofDataApi({dataList:L}),ga(!0),sl.setImportLoading(!1),Ye.setFreshContent(!0)},sr=(e,a)=>(e=e==null?void 0:e.map(r=>{var o,n;return r!=null&&r.children&&((o=r.children)!=null&&o.find(c=>c.id===(a==null?void 0:a.id))?r.children=(n=r.children)==null?void 0:n.filter(c=>(c==null?void 0:c.id)!==(a==null?void 0:a.id)):r.children=sr(r.children,a)),r}),e),Ze=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,r)=>{a===(s==null?void 0:s.index)?r(new Error("选择源不能和目标源一致")):r()}}]},buttonValue:[{label:"取消",background:"#999999",color:"var(--ssbutton-theme-color)"},{label:"确认",background:"var(--ssbutton-theme-bg)",color:"var(--ssbutton-theme-color)"}]}),ko=()=>{Ze.show=!1},mo=e=>{var a,r;if((e==null?void 0:e.buttonName)==="取消")return Ze.show=!1;Ze.to=e==null?void 0:e.content,!(!(s!=null&&s.index)||!((a=Ze.to)!=null&&a.groupName))&&(s==null?void 0:s.index)!==((r=Ze.to)==null?void 0:r.groupName)&&(Ue("change",{buttonName:"迁移",value:{from:Ze.from,to:Ze.to,data:Ze.selectRow}}),Ze.show=!1)},So=e=>{if(e){if(!ca.validateFileSize(e.raw)){D.ElMessage.warning(`文件大小不能超过 ${Lr.value.maxSize}MB`);return}if(!ca.validateFileType(e.raw)){D.ElMessage.warning("请上传图片文件");return}}},Co=async()=>{var e,a;if(Fl.value.length===0){D.ElMessage.warning("请先选择要上传的图片");return}Ql.value=!0;try{const r=Fl.value.map(async v=>{var P;const N=new FormData;N.append("file",v.raw,v.name);const U=await bl.uploadFileApi(N);return((P=U==null?void 0:U.data)==null?void 0:P.result)||{name:v.name,url:"",fileName:v.name}}),o=await Promise.all(r),n=ca.extractTableHeaders(Q.value),c=o.map(v=>({name:(v==null?void 0:v.fileName)||(v==null?void 0:v.name),url:(v==null?void 0:v.url)||""})),t=await ca.recognize(c,n),i=Array.isArray(t==null?void 0:t.result)?t.result:[];if(i.length===0){D.ElMessage.warning("OCR识别未返回有效数据"),Ql.value=!1;return}const p=new Set,k=[];i.forEach((v,N)=>{const U=v!=null&&v.数据&&typeof(v==null?void 0:v.数据)=="object"?v.数据:{},P={_index:N,_certType:(v==null?void 0:v.证书类型)||"",_certNo:(v==null?void 0:v.证书编号)||""};Object.entries(U).forEach(([$,S])=>{Array.isArray(S)&&S.length>=2?(P[$]=S[0]??"",P[`${$}_accuracy`]=S[1]??0,p.add($)):(P[$]=S??"",P[`${$}_accuracy`]=0,p.add($))}),k.push(P)});const x=[];p.forEach(v=>{x.push({prop:v,label:v,editable:!0,minWidth:120}),x.push({prop:`${v}_accuracy`,label:`${v}准确率`,editable:!1,minWidth:100,isAccuracy:!0})}),Ma.value=x,aa.value=k,Ra.value=o,Fa.value=t,xa.value=!1,Fl.value=[],Ql.value=!1,$a.value=!0}catch(r){console.error("OCR处理失败:",r),D.ElMessage.error(((a=(e=r==null?void 0:r.response)==null?void 0:e.data)==null?void 0:a.message)||"OCR识别失败,请重试"),Ql.value=!1}},xo=()=>{var P,$;const e=Ra.value,a=Fa.value,r=aa.value;if(!r||r.length===0){D.ElMessage.warning("暂无数据可添加");return}const o=(P=ce.getAllLeafNodes(Q.value)||[])==null?void 0:P.filter(S=>(S==null?void 0:S.type)!=="operate"&&(S==null?void 0:S.label)!=="操作"&&(S==null?void 0:S.prop)!=="operate"),n=new Map,c=new Map,t=($=o==null?void 0:o.find(S=>(S==null?void 0:S.label)==="OCR图片"))==null?void 0:$.prop;o==null||o.forEach(S=>{S!=null&&S.label&&(S!=null&&S.prop)&&(n.set(S.label,S.prop),c.set(S.prop,S.label))});const i=Date.now(),p=S=>String(i*1e3+S);let k=0,x=0;const v=[],N=[];r.forEach((S,M)=>{const R={id:p(M),_isOCRRow:!0,_ocrTableId:s==null?void 0:s.index};for(const[L,_]of n.entries())Object.prototype.hasOwnProperty.call(S,L)&&(R[_]=S[L]);if(t&&e[M]){const L=e[M];R[t]=[{...L,name:(L==null?void 0:L.fileName)||(L==null?void 0:L.name),url:(L==null?void 0:L.url)||""}]}if(Kl.value&&Kl.value.length>0){const L={};let _=!1;if(Kl.value.forEach(w=>{const u=n.get(w);u&&R[u]!==void 0&&R[u]!==null&&R[u]!==""&&(L[u]=R[u],_=!0)}),_){const w=Y.value.find(u=>Object.entries(L).every(([y,h])=>{const K=u[y];return String(K)===String(h)||K===h}));if(w){for(const[y,h]of n.entries())Object.prototype.hasOwnProperty.call(R,h)&&h!=="_isOCRRow"&&h!=="_ocrTableId"&&h!=="id"&&(w[h]=R[h]);if(t&&e[M]){const y=e[M];w[t]=[{...y,name:(y==null?void 0:y.fileName)||(y==null?void 0:y.name),url:(y==null?void 0:y.url)||""}]}const u=Ul.value.find(y=>y.id===w.id);if(u){for(const[y,h]of n.entries())Object.prototype.hasOwnProperty.call(R,h)&&h!=="_isOCRRow"&&h!=="_ocrTableId"&&h!=="id"&&(u[h]=R[h]);if(t&&e[M]){const y=e[M];u[t]=[{...y,name:(y==null?void 0:y.fileName)||(y==null?void 0:y.name),url:(y==null?void 0:y.url)||""}]}}Cl.value&&Cl.value.set(w.id,w),N.push(JSON.parse(JSON.stringify(w))),k++;return}}}v.push(R),x++}),N.length>0&&(Y.value=[...Y.value||[]]),v.length>0&&(Y.value=[...Y.value||[],...v],Ul.value=[...Ul.value||[],...v],v.forEach(S=>{var M,R;return(R=(M=Cl.value)==null?void 0:M.set)==null?void 0:R.call(M,S.id,S)})),ta.value=Y.value;let U="";k>0&&x>0?U=`成功匹配替换 ${k} 条数据,新增 ${x} 条OCR识别数据`:k>0?U=`成功匹配替换 ${k} 条数据`:U=`成功添加 ${x} 条OCR识别数据`,D.ElMessage.success(U),N.length>0&&Ue("change",{buttonName:"编辑",singleContent:N,content:Y.value,index:s==null?void 0:s.index,parentTableId:s==null?void 0:s.parentTableId,column:Q.value}),v.length>0&&Ue("change",{buttonName:"OCR批量新增",content:Y.value,index:s==null?void 0:s.index,parentTableId:s==null?void 0:s.parentTableId,column:Q.value,ocrRows:v,uploadedFiles:e,ocrResult:a,matchedCount:k,newCount:x}),qa()},qa=()=>{$a.value=!1,aa.value=[],Ma.value=[],Ra.value=[],Fa.value=null,Kl.value=[]},_o=(e,a,r)=>{aa.value[e]&&(aa.value[e][a]=r)},No=(e,a)=>{if(a)Kl.value.includes(e)||Kl.value.push(e);else{const r=Kl.value.indexOf(e);r>-1&&Kl.value.splice(r,1)}},Do=e=>e==null||e===0?"-":`${(Number(e)*100).toFixed(1)}%`,Ao=e=>{if(e==null||e===0)return"#909399";const a=Number(e);return a>=.9?"#67c23a":a>=.7?"#e6a23c":"#f56c6c"},ur=()=>{xa.value=!1,Fl.value=[],Ur.value=null},Eo=async e=>{Za.value=e==null?void 0:e.name;const a=e.raw;Pa.value=URL.createObjectURL(a),Na.value=[{name:Za.value,blobUrl:Pa.value}],_a.value=!0},To=async e=>{const a=Go(e);if(!a||a.length===0){D.ElMessage.warning("暂无图片");return}if(a.length===1){await or(a[0]);return}try{const r=bl.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),o=await Promise.all(a.map(async n=>{const c=await ce.downloadAvatarApi(n),t=URL.createObjectURL(c.data);return{name:za(n),blobUrl:t}}));r.close(),Na.value=o,_a.value=!0}catch(r){console.error("预览图片失败:",r),D.ElMessage.error("预览图片失败,请重试")}},wo=()=>{_a.value=!1,Na.value=[],Pa.value=""},Bo=e=>{Fl.value=Fl.value.filter((a,r)=>r!==e)},Ea=async(e,a,r)=>{var o,n,c,t,i,p,k,x,v,N,U,P,$,S,M;if(Ll.value="",Ca.value=!0,ma.value=!0,Ue("onButtonClick",e,a),Qe.value=[],e==="删除")Ta.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var R,L;(R=Y.value)!=null&&R.find(_=>(_==null?void 0:_.id)===(a==null?void 0:a.id))?Y.value=(L=D.cloneDeep(Y.value))==null?void 0:L.filter(_=>(_==null?void 0:_.id)!==(a==null?void 0:a.id)):Y.value=sr(D.cloneDeep(Y.value),a),Cn(ta.value,da.value,a==null?void 0:a.id),Ye.setTableLoading(s==null?void 0:s.index),Ue("change",{content:Y.value,singleContent:a,index:s==null?void 0:s.index,type:"delete",buttonName:e,column:Q.value})});else if(e==="批量删除"){if(((o=Tl.value)==null?void 0:o.length)===0)return D.ElMessage.warning("请先勾选操作的数据");Ta.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var L,_;const R=(L=Tl.value)==null?void 0:L.map(w=>w.id);Y.value=(_=D.cloneDeep(Y.value))==null?void 0:_.filter(w=>!(R!=null&&R.includes(w.id))),Ye.setTableLoading(s==null?void 0:s.index),Ue("change",{content:Y.value,singleContent:null,selectItems:Tl.value,index:s==null?void 0:s.index,type:"batchDelete",buttonName:e,column:Q.value})})}else if(e==="复制新增"){ml.value="新增";const R=D.cloneDeep(a),L=(n=Q.value)==null?void 0:n.find(u=>u==null?void 0:u.isMainKey),_=L||((c=Q.value)==null?void 0:c[0]),w=(t=_l.value)==null?void 0:t.find(u=>(u==null?void 0:u.label)==="新建");await tr(!0,w,{data:R,firstCol:_})}else if(e==="新增")ml.value="新增",va(""),jl.value=!0;else if(e==="编辑")ml.value="编辑",va(a),jl.value=!0;else if(e==="查看")ml.value="查看",va(a),Ca.value=!1,ma.value=!1,jl.value=!0;else if(e==="查看三维模型"){const R={};for(let _ in a)_!=="id"&&(R[_]=a[_]);let L=(i=Object.values(R))==null?void 0:i[1];Br.setTableShowThree(L)}else if(((p=r==null?void 0:r.extra)==null?void 0:p.type)==="modelExample")ml.value=e,Sa.value=!0;else if(e==="新建"){let R=ea.value,L=[];for(let h in R)h!=null&&h.includes(`loading${((k=ra.value)==null?void 0:k.account)||((x=ra.value)==null?void 0:x.账号)}`)&&(L=[...L,...h]);let _=[];for(let h in R)h!=null&&h.includes(`updateLoading${((v=ra.value)==null?void 0:v.account)||((N=ra.value)==null?void 0:N.账号)}`)&&(_=[..._,...h]);let w=L==null?void 0:L.map(h=>h==null?void 0:h.id);const u=_==null?void 0:_.map(h=>h==null?void 0:h.id);w=[...D.cloneDeep(w),...u],(w==null?void 0:w.length)>0&&(w!=null&&w.every(h=>h!==null&&h))&&await D.batchDeleteInsofDataApi({ids:w});const y=(U=_l.value)==null?void 0:U.find(h=>(h==null?void 0:h.label)==="新建");await tr(!1,y)}else if(e==="修改模板"){let R=D.cloneDeep(Me).value;Ye.setRouteToChildPath(R),sl.setActiveMenuPath(R+fe)}else if(e==="执行")bo(e,a);else if(e!=null&&e.includes("导出")){if(e==="导出选中"&&((P=Tl.value)==null?void 0:P.length)===0)return D.ElMessage.warning(`请先勾选${e}的数据`);if(e==="导出全部"&&(($=Y.value)==null?void 0:$.length)===0)return D.ElMessage.warning("暂无数据导出");const R=(M=(S=Q.value)==null?void 0:S.map(_=>_==null?void 0:_.label))==null?void 0:M.filter(_=>_!=="操作"),L=e==="导出全部"?D.cloneDeep(Y.value):D.cloneDeep(Tl.value);L==null||L.forEach(_=>{_==null||delete _.id}),Hr(L,s==null?void 0:s.compName,R,s==null?void 0:s.compName)}else e==="OCR识别"?(xa.value=!0,Fl.value=[]):e==="迁移"&&(Ze.selectRow=a,Ze.show=!0)},Oo=async e=>{var r,o,n,c,t,i;const a=await D.getInsofDataApi({key:{pageKey:e,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});if(((r=a==null?void 0:a.data)==null?void 0:r.code)===200)return Array.isArray((o=a==null?void 0:a.data)==null?void 0:o.result)&&((c=(n=a==null?void 0:a.data)==null?void 0:n.result)==null?void 0:c.length)>0?(i=(t=a==null?void 0:a.data)==null?void 0:t.result)==null?void 0:i.map(p=>{var k;return{id:p==null?void 0:p.id,...(k=p==null?void 0:p.value)==null?void 0:k.pageData}}):[]},Uo=async(e,a)=>{var r,o,n,c,t,i,p,k,x,v,N,U,P,$,S,M,R,L,_,w;try{let u,y;const h=(r=ea.value[Me.value+fe])==null?void 0:r.filter(C=>{var j;return((j=C==null?void 0:C.key)==null?void 0:j.type)==="structureMethod"}),K=(o=ea.value[Me.value+fe])==null?void 0:o.filter(C=>{var j;return((j=C==null?void 0:C.key)==null?void 0:j.type)==="structure"}),O=h==null?void 0:h.find(C=>{var j,le;return((le=(j=C==null?void 0:C.value)==null?void 0:j.pageData)==null?void 0:le.method)==="保存"});if(!O)return;const J=(i=(t=ea.value[(c=(n=O==null?void 0:O.value)==null?void 0:n.pageData)==null?void 0:c.path])==null?void 0:t.filter(C=>{var j;return((j=C==null?void 0:C.key)==null?void 0:j.type)==="data"}))==null?void 0:i.find(C=>{var j,le,ee,Z;return((le=(j=C==null?void 0:C.value)==null?void 0:j.tableData)==null?void 0:le.算法名称)===((Z=(ee=O==null?void 0:O.value)==null?void 0:ee.pageData)==null?void 0:Z.method)});if(!J)return;const d={buttonName:(k=(p=O==null?void 0:O.value)==null?void 0:p.pageData)==null?void 0:k.method,api:(v=(x=J==null?void 0:J.value)==null?void 0:x.tableData)==null?void 0:v.算法体,content:K==null?void 0:K.map(C=>{var j;return(j=C==null?void 0:C.value)==null?void 0:j.pageData}),extraContent:[],extraValues:(U=(N=O==null?void 0:O.value)==null?void 0:N.pageData)==null?void 0:U.data,methodName:($=(P=O==null?void 0:O.value)==null?void 0:P.pageData)==null?void 0:$.path};if(!e)return;const T={...e,compData:(S=e==null?void 0:e.compData)==null?void 0:S.map(C=>{var j;return(C==null?void 0:C.key)==="formContent"?{...C,contents:(j=C==null?void 0:C.contents)==null?void 0:j.map(le=>(le==null?void 0:le.prop)===a?{...le,value:""}:le)}:C})},ie={key:{pageKey:Me.value+fe,parentTable:"",systemKey:sessionStorage.getItem("systemKey"),type:"structure"},value:{pageData:T}},F=await D.axios.post(d.api,ie,{headers:{"Content-Type":"application/json"}});return((M=F==null?void 0:F.data)==null?void 0:M.code)===200&&(u=(L=(R=F==null?void 0:F.data)==null?void 0:R.result)==null?void 0:L.latestReportCode,y=(w=(_=F==null?void 0:F.data)==null?void 0:_.result)==null?void 0:w.status),{newMainKeyValue:u,newStatus:y}}catch(u){throw D.ElMessage.error(u),new Error(u)}},cr=(e,a,r,o)=>{var n;Ue("contentChange",{contents:(n=e==null?void 0:e.compData)==null?void 0:n.map(c=>{var t;return(c==null?void 0:c.key)==="formContent"?{...c,contents:(t=c==null?void 0:c.contents)==null?void 0:t.map(i=>(i==null?void 0:i.key)===a?{...i,value:r}:ya.value&&(i==null?void 0:i.prop)===ya.prop?{...i,value:ya.value}:i)}:c}),index:e==null?void 0:e.id},o)},ya=l.reactive({prop:"状态",value:""}),Lo=l.ref(["系统自动生成信息","审批意见"]),jo=async(e,a,r)=>{var p,k;let o=e==null?void 0:e[a==null?void 0:a.prop],n=1,c,t;const i=D.cloneDeep(Me).value+fe+o;if(i){ya.value="",c=(p=ea.value[i])==null?void 0:p.filter(N=>{var U;return((U=N==null?void 0:N.key)==null?void 0:U.type)==="structure"});const x=c==null?void 0:c.find(N=>{var U,P,$;return(($=(P=(U=N==null?void 0:N.value)==null?void 0:U.pageData)==null?void 0:P.comp)==null?void 0:$.toUpperCase())==="FORM"});t={...(k=x==null?void 0:x.value)==null?void 0:k.pageData,id:x==null?void 0:x.id};const v=await Uo(t,a==null?void 0:a.prop);if(ya.value=v==null?void 0:v.newStatus,v!=null&&v.newMainKeyValue)return v==null?void 0:v.newMainKeyValue}if(Y.value.some(x=>(x==null?void 0:x[a==null?void 0:a.prop])===o)){const x=o;for(;Y.value.some(v=>(v==null?void 0:v[a==null?void 0:a.prop])===`${x}(${n})`);)n++;o=`${x}(${n})`}return o},tr=async(e,a,r)=>{var t,i,p,k,x,v,N,U;let o,n;const c=await jo(r==null?void 0:r.data,r==null?void 0:r.firstCol);if(e?(o=D.cloneDeep(Me).value+fe+((k=r==null?void 0:r.data)==null?void 0:k[(p=r==null?void 0:r.firstCol)==null?void 0:p.prop]),n=D.cloneDeep(Me).value+fe+c):(o=D.cloneDeep(Me).value+fe,n=D.cloneDeep(o)+`loading${((t=ra.value)==null?void 0:t.account)||((i=ra.value)==null?void 0:i.账号)}`),a){const P=(v=(x=ea.value[n])==null?void 0:x.filter($=>{var S;return((S=$==null?void 0:$.key)==null?void 0:S.parentTable)===""}))==null?void 0:v.map($=>{var S;return{id:$==null?void 0:$.id,...(S=$==null?void 0:$.value)==null?void 0:S.pageData}});if((P==null?void 0:P.length)>0)if(e){const $=P==null?void 0:P.find(S=>{var M;return((M=S==null?void 0:S.comp)==null?void 0:M.toUpperCase())==="FORM"});$&&cr($,(N=r==null?void 0:r.firstCol)==null?void 0:N.label,c,Me.value)}else Ye.setRouteToChildPath(D.cloneDeep(Me).value),sl.setActiveMenuPath(n);else if(await ce.loadingConstruct(o,n,null,null,e?Lo.value:null),e){const $=await Oo(n);if(($==null?void 0:$.length)>0){const S=$==null?void 0:$.find(M=>{var R;return((R=M==null?void 0:M.comp)==null?void 0:R.toUpperCase())==="FORM"});S&&cr(S,(U=r==null?void 0:r.firstCol)==null?void 0:U.label,c,Me.value)}}else Ye.setRouteToChildPath(D.cloneDeep(Me).value),sl.setActiveMenuPath(n)}else e?(Ll.value="",hl.value=r==null?void 0:r.data,ga(!0,r==null?void 0:r.firstCol,c)):(Ye.setRouteToChildPath(D.cloneDeep(Me).value),sl.setActiveMenuPath(n))},Po=()=>{H.value=!1,ua.value=[],be.value=!1},va=e=>{var t,i,p,k,x,v,N,U,P,$,S,M,R,L,_,w,u,y,h,K,O,J;const a=[];let r=[];for(let d in e)Array.isArray(e==null?void 0:e[d])&&r.push(d);qe.value=D.cloneDeep(Q.value),(i=ce.getColumnChild((t=D.cloneDeep(Q.value))==null?void 0:t.filter(d=>(d==null?void 0:d.label)!=="操作")))==null||i.forEach((d,T)=>{var ie,F,C;r.find(j=>j===(d==null?void 0:d.prop))||(d!=null&&d.formType&&((ie=d==null?void 0:d.formType)==null?void 0:ie.toUpperCase())==="SELECT"||d!=null&&d.menuId?a.push({label:(F=d==null?void 0:d.prop)!=null&&F.includes(".")?d==null?void 0:d.prop:(d==null?void 0:d.label)??(d==null?void 0:d.prop)??"",name:(d==null?void 0:d.prop)??"t"+T,prop:d==null?void 0:d.prop,type:"Select",value:(e==null?void 0:e[d==null?void 0:d.prop])??(d==null?void 0:d.value)??"",id:(d==null?void 0:d.id)??T,contents:(d==null?void 0:d.options)??[],width:1,isFormColHidden:d==null?void 0:d.isFormColHidden,relatedValueId:d==null?void 0:d.relatedValueId,disabled:d==null?void 0:d.disabled,optionUrl:{groupSelect:d==null?void 0:d.groupSelect,menuSelect:d==null?void 0:d.formMenuSelect,type:"Select",selectRelateType:d==null?void 0:d.selectRelateType,allSelectionContents:(d==null?void 0:d.allSelectionContents)??[],selectFilter:d==null?void 0:d.selectFilter,menuId:d==null?void 0:d.menuId,filterContent:d==null?void 0:d.filterContent}}):a.push({label:(C=d==null?void 0:d.prop)!=null&&C.includes(".")?d==null?void 0:d.prop:(d==null?void 0:d.label)??(d==null?void 0:d.prop)??"",prop:d==null?void 0:d.prop,name:(d==null?void 0:d.prop)??"t"+T,type:!(d!=null&&d.formType)||(d==null?void 0:d.formType)===""?"Input":d==null?void 0:d.formType,value:(e==null?void 0:e[d==null?void 0:d.prop])??(d==null?void 0:d.value)??"",id:(d==null?void 0:d.id)??T,contents:(d==null?void 0:d.options)??[],width:1,isFormColHidden:d==null?void 0:d.isFormColHidden,disabled:d==null?void 0:d.disabled,relatedValueId:d==null?void 0:d.relatedValueId}))}),e===""||!e||(Ll.value=(e==null?void 0:e.id)??"");let o=ce.getColumnChild((p=D.cloneDeep(Q.value))==null?void 0:p.filter(d=>(d==null?void 0:d.label)!=="操作"));Dl.value&&((k=Dl.value)==null?void 0:k.length)>0&&(Dl.value=(x=D.cloneDeep(Dl).value)==null?void 0:x.map(d=>{var ie;let T=(d==null?void 0:d.prop)||((ie=o==null?void 0:o.find(F=>(F==null?void 0:F.label)===(d==null?void 0:d.label)))==null?void 0:ie.prop);return T&&(d.value=e[T]),d})),ke.value=Dl.value&&((v=Dl.value)==null?void 0:v.length)>0?ce.getTableFormToForm(Dl.value):a;let n=[],c=(N=s.itemData)==null?void 0:N.filter(d=>(d==null?void 0:d.key)==="filterAllType");if((c==null?void 0:c.length)>0&&(n=(c==null?void 0:c.map(T=>T==null?void 0:T.value)).flat()),(n==null?void 0:n.length)>0){let d=(P=n==null?void 0:n.filter(F=>{var C;return(C=F==null?void 0:F.content)==null?void 0:C.includes("@Type")}))==null?void 0:P[((U=n==null?void 0:n.filter(F=>{var C;return(C=F==null?void 0:F.content)==null?void 0:C.includes("@Type")}))==null?void 0:U.length)-1];if(d!=null&&d.content){let F=(M=(S=($=d==null?void 0:d.content)==null?void 0:$.replace(":",ql))==null?void 0:S.split(ql))==null?void 0:M[1];if(((R=F==null?void 0:F.trim())==null?void 0:R.toUpperCase())==="MANUAL"){let C=(y=(u=(L=s.itemData)==null?void 0:L.filter(j=>(j==null?void 0:j.key)==="contentTableId"))==null?void 0:u[((w=(_=s.itemData)==null?void 0:_.filter(j=>(j==null?void 0:j.key)==="contentTableId"))==null?void 0:w.length)-1])==null?void 0:y.contents;ke.value=(h=ke.value)==null?void 0:h.map((j,le)=>{var ee,Z;return(ee=j==null?void 0:j.optionUrl)!=null&&ee.menuId&&(j.type="Select",(Z=j==null?void 0:j.optionUrl)!=null&&Z.menuId&&(j.optionUrl.menuId=j.optionUrl.menuId??C,j.optionUrl.menuFilter=n,ml.value==="新增"&&(j.optionUrl.multiple=!0,j.optionUrl.multipleLimit=5))),j})}}let T=(K=ke.value)==null?void 0:K.filter(F=>{var C,j;return((C=F==null?void 0:F.optionUrl)==null?void 0:C.menuId)&&((j=F==null?void 0:F.optionUrl)==null?void 0:j.menuId)!==""}),ie;if(T==null||T.forEach(F=>{var j,le;if(ie!==void 0)return;let C=(j=F==null?void 0:F.optionUrl)==null?void 0:j.menuId;((le=T==null?void 0:T.filter(ee=>{var Z;return((Z=ee==null?void 0:ee.optionUrl)==null?void 0:Z.menuId)===C}))==null?void 0:le.length)>1&&(ie=C)}),T=T==null?void 0:T.filter(F=>{var C;return((C=F==null?void 0:F.optionUrl)==null?void 0:C.menuId)===ie}),(T==null?void 0:T.length)>1){let F=T==null?void 0:T.map(ee=>ee==null?void 0:ee.prop),C=T==null?void 0:T.map(ee=>ee==null?void 0:ee.label),j=T==null?void 0:T.map(ee=>ee==null?void 0:ee.value),le=(O=D.cloneDeep(T))==null?void 0:O[0];le.label=C==null?void 0:C.join("·"),le.value=j==null?void 0:j.join(" "),le.value.trim()===""&&(le.value=""),le.prop=F==null?void 0:F.join("·"),le.usingType="parent",ke.value.unshift(le),ke.value=(J=ke.value)==null?void 0:J.map(ee=>(F!=null&&F.find(Z=>Z===(ee==null?void 0:ee.prop))&&(ee.isFormColHidden=!0),ee))}}},$o=()=>{var a;const e=(a=V.value)==null?void 0:a.$el;e&&ce.Sortable.create(e,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:r=>{var t;const{oldIndex:o,newIndex:n}=r;if(o===n)return;const c=fa.value.splice(o,1)[0];fa.value.splice(n,0,c),Q.value=(t=Q.value)==null?void 0:t.slice().sort((i,p)=>{if(i.label==="操作")return 1;if(p.label==="操作")return-1;const k=fa.value.findIndex(v=>v.label===i.label),x=fa.value.findIndex(v=>v.label===p.label);return k-x})}})};l.onMounted(()=>{ja.value=window.innerWidth-240*2});const Mo=()=>{l.nextTick(()=>{$o()})},Ja=(e,a)=>{var o;if(!e&&!(e!=null&&e.children))return{contents:e,currentSelectContents:void 0};let r;return e.children=(o=e.children)==null?void 0:o.map(n=>{var c,t;if((n==null?void 0:n.id)===Ll.value){let i={};for(let p in n){let k=(c=a==null?void 0:a.find(x=>(x==null?void 0:x.prop)===p))==null?void 0:c.label;k?i[p]=(t=hl.value)==null?void 0:t[k]:i[p]=n[p]}n=Object.assign(i,hl.value),r=n}else{let i=Ja(n,a);n=i==null?void 0:i.contents,r=i==null?void 0:i.currentSelectContents}return n}),{contents:e,currentSelectContents:r}},dr=(e,a)=>{let r,o;return e!=null&&e.find(n=>(n==null?void 0:n.id)===Ll.value)?r=e==null?void 0:e.map(n=>{var c,t;if((n==null?void 0:n.id)===Ll.value){let i={};for(let p in n){let k=(c=a==null?void 0:a.find(x=>(x==null?void 0:x.prop)===p))==null?void 0:c.label;k?i[p]=(t=hl.value)==null?void 0:t[k]:i[p]=n[p]}n=Object.assign(i,hl.value),o=n}return n}):r=e==null?void 0:e.map(n=>{var c,t,i,p;if((n==null?void 0:n.id)===Ll.value){let k={};for(let x in n){let v=(c=a==null?void 0:a.find(N=>(N==null?void 0:N.prop)===x))==null?void 0:c.label;v?k[x]=(t=hl.value)==null?void 0:t[v]:k[x]=n[x]}n=Object.assign(k,hl.value),o=n}else n=(i=Ja(n,a))==null?void 0:i.contents,o=(p=Ja(n,a))==null?void 0:p.currentSelectContents;return n}),{newContents:r,currentSelectContents:o}},pr=(e,a,r)=>{var o,n;return e[a==null?void 0:a.prop]=r,typeof e.id=="number"&&(e.id=(o=e.id)==null?void 0:o.toString()),e.children&&((n=e.children)==null?void 0:n.length)>0&&(e.children=e.children.map(pr)),e},Wa=e=>{var r;const a=[];return a.push({...e}),e!=null&&e.children&&Array.isArray(e.children)&&((r=e.children)==null||r.forEach(o=>{a.push(...Wa(o))})),(a==null?void 0:a.length)>0?a==null?void 0:a.map(o=>{const n={...o};return delete n.children,n}):[]},ga=(e=!0,a,r)=>{var k,x,v,N,U,P,$,S,M,R,L,_,w,u,y,h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne;let o=ce.getColumnChild((k=D.cloneDeep(Q.value))==null?void 0:k.filter(G=>(G==null?void 0:G.label)!=="操作")),n,c=D.cloneDeep(Y.value);if(!hl.value){jl.value=!1;return}if(Ll.value===""){la.value++;let G;a&&r?G={id:la.value.toString(),[a==null?void 0:a.prop]:r,children:hl.value.children}:G={id:la.value.toString()},G!=null&&G.children&&(G={...G,children:(x=G.children)==null?void 0:x.map(re=>pr(re,a,r))}),c.push(Object.assign(hl.value,G)),n=Object.assign(hl.value,G)}else c=(v=dr(c,o))==null?void 0:v.newContents,n=(N=dr(c,o))==null?void 0:N.currentSelectContents;const t=(U=s.itemData)==null?void 0:U.filter(G=>(G==null?void 0:G.key)==="childTree")[0];if(((P=t==null?void 0:t.contents)==null?void 0:P.length)>0){ml.value="编辑";const G=[];c==null||c.forEach((re,Le)=>{var pe;let se={};if(Array.isArray(re)){let xe=[];re==null||re.filter(Ve=>!(Ve!=null&&Ve.id)).forEach((Ve,A)=>{var I,Re,je,We,f,ae,Pe;if((Re=(I=Al.value)==null?void 0:I[A])!=null&&Re.prop&&!Array.isArray(Ve)){let m={};m[Al.value[A].column]=Ve,ze!=null&&ze.value&&((je=ze==null?void 0:ze.value)==null?void 0:je.length)>0&&((We=ze==null?void 0:ze.value)!=null&&We.find(ge=>JSON.stringify(ge==null?void 0:ge[0])===JSON.stringify(m)))&&(xe=(f=ze==null?void 0:ze.value)==null?void 0:f.find(ge=>JSON.stringify(ge==null?void 0:ge[0])===JSON.stringify(m))),xe&&xe.length>0?se[Al.value[A].prop]=xe!=null&&xe.find(ge=>{var Te;return((Te=Object.keys(ge))==null?void 0:Te[0])===Al.value[A].column})?(ae=xe==null?void 0:xe.find(ge=>{var Te;return((Te=Object.keys(ge))==null?void 0:Te[0])===Al.value[A].column}))==null?void 0:ae[Al.value[A].column]:Ve:se[Al.value[A].prop]=Ve}else Array.isArray(Ve)&&((Pe=Al.value[A])!=null&&Pe.prop?se[Al.value[A].prop]=Ve:se.children=Ha(Ve,Al.value))})}else se=re;if(Array.isArray(re)&&re.some(xe=>xe==null?void 0:xe.id)){const xe=(pe=re==null?void 0:re.find(Ve=>Ve.id))==null?void 0:pe.id;G.push(Object.assign(se,{id:rr(xe)}))}else se.id?G.push(se):G.push(Object.assign(se,{id:Le.toString()}))}),Y.value=gr(G,t,Q.value)}else Y.value=c;yr(Y.value),ta.value=Y.value;const i=_n(ta.value,da.value,c);let p=[];if(ia.value?(p=($=D.cloneDeep(ia).value.singleContent)==null?void 0:$.filter(G=>(G==null?void 0:G.id)!==(n==null?void 0:n.id)),p.push(n)):p=[n],El.value){const G={content:i,singleContent:((S=t==null?void 0:t.contents)==null?void 0:S.length)>0?p==null?void 0:p.flatMap(Wa):p,index:s==null?void 0:s.index,buttonName:"编辑",column:Q.value,parentTableId:s==null?void 0:s.parentTableId};Ye.setCacheUpdatingData(G)}if(e){let G=(_=(L=(R=(M=s.itemData)==null?void 0:M.find(se=>(se==null?void 0:se.key)==="filterAllType"))==null?void 0:R.value)==null?void 0:L.find(se=>(se==null?void 0:se.value)==="onConditionContents"))==null?void 0:_.content,re=(w=s.itemData)==null?void 0:w.filter(se=>(se==null?void 0:se.key)==="filterAllType");re=Array.from(new Map(re.filter(Boolean).map((se,pe)=>[se.value,{...se,_idx:pe}])).values()).sort((se,pe)=>se._idx-pe._idx).map(({_idx:se,...pe})=>pe),re=(u=re==null?void 0:re[(re==null?void 0:re.length)-1])==null?void 0:u.value;const Le={content:i,singleContent:((y=t==null?void 0:t.contents)==null?void 0:y.length)>0?Wa(n):n,index:s==null?void 0:s.index,buttonName:ml.value,column:Q.value,parentTableId:s==null?void 0:s.parentTableId,filter:G,allFilter:re,pathIndex:(K=(h=s.itemData)==null?void 0:h.find(se=>(se==null?void 0:se.key)==="relatedFilter"))==null?void 0:K.index,rowContents:ke.value,addArrayValues:Qe.value};Ye.setTableLoading(s==null?void 0:s.index),jl.value=!1,hl.value=void 0,Ue("change",Le)}if((d=(J=(O=ke.value)==null?void 0:O[0])==null?void 0:J.optionUrl)!=null&&d.menuId){jl.value=!1;let G=(T=s.itemData)==null?void 0:T.filter(re=>(re==null?void 0:re.key)==="filterAllType");if((G==null?void 0:G.length)>0){let re=G==null?void 0:G.map(pe=>pe==null?void 0:pe.value),Le=(C=(F=(ie=re.flat().find(pe=>{var xe;return(xe=pe==null?void 0:pe.content)==null?void 0:xe.includes("@Num")}))==null?void 0:ie.content)==null?void 0:F.split(":"))==null?void 0:C[1];((ee=(le=(j=re.flat().find(pe=>{var xe;return(xe=pe==null?void 0:pe.content)==null?void 0:xe.includes("@Type:")}))==null?void 0:j.content)==null?void 0:le.split(":"))==null?void 0:ee[1])!=="Manual"&&(Le=parseInt(Le),Y.value=(Ne=Y.value)==null?void 0:Ne.slice(((Z=Y.value)==null?void 0:Z.length)-Le,(ve=Y.value)==null?void 0:ve.length))}}};l.onUnmounted(()=>{Q.value=[],Y.value=[],qe.value=[],La.value=[],Dl.value=[],Jl.value=[],ua.value=[],xl.value=[],ke.value=[],Tl.value=[],V.value=null});const fr=async(e,a,r)=>{var k,x,v,N,U,P,$,S,M,R,L;wl.value=r==null?void 0:r.prop;const o=D.cloneDeep(s.itemData),n=o==null?void 0:o.map(_=>{var w;return(_==null?void 0:_.key)==="header"&&((w=_.contents)==null||w.map((u,y)=>{var h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne,G,re,Le,se;return u.type=u!=null&&u.type?u.type:(J=(O=(K=(h=u==null?void 0:u.key)==null?void 0:h.split("$"))==null?void 0:K[1])==null?void 0:O.split("("))!=null&&J[0]?(T=(d=ce.FormType)==null?void 0:d.find(pe=>{var xe,Ve,A,I;return(pe==null?void 0:pe.key)===((I=(A=(Ve=(xe=u==null?void 0:u.key)==null?void 0:xe.split("$"))==null?void 0:Ve[1])==null?void 0:A.split("("))==null?void 0:I[0])}))==null?void 0:T.value:"Input",u.options=u!=null&&u.options?u.options:((C=(F=(ie=u==null?void 0:u.key)==null?void 0:ie.split("$"))==null?void 0:F[1])==null?void 0:C.length)>0?(Z=(ee=wa((le=(j=u==null?void 0:u.key)==null?void 0:j.split("$"))==null?void 0:le[1]))==null?void 0:ee.split(","))==null?void 0:Z.map(pe=>({label:pe,value:pe})):[],(ve=u==null?void 0:u.key)!=null&&ve.includes("$")&&(u.key=(G=(Ne=u==null?void 0:u.key)==null?void 0:Ne.split("$"))==null?void 0:G[0]),u.value=(re=Object.values(a))==null?void 0:re[y],u.optionUrl=u!=null&&u.formMenuSelect&&((Le=u==null?void 0:u.formMenuSelect)==null?void 0:Le.length)>0?{groupSelect:(se=u==null?void 0:u.groupSelect)==null?void 0:se.split(/[::]/).map(pe=>pe.trim()),menuSelect:u==null?void 0:u.formMenuSelect,selectRelateType:"",type:(u==null?void 0:u.formType)??(u!=null&&u.groupSelect?"Select":"")}:null,u})),_});let c=D.cloneDeep(ke.value),t=(x=(k=D.cloneDeep(n))==null?void 0:k.find(_=>(_==null?void 0:_.key)==="header"))==null?void 0:x.contents;c=c==null?void 0:c.map(_=>{var w;return _.value=(w=t==null?void 0:t.find((u,y)=>y===(_==null?void 0:_.id)))==null?void 0:w.value,_});let i="",p=(U=(N=(v=D.cloneDeep(n))==null?void 0:v.find(_=>(_==null?void 0:_.key)==="header"))==null?void 0:N.contents)==null?void 0:U.find((_,w)=>{var u,y,h;return(_==null?void 0:_.label)===wl.value||(w==null?void 0:w.toString())===((h=(y=(u=wl.value)==null?void 0:u.split("a"))==null?void 0:y[1])==null?void 0:h.toString())});if((S=($=(P=D.cloneDeep(n))==null?void 0:P.find(_=>(_==null?void 0:_.key)==="header"))==null?void 0:$.contents)==null||S.forEach(_=>{var w,u,y,h,K;i===""&&((y=(u=(w=_==null?void 0:_.optionUrl)==null?void 0:w.groupSelect)==null?void 0:u[1])!=null&&y.includes("["))&&(i=(K=(h=_==null?void 0:_.optionUrl)==null?void 0:h.groupSelect)==null?void 0:K[1])}),(M=p==null?void 0:p.optionUrl)!=null&&M.menuSelect){let _=await Ba(p),w;if(_==null||_.forEach(u=>{var y,h,K,O,J,d,T,ie,F,C;i===((h=(y=p==null?void 0:p.optionUrl)==null?void 0:y.groupSelect)==null?void 0:h[1])&&((J=(O=(K=p==null?void 0:p.optionUrl)==null?void 0:K.groupSelect)==null?void 0:O[1])!=null&&J.includes("["))&&((C=D.cloneDeep(u))==null?void 0:C[(F=(ie=(T=(d=p==null?void 0:p.optionUrl)==null?void 0:d.groupSelect)==null?void 0:T[1])==null?void 0:ie.replaceAll("[",""))==null?void 0:F.replaceAll("]","")])===(p==null?void 0:p.value)&&(w=u)}),w){let u=D.cloneDeep(c);u=u==null?void 0:u.map(h=>{var K,O,J,d,T,ie,F,C,j,le,ee;return(w!=null&&w[h==null?void 0:h.label]||w!=null&&w[(d=(J=(O=(K=h==null?void 0:h.optionUrl)==null?void 0:K.groupSelect)==null?void 0:O[1])==null?void 0:J.replaceAll("[",""))==null?void 0:d.replaceAll("]","")])&&((F=(ie=(T=h==null?void 0:h.optionUrl)==null?void 0:T.groupSelect)==null?void 0:ie[1])!=null&&F.includes("["))&&(h.value=(w==null?void 0:w[h==null?void 0:h.label])||(w==null?void 0:w[(ee=(le=(j=(C=h==null?void 0:h.optionUrl)==null?void 0:C.groupSelect)==null?void 0:j[1])==null?void 0:le.replaceAll("[",""))==null?void 0:ee.replaceAll("]","")])),h}),Y.value=(R=D.cloneDeep(Y.value))==null?void 0:R.map(h=>{if((h==null?void 0:h.id)===(a==null?void 0:a.id)){const K={};return u==null||u.forEach(O=>{K[O.name]=O.value}),K.id=h==null?void 0:h.id,K}return h});let y=D.cloneDeep(u);y=y==null?void 0:y.map(h=>{var K,O,J,d;return(O=(K=h==null?void 0:h.optionUrl)==null?void 0:K.menuSelect)!=null&&O.some(T=>T==null?void 0:T.includes)&&(h.optionUrl.menuSelect=(d=(J=h==null?void 0:h.optionUrl)==null?void 0:J.menuSelect)==null?void 0:d.map(T=>{var ie,F,C,j;if(T!=null&&T.includes("[")){let le=(F=(ie=T==null?void 0:T.replaceAll("[","").replaceAll("]",""))==null?void 0:ie.split(":"))==null?void 0:F[1];T=(j=(C=D.cloneDeep(u))==null?void 0:C.find(ee=>(ee==null?void 0:ee.label)===le))==null?void 0:j.value}return T})),h}),Y.value=(L=D.cloneDeep(Y.value))==null?void 0:L.map(h=>{if((h==null?void 0:h.id)===(a==null?void 0:a.id)){const K={};return y==null||y.forEach(O=>{K[O.name]=O.value}),K.id=h==null?void 0:h.id,K}return h})}}},Ro=async e=>{var U,P,$,S,M,R,L,_,w,u,y,h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne,G,re,Le,se,pe,xe,Ve;if(!e)return;hl.value=e;const a=D.cloneDeep(s.itemData);let r=a==null?void 0:a.map(A=>{var I,Re,je,We;return(A==null?void 0:A.key)==="header"&&(Array.isArray((I=A.contents)==null?void 0:I[0])?A.contents=(je=ce.getColumnChild((Re=A.contents)==null?void 0:Re[0]))==null?void 0:je.map((f,ae)=>{var Pe,m,ge,Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl,b,q,_e,cl,Nl,tl;return f.type=f!=null&&f.type?f.type:(Te=(ge=(m=(Pe=f==null?void 0:f.key)==null?void 0:Pe.split("$"))==null?void 0:m[1])==null?void 0:ge.split("("))!=null&&Te[0]?(al=(ll=ce.FormType)==null?void 0:ll.find(Ae=>{var gl,ye,B,g;return(Ae==null?void 0:Ae.key)===((g=(B=(ye=(gl=f==null?void 0:f.key)==null?void 0:gl.split("$"))==null?void 0:ye[1])==null?void 0:B.split("("))==null?void 0:g[0])}))==null?void 0:al.value:"Input",f.options=f!=null&&f.options?f.options:((nl=(ol=(rl=f==null?void 0:f.key)==null?void 0:rl.split("$"))==null?void 0:ol[1])==null?void 0:nl.length)>0?(Ee=(Se=wa((el=(il=f==null?void 0:f.key)==null?void 0:il.split("$"))==null?void 0:el[1]))==null?void 0:Se.split(","))==null?void 0:Ee.map(Ae=>({label:Ae,value:Ae})):[],(ul=f==null?void 0:f.key)!=null&&ul.includes("$")&&(f.key=(fl=(pl=f==null?void 0:f.key)==null?void 0:pl.split("$"))==null?void 0:fl[0]),((b=(dl=(vl=ke.value)==null?void 0:vl.find(Ae=>(Ae==null?void 0:Ae.prop)===(f==null?void 0:f.prop)))==null?void 0:dl.optionUrl)==null?void 0:b.multiple)===!0&&!Array.isArray((q=Object.values(e))==null?void 0:q[ae])?f.value=[(_e=Object.values(e))==null?void 0:_e[ae]]:f.value=(cl=Object.values(e))==null?void 0:cl[ae],f.optionUrl=f!=null&&f.formMenuSelect&&((Nl=f==null?void 0:f.formMenuSelect)==null?void 0:Nl.length)>0?{groupSelect:(tl=f==null?void 0:f.groupSelect)==null?void 0:tl.split(/[::]/).map(Ae=>Ae.trim()),menuSelect:f==null?void 0:f.formMenuSelect,selectRelateType:"",type:(f==null?void 0:f.formType)??(f!=null&&f.groupSelect?"Select":"")}:null,f}):A.contents=(We=A.contents)==null?void 0:We.map((f,ae)=>{var Pe,m,ge,Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl,b,q,_e,cl,Nl,tl;return f.type=f!=null&&f.type?f.type:(Te=(ge=(m=(Pe=f==null?void 0:f.key)==null?void 0:Pe.split("$"))==null?void 0:m[1])==null?void 0:ge.split("("))!=null&&Te[0]?(al=(ll=ce.FormType)==null?void 0:ll.find(Ae=>{var gl,ye,B,g;return(Ae==null?void 0:Ae.key)===((g=(B=(ye=(gl=f==null?void 0:f.key)==null?void 0:gl.split("$"))==null?void 0:ye[1])==null?void 0:B.split("("))==null?void 0:g[0])}))==null?void 0:al.value:"Input",f.options=f!=null&&f.options?f.options:((nl=(ol=(rl=f==null?void 0:f.key)==null?void 0:rl.split("$"))==null?void 0:ol[1])==null?void 0:nl.length)>0?(Ee=(Se=wa((el=(il=f==null?void 0:f.key)==null?void 0:il.split("$"))==null?void 0:el[1]))==null?void 0:Se.split(","))==null?void 0:Ee.map(Ae=>({label:Ae,value:Ae})):[],(ul=f==null?void 0:f.key)!=null&&ul.includes("$")&&(f.key=(fl=(pl=f==null?void 0:f.key)==null?void 0:pl.split("$"))==null?void 0:fl[0]),((b=(dl=(vl=ke.value)==null?void 0:vl.find(Ae=>(Ae==null?void 0:Ae.prop)===(f==null?void 0:f.prop)))==null?void 0:dl.optionUrl)==null?void 0:b.multiple)===!0&&!Array.isArray((q=Object.values(e))==null?void 0:q[ae])?f.value=[(_e=Object.values(e))==null?void 0:_e[ae]]:f.value=(cl=Object.values(e))==null?void 0:cl[ae],f.optionUrl=f!=null&&f.formMenuSelect&&((Nl=f==null?void 0:f.formMenuSelect)==null?void 0:Nl.length)>0?{groupSelect:(tl=f==null?void 0:f.groupSelect)==null?void 0:tl.split(/[::]/).map(Ae=>Ae.trim()),menuSelect:f==null?void 0:f.formMenuSelect,selectRelateType:"",type:(f==null?void 0:f.formType)??(f!=null&&f.groupSelect?"Select":"")}:null,f})),A}),o=ke.value,n=(P=(U=D.cloneDeep(r))==null?void 0:U.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:P.contents;if(n=n==null?void 0:n.filter(A=>(A==null?void 0:A.label)!=="操作"),n.push({label:"操作",type:"operate"}),o=o==null?void 0:o.map(A=>{var I;return A.value=A.value??((I=n==null?void 0:n.find((Re,je)=>(Re==null?void 0:Re.prop)===(A==null?void 0:A.name)))==null?void 0:I.value),A}),!pa.value)return;let c="",t=D.cloneDeep(wl.value);($=wl.value)!=null&&$.includes("·")&&(wl.value=(M=(S=wl.value)==null?void 0:S.split("·"))==null?void 0:M[0]);let i=(_=(L=(R=D.cloneDeep(r))==null?void 0:R.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:L.contents)==null?void 0:_.find((A,I)=>{var Re,je,We;return(A==null?void 0:A.prop)===wl.value||(I==null?void 0:I.toString())===((We=(je=(Re=wl.value)==null?void 0:Re.split("a"))==null?void 0:je[1])==null?void 0:We.toString())}),p=(w=i==null?void 0:i.optionUrl)==null?void 0:w.menuSelect,k=!0;(h=(y=(u=D.cloneDeep(r))==null?void 0:u.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:y.contents)==null||h.forEach(A=>{var I,Re,je,We,f,ae;k&&((je=(Re=(I=A==null?void 0:A.optionUrl)==null?void 0:I.groupSelect)==null?void 0:Re[1])!=null&&je.includes("["))&&(c=(f=(We=A==null?void 0:A.optionUrl)==null?void 0:We.groupSelect)==null?void 0:f[1],JSON.stringify(p)===JSON.stringify((ae=A==null?void 0:A.optionUrl)==null?void 0:ae.menuSelect)&&(k=!1))});let x=D.cloneDeep(o),v=X.value;v!=null&&v.find(A=>(i==null?void 0:i.prop)===(A==null?void 0:A.key))&&(v=v==null?void 0:v.filter(A=>(i==null?void 0:i.prop)!==(A==null?void 0:A.key))),v!=null&&v.find(A=>t===(A==null?void 0:A.key))&&(v=v==null?void 0:v.filter(A=>t!==(A==null?void 0:A.key))),x=x==null?void 0:x.map(A=>{var I,Re,je,We,f,ae,Pe,m,ge;return(A==null?void 0:A.type)==="Select"&&(((Re=(I=A==null?void 0:A.optionUrl)==null?void 0:I.allSelectionContents)==null?void 0:Re.length)>0&&(A.optionUrl.contactValue=e),((i==null?void 0:i.prop)===(A==null?void 0:A.prop)||t===(A==null?void 0:A.prop))&&i&&(Array.isArray(i.value)&&((je=i.value)==null?void 0:je.length)>0&&((We=i.value)!=null&&We.every(Te=>typeof Te=="string"))?(v.push({key:A==null?void 0:A.prop,value:[(ae=i.value)==null?void 0:ae[((f=i.value)==null?void 0:f.length)-1]]}),A.selectValue=(Pe=v==null?void 0:v.find(Te=>(Te==null?void 0:Te.key)===(A==null?void 0:A.prop)))==null?void 0:Pe.value):Array.isArray(i.value)&&((m=i.value)==null?void 0:m.length)===0?(v=[],A.selectValue=[],e[A==null?void 0:A.prop]=""):Array.isArray(A.value)&&v.push({key:A==null?void 0:A.prop,value:[(ge=A.value)==null?void 0:ge[(A==null?void 0:A.length)-1]]}))),A.value=e==null?void 0:e[A==null?void 0:A.prop],A}),X.value=v,ke.value=D.cloneDeep(x);let N=(i==null?void 0:i.menuId)??((J=(O=(K=ke.value)==null?void 0:K.find(A=>{var I;return(I=A==null?void 0:A.optionUrl)==null?void 0:I.menuId}))==null?void 0:O.optionUrl)==null?void 0:J.menuId);if((d=i==null?void 0:i.optionUrl)!=null&&d.menuSelect&&pa.value||N){let A=await Ba(i,N),I;if(A==null||A.forEach(f=>{var ae,Pe,m,ge,Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl,b,q,_e,cl,Nl,tl,Ae,gl;if(!N&&c===((Pe=(ae=i==null?void 0:i.optionUrl)==null?void 0:ae.groupSelect)==null?void 0:Pe[1])&&((Te=(ge=(m=i==null?void 0:i.optionUrl)==null?void 0:m.groupSelect)==null?void 0:ge[1])!=null&&Te.includes("["))&&((nl=D.cloneDeep(f))==null?void 0:nl[(ol=(rl=(al=(ll=i==null?void 0:i.optionUrl)==null?void 0:ll.groupSelect)==null?void 0:al[1])==null?void 0:rl.replaceAll("[",""))==null?void 0:ol.replaceAll("]","")])===(i==null?void 0:i.value)&&(I=f),N){let ye=(el=(il=ke.value)==null?void 0:il.find(ue=>{var me;return(i==null?void 0:i.menuId)===((me=ue==null?void 0:ue.optionUrl)==null?void 0:me.menuId)}))==null?void 0:el.prop,B=e[ye];if(ye!=null&&ye.includes("·"))if(!Array.isArray(e[ye]))B=(Ee=(Se=e[ye])==null?void 0:Se.split(" "))==null?void 0:Ee[0],ye=(ul=ye==null?void 0:ye.split("·"))==null?void 0:ul[0];else{ye=(pl=ye==null?void 0:ye.split("·"))==null?void 0:pl[0];let ue=(vl=(fl=x==null?void 0:x.find(me=>(me==null?void 0:me.prop)===ye))==null?void 0:fl.selectValue)==null?void 0:vl[0];B=(dl=ue==null?void 0:ue.split(" "))==null?void 0:dl[0]}let g=(q=(b=x==null?void 0:x.find(ue=>{var me;return(ue==null?void 0:ue.prop)===ye||((me=ue==null?void 0:ue.prop)==null?void 0:me.includes("."+ye))}))==null?void 0:b.selectValue)==null?void 0:q[0];if(ye!=null&&ye.includes(".")&&!f[ye]&&(ye=(cl=ye==null?void 0:ye.split("."))==null?void 0:cl[((_e=ye==null?void 0:ye.split("."))==null?void 0:_e.length)-1]),Array.isArray(B)&&!g&&(g=B==null?void 0:B[0]),f[ye]===(Array.isArray(B)?g:B)&&(i==null?void 0:i.directiveLabel)==="#isMain"){if(t!=null&&t.includes("·")){let ue=t==null?void 0:t.split("·"),me=(gl=(Ae=(tl=Array.isArray(e==null?void 0:e[t])?(Nl=e==null?void 0:e[t])==null?void 0:Nl[0]:e==null?void 0:e[t])==null?void 0:tl.split(" "))==null?void 0:Ae.filter(De=>De&&De!==""))==null?void 0:gl.map(De=>De==null?void 0:De.trim());ue==null||ue.forEach((De,Ge)=>{f[De]=me==null?void 0:me[Ge]})}I=f}}}),kl.value&&(i==null?void 0:i.directiveLabel)==="#isMain"&&(Qe.value=[]),!I){if(kl.value&&(i==null?void 0:i.directiveLabel)==="#isMain")if(t!=null&&t.includes("·")){let f=e,ae=(F=(ie=(T=e==null?void 0:e[t])==null?void 0:T.split(" "))==null?void 0:ie.filter(m=>m&&m!==""))==null?void 0:F.map(m=>m==null?void 0:m.trim());(C=t==null?void 0:t.split("·"))==null||C.forEach((m,ge)=>{f[m]=ae[ge]});let Pe=(j=ke.value)==null?void 0:j.find(m=>(m==null?void 0:m.prop)===t);f[Pe.prop]=[Pe.value],I=f}else{let f=(le=ke.value)==null?void 0:le.find(ae=>(ae==null?void 0:ae.prop)===(i==null?void 0:i.prop));e[f.prop]=[f.value],I=e}else if((i==null?void 0:i.directiveLabel)==="#isMain"){let f={};(ee=ke.value)==null||ee.forEach(ae=>{var Pe,m;(ae==null?void 0:ae.prop)===t?f[ae.prop]=(Pe=ae==null?void 0:ae.selectValue)!=null&&Pe[0]?[(m=ae==null?void 0:ae.selectValue)==null?void 0:m[0]]:"":f[ae.prop]=""}),I=f}}if(I){let f=D.cloneDeep(o);f=f==null?void 0:f.map(m=>{var Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl,b,q,_e,cl,Nl,tl,Ae,gl,ye,B,g,ue,me,De,Ge,Fe,Pl,zl,Vl,Ce;(I!=null&&I[m==null?void 0:m.prop]||I!=null&&I[(rl=(al=(ll=(Te=m==null?void 0:m.optionUrl)==null?void 0:Te.groupSelect)==null?void 0:ll[1])==null?void 0:al.replaceAll("[",""))==null?void 0:rl.replaceAll("]","")])&&((il=(nl=(ol=m==null?void 0:m.optionUrl)==null?void 0:ol.groupSelect)==null?void 0:nl[1])!=null&&il.includes("["))&&(m!=null&&m.relatedValueId)&&(m.value=(I==null?void 0:I[m==null?void 0:m.prop])||(I==null?void 0:I[(ul=(Ee=(Se=(el=m==null?void 0:m.optionUrl)==null?void 0:el.groupSelect)==null?void 0:Se[1])==null?void 0:Ee.replaceAll("[",""))==null?void 0:ul.replaceAll("]","")]));let ge=I==null?void 0:I[m==null?void 0:m.prop];return(pl=m==null?void 0:m.prop)!=null&&pl.includes(".")&&!ge&&((vl=(fl=i==null?void 0:i.prop)==null?void 0:fl.split("."))==null?void 0:vl[0])===((b=(dl=m==null?void 0:m.prop)==null?void 0:dl.split("."))==null?void 0:b[0])&&(ge=(I==null?void 0:I[(Nl=(q=m==null?void 0:m.prop)==null?void 0:q.split("."))==null?void 0:Nl[((cl=(_e=m==null?void 0:m.prop)==null?void 0:_e.split("."))==null?void 0:cl.length)-1]])??(I==null?void 0:I[m==null?void 0:m.prop])),N&&(ge||ge==="")&&(m!=null&&m.relatedValueId)&&ml.value==="新增"&&((m==null?void 0:m.prop)!==(i==null?void 0:i.prop)||t!=null&&t.includes((i==null?void 0:i.prop)+"·")||t!=null&&t.includes("·"+(m==null?void 0:m.prop)))?m.value=ge??(I==null?void 0:I[(ye=(gl=(Ae=(tl=m==null?void 0:m.optionUrl)==null?void 0:tl.groupSelect)==null?void 0:Ae[1])==null?void 0:gl.replaceAll("[",""))==null?void 0:ye.replaceAll("]","")]):(t!=null&&t.includes("·"+(m==null?void 0:m.prop))||t!=null&&t.includes("."))&&(m==null?void 0:m.prop)!==(i==null?void 0:i.prop)&&!Array.isArray((g=(B=ke.value)==null?void 0:B.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:g.value)?m.value=ge??"":((ue=m==null?void 0:m.optionUrl)==null?void 0:ue.multiple)===!0&&!Array.isArray((De=(me=ke.value)==null?void 0:me.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:De.value)?m.value=((Fe=(Ge=ke.value)==null?void 0:Ge.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:Fe.value)===""?[]:[(zl=(Pl=ke.value)==null?void 0:Pl.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:zl.value]:m.value=(Ce=(Vl=ke.value)==null?void 0:Vl.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:Ce.value,m}),ke.value=D.cloneDeep(f);let ae=D.cloneDeep(f);ae=ae==null?void 0:ae.map(m=>{var ge,Te,ll,al,rl,ol,nl,il,el;return(Te=(ge=m==null?void 0:m.optionUrl)==null?void 0:ge.menuSelect)!=null&&Te.some(Se=>Se==null?void 0:Se.includes("["))&&(m.optionUrl.oldMenuSelect=(al=(ll=D.cloneDeep(m))==null?void 0:ll.optionUrl)==null?void 0:al.menuSelect,m.optionUrl.menuSelect=(ol=(rl=m==null?void 0:m.optionUrl)==null?void 0:rl.menuSelect)==null?void 0:ol.map(Se=>{var Ee,ul,pl,fl;if(Se!=null&&Se.includes("[")){let vl=(ul=(Ee=Se==null?void 0:Se.replaceAll("[","").replaceAll("]",""))==null?void 0:Ee.split(":"))==null?void 0:ul[1];Se=(fl=(pl=D.cloneDeep(f))==null?void 0:pl.find(dl=>(dl==null?void 0:dl.label)===vl))==null?void 0:fl.value}return Se})),((i==null?void 0:i.prop)===(m==null?void 0:m.prop)||t===(m==null?void 0:m.prop))&&Array.isArray(i.value)&&(nl=i.value)!=null&&nl.every(Se=>typeof Se=="string")&&(m.selectValue=((il=v==null?void 0:v.find(Se=>(Se==null?void 0:Se.key)===(m==null?void 0:m.prop)))==null?void 0:il.value)??((el=m.value)==null?void 0:el[0])),m}),ke.value=ae;let Pe={};(Z=ke.value)==null||Z.forEach(m=>{Pe[m.prop]=m==null?void 0:m.value}),hl.value=Pe}let Re=Qe.value,je={};(ve=ke.value)==null||ve.forEach(f=>{var ae,Pe,m,ge,Te,ll,al,rl,ol,nl,il;if(((f==null?void 0:f.directiveLabel)==="#isMain"||(ae=f==null?void 0:f.optionUrl)!=null&&ae.menuId)&&Array.isArray(f==null?void 0:f.value)){if(je[f.prop]||(je[f.prop]=(m=f.value)==null?void 0:m[((Pe=f.value)==null?void 0:Pe.length)-1]),(ge=f==null?void 0:f.prop)!=null&&ge.includes("·")){let el=(al=(ll=(Te=f==null?void 0:f.prop)==null?void 0:Te.split("·"))==null?void 0:ll.filter(Ee=>Ee&&Ee!==""))==null?void 0:al.map(Ee=>Ee==null?void 0:Ee.trim()),Se=(il=(nl=(ol=(rl=f==null?void 0:f.selectValue)==null?void 0:rl[0])==null?void 0:ol.split(" "))==null?void 0:nl.filter(Ee=>Ee&&Ee!==""))==null?void 0:il.map(Ee=>Ee==null?void 0:Ee.trim());el==null||el.forEach((Ee,ul)=>{je=Object.assign({},je,{[Ee]:Se==null?void 0:Se[ul]})})}}else je[f.prop]=(je==null?void 0:je[f==null?void 0:f.prop])??f.value});let We=(Ne=ke.value)==null?void 0:Ne.find(f=>{var ae;return(f==null?void 0:f.directiveLabel)==="#isMain"||((ae=f==null?void 0:f.optionUrl)==null?void 0:ae.menuId)});(i==null?void 0:i.directiveLabel)==="#isMain"&&((re=i==null?void 0:i.value)==null?void 0:re[((G=i==null?void 0:i.value)==null?void 0:G.length)-1])!==""?Re.push({label:i==null?void 0:i.prop,value:(se=i==null?void 0:i.value)==null?void 0:se[((Le=i==null?void 0:i.value)==null?void 0:Le.length)-1],objectValue:je}):((pe=We==null?void 0:We.value)==null?void 0:pe.length)>0&&((Ve=i==null?void 0:i.value)==null?void 0:Ve[((xe=i==null?void 0:i.value)==null?void 0:xe.length)-1])!==""&&(Re=Re==null?void 0:Re.map(f=>{var ae;return(f==null?void 0:f.value)===((ae=We==null?void 0:We.selectValue)==null?void 0:ae[0])&&(f.objectValue=je),f})),Qe.value=Re}pa.value=!0,kl.value=!1},Fo=e=>e?(e==null?void 0:e.toUpperCase())==="INPUT"?"TEXTAREA":e:"TEXTAREA",Ko=e=>{var c,t;const a=(t=(c=Dl.value)==null?void 0:c.find(i=>(i==null?void 0:i.label)===(e==null?void 0:e.label)))==null?void 0:t.multiple,r=e==null?void 0:e.prop;if((e==null?void 0:e.formType)!="Select")return;Y.value.forEach(i=>{const p=i==null?void 0:i[r];a&&Cr.isString(p)&&(i[r]=[p]),!a&&!Cr.isString(p)&&(i[r]="")})},hr=(e,a)=>{var r;return a==null||a.forEach(o=>{e[o==null?void 0:o.prop]=o==null?void 0:o.value}),e.children&&((r=e.children)==null?void 0:r.length)>0&&(e.children=e.children.map(o=>hr(o,a))),e},Ga=e=>{var r,o,n,c,t,i;va("");const a=(r=ke.value)==null?void 0:r.reduce((p,k)=>(p[k.name]=k.value,p),{});if(((o=Object.keys(a))==null?void 0:o.length)>0){hl.value=a,Ll.value="",la.value=(n=Y.value)==null?void 0:n.length,xl.value=(c=_l.value)==null?void 0:c.filter(k=>(k==null?void 0:k.label)!=="新增");const p=(i=(t=qe.value)==null?void 0:t.filter(k=>(k==null?void 0:k.label)!=="操作"))==null?void 0:i.map(k=>{var v,N,U;const x=(N=(v=Dl.value)==null?void 0:v.find(P=>(P==null?void 0:P.label)===(k==null?void 0:k.label)))==null?void 0:N.multiple;return Ko(k),{...k,contents:(k==null?void 0:k.options)??[],optionUrl:k!=null&&k.formMenuSelect&&((U=k==null?void 0:k.formMenuSelect)==null?void 0:U.length)>0?{groupSelect:k==null?void 0:k.groupSelect,menuSelect:k==null?void 0:k.formMenuSelect,selectRelateType:"",type:k==null?void 0:k.formType,multiple:x}:null}});Q.value=p==null?void 0:p.map(k=>hr(k,[{prop:"type",value:"edit"},{prop:"columnType",value:Fo(k==null?void 0:k.formType)||(k==null?void 0:k.columnType)}])),e==="createClick"&&ga(!1)}},oa={START:"开始时间",END:"结束时间",HOURS:"工时"},zo=(e,a)=>Number(ce.dayjs(a).diff(ce.dayjs(e),"day",!0).toFixed(1)),yr=e=>{var c;const a=s.itemData,r=(c=a==null?void 0:a.find(t=>(t==null?void 0:t.key)==="header"))==null?void 0:c.contents,o=new Map;return r==null||r.forEach((t,i)=>{const{label:p}=t;o.set(p,i)}),!o.has(oa.START)||!o.has(oa.END)||!o.has(oa.HOURS)?e:e==null?void 0:e.map(t=>{const i=t==null?void 0:t[oa.START],p=t==null?void 0:t[oa.END],k=zo(i,p);return i&&p&&(t[oa.HOURS]=`${k}天`),t})},vr=(e,a,r=0)=>{if(r>((a==null?void 0:a.length)??""))return e;const o=a==null?void 0:a[r],n=new Map;for(const t of e){const i=t[o];n.has(i)||n.set(i,[]),n.get(i)&&n.get(i).push(t)}const c=[];for(const[t,i]of n){const[p,...k]=i,x={...p};r+1===((a==null?void 0:a.length)??"")?x.children=i==null?void 0:i.map(v=>(v.level=D.cloneDeep(r)+1,v)).filter((v,N)=>N!==0):k.length>0&&(x.children=vr(k,a,r+1)),x.level=r,c.push(x)}return c},gr=(e,a,r)=>{var n;if(!(a!=null&&a.contents)||((n=a==null?void 0:a.contents)==null?void 0:n.length)===0)return e;let o=[];return o=vr(e,a==null?void 0:a.contents,0),o},br=(e,a)=>{var U,P,$,S,M,R,L,_,w,u,y,h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne,G,re,Le,se,pe,xe,Ve,A,I,Re,je,We,f,ae,Pe,m,ge,Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl;const r=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="header");e==null||e.filter(b=>(b==null?void 0:b.key)==="tableIndexColumn")[0];const o=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="childTree")[0];let n=!0;if(($=(P=(U=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="filterAllType"))==null?void 0:U.value)==null?void 0:P.find(b=>(b==null?void 0:b.value)==="onPamButtonContents"))!=null&&$.content){let b=(R=(M=(S=e==null?void 0:e.find(q=>(q==null?void 0:q.key)==="filterAllType"))==null?void 0:S.value)==null?void 0:M.find(q=>(q==null?void 0:q.value)==="onPamButtonContents"))==null?void 0:R.content;b=(L=b==null?void 0:b.split(":"))==null?void 0:L[1],b=(_=b.slice(1,(b==null?void 0:b.length)-1))==null?void 0:_.split(","),n=!!(b!=null&&b.find(q=>q==="操作"))}let c=a;const t=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="page"),i=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="rowButton"),p=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="extraButton"),k=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableContents"),x=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableIndex");Dl.value=(u=(w=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableToForm"))==null?void 0:w[0])==null?void 0:u.contents,Ya.value=(t==null?void 0:t.contents)??!0;let v=[];Xl.value===""?v=r==null?void 0:r[0]:v=(r==null?void 0:r.find(b=>(b==null?void 0:b.selectLabel)==="("+Xl.value+")"))??(r==null?void 0:r.find(b=>!(b!=null&&b.selectLabel)));let N=[];if(Xl.value===""?N=x==null?void 0:x[0]:N=(x==null?void 0:x.find(b=>(b==null?void 0:b.selectLabel)==="("+Xl.value+")"))??(x==null?void 0:x.find(b=>!(b!=null&&b.selectLabel))),((y=v==null?void 0:v.contents)==null?void 0:y.length)>0){let b=[];if(v!=null&&v.contents.some(B=>Array.isArray(B)&&(B==null?void 0:B.find(g=>g.children))))da.value===""?b=(K=(h=ce.getGradeColumns(v==null?void 0:v.contents,n,c))==null?void 0:h[0])==null?void 0:K.filter(B=>!Array.isArray(B)):(da.value.split("-"),b=(O=ce.getGradeColumns(v==null?void 0:v.contents,n,c))==null?void 0:O[0]);else{let B=v!=null&&v.contents.some(g=>Array.isArray(g))?(J=v==null?void 0:v.contents)==null?void 0:J[0]:v==null?void 0:v.contents;B!=null&&B.find(g=>(g==null?void 0:g.label)==="操作")||B.push({label:"操作"}),B==null||B.forEach((g,ue)=>{var Ge,Fe,Pl,zl,Vl;let me="";(Fe=(Ge=Me.value)==null?void 0:Ge.split("/"))==null||Fe.forEach(Ce=>{var Oe,Wl,na;if(Ce!==""){let Sl=(na=(Wl=(Oe=Ce==null?void 0:Ce.split(fe+"updateLoading"))==null?void 0:Oe[0])==null?void 0:Wl.split(fe+"loading"))==null?void 0:na[0];me=me===""?me+Sl:me+"/"+Sl}}),me=me+"/";const De=(Pl=Dl.value)==null?void 0:Pl.find(Ce=>(Ce==null?void 0:Ce.prop)===(g==null?void 0:g.prop));b.push({label:(g==null?void 0:g.label)==="操作"?n?"操作":"":(g==null?void 0:g.label)??"",prop:(g==null?void 0:g.label)==="操作"?"operate":(g==null?void 0:g.prop)??"a"+ue,width:g!=null&&g.width?parseInt(g.width):"",fixed:(g==null?void 0:g.fixed)??void 0,sortable:(g==null?void 0:g.sortable)??!1,filterable:(g==null?void 0:g.filterable)??!1,operable:(g==null?void 0:g.operable)??!1,showSummary:(g==null?void 0:g.showSummary)??!1,align:(g==null?void 0:g.align)??"left",showOverflowTooltip:(g==null?void 0:g.showOverflowTooltip)??!0,isNotDrag:(g==null?void 0:g.isNotDrag)??!1,isEditCol:(g==null?void 0:g.isEditCol)??!1,isOperate:(g==null?void 0:g.isOperate)??!1,id:(g==null?void 0:g.id)??ue,type:(g==null?void 0:g.label)==="操作"?"operate":void 0,formType:(g==null?void 0:g.formType)??(g!=null&&g.groupSelect?"Select":""),isTableColHidden:g==null?void 0:g.isTableColHidden,isFormColHidden:g==null?void 0:g.isFormColHidden,disabled:g==null?void 0:g.disabled,options:(g==null?void 0:g.options)??[],value:(g==null?void 0:g.value)??"",formMenuSelect:(g==null?void 0:g.formMenuSelect)??[],isRoute:(g==null?void 0:g.isRoute)??!1,groupSelect:g!=null&&g.groupSelect?(zl=g==null?void 0:g.groupSelect)==null?void 0:zl.replaceAll('"',"").split(":"):[],isMainKey:(g==null?void 0:g.isMainKey)||(g==null?void 0:g.directiveLabel)==="#isMain",columnType:(De==null?void 0:De.type)||(g==null?void 0:g.columnType)||"TEXTAREA",directiveLabel:g==null?void 0:g.directiveLabel,directiveColor:(g==null?void 0:g.directiveColor)??!1,isExistChild:!!(g!=null&&g.directiveLabel&&(c!=null&&c[me])&&!((Vl=g==null?void 0:g.directiveLabel)!=null&&Vl.includes("@"))&&(g==null?void 0:g.directiveLabel)==="#isMain"),childPath:(g==null?void 0:g.directiveLabel)!=="#isMain"?me:void 0,allSelectionContents:(g==null?void 0:g.allSelectionContents)??[],selectFilter:g==null?void 0:g.selectFilter,menuId:g==null?void 0:g.menuId,filterContent:g==null?void 0:g.filterContent,relatedValueId:g==null?void 0:g.relatedValueId})})}Q.value=ce.getNewColumnChild(b),La.value=ce.getNewColumnChild(b),oe.value=(d=Q.value)==null?void 0:d.map(B=>B==null?void 0:B.label),He.value=(T=Q.value)==null?void 0:T.every(B=>B==null?void 0:B.filterable),he.value=(ie=Q.value)==null?void 0:ie.every(B=>B==null?void 0:B.operable),$e.value=(F=Q.value)==null?void 0:F.every(B=>B==null?void 0:B.sortable);let q=(j=(C=ce.getAllLeafNodes(Q.value))==null?void 0:C.filter(B=>(B==null?void 0:B.type)!=="operate"))==null?void 0:j.map((B,g)=>({prop:(B==null?void 0:B.prop)??"a"+g,column:B.label}));Al.value=q;let _e=[];Xl.value===""?_e=k==null?void 0:k[0]:_e=(k==null?void 0:k.find(B=>(B==null?void 0:B.selectLabel)==="("+Xl.value+")"))??(k==null?void 0:k.find(B=>!(B!=null&&B.selectLabel)));let cl=Array.isArray((le=_e==null?void 0:_e.contents)==null?void 0:le[0])&&((ee=_e==null?void 0:_e.contents)!=null&&ee[0].every(B=>Array.isArray(B)))?(Z=_e==null?void 0:_e.contents)==null?void 0:Z[0]:_e==null?void 0:_e.contents;N!=null&&N.contents&&((ve=N==null?void 0:N.contents)==null?void 0:ve.length)!==0&&(cl=(Ne=D.cloneDeep(cl))==null?void 0:Ne.map((B,g)=>{if(!Array.isArray(B)){let ue={};for(let me in B)me!=="id"&&me!=="index"&&(ue[me]=B[me]);B=Object.values(ue)}return B}));const Nl=!!((G=Q.value)!=null&&G.find(B=>B.prop==="index"));cl=Nr(cl,N==null?void 0:N.contents,Nl);const tl=[];cl==null||cl.forEach((B,g)=>{var me;let ue={};if(Array.isArray(B)){let De=[];B==null||B.filter(Ge=>!(Ge!=null&&Ge.id)).forEach((Ge,Fe)=>{var Pl,zl,Vl,Ce,Oe,Wl;if((Pl=q==null?void 0:q[Fe])!=null&&Pl.prop&&!Array.isArray(Ge)){let na={};na[q[Fe].column]=Ge,ze!=null&&ze.value&&((zl=ze==null?void 0:ze.value)==null?void 0:zl.length)>0&&((Vl=ze==null?void 0:ze.value)!=null&&Vl.find(Sl=>JSON.stringify(Sl==null?void 0:Sl[0])===JSON.stringify(na)))&&(De=(Ce=ze==null?void 0:ze.value)==null?void 0:Ce.find(Sl=>JSON.stringify(Sl==null?void 0:Sl[0])===JSON.stringify(na))),De&&De.length>0?ue[q[Fe].prop]=De!=null&&De.find(Sl=>{var ba;return((ba=Object.keys(Sl))==null?void 0:ba[0])===q[Fe].column})?(Oe=De==null?void 0:De.find(Sl=>{var ba;return((ba=Object.keys(Sl))==null?void 0:ba[0])===q[Fe].column}))==null?void 0:Oe[q[Fe].column]:Ge:ue[q[Fe].prop]=Ge}else Array.isArray(Ge)&&((Wl=q[Fe])!=null&&Wl.prop?ue[q[Fe].prop]=Ge:ue.children=Ha(Ge,q))})}else ue=B;if(Array.isArray(B)&&B.some(De=>De==null?void 0:De.id)){const De=(me=B==null?void 0:B.find(Ge=>Ge.id))==null?void 0:me.id;tl.push(Object.assign(ue,{id:rr(De)}))}else ue.id?tl.push(ue):tl.push(Object.assign(ue,{id:g.toString()}))});try{const B=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),g=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null"),ue=B==null?void 0:B.tableId,me=B==null?void 0:B.compIndex;if(ue&&Array.isArray(g)&&g.length>0&&String(ue)===String(s==null?void 0:s.parentTableId)&&String(me)===String(s==null?void 0:s.index)){const De=new Set(tl.map(Fe=>String(Fe==null?void 0:Fe.id))),Ge=g.filter(Fe=>!De.has(String(Fe)));if(Ge.length>0){const Fe=B==null?void 0:B.pageKey,Pl=Fe!=null&&Fe.startsWith("/")?Fe.substring(1):Fe;((a==null?void 0:a[Fe])||(a==null?void 0:a[Pl])||[]).filter(Ce=>{var Oe,Wl;return((Oe=Ce==null?void 0:Ce.key)==null?void 0:Oe.type)==="data"&&String((Wl=Ce==null?void 0:Ce.key)==null?void 0:Wl.tableId)===String(ue)&&Ge.includes(Ce==null?void 0:Ce.id)}).forEach(Ce=>{var Oe;De.has(String(Ce==null?void 0:Ce.id))||(tl.push({id:Ce==null?void 0:Ce.id,...((Oe=Ce==null?void 0:Ce.value)==null?void 0:Oe.tableData)||{}}),De.add(String(Ce==null?void 0:Ce.id)))})}}}catch{}const Ae=Array.from(((re=Cl.value)==null?void 0:re.values())||[]).filter(B=>(B==null?void 0:B._isOCRRow)&&(B==null?void 0:B._ocrTableId)===(s==null?void 0:s.index));Y.value=gr(tl,o,Q.value),Ul.value=tl,(Le=Ul.value)==null||Le.forEach(B=>{var g;(g=Cl.value)==null||g.set(B.id,B)});const gl=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),ye=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null");if(gl&&Array.isArray(ye)&&ye.length>0&&String(gl==null?void 0:gl.compIndex)===String(s==null?void 0:s.index)){const B=new Set((Ul.value||[]).map(g=>String(g==null?void 0:g.id)));ye.filter(g=>!B.has(String(g)))}if(Ae.length>0){const B=new Set((Y.value||[]).map(ue=>ue==null?void 0:ue.id)),g=Ae.filter(ue=>!B.has(ue.id));g.length>0&&(Y.value=[...Y.value||[],...g],Ul.value=[...Ul.value||[],...g],g.forEach(ue=>{var me;return(me=Cl.value)==null?void 0:me.set(ue.id,ue)}))}}else Q.value=[],qe.value=[],Y.value=[],Ul.value=[],Cl.value=new Map;if(((se=i==null?void 0:i.contents)==null?void 0:se.length)>0)if((Ve=(xe=(pe=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="filterAllType"))==null?void 0:pe.value)==null?void 0:xe.find(b=>(b==null?void 0:b.value)==="onRowButtonContents"))!=null&&Ve.content){let b=(Re=(I=(A=e==null?void 0:e.find(q=>(q==null?void 0:q.key)==="filterAllType"))==null?void 0:A.value)==null?void 0:I.find(q=>(q==null?void 0:q.value)==="onButtonContents"))==null?void 0:Re.content;b=(je=b==null?void 0:b.split(":"))==null?void 0:je[1],b=(We=b.slice(1,(b==null?void 0:b.length)-1))==null?void 0:We.split(","),Jl.value=(f=i==null?void 0:i.contents)==null?void 0:f.filter(q=>b==null?void 0:b.find(_e=>_e===(q==null?void 0:q.label)))}else Jl.value=i==null?void 0:i.contents;else Jl.value=[];if(((ae=p==null?void 0:p.contents)==null?void 0:ae.length)>0)if((ge=(m=(Pe=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="filterAllType"))==null?void 0:Pe.value)==null?void 0:m.find(b=>(b==null?void 0:b.value)==="onButtonContents"))!=null&&ge.content){let b=(al=(ll=(Te=e==null?void 0:e.find(q=>(q==null?void 0:q.key)==="filterAllType"))==null?void 0:Te.value)==null?void 0:ll.find(q=>(q==null?void 0:q.value)==="onButtonContents"))==null?void 0:al.content;if(b=(rl=b==null?void 0:b.split(":"))==null?void 0:rl[1],b=(ol=b.slice(1,(b==null?void 0:b.length)-1))==null?void 0:ol.split(","),xl.value=(nl=p==null?void 0:p.contents)==null?void 0:nl.filter(q=>b==null?void 0:b.find(_e=>_e===(q==null?void 0:q.label))),_l.value=(il=p==null?void 0:p.contents)==null?void 0:il.filter(q=>b==null?void 0:b.find(_e=>_e===(q==null?void 0:q.label))),(el=p==null?void 0:p.contents)!=null&&el.some(q=>(q==null?void 0:q.label)==="OCR识别")&&!((Se=xl.value)!=null&&Se.some(q=>(q==null?void 0:q.label)==="OCR识别"))){const q=(Ee=p==null?void 0:p.contents)==null?void 0:Ee.find(_e=>(_e==null?void 0:_e.label)==="OCR识别");xl.value=[...xl.value,q],_l.value=[..._l.value,q]}Be.value=!!(b!=null&&b.find(q=>q==="搜索")),Xe.value=!!(b!=null&&b.find(q=>q==="块状显示"))}else xl.value=p==null?void 0:p.contents,_l.value=p==null?void 0:p.contents;else xl.value=[],_l.value=[];(ul=xl.value)!=null&&ul.some(b=>(b==null?void 0:b.label)==="OCR识别")||(xl.value=[...xl.value||[],{label:"OCR识别"}]),(pl=_l.value)!=null&&pl.some(b=>(b==null?void 0:b.label)==="OCR识别")||(_l.value=[..._l.value||[],{label:"OCR识别"}]),la.value=((fl=Y==null?void 0:Y.value)==null?void 0:fl.length)??0,yr(Y.value),ta.value=Y.value,El.value&&(Q.value=(dl=(vl=qe.value)==null?void 0:vl.filter(b=>(b==null?void 0:b.label)!=="操作"))==null?void 0:dl.map(b=>{var q;return{...b,type:"edit",optionUrl:b!=null&&b.formMenuSelect&&((q=b==null?void 0:b.formMenuSelect)==null?void 0:q.length)>0?{groupSelect:b==null?void 0:b.groupSelect,menuSelect:b==null?void 0:b.formMenuSelect,selectRelateType:"",type:b==null?void 0:b.formType}:null}}),Ga())};l.watch(()=>[s.itemData,Xl.value,$r.value,da.value,ze==null?void 0:ze.value],async()=>{var e,a,r,o,n,c;if((e=s==null?void 0:s.itemData)!=null&&e.find(t=>(t==null?void 0:t.key)==="columnPath")&&!((a=sa.value)!=null&&a.find(t=>{var i,p;return(t==null?void 0:t.key)===((p=(i=s==null?void 0:s.itemData)==null?void 0:i.find(k=>(k==null?void 0:k.key)==="columnPath"))==null?void 0:p.contents)}))){let t=sa.value,i={key:(o=(r=s==null?void 0:s.itemData)==null?void 0:r.find(p=>(p==null?void 0:p.key)==="columnPath"))==null?void 0:o.contents,value:(c=(n=s==null?void 0:s.itemData)==null?void 0:n.find(p=>(p==null?void 0:p.key)==="columnUsingPath"))==null?void 0:c.contents};t!=null&&t.find(p=>(p==null?void 0:p.key)===(i==null?void 0:i.key))?t=t==null?void 0:t.map(p=>((p==null?void 0:p.key)===(i==null?void 0:i.key)&&(p.value=i.value),p)):t.push(i),Ye.setTableViewContents(t)}br(s.itemData,s.allMapContents)},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.operatingForm,e=>{e!=null&&e.form&&(va(e==null?void 0:e.form),ml.value=e==null?void 0:e.dialogTitle,Ca.value=!0,jl.value=!0)},{immediate:!0,deep:!0});const kr=()=>{var e;(e=Je.value)!=null&&e.includes("read")&&(El.value=!El.value)},Vo=()=>{Da.value=!Da.value};l.watch(()=>{var e;return(e=s==null?void 0:s.config)==null?void 0:e.viewport},e=>{var a;Je.value=e,(e==null?void 0:e.length)===0?El.value=!1:(e!=null&&e.includes("read")||(El.value=!0),e!=null&&e.includes("edit")||(El.value=!1)),we.value=((a=s==null?void 0:s.config)==null?void 0:a.showIndex)||El.value},{immediate:!0}),l.watch(()=>El.value,e=>{var a;e?(Ga("viewChange"),Ye.setCacheUpdatingData(null)):(xl.value=_l.value,Q.value=La.value,ia.value&&(Ye.setTableLoading(s==null?void 0:s.index),Ue("change",ia.value))),de.value=e,we.value=e||((a=s==null?void 0:s.config)==null?void 0:a.showIndex)},{immediate:!0}),l.watch(()=>{var e;return(e=er.value)==null?void 0:e.length},e=>{e===0&&(ne.currentPage=1)}),l.watch(()=>s==null?void 0:s.compNames,e=>{Ze.contents=[{label:"列表名",prop:"groupName",name:"列表名",type:"select",value:"",id:0,contents:e||[],width:1}]},{immediate:!0}),l.ref(!1);const qo=(e,a)=>{var r;Ga("createClick"),a===ne.pageSize&&(ne.currentPage=Math.ceil(((r=Y.value)==null?void 0:r.length)/ne.pageSize))},Jo=(e,a,r)=>{var o;fr(r,e,a),hl.value=D.cloneDeep(e),Ll.value=e==null?void 0:e.id,la.value=(o=Y.value)==null?void 0:o.length,ml.value=typeof(e==null?void 0:e.id)=="string"?"新增":"编辑",ga(!1)},yl=e=>{var p,k,x,v,N,U,P,$,S,M;const{row:a,column:r,item:o,slotData:n}=e;let c=a!=null&&a[r==null?void 0:r.prop]||(a==null?void 0:a[r==null?void 0:r.prop])===0?((k=(p=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:p[0])==null?void 0:k.contents)??((a==null?void 0:a[r==null?void 0:r.prop])===0?"0":a==null?void 0:a[r==null?void 0:r.prop]):((v=(x=a==null?void 0:a[o==null?void 0:o.prop])==null?void 0:x[0])==null?void 0:v.contents)??(a==null?void 0:a[o==null?void 0:o.prop])??((U=(N=n==null?void 0:n[o==null?void 0:o.prop])==null?void 0:N[0])==null?void 0:U.contents)??(n==null?void 0:n[o==null?void 0:o.prop])??((S=($=a==null?void 0:a[(P=o==null?void 0:o.child)==null?void 0:P.prop])==null?void 0:$[0])==null?void 0:S.contents)??(a==null?void 0:a[(M=o==null?void 0:o.child)==null?void 0:M.prop]),i=Array.isArray(c)&&!(c!=null&&c.every(R=>typeof R=="string"||typeof R=="number"))?"查看":c;return i=Array.isArray(i)?i.join(","):i,i},Wo=e=>{var k,x,v,N,U,P,$,S,M,R;const{row:a,column:r,item:o,slotData:n}=e;let c=a!=null&&a[r==null?void 0:r.prop]?((x=(k=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:k[0])==null?void 0:x.contents)??(a==null?void 0:a[r==null?void 0:r.prop]):((N=(v=a==null?void 0:a[o==null?void 0:o.prop])==null?void 0:v[0])==null?void 0:N.contents)??(a==null?void 0:a[o==null?void 0:o.prop])??((P=(U=n==null?void 0:n[o==null?void 0:o.prop])==null?void 0:U[0])==null?void 0:P.contents)??(n==null?void 0:n[o==null?void 0:o.prop])??((M=(S=a==null?void 0:a[($=o==null?void 0:o.child)==null?void 0:$.prop])==null?void 0:S[0])==null?void 0:M.contents)??(a==null?void 0:a[(R=o==null?void 0:o.child)==null?void 0:R.prop]);const i=Array.isArray(c)&&!(c!=null&&c.every(L=>typeof L=="string"||typeof L=="number")),p=Array.isArray(c)&&(c==null?void 0:c.find(L=>L==null?void 0:L.url));return i&&p},Go=e=>{var t,i,p,k,x,v,N,U,P,$;const{row:a,column:r,item:o,slotData:n}=e||{};let c=a!=null&&a[r==null?void 0:r.prop]?((i=(t=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:t[0])==null?void 0:i.contents)??(a==null?void 0:a[r==null?void 0:r.prop]):((k=(p=a==null?void 0:a[o==null?void 0:o.prop])==null?void 0:p[0])==null?void 0:k.contents)??(a==null?void 0:a[o==null?void 0:o.prop])??((v=(x=n==null?void 0:n[o==null?void 0:o.prop])==null?void 0:x[0])==null?void 0:v.contents)??(n==null?void 0:n[o==null?void 0:o.prop])??((P=(U=a==null?void 0:a[(N=o==null?void 0:o.child)==null?void 0:N.prop])==null?void 0:U[0])==null?void 0:P.contents)??(a==null?void 0:a[($=o==null?void 0:o.child)==null?void 0:$.prop]);return Array.isArray(c)?(c==null?void 0:c.filter(S=>(S==null?void 0:S.url)||(S==null?void 0:S.downloadUrl)))??[]:[]},Ho=(e,a)=>e.find(r=>Object.values(r).some(o=>o===a));return l.watch(()=>wr.value,async e=>{if(e){sl.setContentLoading(!0),await l.nextTick();const a=Ho(Y.value,e==null?void 0:e.data);if(!a)return sl.setContentLoading(!1);await ir(e==null?void 0:e.data,null,a,{data:e==null?void 0:e.data,isMainKey:!0}),sl.setContentLoading(!1)}},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.cacheNewData,e=>{var a;e&&(Array.isArray(e)?e.forEach(r=>{var o,n,c,t,i,p,k;if((r==null?void 0:r.compId)===(s==null?void 0:s.index)&&(r!=null&&r.resId)&&((o=r==null?void 0:r.data)!=null&&o.id)&&(Y.value=(n=Y.value)==null?void 0:n.map(x=>{var v;return(x==null?void 0:x.id)===((v=r==null?void 0:r.data)==null?void 0:v.id)?{...x,id:r==null?void 0:r.resId}:x}),(i=(c=Cl.value)==null?void 0:c.has)!=null&&i.call(c,(t=r==null?void 0:r.data)==null?void 0:t.id))){const x=Cl.value.get((p=r==null?void 0:r.data)==null?void 0:p.id);Cl.value.delete((k=r==null?void 0:r.data)==null?void 0:k.id),Cl.value.set(r==null?void 0:r.resId,{...x,id:r==null?void 0:r.resId})}}):(e==null?void 0:e.compId)===(s==null?void 0:s.index)&&(Y.value=(a=Y.value)==null?void 0:a.map(r=>{var o;return(r==null?void 0:r.id)===((o=e==null?void 0:e.data)==null?void 0:o.id)?{...r,id:e==null?void 0:e.resId}:r})))},{immediate:!0,deep:!0}),(e,a)=>{var R,L,_,w;const r=l.resolveComponent("svg-icon"),o=l.resolveComponent("el-popover"),n=l.resolveComponent("el-switch"),c=l.resolveComponent("el-checkbox"),t=l.resolveComponent("el-radio"),i=l.resolveComponent("el-radio-group"),p=l.resolveComponent("el-checkbox-group"),k=l.resolveComponent("el-button"),x=l.resolveComponent("LookComponent"),v=l.resolveComponent("el-icon"),N=l.resolveComponent("el-upload"),U=l.resolveComponent("el-alert"),P=l.resolveComponent("el-table-column"),$=l.resolveComponent("el-input"),S=l.resolveComponent("el-table"),M=l.resolveDirective("loading");return l.openBlock(),l.createElementBlock("div",Dn,[Ia.value?(l.openBlock(),l.createBlock(bl.ssTable,{id:"excel-table",pageObj:ne,showIndex:we.value,isTree:(R=W.compItem)==null?void 0:R.isTree,summaryInfo:Rl,columns:Q.value,defaultSort:E,isCardViewport:Da.value,checkedColumns:oe.value,key:Ka.value+JSON.stringify(Q.value),tableData:er.value,isEditViewport:El.value,isShowPagination:Ya.value,isShowEdit:!1,isShowDelete:!1,allowSelect:de.value,onDbClickRow:co,extraButton:xl.value,rowButton:Jl.value,cacheExtraButtons:_l.value,isClearSelection:((L=Tl.value)==null?void 0:L.length)===0,onDoCurrentChange:qr,onDoSizeChange:Jr,onContentClick:ir,onRowClick:po,onSelectChange:Zr,onCellChange:Jo,onChange:fr,onPreview:ar,onSubmitEditingTable:Yr,onHandleColEditChange:Qr,onHandleColTypeChange:Xr,onClickButton:Ea},l.createSlots({headerButton:l.withCtx(u=>{var y,h;return[W.showHeader?(l.openBlock(),l.createBlock(hn,{key:0,pageLayout:W.pageLayout,lockingPage:l.unref(ka)===l.unref(Me),filterValues:nr.value,selectNums:(y=Tl.value)==null?void 0:y.length,dataNums:(h=Y.value)==null?void 0:h.length,compName:W.compName,isDevMode:W.isDevMode,buttons:u.buttons,onButtonClick:a[1]||(a[1]=K=>Ea(K,"",{})),columns:Q.value,onFilter:uo,onGetImportData:Gr,level:W.level,filterShow:Be.value},null,8,["pageLayout","lockingPage","filterValues","selectNums","dataNums","compName","isDevMode","buttons","columns","level","filterShow"])):l.createCommentVNode("",!0)]}),viewport:l.withCtx(()=>{var u,y,h,K;return[((u=Y.value)==null?void 0:u.length)>0&&W.allowOperate&&Xe.value?(l.openBlock(),l.createElementBlock("div",Tn,[(y=Je.value)!=null&&y.includes("read")&&((h=Je.value)!=null&&h.includes("edit"))&&((K=Jl.value)!=null&&K.some(O=>(O==null?void 0:O.label)==="编辑"))&&!Da.value&&l.unref(ka)!==l.unref(Me)?(l.openBlock(),l.createElementBlock("span",{key:0,title:"编辑表格",onClick:kr},[l.createVNode(r,{name:"editTable",class:"view-icon"})])):l.createCommentVNode("",!0),l.createElementVNode("span",{title:"卡片视图",onClick:Vo},[l.createVNode(r,{name:"cardViewport",class:"view-icon"})])])):l.createCommentVNode("",!0)]}),rowCreate:l.withCtx(({row:u,index:y})=>[l.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:h=>qo(u,y)},[l.createVNode(r,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,wn)]),operateCol:l.withCtx(()=>[l.createVNode(o,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"hover",onShow:Mo},{reference:l.withCtx(()=>[l.createElementVNode("span",Bn,[l.createVNode(r,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:l.withCtx(()=>[l.createElementVNode("div",On,[a[13]||(a[13]=l.createElementVNode("div",{class:"group-title"},"表格操作",-1)),l.createVNode(n,{"model-value":$e.value,"active-text":"排序","inactive-text":"",style:{"margin-right":"8px"},onChange:a[3]||(a[3]=u=>lo(u,"sortable"))},null,8,["model-value"]),a[14]||(a[14]=l.createElementVNode("div",{class:"group-title"},"表格列操作",-1)),l.createVNode(p,{modelValue:oe.value,"onUpdate:modelValue":a[4]||(a[4]=u=>oe.value=u),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:V},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(fa.value,u=>(l.openBlock(),l.createElementBlock("div",{style:{display:"flex","align-items":"center"},key:u.label},[l.createVNode(c,{value:u.label,style:{width:"100%",marginRight:0}},{default:l.withCtx(()=>[l.createElementVNode("span",{title:u.label,style:{display:"inline-block",width:"250px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},l.toDisplayString(u.label),9,Un)]),_:2},1032,["value"]),l.createVNode(o,{"popper-class":"col-operate-popover",title:"列操作",placement:"left",teleported:!1,trigger:"hover"},{reference:l.withCtx(()=>[l.createVNode(r,{name:"colOperate",style:{width:"15px",height:"15px",cursor:"pointer",color:"grey",position:"absolute",right:"40px"}})]),default:l.withCtx(()=>{var y;return[l.createElementVNode("div",Ln,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((y=Object.keys(u))==null?void 0:y.filter(h=>{var K;return(K=$l.value)==null?void 0:K.find(O=>(O==null?void 0:O.value)===h)}),h=>{var K,O;return l.openBlock(),l.createElementBlock("div",{key:h},[Bl[h]=="radio"?(l.openBlock(),l.createElementBlock("div",jn,[a[12]||(a[12]=l.createElementVNode("div",null,"固定:",-1)),l.createVNode(i,{"model-value":u==null?void 0:u[h],onChange:J=>lr(J,h,u)},{default:l.withCtx(()=>{var J,d;return[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((d=(J=$l.value)==null?void 0:J.find(T=>(T==null?void 0:T.value)===h))==null?void 0:d.options,T=>(l.openBlock(),l.createBlock(t,{key:T==null?void 0:T.value,label:T==null?void 0:T.value,value:T==null?void 0:T.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(T==null?void 0:T.label),1)]),_:2},1032,["label","value"]))),128))]}),_:2},1032,["model-value","onChange"])])):l.createCommentVNode("",!0),Bl[h]=="switch"?(l.openBlock(),l.createBlock(n,{key:1,"model-value":u==null?void 0:u[h],"active-text":(O=(K=$l.value)==null?void 0:K.find(J=>(J==null?void 0:J.value)===h))==null?void 0:O.label,onChange:J=>lr(J,h,u)},null,8,["model-value","active-text","onChange"])):l.createCommentVNode("",!0)])}),128))])]}),_:2},1024),l.createElementVNode("span",Pn,[l.createVNode(r,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px"}})])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),content:l.withCtx(u=>{var y,h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne,G,re,Le,se;return[((y=u==null?void 0:u.column)==null?void 0:y.label)==="OCR图片"||((h=u==null?void 0:u.column)==null?void 0:h.prop)==="OCR图片"?(l.openBlock(),l.createElementBlock("div",$n,[l.createVNode(r,{name:"query",style:{width:"20px",height:"20px",color:"var(--ssComponent-theme-color)",cursor:"pointer"},onClick:l.withModifiers(pe=>To(u),["stop"]),title:"查看OCR图片"},null,8,["onClick"])])):Wo(u)?(l.openBlock(),l.createBlock(o,{key:1,"popper-class":"file-popover",placement:"right",trigger:"hover",effect:"light",width:"auto"},{reference:l.withCtx(()=>[l.createElementVNode("span",Mn,l.toDisplayString(yl(u)),1)]),default:l.withCtx(()=>{var pe,xe;return[l.createElementVNode("div",Rn,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((xe=u==null?void 0:u.row)==null?void 0:xe[(pe=u==null?void 0:u.column)==null?void 0:pe.prop],Ve=>(l.openBlock(),l.createElementBlock("div",Fn,[l.createElementVNode("div",{class:"prop-url",title:ha(Ve),onClick:A=>or(Ve)},l.toDisplayString(ha(Ve)),9,Kn),l.createElementVNode("div",{class:"prop-download",onClick:A=>oo(Ve)}," 下载 ",8,zn)]))),256))])]}),_:2},1024)):(l.openBlock(),l.createElementBlock("div",{key:2,style:l.normalizeStyle({color:!Array.isArray(yl(u))&&((O=(K=yl(u))==null?void 0:K.toString())!=null&&O.includes(".txt")||(d=(J=yl(u))==null?void 0:J.toString())!=null&&d.includes(".cpt")||(ie=(T=yl(u))==null?void 0:T.toString())!=null&&ie.includes(".cyd"))?"var(--vertical-menuitem-active-bg)":"",textDecoration:!Array.isArray(yl(u))&&((C=(F=yl(u))==null?void 0:F.toString())!=null&&C.includes(".txt")||(le=(j=yl(u))==null?void 0:j.toString())!=null&&le.includes(".cpt")||(Z=(ee=yl(u))==null?void 0:ee.toString())!=null&&Z.includes(".cyd"))?"underline":"",cursor:!Array.isArray(yl(u))&&((Ne=(ve=yl(u))==null?void 0:ve.toString())!=null&&Ne.includes(".txt")||(re=(G=yl(u))==null?void 0:G.toString())!=null&&re.includes(".cpt")||(se=(Le=yl(u))==null?void 0:Le.toString())!=null&&se.includes(".cyd"))?"pointer":"",marginLeft:(u==null?void 0:u.colIndex)===0?`${((u==null?void 0:u.level)??0)*20}px`:0}),onClick:pe=>Vr(yl(u))},l.toDisplayString(yl(u)===0?"0":yl(u)),13,Vn))]}),_:2},[((_=Jl.value)==null?void 0:_.length)>0&&l.unref(ka)!==l.unref(Me)?{name:"actions",fn:l.withCtx(({item:u})=>[l.createVNode(o,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:l.withCtx(()=>[l.createVNode(r,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"},onClick:a[0]||(a[0]=l.withModifiers(()=>{},["stop"]))})]),default:l.withCtx(()=>[l.createElementVNode("div",An,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(no(Jl.value,u),(y,h)=>(l.openBlock(),l.createElementBlock("div",{class:"menu-config-item",key:h,onClick:l.withModifiers(K=>Ea(y==null?void 0:y.label,u,{extra:y}),["stop"])},[l.createElementVNode("div",{style:l.normalizeStyle({color:y==null?void 0:y.textColor}),class:"extra-button-label"},l.toDisplayString(y==null?void 0:y.label),5)],8,En))),128))])]),_:2},1024)]),key:"0"}:void 0,((w=Y.value)==null?void 0:w.length)>0?{name:"batchButton",fn:l.withCtx(u=>[l.withDirectives(l.createVNode(vn,{lockingPage:l.unref(ka)===l.unref(Me),buttons:u.buttons,selectTableItems:Tl.value,onButtonClick:a[2]||(a[2]=y=>Ea(y,"",{}))},null,8,["lockingPage","buttons","selectTableItems"]),[[l.vShow,de.value]]),l.withDirectives(l.createElementVNode("div",null,null,512),[[l.vShow,!de.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(Zl.ssDialog,{title:ml.value,visible:jl.value,width:Rr.value,onBeforeDestroy:ao,style:{height:"74%"}},{default:l.withCtx(()=>[l.createElementVNode("div",qn,[l.createVNode(bl.ssForm,{rowContents:ke.value,isEnableWrap:!1,showOperator:!1,onChange:Ro,onFixChangeValue:so,onClickTrigger:ro,isEdit:ma.value,onBlurChange:Ir,onCreate:eo,onTagChange:zr},null,8,["rowContents","isEdit"])])]),footer:l.withCtx(()=>[Ca.value?(l.openBlock(),l.createElementBlock("div",Jn,[l.createVNode(k,{onClick:a[5]||(a[5]=u=>jl.value=!1),id:"themeBorderButton"},{default:l.withCtx(()=>a[15]||(a[15]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[15]}),l.createVNode(k,{class:"ok-button",onClick:a[6]||(a[6]=u=>ga(!0)),id:"themeButton"},{default:l.withCtx(()=>a[16]||(a[16]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[16]})])):l.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),l.createVNode(Zl.ssDialog,{title:ml.value,visible:Sa.value,width:ja.value,onBeforeDestroy:a[8]||(a[8]=u=>Sa.value=!1)},{default:l.withCtx(()=>[l.createVNode(Sn)]),footer:l.withCtx(()=>[l.createElementVNode("div",Wn,[l.createVNode(k,{onClick:a[7]||(a[7]=u=>Sa.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:l.withCtx(()=>a[17]||(a[17]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[17]}),l.createVNode(k,{class:"ok-button",onClick:fo,id:"themeButton"},{default:l.withCtx(()=>a[18]||(a[18]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[18]})])]),_:1},8,["title","visible","width"]),Hl.value?(l.openBlock(),l.createBlock(bl.ssFilePreview,{key:1,fileDataList:Il.value,onDestroy:to},null,8,["fileDataList"])):l.createCommentVNode("",!0),H.value?(l.openBlock(),l.createBlock(Zl.ssDialog,{key:2,visible:H.value,onBeforeDestroy:Po,style:{height:"80vh",width:"80vw"},"body-class":"three-dialog-body","footer-class":"three-dialog-footer"},{default:l.withCtx(()=>[l.createVNode(Sr.ThreeViewerHost,{files:ua.value,threeData:Ke.value},null,8,["files","threeData"])]),_:1},8,["visible"])):l.createCommentVNode("",!0),l.createVNode(Zl.ssDialog,{visible:e.componentVisible,onBeforeDestroy:a[9]||(a[9]=u=>e.componentVisible=!1),width:ja.value,style:{height:"70vh"}},{default:l.withCtx(()=>[l.createVNode(x,{dialogItem:Yl.value},null,8,["dialogItem"])]),_:1},8,["visible","width"]),l.createVNode(Zl.ssDialog,{title:"上传OCR图片",visible:xa.value,onBeforeDestroy:ur,width:"600px"},{default:l.withCtx(()=>[l.withDirectives((l.openBlock(),l.createElementBlock("div",Gn,[l.createVNode(N,{"file-list":Fl.value,"onUpdate:fileList":a[10]||(a[10]=u=>Fl.value=u),multiple:"",drag:"",action:"","auto-upload":!1,limit:20,accept:"image/*","on-change":So,class:"upload-content"},{tip:l.withCtx(()=>a[19]||(a[19]=[l.createElementVNode("div",{class:"el-upload__tip tip-content"}," 请上传图片文件,大小不超过10MB ",-1)])),default:l.withCtx(()=>[l.createVNode(v,{class:"el-icon--upload"},{default:l.withCtx(()=>[l.createVNode(l.unref(D.upload_filled_default))]),_:1}),a[20]||(a[20]=l.createElementVNode("div",{class:"el-upload__text"},[l.createTextVNode(" 将图片拖到此处或"),l.createElementVNode("em",null,"点击上传")],-1))]),file:l.withCtx(({file:u,index:y})=>[l.createElementVNode("div",Hn,[l.createElementVNode("div",{class:"upload-content-title",style:{flex:"1",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},title:u==null?void 0:u.name},l.toDisplayString(u==null?void 0:u.name),9,Qn),l.createElementVNode("div",Xn,[l.createVNode(r,{class:"icon-blue",name:"EyeFill",style:{width:"15px",height:"15px",cursor:"pointer",color:"var(--ssform-label-color)"},onClick:h=>Eo(u),title:"预览"},null,8,["onClick"]),l.createVNode(r,{class:"icon-blue",name:"Cancel",style:{width:"15px",height:"15px",cursor:"pointer",color:"var(--ssform-label-color)"},onClick:h=>Bo(y),title:"删除"},null,8,["onClick"])])])]),_:1},8,["file-list"])])),[[M,Ql.value]])]),footer:l.withCtx(()=>[l.createElementVNode("div",Yn,[l.createVNode(k,{onClick:ur,id:"themeBorderButton",disabled:Ql.value},{default:l.withCtx(()=>a[21]||(a[21]=[l.createTextVNode("取消")])),_:1,__:[21]},8,["disabled"]),l.createVNode(k,{class:"ok-button",onClick:Co,id:"themeButton",disabled:Ql.value},{default:l.withCtx(()=>a[22]||(a[22]=[l.createTextVNode("确认")])),_:1,__:[22]},8,["disabled"])])]),_:1},8,["visible"]),_a.value?(l.openBlock(),l.createBlock(bl.ssFilePreview,{key:3,fileDataList:Na.value,onDestroy:wo},null,8,["fileDataList"])):l.createCommentVNode("",!0),l.createVNode(Zl.ssDialog,{title:"OCR识别结果预览",visible:$a.value,onBeforeDestroy:qa,width:"90%",style:{maxWidth:"1200px"}},{default:l.withCtx(()=>[l.createElementVNode("div",Zn,[l.createElementVNode("div",In,[l.createVNode(U,{title:"请核对识别结果,您可以修改字段值后点击确认添加到表格。在表头勾选字段用于匹配并替换现有数据",type:"info",closable:!1,"show-icon":""})]),l.createElementVNode("div",ei,[l.createVNode(S,{data:aa.value,border:"",stripe:"","max-height":"400",style:{width:"100%"}},{default:l.withCtx(()=>[l.createVNode(P,{type:"index",label:"序号",width:"60",fixed:""}),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Ma.value,u=>(l.openBlock(),l.createBlock(P,{key:u.prop,prop:u.prop,"min-width":u.minWidth||120,"class-name":u.isAccuracy?"accuracy-column":""},{header:l.withCtx(()=>[l.createElementVNode("div",li,[u.isAccuracy?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(c,{key:0,"model-value":Kl.value.includes(u.prop),onChange:y=>No(u.prop,y),onClick:a[11]||(a[11]=l.withModifiers(()=>{},["stop"]))},null,8,["model-value","onChange"])),l.createElementVNode("span",null,l.toDisplayString(u.label),1)])]),default:l.withCtx(({row:y,$index:h})=>[u.isAccuracy?(l.openBlock(),l.createElementBlock("span",{key:0,class:"accuracy-value",style:l.normalizeStyle({color:Ao(y[u.prop]),fontWeight:500})},l.toDisplayString(Do(y[u.prop])),5)):(l.openBlock(),l.createBlock($,{key:1,modelValue:y[u.prop],"onUpdate:modelValue":K=>y[u.prop]=K,size:"small",placeholder:"请输入"+u.label,onChange:K=>_o(h,u.prop,K)},null,8,["modelValue","onUpdate:modelValue","placeholder","onChange"]))]),_:2},1032,["prop","min-width","class-name"]))),128))]),_:1},8,["data"])])])]),footer:l.withCtx(()=>[l.createElementVNode("div",ai,[l.createVNode(k,{onClick:qa,id:"themeBorderButton"},{default:l.withCtx(()=>a[23]||(a[23]=[l.createTextVNode("取消")])),_:1,__:[23]}),l.createVNode(k,{class:"ok-button",onClick:xo,id:"themeButton"},{default:l.withCtx(()=>a[24]||(a[24]=[l.createTextVNode("确认")])),_:1,__:[24]})])]),_:1},8,["visible"]),l.createVNode(Zl.ssDialog,{title:Ze.title,visible:Ze.show,width:Ze.width,onBeforeDestroy:ko},{default:l.withCtx(()=>[l.createElementVNode("div",ri,[l.createVNode(bl.ssForm,{rowContents:Ze==null?void 0:Ze.contents,formRules:Ze==null?void 0:Ze.formRules,showOperator:!1,buttonValue:Ze.buttonValue,isEdit:ma.value,isStartJustify:!1,isEnableWrap:!1,onOnButtonClick:mo},null,8,["rowContents","formRules","buttonValue","isEdit"])])]),_:1},8,["title","visible","width"])])}}},ni=Oa._export_sfc(oi,[["__scopeId","data-v-1d35a8e8"]]);exports.formGetOptions=wa;exports.getSelectRow=Ba;exports.ssTable=ni;exports.useFormComp=Er;exports.useFormToTableComp=_r;
1
+ "use strict";const l=require("vue"),D=require("./index-DOItJqcJ.cjs"),ce=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C-Z-yYuH.cjs"),bl=require("./index-DjA4WahR.cjs"),Sr=require("./threeViewerHost-BjJ4CzrA.cjs"),Ta=require("./index-CXC0u8pm.cjs"),Qo=require("./index.vue_vue_type_style_index_1_lang-DkCwPTKt.cjs"),Oa=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Zl=require("./index-C5Y11t9J.cjs");require("./index-KaxOq1_-.cjs");const Cr=require("./isString-Do5yyRUw.cjs"),wa=W=>W.match(/\((.*)\)/)[1],xr={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200}},setup(W){const te=W,oe=l.ref(null),z=l.ref(!1),V=l.ref(null);return l.watch(()=>te==null?void 0:te.isVisible,()=>{z.value=te==null?void 0:te.isVisible},{deep:!0,immediate:!0}),l.watch(()=>V.value,()=>{l.nextTick(()=>{var s,de;(de=(s=oe.value)==null?void 0:s.updatePopper)==null||de.call(s)})},{deep:!0,immediate:!0}),(s,de)=>{const we=l.resolveComponent("el-popover");return l.openBlock(),l.createBlock(we,{visible:z.value,title:te==null?void 0:te.title,placement:te==null?void 0:te.placement,width:te==null?void 0:te.width,ref_key:"popOverRef",ref:oe},{reference:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"reference",{ref_key:"referenceRef",ref:V})])]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"content")])]),_:3},8,["visible","title","placement","width"])}}},Xo={key:0,class:"extra-button-content"},Yo={class:"table-operator-wrap"},Zo={key:0,class:"extra-button-filter"},Io={class:"form-content-value"},en={key:1,class:"extra-header"},ln={class:"drop-menu",style:{width:"120px"}},an={key:0},rn={key:1},on={key:1,class:"extra-button-content tabs-button-wrapper"},nn={class:"table-operator-wrap"},sn={class:"extra-button-filter"},un={class:"form-content-value"},cn={key:0,class:"extra-header"},tn={class:"drop-menu",style:{width:"120px"}},dn={key:0},pn={key:1},fn={__name:"header",props:{pageLayout:{type:String,default:"vertical"},lockingPage:Boolean,level:{type:Number,default:1},compName:{type:String,default:"表格名称",required:!1},filterShow:{type:Boolean,default:!1},isDevMode:Boolean,selectNums:Number,dataNums:Number,filterValues:Array,buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter","getImportData"],setup(W,{emit:te}){const oe=te,z=W,V=l.ref(""),s=l.ref(!1),de=l.ref([]),we=l.ref([{label:"取消",background:"#999999"},{label:"清空",background:"#999999"},{label:"确认"}]),Je=[{label:"新增",icon:"Plus"},{label:"导入",icon:"import"},{label:"导出",icon:"export"},{label:"OCR识别",icon:"ocr"}],Be=fe=>{const $e=fe.raw;if(!$e)return;const He=new FileReader;He.onload=he=>{try{const Xe=new Uint8Array(he.target.result),Qe=ce.readSync(Xe,{type:"array"}),Rl=Qe.SheetNames[0],ne=Qe.Sheets[Rl],Q=ce.utils.decode_range(ne["!ref"]).e.c+1,X=new Array(Q).fill(""),E=[];for(const H in ne){if(H[0]==="!")continue;const{r:be,c:Ke}=ce.utils.decode_cell(H);let Ie=ne[H].v;if(ne[H].t==="n"&&Ie>0&&Ie<1e6&&(Ie=new Date((Ie-25569)*86400*1e3).toISOString().split("T")[0]),(Ie==null||Ie==="")&&(Ie=""),be===0)X[Ke]=Ie;else{if(!E[be-1]){E[be-1]={};for(let Ol=0;Ol<Q;Ol++)E[be-1][`col_${Ol}`]=""}E[be-1][`col_${Ke}`]=Ie}}for(let H=0;H<Q;H++)X[H]===void 0&&(X[H]="");const qe=E==null?void 0:E[0];if(!(qe!=null&&qe.hasOwnProperty("col_0")))return D.ElMessage.error("导入的数据列不匹配,请检查是否错位");oe("getImportData",X,E)}catch(Xe){throw D.ElMessage.error(Xe.message),new Error(Xe.message)}},He.readAsArrayBuffer($e)},kl=fe=>{var He;const $e=(He=de.value)==null?void 0:He.reduce((he,Xe,Qe)=>(Qe===0?he[Xe.label]=fe:he[Xe.label]=Xe==null?void 0:Xe.value,he),{});oe("filter",$e,fe,!0)},Bl=fe=>{oe("buttonClick",fe)},$l=fe=>{var $e,He;de.value=(He=($e=ce.getColumnChild(D.cloneDeep(fe)))==null?void 0:$e.filter(he=>(he==null?void 0:he.label)!==""&&(he==null?void 0:he.label)!=="操作"))==null?void 0:He.map(he=>({label:(he==null?void 0:he.label)??"",value:"",name:(he==null?void 0:he.label)??"",isFormColHidden:he==null?void 0:he.isTableColHidden,width:2}))},Ml=l.ref(!1),ql=fe=>{var $e;if((fe==null?void 0:fe.buttonName)==="确认"&&(oe("filter",fe==null?void 0:fe.content),Ml.value=(fe==null?void 0:fe.content)&&Object.values(fe==null?void 0:fe.content).length>0),(fe==null?void 0:fe.buttonName)==="清空"){const He=D.cloneDeep(fe==null?void 0:fe.content);for(const he in He)He[he]="";de.value=($e=de.value)==null?void 0:$e.map(he=>({...he,value:""})),oe("filter",He),Ml.value=!1}s.value=!1},Gl=()=>{var $e,He;de.value=($e=de.value)==null?void 0:$e.map(he=>({...he,value:""}));const fe=(He=de.value)==null?void 0:He.reduce((he,Xe)=>(he[Xe.label]=Xe.value,he),{});oe("filter",fe)};return l.onMounted(()=>{$l(z.columns)}),l.watch(()=>z.columns,()=>{$l(z.columns)},{deep:!0,immediate:!0}),(fe,$e)=>{var ne,Ue,Q,X;const He=l.resolveComponent("el-icon"),he=l.resolveComponent("svg-icon"),Xe=l.resolveComponent("el-input"),Qe=l.resolveComponent("el-button"),Rl=l.resolveComponent("el-upload");return W.pageLayout==="vertical"?(l.openBlock(),l.createElementBlock("div",Xo,[l.createElementVNode("div",{class:l.normalizeClass(W.compName?"table-name-wrap":""),style:l.normalizeStyle({background:(z==null?void 0:z.level)>1?"transparent":"var(--ssgroup-background)",paddingLeft:((z==null?void 0:z.level)-1)*12+"px",fontWeight:600-((z==null?void 0:z.level)-1)*100>=400?600-((z==null?void 0:z.level)-1)*100:400,fontSize:17-(z==null?void 0:z.level)>=14?17-(z==null?void 0:z.level)+"px":"14px"})},l.toDisplayString(W.compName),7),l.createElementVNode("div",Yo,[z!=null&&z.filterShow?(l.openBlock(),l.createElementBlock("div",Zo,[l.createVNode(xr,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var E,qe,H,be;return[l.createVNode(Xe,{modelValue:V.value,"onUpdate:modelValue":$e[1]||($e[1]=Ke=>V.value=Ke),style:{"min-width":"80px"},placeholder:Ml.value?(H=(qe=(E=W.filterValues)==null?void 0:E.filter(Ke=>Ke))==null?void 0:qe.slice(0,3))==null?void 0:H.join("/"):"搜索","prefix-icon":l.unref(D.search_default),clearable:"",onInput:kl,disabled:((be=de.value)==null?void 0:be.length)===0},{suffix:l.withCtx(()=>{var Ke,Ie;return[!V.value&&((Ie=(Ke=W.filterValues)==null?void 0:Ke.filter(Ol=>Ol))!=null&&Ie.join("/"))?(l.openBlock(),l.createBlock(He,{key:0,style:{cursor:"pointer"},onClick:Gl},{default:l.withCtx(()=>[l.createVNode(l.unref(D.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:$e[0]||($e[0]=Ke=>s.value=!s.value)},[l.createVNode(he,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",Io,[(l.openBlock(),l.createBlock(bl.ssForm,{rowContents:de.value,buttonValue:we.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:we.value,isStartJustify:!1,onOnButtonClick:ql},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])])):l.createCommentVNode("",!0),W.buttons&&((ne=W.buttons)==null?void 0:ne.length)>0?(l.openBlock(),l.createElementBlock("div",en,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((Ue=W.buttons)==null?void 0:Ue.filter(E=>W.isDevMode||(E==null?void 0:E.label)!=="修改模板"),(E,qe)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:qe},[(E==null?void 0:E.type)==="upload"?(l.openBlock(),l.createBlock(Rl,{key:0,class:"upload-button-wrap","on-change":Be,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1,disabled:!!W.lockingPage},{default:l.withCtx(()=>[l.createVNode(Qe,{disabled:!!W.lockingPage,style:l.normalizeStyle({background:(E==null?void 0:E.background)??"var(--ssbutton-theme-bg)",color:(E==null?void 0:E.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1032,["disabled","style"])]),_:2},1032,["disabled"])):l.createCommentVNode("",!0),(E==null?void 0:E.type)==="popover"?(l.openBlock(),l.createBlock(bl._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(E==null?void 0:E.type)==="popover"?(l.openBlock(),l.createBlock(Qe,{key:0,disabled:!!W.lockingPage,style:l.normalizeStyle({background:(E==null?void 0:E.background)??"var(--ssbutton-theme-bg)",color:(E==null?void 0:E.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1032,["disabled","style"])):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",ln,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(E==null?void 0:E.contents,H=>(l.openBlock(),l.createBlock(Qe,{key:H==null?void 0:H.label,disabled:!!W.lockingPage,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:be=>Bl(H==null?void 0:H.label)},{default:l.withCtx(()=>{var be,Ke;return[l.createTextVNode(l.toDisplayString(H==null?void 0:H.label),1),(be=H==null?void 0:H.label)!=null&&be.includes("选中")?(l.openBlock(),l.createElementBlock("span",an,"("+l.toDisplayString(W.selectNums)+")",1)):l.createCommentVNode("",!0),(Ke=H==null?void 0:H.label)!=null&&Ke.includes("全部")?(l.openBlock(),l.createElementBlock("span",rn,"("+l.toDisplayString(W.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["disabled","onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),E!=null&&E.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Qe,{key:2,id:"themeButton",disabled:!!W.lockingPage,style:l.normalizeStyle({background:(E==null?void 0:E.background)??"var(--ssbutton-theme-bg)",color:(E==null?void 0:E.color)??"var(--ssbutton-theme-color)"}),onClick:H=>Bl(E==null?void 0:E.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1032,["disabled","style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])])):(l.openBlock(),l.createElementBlock("div",on,[l.createElementVNode("div",nn,[l.createElementVNode("div",sn,[l.createVNode(xr,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var E,qe,H,be;return[l.createVNode(Xe,{modelValue:V.value,"onUpdate:modelValue":$e[3]||($e[3]=Ke=>V.value=Ke),style:{"min-width":"80px"},placeholder:Ml.value?(H=(qe=(E=W.filterValues)==null?void 0:E.filter(Ke=>Ke))==null?void 0:qe.slice(0,3))==null?void 0:H.join("/"):"搜索","prefix-icon":l.unref(D.search_default),clearable:"",onInput:kl,disabled:((be=de.value)==null?void 0:be.length)===0},{suffix:l.withCtx(()=>{var Ke,Ie;return[!V.value&&((Ie=(Ke=W.filterValues)==null?void 0:Ke.filter(Ol=>Ol))!=null&&Ie.join("/"))?(l.openBlock(),l.createBlock(He,{key:0,style:{cursor:"pointer"},onClick:Gl},{default:l.withCtx(()=>[l.createVNode(l.unref(D.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:$e[2]||($e[2]=Ke=>s.value=!s.value)},[l.createVNode(he,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",un,[(l.openBlock(),l.createBlock(bl.ssForm,{rowContents:de.value,buttonValue:we.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:we.value,isStartJustify:!1,onOnButtonClick:ql},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),W.buttons&&((Q=W.buttons)==null?void 0:Q.length)>0?(l.openBlock(),l.createElementBlock("div",cn,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((X=W.buttons)==null?void 0:X.filter(E=>W.isDevMode||(E==null?void 0:E.label)!=="修改模板"),(E,qe)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:qe},[(E==null?void 0:E.type)==="upload"?(l.openBlock(),l.createBlock(Rl,{key:0,class:"upload-button-wrap","on-change":Be,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1},{default:l.withCtx(()=>[l.createVNode(Qe,{style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var H;return[l.createVNode(he,{name:(H=Je==null?void 0:Je.find(be=>(be==null?void 0:be.label)===(E==null?void 0:E.label)))==null?void 0:H.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1024)]),_:2},1024)):l.createCommentVNode("",!0),(E==null?void 0:E.type)==="popover"?(l.openBlock(),l.createBlock(bl._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(E==null?void 0:E.type)==="popover"?(l.openBlock(),l.createBlock(Qe,{key:0,style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var H;return[l.createVNode(he,{name:(H=Je==null?void 0:Je.find(be=>(be==null?void 0:be.label)===(E==null?void 0:E.label)))==null?void 0:H.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1024)):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",tn,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(E==null?void 0:E.contents,H=>(l.openBlock(),l.createBlock(Qe,{key:H==null?void 0:H.label,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:be=>Bl(H==null?void 0:H.label)},{default:l.withCtx(()=>{var be,Ke;return[l.createTextVNode(l.toDisplayString(H==null?void 0:H.label),1),(be=H==null?void 0:H.label)!=null&&be.includes("选中")?(l.openBlock(),l.createElementBlock("span",dn,"("+l.toDisplayString(W.selectNums)+")",1)):l.createCommentVNode("",!0),(Ke=H==null?void 0:H.label)!=null&&Ke.includes("全部")?(l.openBlock(),l.createElementBlock("span",pn,"("+l.toDisplayString(W.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),E!=null&&E.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Qe,{key:2,id:"themeButton",style:l.normalizeStyle({background:"transparent",color:(E==null?void 0:E.label)==="新增"?"var(--ssbutton-theme-bg)":"#666666"}),onClick:H=>Bl(E==null?void 0:E.label)},{icon:l.withCtx(()=>{var H;return[l.createVNode(he,{name:(H=Je==null?void 0:Je.find(be=>(be==null?void 0:be.label)===(E==null?void 0:E.label)))==null?void 0:H.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(E==null?void 0:E.label),1)]),_:2},1032,["style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])]))}}},hn=Oa._export_sfc(fn,[["__scopeId","data-v-03b0d8fa"]]),yn=l.defineComponent({__name:"batch",props:{lockingPage:Boolean,buttons:{type:Array,default:()=>[]},selectTableItems:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick"],setup(W,{emit:te}){const oe=W,z=te,V=de=>{z("buttonClick",de)},s=de=>{var we;return de!=null&&de.includes("删除")?((we=oe.selectTableItems)==null?void 0:we.length)>0?"warning-active-type":"warning-type":"default-type"};return(de,we)=>{const Je=l.resolveComponent("el-button");return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(W.buttons,Be=>(l.openBlock(),l.createBlock(Je,{key:Be==null?void 0:Be.label,disabled:!!W.lockingPage,class:l.normalizeClass(s(Be==null?void 0:Be.label)),onClick:kl=>V(Be==null?void 0:Be.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(Be==null?void 0:Be.label),1)]),_:2},1032,["disabled","class","onClick"]))),128))])}}}),vn=Oa._export_sfc(yn,[["__scopeId","data-v-70b12973"]]),_r=D.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(W){this.selectArray=W},setSelectString(W){this.selectString=W}}}),gn={class:"calculator-content"},bn={class:"calculator-child"},kn={class:"calculator-child"},mn=l.defineComponent({__name:"calculator",setup(W){const te=l.ref(),oe=l.ref();return l.onMounted(()=>{te.value=[{type:"Upload",label:"输入",name:"input"}],oe.value=[{type:"Upload",label:"输出",name:"output"}]}),(z,V)=>(l.openBlock(),l.createElementBlock("div",gn,[l.createElementVNode("div",bn,[l.createVNode(bl.ssForm,{rowContents:te.value,isRowFlex:!0},null,8,["rowContents"])]),l.createElementVNode("div",kn,[l.createVNode(bl.ssForm,{rowContents:oe.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),Sn=Oa._export_sfc(mn,[["__scopeId","data-v-73db0fe7"]]),Ha=(W,te)=>{let oe=W,z=te;return Array.isArray(oe)&&(oe=oe==null?void 0:oe.map((V,s)=>{if(Array.isArray(V)){let de={};return V=V==null?void 0:V.forEach((we,Je)=>{var Be;(Be=z==null?void 0:z[Je])!=null&&Be.prop?de[z[Je].prop]=we:Array.isArray(we)&&(de.children=Ha(we,z))}),Object.assign(de,{id:s})}else return V})),oe},Nr=(W,te,oe)=>{let z=W,V=te;return z=z==null?void 0:z.map((s,de)=>{var we,Je;return!Array.isArray(s)||!((we=V==null?void 0:V[de])!=null&&we.label)&&!oe||(s.unshift(((Je=V==null?void 0:V[de])==null?void 0:Je.label)??""),s.some(Be=>Array.isArray(Be))&&(s=s==null?void 0:s.map(Be=>{var kl;return Array.isArray(Be)&&(Be=Nr(Be,(kl=V==null?void 0:V[de])==null?void 0:kl.children,oe)),Be}))),s}),z},Cn=(W,te,oe)=>{if(te==="")return W==null?void 0:W.filter(z=>(z==null?void 0:z.id)!==oe);{const z=te.split("-");return xn(W,z,oe)}},xn=(W,te,oe)=>{let z=W,V=te;return(V==null?void 0:V.length)===0?z=z==null?void 0:z.filter(s=>s.id!==oe):z=z==null?void 0:z.map(s=>(s.id.toString()===(V==null?void 0:V[0])&&(V==null||V.shift(),s=Dr(s,V,oe)),s)),z},Dr=(W,te,oe)=>{var s,de;let z=W,V=te;return(V==null?void 0:V.length)===0?z.children=(s=z.children)==null?void 0:s.filter(we=>we.id!==oe):z.children=(de=z.children)==null?void 0:de.map(we=>(we.id.toString()===(V==null?void 0:V[0])&&(V==null||V.shift(),we=Dr(we,V,oe)),we)),z},_n=(W,te,oe)=>{if(te==="")return oe;{const z=te.split("-");return Nn(W,z,oe)}},Nn=(W,te,oe)=>{let z=W,V=te;return(V==null?void 0:V.length)===0?z=oe:z=z==null?void 0:z.map(s=>(s.id.toString()===(V==null?void 0:V[0])&&(V==null||V.shift(),s=Ar(s,V,oe)),s)),z},Ar=(W,te,oe)=>{var s;let z=W,V=te;return(V==null?void 0:V.length)===0?z.children=oe:z.children=(s=z.children)==null?void 0:s.map(de=>(de.id.toString()===(V==null?void 0:V[0])&&(V==null||V.shift(),de=Ar(de,V,oe)),de)),z},Er=D.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(W){this.objUrl=W},setBlobUrls(W){this.blobUrls=W}}}),Ba=async(W,te)=>{var de,we,Je,Be,kl,Bl,$l,Ml,ql,Gl,fe,$e,He,he,Xe,Qe,Rl;let oe=(we=(de=D.cloneDeep(W))==null?void 0:de.optionUrl)==null?void 0:we.menuSelect,z=[];oe==null||oe.forEach(ne=>{});let V="",s=await ce.menuToParent(oe);if(s==null||s.forEach(ne=>{var Ue,Q,X,E;(ne==null?void 0:ne.name)===(((E=(X=(Q=(Ue=D.cloneDeep(W))==null?void 0:Ue.optionUrl)==null?void 0:Q.groupSelect)==null?void 0:X[0])==null?void 0:E.replaceAll("'",""))??"")&&(V=ne==null?void 0:ne.id)}),te){V=te;const ne=await D.getInsofDataApi({id:V}),Ue=(Bl=(kl=(Be=(Je=ne==null?void 0:ne.data)==null?void 0:Je.result)==null?void 0:Be[0])==null?void 0:kl.key)==null?void 0:Bl.pageKey;s=await ce.getItemData(Ue,sessionStorage.getItem("systemKey"),"")}if(V!==""){let ne;te?ne=($l=s==null?void 0:s.find(X=>(X==null?void 0:X.id)===te))==null?void 0:$l.compData:ne=(Ml=s==null?void 0:s.find(X=>{var E,qe,H,be;return(X==null?void 0:X.name)===(((qe=(E=W==null?void 0:W.groupSelect)==null?void 0:E.split(":"))==null?void 0:qe[0])||((be=(H=W==null?void 0:W.optionUrl)==null?void 0:H.groupSelect)==null?void 0:be[0]))}))==null?void 0:Ml.compData;let Ue=(Gl=(ql=ne==null?void 0:ne.find(X=>(X==null?void 0:X.key)==="header"))==null?void 0:ql.contents)==null?void 0:Gl.map(X=>X==null?void 0:X.label);($e=(fe=ne==null?void 0:ne.find(X=>(X==null?void 0:X.key)==="header"))==null?void 0:fe.contents)!=null&&$e.every(X=>Array.isArray(X))&&(Ue=(Xe=ce.getColumnChild((he=(He=ne==null?void 0:ne.find(X=>(X==null?void 0:X.key)==="header"))==null?void 0:He.contents)==null?void 0:he[0]))==null?void 0:Xe.map(X=>X==null?void 0:X.prop));let Q=(Rl=(Qe=ne==null?void 0:ne.find(X=>(X==null?void 0:X.key)==="tableContents"))==null?void 0:Qe.contents)==null?void 0:Rl.map(X=>{if(Array.isArray(X))X=X==null?void 0:X.filter(E=>!(E!=null&&E.id));else{let E={};for(let qe in X)qe!=="id"&&(E[qe]=X==null?void 0:X[qe]);X=E}return X});Q==null||Q.forEach(X=>{Array.isArray(X)?z.push(ce.getValueToObjectValue(X,Ue)):z.push(X)})}return z},Dn={class:"table-content"},An={class:"menu-config-wrap"},En=["onClick"],Tn={key:0,class:"viewport-wrap"},wn=["onClick"],Bn={title:"选择显示列信息"},On={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"],Ln={class:"col-operate-wrap"},jn={key:0,class:"col-operate-radio-wrapper"},Pn={title:"拖拽排序列",style:{cursor:"move",color:"grey",position:"absolute",right:"15px"}},$n={key:0,style:{display:"flex","justify-content":"center","align-items":"center"}},Mn={class:"pop-view"},Rn={class:"pop-wrapper"},Fn={class:"file-list-pop"},Kn=["title","onClick"],zn=["onClick"],Vn=["onClick"],qn={class:"form-content"},Jn={key:0,class:"dialog-footer"},Wn={class:"dialog-footer"},Gn={"element-loading-text":"正在识别中 请稍后"},Hn={style:{display:"flex","justify-content":"space-between",width:"100%","align-items":"center"}},Qn=["title"],Xn={class:"icon",style:{display:"flex",gap:"8px"}},Yn={class:"dialog-footer"},Zn={class:"ocr-preview-content"},In={class:"ocr-preview-tip"},ei={class:"ocr-preview-table"},li={style:{display:"flex","align-items":"center",gap:"8px"}},ai={class:"dialog-footer"},ri={class:"form-content"},oi={__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(W,{emit:te}){var mr;const oe=l.ref([]),z=Er(D.pinia),V=l.ref(null),s=W,de=l.ref(s==null?void 0:s.allowSelect),we=l.ref((mr=s==null?void 0:s.config)==null?void 0:mr.showIndex),Je=l.ref(),Be=l.ref(!0),kl=l.ref(!1),Bl={sortable:"switch",filterable:"switch",showSummary:"switch",operable:"switch",fixed:"radio"},$l=l.ref([{label:"排序",value:"sortable",checked:!1},{label:"合计",value:"showSummary",checked:!1},{type:"radio",label:"固定",value:"fixed",checked:"",options:[{label:"无",value:!1},{label:"左",value:"left"},{label:"右",value:"right"}]}]),Ml=ce.useOriginalState(D.pinia);let ql="$R";const{originalPath:Gl}=D.storeToRefs(Ml),fe=Gl.value,$e=l.ref(!1),He=l.ref(!1),he=l.ref(!1),Xe=l.ref(!0),Qe=l.ref([]),Rl=l.reactive({column:{},status:!1,text:"合计"}),ne=l.reactive({currentPage:1,pageSize:10,total:0,pageSizes:[5,10,20,50,100]}),Ue=te,Q=l.ref([]),X=l.ref([]),E=l.reactive({prop:"",order:null}),qe=l.ref([]),H=l.ref(!1),be=l.ref(!1),Ke=l.ref(null),{isUseBackdrop:Ie,initTrackFileType:Ol,getFileExtension:Qa,setData:Ua,getFileInfo:Xa,getFilesInfo:Tr}=Sr.useThreeSystem(),La=l.ref([]),Hl=l.ref(!1),Il=l.ref(),sl=Ta.useMenuState(),{importLoading:ii,activeMenuPath:Me,contentLoading:si,linkMenuInfo:wr}=D.storeToRefs(sl),Br=ce.useTableComp(D.pinia),Ye=Ta.useModelComp(D.pinia),{extraContents:ze,cacheUpdatingData:ia,tableViewContents:sa,tableLoading:ui,pageMapState:ea,lockingPage:ka}=D.storeToRefs(Ye),Y=l.ref([]),Ul=l.ref([]),Cl=l.ref(new Map);l.ref(!1);const Ll=l.ref("");l.ref();const ma=l.ref(!0),la=l.ref(0),Ya=l.ref(!0),ml=l.ref(""),jl=l.ref(!1),Or=l.ref({label:"查看三维模型"}),Sa=l.ref(!1),ja=l.ref(),Dl=l.ref([]),Jl=l.ref([]),Ca=l.ref(!1),ua=l.ref([]),xl=l.ref([]),_l=l.ref([]),ke=l.ref([]),xa=l.ref(!1),Ql=l.ref(!1),Fl=l.ref([]),Ur=l.ref(null),_a=l.ref(!1),Na=l.ref([]),Za=l.ref(""),Pa=l.ref(""),$a=l.ref(!1),aa=l.ref([]),Ma=l.ref([]),Ra=l.ref([]),Fa=l.ref(null),Kl=l.ref([]),ca=Qo.createOCRService(),Lr=l.computed(()=>ca.getConfig()),Al=l.ref(),hl=l.ref(),jr=_r(D.pinia),ta=l.ref(),Ka=l.ref(0),Pr=ce.useUnit(D.pinia),{selectIndex:$r,selectMenu:da,selectTitle:ci}=D.storeToRefs(Pr),{selectString:Xl}=D.storeToRefs(jr),Mr=D.useLoginState(D.pinia),{loginUserInfo:ra}=D.storeToRefs(Mr),Rr=l.ref(720),El=l.ref(!1),Da=l.ref(!1),Tl=l.ref([]),wl=l.ref(),pa=l.ref(!0),Ia=l.ref(!0),Yl=l.ref([]),Fr=l.inject("contentRef");l.provide("contentRef",Fr),l.watch(()=>{var e;return(e=Y.value)==null?void 0:e.length},e=>{ne.total=e}),l.watch(()=>sa.value,async()=>{var c,t,i,p,k,x,v,N,U,P,$,S,M,R,L,_,w,u;if(((c=sa.value)==null?void 0:c.length)===0||!((t=s==null?void 0:s.itemData)!=null&&t.find(y=>(y==null?void 0:y.key)==="columnPath"))||!((i=s==null?void 0:s.itemData)!=null&&i.find(y=>(y==null?void 0:y.key)==="pageColumn")))return;let e=(U=(N=(v=(x=(k=(p=s==null?void 0:s.itemData)==null?void 0:p.find(y=>(y==null?void 0:y.key)==="pageColumn"))==null?void 0:k.contents)==null?void 0:x.split("["))==null?void 0:v[1])==null?void 0:N.split("]"))==null?void 0:U[0],a=((M=(S=($=(P=s==null?void 0:s.itemData)==null?void 0:P.find(y=>(y==null?void 0:y.key)==="pageColumn"))==null?void 0:$.contents)==null?void 0:S.split("["))==null?void 0:M[0])+((L=(R=sa.value)==null?void 0:R.find(y=>(y==null?void 0:y.key)===e))==null?void 0:L.value),r=((w=(_=s==null?void 0:s.itemData)==null?void 0:_.find(y=>(y==null?void 0:y.key)==="pageGroup"))==null?void 0:w.contents)??"",o=await ce.getItemData(a,sessionStorage.getItem("systemKey"),""),n=(u=o==null?void 0:o.find(y=>(y==null?void 0:y.name)===(r===""?s==null?void 0:s.compName:r)))==null?void 0:u.compData;br(n,s.allMapContents)},{deep:!0});const Kr=async(e,a)=>{var r,o,n,c,t;try{const i=await D.getInsofDataApi({id:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index)});let p;((r=i==null?void 0:i.data)==null?void 0:r.code)===200&&(p=((n=(o=i==null?void 0:i.data)==null?void 0:o.result)==null?void 0:n[0])||null);const k={type:"data",pageKey:s!=null&&s.parentTableId?(c=p==null?void 0:p.key)==null?void 0:c.pageKey:Me.value,tableId:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index),systemKey:sessionStorage.getItem("systemKey")},x=a==null?void 0:a.map(U=>{const P=Object.keys(U),$={};return P.forEach((S,M)=>{$[e[M]]=U[S]}),$}),v=x==null?void 0:x.map(U=>({key:k,value:{tableData:U}})),N=await D.batchAddInsofDataApi({dataList:v});((t=N==null?void 0:N.data)==null?void 0:t.code)===200?(Ye.setRefreshCurStructure(!0),D.ElMessage.success("导入数据成功")):D.ElMessage.error("导入数据响应失败")}catch(i){throw D.ElMessage.error("导入数据处理失败"),new Error(i)}},zr=async e=>{var c,t,i,p,k,x,v;let a=X.value;a!=null&&a.find(N=>(e==null?void 0:e.key)===(N==null?void 0:N.key))&&(a=a==null?void 0:a.filter(N=>(e==null?void 0:e.key)!==(N==null?void 0:N.key))),a.push({key:e==null?void 0:e.key,value:[(t=e==null?void 0:e.value)==null?void 0:t[((c=e==null?void 0:e.value)==null?void 0:c.length)-1]]});let r=ke.value;r=r==null?void 0:r.map(N=>{var U,P;return(N==null?void 0:N.type)==="Select"&&(e==null?void 0:e.key)===(N==null?void 0:N.prop)&&Array.isArray(N.value)&&(U=N.value)!=null&&U.every($=>typeof $=="string")&&(N.selectValue=(P=a==null?void 0:a.find($=>($==null?void 0:$.key)===(N==null?void 0:N.prop)))==null?void 0:P.value),N});let o=(p=(i=r==null?void 0:r.find(N=>(N==null?void 0:N.prop)===(e==null?void 0:e.key)))==null?void 0:i.optionUrl)==null?void 0:p.menuId,n=r==null?void 0:r.find(N=>(N==null?void 0:N.prop)===(e==null?void 0:e.key));if(o){let N=await Ba(n==null?void 0:n.optionUrl,o),U,P=Qe.value,$=(v=(x=(k=ke.value)==null?void 0:k.find(S=>{var M;return(M=n==null?void 0:n.optionUrl)==null?void 0:M.menuId}))==null?void 0:x.selectValue)==null?void 0:v[0];if(N==null||N.forEach(S=>{var M,R,L,_,w,u,y,h,K,O;if(o){let J=(R=(M=ke.value)==null?void 0:M.find(T=>{var ie,F;return((ie=n==null?void 0:n.optionUrl)==null?void 0:ie.menuId)===((F=T==null?void 0:T.optionUrl)==null?void 0:F.menuId)}))==null?void 0:R.prop,d=(_=(L=r==null?void 0:r.find(T=>(T==null?void 0:T.prop)===J))==null?void 0:L.selectValue)==null?void 0:_[0];J!=null&&J.includes("·")&&(J=(w=J==null?void 0:J.split("·"))==null?void 0:w[0],d=(K=(h=(y=e==null?void 0:e.value)==null?void 0:y[((u=e==null?void 0:e.value)==null?void 0:u.length)-1])==null?void 0:h.split(" "))==null?void 0:K[0]),P!=null&&P.find(T=>(T==null?void 0:T.value)===$)?U=(O=P==null?void 0:P.find(T=>(T==null?void 0:T.value)===$))==null?void 0:O.objectValue:S[J]===d&&(U=S)}}),U){let S=r;S=S==null?void 0:S.map(M=>{var R,L,_,w,u,y;return o&&(U!=null&&U[M==null?void 0:M.prop])&&ml.value==="新增"&&(M==null?void 0:M.prop)!==(n==null?void 0:n.prop)?M.value=(U==null?void 0:U[M==null?void 0:M.prop])||(U==null?void 0:U[(w=(_=(L=(R=M==null?void 0:M.optionUrl)==null?void 0:R.groupSelect)==null?void 0:L[1])==null?void 0:_.replaceAll("[",""))==null?void 0:w.replaceAll("]","")]):M.value=(y=(u=ke.value)==null?void 0:u.find(h=>(h==null?void 0:h.prop)===(M==null?void 0:M.prop)))==null?void 0:y.value,M}),ke.value=S}}X.value=a},Vr=async e=>{var a,r,o,n,c;if((a=e==null?void 0:e.toString())!=null&&a.includes(".txt")||(r=e==null?void 0:e.toString())!=null&&r.includes(".cpt")||(o=e==null?void 0:e.toString())!=null&&o.includes(".cyd")){const t=await D.axios.get(e,{responseType:"blob",headers:{"Content-Type":"application/json"}}),i=new Blob([t.data],{type:"application/octet-stream;charset=UTF-8"});let p=URL.createObjectURL(i);Il.value=[{name:(c=e==null?void 0:e.split("/"))==null?void 0:c[((n=e==null?void 0:e.split("/"))==null?void 0:n.length)-1],blobUrl:p}],Hl.value=!0}};l.onBeforeUnmount(()=>{Ia.value=!1;let e=Ka.value;Ka.value=e+1});const er=l.computed(()=>{var o,n;const e=(ne.currentPage-1)*ne.pageSize,a=e+ne.pageSize,r=(o=Q.value)==null?void 0:o.find(c=>{var t;return(c==null?void 0:c.sortable)&&((t=c==null?void 0:c.label)==null?void 0:t.includes("时间"))});return r&&(E.order="descending",E.prop=r==null?void 0:r.prop),Ue("getSliceContLength",ne),(n=Y.value)==null?void 0:n.slice(e,a)}),qr=e=>{ne.currentPage=e,Ue("getSliceContLength",ne)},Jr=e=>{var a;ne.pageSize=e,e*ne.currentPage>((a=Y.value)==null?void 0:a.length)&&(ne.currentPage=1,ne.pageSize=10,D.ElMessage.warning("分页无效,返回第一页")),Ue("getSliceContLength",ne)},Wr=(e,a)=>{var t,i;const r=(i=(t=Q.value)==null?void 0:t.map(p=>p==null?void 0:p.prop))==null?void 0:i.filter(p=>p!=="operate");let o;const n=(e==null?void 0:e.length)===(r==null?void 0:r.length);if(e!=null&&e.includes("序号"))return D.ElMessage.error("导入的数据不需要包含序号列");if(o=n?e:e.slice(0,r==null?void 0:r.length),!(o==null?void 0:o.every(p=>r==null?void 0:r.find(k=>p===k))))return D.ElMessage.error("导入的数据表头不匹配");Kr(o,a)},Gr=(e,a)=>{var r;Ye.setRefreshCurStructure(!1),((r=Q.value)==null?void 0:r.length)===0||Wr(e,a)},Hr=(e,a,r,o)=>{const n=[],c=[],t=k=>Object.keys(k).length;for(const k in e)if(e[k]!==void 0){const x=e[k],v=[];for(const[N,U]of Object.entries(x))v.push(U),c.length<t(x)&&c.push(N);n.push(v)}n.unshift(c);const i=ce.utils.aoa_to_sheet(n),p=ce.utils.book_new();ce.utils.book_append_sheet(p,i,o),ce.writeFileSync(p,`${a}.xlsx`),Tl.value=[]},Aa=async(e,a,r,o=!1,n)=>{var c,t,i,p,k,x,v,N;try{Ye.setRefreshCurStructure(!1);const U=await D.getInsofDataApi({id:s==null?void 0:s.index});if(((c=U==null?void 0:U.data)==null?void 0:c.code)===200){let P=(k=(p=(i=(t=U==null?void 0:U.data)==null?void 0:t.result)==null?void 0:i[0])==null?void 0:p.value)==null?void 0:k.pageData;o?P={...P,compData:(v=P==null?void 0:P.compData)==null?void 0:v.map(S=>{var M;return(S==null?void 0:S.key)==="header"?{...S,contents:(M=S==null?void 0:S.contents)==null?void 0:M.map(R=>({...R,[e]:r}))}:S})}:P={...P,compData:(x=P==null?void 0:P.compData)==null?void 0:x.map(S=>{var M,R;return(S==null?void 0:S.key)==="header"?{...S,contents:(M=S==null?void 0:S.contents)==null?void 0:M.map(L=>(L==null?void 0:L.prop)===(a==null?void 0:a.prop)?{...L,[e]:r}:L)}:(S==null?void 0:S.key)==="tableToForm"&&n?{...S,contents:(R=S==null?void 0:S.contents)==null?void 0:R.map(L=>(L==null?void 0:L.prop)===(a==null?void 0:a.prop)?{...L,[n]:r}:L)}:S})};const $=await D.updateInsofDataApi({id:s==null?void 0:s.index,value:{pageData:P}});((N=$==null?void 0:$.data)==null?void 0:N.code)===200?(D.ElMessage.success("编辑成功"),Ye.setRefreshCurStructure(!0)):D.ElMessage.error("编辑响应失败")}}catch(U){D.ElMessage.error(U)}},Qr=async(e,a)=>{await Aa("label",a,e)},Xr=async(e,a)=>{await Aa("columnType",a,e,!1,"type")},Yr=()=>{ia.value?El.value=!1:kr()},Zr=e=>{Tl.value=e},Ir=(e,a)=>{wl.value===a?pa.value=!1:pa.value=!0,wl.value=a==null?void 0:a.changeProp},eo=e=>{if(!e)return;const{item:a,value:r}=e,o=ke.value.find(n=>n.prop==a.prop);o&&o.contents.push({label:r,value:r})},fa=l.computed(()=>{var r,o,n;const e=(r=Q.value)==null?void 0:r.some(c=>c==null?void 0:c.filterable);return document.documentElement.style.setProperty("--ssTable-header-filter-display",e?"inline-block":"none"),(n=(o=Q.value)==null?void 0:o.filter(c=>(c==null?void 0:c.label)!=="操作"))==null?void 0:n.map(c=>({...c,filterable:!!(c!=null&&c.filterable),showSummary:!!(c!=null&&c.showSummary),operable:!!(c!=null&&c.operable),fixed:c==null?void 0:c.fixed}))}),lr=async(e,a,r)=>{const o=D.cloneDeep(Q.value);await l.nextTick(),Q.value=o==null?void 0:o.map(n=>(r==null?void 0:r.label)===(n==null?void 0:n.label)?{...n,[a]:e}:n),await Aa(a,r,e)},lo=async(e,a)=>{await Aa(a,null,e,!0)},ao=()=>{jl.value=!1},ro=e=>{Ue("clickTrigger",e)},ar=async e=>{var c,t,i,p,k,x,v,N,U,P,$,S,M,R,L;const a=e==null?void 0:e.row,r=e==null?void 0:e.rowData,o=e==null?void 0:e.suffix;if((c=a==null?void 0:a.toString())!=null&&c.includes(".urdf")||e!=null&&e.isUrdf||o!=null&&o.includes(".urdf")){if(a.includes(",")){D.ElMessage.error("当前版本仅允许单个urdf预览!");return}if(Ie(a)){const w={files:[Xa(a)],data:{}};Ua(w);return}ua.value=[{url:a,extension:Qa(a)}],be.value=!0,Ke.value={data:D.cloneDeep(r)},H.value=!0;return}let n=[];if((t=a==null?void 0:a.toString())!=null&&t.includes(".stl")||(i=a==null?void 0:a.toString())!=null&&i.includes(".STL")||(p=a==null?void 0:a.toString())!=null&&p.includes(".obj")||(k=a==null?void 0:a.toString())!=null&&k.includes(".mtl")){const _=(x=a==null?void 0:a.toString())==null?void 0:x.split(","),w=Tr(_),u=w==null?void 0:w[0];if(Ie(u==null?void 0:u.extension)){Ua({files:w,data:{}});return}ua.value=w,be.value=!1,H.value=!0;return}if((v=a==null?void 0:a.toString())!=null&&v.includes(".stl")||(N=a==null?void 0:a.toString())!=null&&N.includes(".STL")||(U=a==null?void 0:a.toString())!=null&&U.includes(".obj")||(P=a==null?void 0:a.toString())!=null&&P.includes(".mtl")||o!=null&&o.includes(".stl")||o!=null&&o.includes(".STL")||o!=null&&o.includes(".obj")||o!=null&&o.includes(".mtl")){let _,w=[],u={};if(Array.isArray(a)?_=a:_=a==null?void 0:a.split(","),_==null||_.forEach(y=>{y.includes(".mtl")?w.push(y):u.blob=u.blob?u.blob+","+y:y}),(w==null?void 0:w.length)>0&&(u.mtlBlobs=w),o&&(u.suffix=o),(S=($=Object.values(u))==null?void 0:$[0])!=null&&S.includes("http:"))n.push(u);else{const y=new Blob([u.blob],{type:"application/octet-stream;charset=UTF-8"});let h=URL.createObjectURL(y),K="";(M=a==null?void 0:a.split("/"))==null||M.forEach((O,J)=>{var d;J===((d=a==null?void 0:a.split("/"))==null?void 0:d.length)-1&&(K=O)}),(R=u.blob)!=null&&R.includes(".stl")&&(K=(K==null?void 0:K.replaceAll(">",""))+".urdf"),Il.value=[{name:K,blobUrl:h}],Hl.value=!0}}else{const _=await D.axios.get(a,{responseType:"blob",headers:{"Content-Type":"application/json"}}),w=new Blob([_.data],{type:"application/octet-stream;charset=UTF-8"});let u=URL.createObjectURL(w),y="";if((L=a==null?void 0:a.split("/"))==null||L.forEach((h,K)=>{var O;K===((O=a==null?void 0:a.split("/"))==null?void 0:O.length)-1&&(y=h)}),Ie(y)){const h=Ol(y),K=Xa(a);Ua({files:[K],data:{trackFileType:h}});return}Il.value=[{name:y,blobUrl:u}],Hl.value=!0}(n==null?void 0:n.length)>0&&z.setBlobUrls(n)},ha=e=>{var o,n,c,t;if(e!=null&&e.downloadUrl)return e==null?void 0:e.name;const a=(t=(o=e==null?void 0:e.url)==null?void 0:o.split("."))==null?void 0:t[((c=(n=e==null?void 0:e.url)==null?void 0:n.split("."))==null?void 0:c.length)-1];return(e==null?void 0:e.name)+"."+a},za=e=>{if(!e)return"未知文件";try{const o=ha(e);if(typeof o=="string"&&o.includes("."))return o}catch{}const a=(e==null?void 0:e.fileName)||(e==null?void 0:e.name)||"未知文件",r=(e==null?void 0:e.suffix)||"";return a.includes(".")?a:`${a}${r}`},rr=e=>{if(e==null||typeof e=="number"||typeof e!="string")return e;const a=e.match(/^(\d+)\_(\d+)$/);if(!a)return e;const r=Number(a[1]),o=Number(a[2]);return!Number.isFinite(r)||!Number.isFinite(o)?e:String(r*1e3+o)},or=async e=>{let a=null,r=null;if(e!=null&&e.id){const n=bl.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"});try{const c=await ce.downloadAvatarApi(e);a=URL.createObjectURL(c.data),r=za(e)}finally{n.close()}}else if(e!=null&&e.downloadUrl){const n=await Va(),c=bl.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),t=await D.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:n,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}).finally(()=>{c.close()}),i=new Blob([t.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(i),r=e==null?void 0:e.name}else{const n=await ce.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(n.data),r=ha(e)):a=e==null?void 0:e.url}if(Ie(a)){const n={row:`${a}`,suffix:Qa(r)};ar(n);return}const o={name:r,blobUrl:a};Il.value=[o],Hl.value=!0},oo=async e=>{let a=null,r=null;if(e!=null&&e.id){const c=await ce.downloadAvatarApi(e);a=URL.createObjectURL(c.data),r=za(e)}else if(e!=null&&e.downloadUrl){const c=await Va(),t=await D.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:c,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}),i=new Blob([t.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(i),r=e==null?void 0:e.name}else{const c=await ce.downloadAvatarApi({url:e==null?void 0:e.url});a=URL.createObjectURL(c.data),r=ha(e)}const o={name:r,blobUrl:a},n=document.createElement("a");n.href=o.blobUrl,n.download=o.name,n.style.display="none",document.body.appendChild(n),n.click(),setTimeout(()=>{document.body.removeChild(n)},100)},no=(e,a)=>{var o;if(Object.values(a).length===0)return;let r=e;return Object.values(a).find(n=>{var c,t,i;return((c=n==null?void 0:n.toString())==null?void 0:c.includes(".txt"))||((t=n==null?void 0:n.toString())==null?void 0:t.includes(".cpt"))||((i=n==null?void 0:n.toString())==null?void 0:i.includes(".obj"))})?r=[...e,Or.value]:(o=s==null?void 0:s.config)!=null&&o.allowMove&&(r=[...e,{label:"迁移"}]),r},io=(e,a={})=>[...e==null?void 0:e.values()].filter(r=>Object.keys(a).every(o=>{var t;const n=r[o],c=(t=a[o])==null?void 0:t.toLowerCase();return c&&n&&typeof n=="string"?n.toLowerCase().includes(c):!0})),so=()=>{kl.value=!0},nr=l.ref([]),uo=async(e,a,r=!1)=>{var o;if(e){if(Ye.setTableLoading(!0),nr.value=Object.values(e),e&&((o=Object.values(e))!=null&&o.every(n=>!n)))return Y.value=Ul.value;if(r){Y.value=[...Cl.value.values()].filter(n=>Object.values(n).some(c=>typeof c=="string"?c==null?void 0:c.toLowerCase().includes(a==null?void 0:a.toLowerCase()):!1));return}Y.value=io(Cl.value,e),Ye.setTableLoading(!1)}},co=async e=>{},ir=async(e,a,r,o)=>{var n,c,t,i,p,k,x,v,N,U,P,$,S,M,R,L,_,w,u,y;if(Ue("clickMainKey",r),(o==null?void 0:o.isExistChild)===!0){let h=(n=o==null?void 0:o.columnType)==null?void 0:n.prop,K=o==null?void 0:o.data;if(Yl.value=await ce.getItemData(Me.value,sessionStorage.getItem("systemKey"),""),!Yl.value){let J=(i=(t=(c=Me.value)==null?void 0:c.split("/"))==null?void 0:t.filter((d,T)=>{var ie,F;return T!==((F=(ie=Me.value)==null?void 0:ie.split("/"))==null?void 0:F.length)-1}))==null?void 0:i.join("/");Yl.value=await ce.getItemData(J,sessionStorage.getItem("systemKey"),"")}let O=(p=Yl.value)==null?void 0:p.filter(J=>(J==null?void 0:J.name)===h);Yl.value=O==null?void 0:O.map(J=>{var d;return J.compData=(d=J.compData)==null?void 0:d.map(T=>{var ie,F;return(T==null?void 0:T.key)==="tableContents"&&(ie=T==null?void 0:T.contents)!=null&&ie.every(C=>C==null?void 0:C.find(j=>j==null?void 0:j.id))&&(T.contents=(F=T==null?void 0:T.contents)==null?void 0:F.filter(C=>(C==null?void 0:C[1])===K)),T}),J}),Ue("routeUrl",Yl.value,{isEdit:!0,routerUrl:Me.value});return}if((o==null?void 0:o.data)==="查看"&&(e!=null&&e.every(h=>(h==null?void 0:h.url)&&(h==null?void 0:h.name)))){let h=D.cloneDeep(e);h=await((k=D.cloneDeep(h))==null?void 0:k.map(async O=>{var T,ie,F,C;const J=await ce.downloadAvatarApi({url:O==null?void 0:O.url});let d=URL.createObjectURL(J.data);return{name:(O==null?void 0:O.name)+"."+((C=(T=O==null?void 0:O.url)==null?void 0:T.split("."))==null?void 0:C[((F=(ie=O==null?void 0:O.url)==null?void 0:ie.split("."))==null?void 0:F.length)-1]),blobUrl:d}}));let K=await Promise.all(h);Il.value=K,Hl.value=!0}if(D.cloneDeep(Q.value),(o==null?void 0:o.isMainKey)===!0){sl.setActiveMenuPath(void 0),Ye.setRouteToChildPath(void 0),Ye.setFixMenuStatus(!0);let h=(v=(x=s.itemData)==null?void 0:x.find(O=>(O==null?void 0:O.key)==="contentTableId"))==null?void 0:v.contents,K=(U=(N=s.itemData)==null?void 0:N.find(O=>(O==null?void 0:O.key)==="relatedFilter"))==null?void 0:U.index;if(K!==0){let O=($=(P=Q.value)==null?void 0:P[K])==null?void 0:$.prop;if((r==null?void 0:r[O])===(o==null?void 0:o.data)){let J=await D.getInsofDataApi({id:h}),d=(L=(R=(M=(S=J==null?void 0:J.data)==null?void 0:S.result)==null?void 0:M[0])==null?void 0:R.key)==null?void 0:L.pageKey;sl.setActiveMenuPath(d+"/"+(o==null?void 0:o.data))}else{let J=await D.getInsofDataApi({key:{pageKey:D.cloneDeep(Me).value+"/"+(o==null?void 0:o.data),systemKey:sessionStorage.getItem("systemKey")}});((w=(_=J==null?void 0:J.data)==null?void 0:_.result)==null?void 0:w.length)>0&&sl.setActiveMenuPath(D.cloneDeep(Me).value+"/"+(o==null?void 0:o.data))}}else{let O=await D.getInsofDataApi({key:{pageKey:D.cloneDeep(Me).value+"/"+(o==null?void 0:o.data),systemKey:sessionStorage.getItem("systemKey")}});((y=(u=O==null?void 0:O.data)==null?void 0:u.result)==null?void 0:y.length)>0&&sl.setActiveMenuPath(D.cloneDeep(Me).value+"/"+(o==null?void 0:o.data))}}},to=()=>{Hl.value=!1},po=e=>{Ue("rowClick",e)};l.watch(()=>s.changedContent,()=>{var r,o;if(!s.changedContent)return;let e=(r=Y.value)==null?void 0:r.map(n=>{var c;return n.id===((c=s.changedContent)==null?void 0:c.id)&&(n={...s.changedContent,id:s.changedContent.newId?s.changedContent.newId:s.changedContent.id},delete n.newId),n});const a=(o=s.itemData)==null?void 0:o.map(n=>((n==null?void 0:n.key)==="tableContents"&&(n.contents=e),n));Y.value=e,Ue("contentChange",{contents:a,index:s.index}),Ue("change",{content:e,index:s==null?void 0:s.index,buttonName:"",id:s==null?void 0:s.index})},{deep:!0,immediate:!0});const fo=()=>{},ho=async()=>{const e=Me.value,a=sessionStorage.getItem("systemKey"),r=await ce.getItemData(e,a,""),o=(r==null?void 0:r.find(i=>(i==null?void 0:i.name)==="方法明细"))||(r==null?void 0:r[0]),n=(o==null?void 0:o.compData)||[],c=n==null?void 0:n.find(i=>{const p=i==null?void 0:i.key;return p==="formContent"||p==="tableContents"});return c==null?void 0:c.contents},Va=async()=>`Bearer ${D.Local.get("access-token")}`,yo=async(e,{token:a,inputData:r}={})=>await D.axios.post(e,r,{headers:{Authorization:a}}).catch(n=>(sl.setImportLoading(!1),Promise.reject(n))),vo=e=>{var o;let a={};const r=[];return a.form={},(o=D.cloneDeep(e))==null||o.forEach((n,c)=>{var t,i,p,k,x,v,N,U,P,$,S,M,R,L;if((n==null?void 0:n.comp)==="Table"){(i=(t=n==null?void 0:n.compData)==null?void 0:t.find(y=>(y==null?void 0:y.key)==="header"))==null||i.contents;let _=(x=(k=(p=n==null?void 0:n.compData)==null?void 0:p.find(y=>(y==null?void 0:y.key)==="tableContents"))==null?void 0:k.contents)==null?void 0:x.map(y=>y.slice(1));($=(P=(U=(N=(v=n==null?void 0:n.compData)==null?void 0:v.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:N.contents)==null?void 0:U[0])==null?void 0:P[0])==null||$.label;let w=(M=(S=n==null?void 0:n.compData)==null?void 0:S.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:M.contents,u=[];_==null||_.forEach(y=>{let h=[];y==null||y.forEach((K,O)=>{var d;let J={};((d=w[O])==null?void 0:d.label)!=="操作"&&(J[w[O].label]=K,h.push(J))}),u.push(h)}),a[n.name]=u}else{const _=(L=(R=n.compData)==null?void 0:R.find(w=>(w==null?void 0:w.key)==="formContent"))==null?void 0:L.contents;_==null||_.forEach(w=>{var u,y;if(w.prop!==""){let h=w==null?void 0:w.value;Array.isArray(h)?h=((u=h==null?void 0:h[0])==null?void 0:u.oldUrl)||"http://222.92.178.198:62001/"+((y=h==null?void 0:h[0])==null?void 0:y.url):h=h.toString(),w={key:(w==null?void 0:w.prop)??(w==null?void 0:w.label),value:h},r.push(w)}})}}),a.form=ce.getFormContents(r),a},go=e=>{const a=[],r=o=>{o&&typeof o=="object"&&!Array.isArray(o)?Object.values(o).forEach(r):a.push(o)};return r(e),a},bo=async(e,a,r)=>{var w,u,y,h,K,O,J,d,T,ie,F;sl.setImportLoading(!0),Ye.setFreshContent(!1);let o=await ho().catch(C=>(sl.setImportLoading(!1),Promise.reject(C)));o=o==null?void 0:o.filter(C=>{var j;return((j=C==null?void 0:C.find(le=>le==null?void 0:le.id))==null?void 0:j.id)===(a==null?void 0:a.id)});let n=ce.getEqualChild([(w=Q.value)==null?void 0:w.filter(C=>(C==null?void 0:C.label)!=="操作")]);const c=(y=(u=ce.tableToForm(o,n))==null?void 0:u[0])==null?void 0:y.find(C=>{const j=C==null?void 0:C.key;return j==="Interface"||j==="方法体"}),t=c==null?void 0:c.value;if(!t){console.log("未搜索到isMain, 缺少算法执行接口"),sl.setImportLoading(!1);return}const i=Q.value?ce.getEqualChild([Q.value]):[],p=i.find(C=>{const j=C==null?void 0:C.prop;return j==="Input1"||j==="输入数据.输入1"||j==="样本输入数据"}),k=p==null?void 0:p.prop;let x=a==null?void 0:a[k];const v=await Va().catch(C=>(sl.setImportLoading(!1),Promise.reject(C)));let N=!0,U="";(h=Q.value)==null||h.forEach(C=>{(C==null?void 0:C.prop)===k&&(N=!!(C!=null&&C.childPath),U=C==null?void 0:C.childPath)});let P="";if(N){let C=(O=(K=Q.value)==null?void 0:K.find(ve=>(ve==null?void 0:ve.isMainKey)===!0))==null?void 0:O.prop;P=a==null?void 0:a[C];let j=U==null?void 0:U.split(fe),le=[];j==null||j.forEach((ve,Ne)=>{(j==null?void 0:j.length)-1===Ne&&le.push(P),le.push(ve)}),le=le==null?void 0:le[0];let ee=await ce.getItemData(le,sessionStorage.getItem("systemKey"),""),Z=ee==null?void 0:ee.filter(ve=>(ve==null?void 0:ve.name)===k);Z=Z==null?void 0:Z.map(ve=>{var Ne;return ve.compData=(Ne=ve==null?void 0:ve.compData)==null?void 0:Ne.map(G=>{var re;return(G==null?void 0:G.key)==="tableContents"&&(G.contents=(re=G==null?void 0:G.contents)==null?void 0:re.filter(Le=>(Le==null?void 0:Le[1])===(a==null?void 0:a[k]))),G}),ve}),(!Z||(Z==null?void 0:Z.length)===0)&&(Z=ee,Z=Z==null?void 0:Z.map(ve=>{var Ne;return ve.compData=(Ne=ve==null?void 0:ve.compData)==null?void 0:Ne.map(G=>{var re;return(G==null?void 0:G.key)==="tableContents"&&(G.contents=(re=G==null?void 0:G.contents)==null?void 0:re.filter(Le=>{var se,pe;return(Le==null?void 0:Le[1])===(a==null?void 0:a[(pe=(se=Q==null?void 0:Q.value)==null?void 0:se[0])==null?void 0:pe.prop])})),G}),ve})),x=vo(Z)}const $=await yo(t,{token:v,inputData:x}).catch(C=>(sl.setImportLoading(!1),Promise.reject(C))),S=(J=$==null?void 0:$.data)==null?void 0:J.data,M=i.find(C=>(C==null?void 0:C.prop)==="Output1"),R=M==null?void 0:M.prop;let L=[],_=[];if(S&&((d=Object.values(S))==null?void 0:d.length)>0){let C=[];const j=new FormData,le=(T=go(S))==null?void 0:T.map(async Z=>{var ve,Ne;if(!Array.isArray(Z)&&(Z!=null&&Z.includes("http"))){let G=await D.axios.get(Z,{responseType:"blob"}),re=(Ne=Z==null?void 0:Z.split("/"))==null?void 0:Ne[((ve=Z==null?void 0:Z.split("/"))==null?void 0:ve.length)-1];j.append("files",G.data,re)}else C.push(Z)});if(await Promise.all(le),!ce.isFormDataEmpty(j)){let Z=await ce.uploadAmountApi(j),ve=(F=(ie=Z==null?void 0:Z.data)==null?void 0:ie.result)==null?void 0:F.map(Ne=>{var G,re,Le,se,pe,xe;return{name:(xe=(pe=(se=(G=Ne==null?void 0:Ne.url)==null?void 0:G.split("/"))==null?void 0:se[((Le=(re=Ne==null?void 0:Ne.url)==null?void 0:re.split("/"))==null?void 0:Le.length)-1])==null?void 0:pe.split("."))==null?void 0:xe[0],url:Ne==null?void 0:Ne.url}});C=[...C,...ve]}let ee={};for(let Z in a)Z!=="id"&&(ee[Z]=a[Z]);ee[R]=C,_.push({id:a==null?void 0:a.id,value:{tableData:ee}})}(_==null?void 0:_.length)>0&&await D.batchUpdateInsofDataApi({dataList:_}),(L==null?void 0:L.length)>0&&await D.batchAddInsofDataApi({dataList:L}),ga(!0),sl.setImportLoading(!1),Ye.setFreshContent(!0)},sr=(e,a)=>(e=e==null?void 0:e.map(r=>{var o,n;return r!=null&&r.children&&((o=r.children)!=null&&o.find(c=>c.id===(a==null?void 0:a.id))?r.children=(n=r.children)==null?void 0:n.filter(c=>(c==null?void 0:c.id)!==(a==null?void 0:a.id)):r.children=sr(r.children,a)),r}),e),Ze=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,r)=>{a===(s==null?void 0:s.index)?r(new Error("选择源不能和目标源一致")):r()}}]},buttonValue:[{label:"取消",background:"#999999",color:"var(--ssbutton-theme-color)"},{label:"确认",background:"var(--ssbutton-theme-bg)",color:"var(--ssbutton-theme-color)"}]}),ko=()=>{Ze.show=!1},mo=e=>{var a,r;if((e==null?void 0:e.buttonName)==="取消")return Ze.show=!1;Ze.to=e==null?void 0:e.content,!(!(s!=null&&s.index)||!((a=Ze.to)!=null&&a.groupName))&&(s==null?void 0:s.index)!==((r=Ze.to)==null?void 0:r.groupName)&&(Ue("change",{buttonName:"迁移",value:{from:Ze.from,to:Ze.to,data:Ze.selectRow}}),Ze.show=!1)},So=e=>{if(e){if(!ca.validateFileSize(e.raw)){D.ElMessage.warning(`文件大小不能超过 ${Lr.value.maxSize}MB`);return}if(!ca.validateFileType(e.raw)){D.ElMessage.warning("请上传图片文件");return}}},Co=async()=>{var e,a;if(Fl.value.length===0){D.ElMessage.warning("请先选择要上传的图片");return}Ql.value=!0;try{const r=Fl.value.map(async v=>{var P;const N=new FormData;N.append("file",v.raw,v.name);const U=await bl.uploadFileApi(N);return((P=U==null?void 0:U.data)==null?void 0:P.result)||{name:v.name,url:"",fileName:v.name}}),o=await Promise.all(r),n=ca.extractTableHeaders(Q.value),c=o.map(v=>({name:(v==null?void 0:v.fileName)||(v==null?void 0:v.name),url:(v==null?void 0:v.url)||""})),t=await ca.recognize(c,n),i=Array.isArray(t==null?void 0:t.result)?t.result:[];if(i.length===0){D.ElMessage.warning("OCR识别未返回有效数据"),Ql.value=!1;return}const p=new Set,k=[];i.forEach((v,N)=>{const U=v!=null&&v.数据&&typeof(v==null?void 0:v.数据)=="object"?v.数据:{},P={_index:N,_certType:(v==null?void 0:v.证书类型)||"",_certNo:(v==null?void 0:v.证书编号)||""};Object.entries(U).forEach(([$,S])=>{Array.isArray(S)&&S.length>=2?(P[$]=S[0]??"",P[`${$}_accuracy`]=S[1]??0,p.add($)):(P[$]=S??"",P[`${$}_accuracy`]=0,p.add($))}),k.push(P)});const x=[];p.forEach(v=>{x.push({prop:v,label:v,editable:!0,minWidth:120}),x.push({prop:`${v}_accuracy`,label:`${v}准确率`,editable:!1,minWidth:100,isAccuracy:!0})}),Ma.value=x,aa.value=k,Ra.value=o,Fa.value=t,xa.value=!1,Fl.value=[],Ql.value=!1,$a.value=!0}catch(r){console.error("OCR处理失败:",r),D.ElMessage.error(((a=(e=r==null?void 0:r.response)==null?void 0:e.data)==null?void 0:a.message)||"OCR识别失败,请重试"),Ql.value=!1}},xo=()=>{var P,$;const e=Ra.value,a=Fa.value,r=aa.value;if(!r||r.length===0){D.ElMessage.warning("暂无数据可添加");return}const o=(P=ce.getAllLeafNodes(Q.value)||[])==null?void 0:P.filter(S=>(S==null?void 0:S.type)!=="operate"&&(S==null?void 0:S.label)!=="操作"&&(S==null?void 0:S.prop)!=="operate"),n=new Map,c=new Map,t=($=o==null?void 0:o.find(S=>(S==null?void 0:S.label)==="OCR图片"))==null?void 0:$.prop;o==null||o.forEach(S=>{S!=null&&S.label&&(S!=null&&S.prop)&&(n.set(S.label,S.prop),c.set(S.prop,S.label))});const i=Date.now(),p=S=>String(i*1e3+S);let k=0,x=0;const v=[],N=[];r.forEach((S,M)=>{const R={id:p(M),_isOCRRow:!0,_ocrTableId:s==null?void 0:s.index};for(const[L,_]of n.entries())Object.prototype.hasOwnProperty.call(S,L)&&(R[_]=S[L]);if(t&&e[M]){const L=e[M];R[t]=[{...L,name:(L==null?void 0:L.fileName)||(L==null?void 0:L.name),url:(L==null?void 0:L.url)||""}]}if(Kl.value&&Kl.value.length>0){const L={};let _=!1;if(Kl.value.forEach(w=>{const u=n.get(w);u&&R[u]!==void 0&&R[u]!==null&&R[u]!==""&&(L[u]=R[u],_=!0)}),_){const w=Y.value.find(u=>Object.entries(L).every(([y,h])=>{const K=u[y];return String(K)===String(h)||K===h}));if(w){for(const[y,h]of n.entries())Object.prototype.hasOwnProperty.call(R,h)&&h!=="_isOCRRow"&&h!=="_ocrTableId"&&h!=="id"&&(w[h]=R[h]);if(t&&e[M]){const y=e[M];w[t]=[{...y,name:(y==null?void 0:y.fileName)||(y==null?void 0:y.name),url:(y==null?void 0:y.url)||""}]}const u=Ul.value.find(y=>y.id===w.id);if(u){for(const[y,h]of n.entries())Object.prototype.hasOwnProperty.call(R,h)&&h!=="_isOCRRow"&&h!=="_ocrTableId"&&h!=="id"&&(u[h]=R[h]);if(t&&e[M]){const y=e[M];u[t]=[{...y,name:(y==null?void 0:y.fileName)||(y==null?void 0:y.name),url:(y==null?void 0:y.url)||""}]}}Cl.value&&Cl.value.set(w.id,w),N.push(JSON.parse(JSON.stringify(w))),k++;return}}}v.push(R),x++}),N.length>0&&(Y.value=[...Y.value||[]]),v.length>0&&(Y.value=[...Y.value||[],...v],Ul.value=[...Ul.value||[],...v],v.forEach(S=>{var M,R;return(R=(M=Cl.value)==null?void 0:M.set)==null?void 0:R.call(M,S.id,S)})),ta.value=Y.value;let U="";k>0&&x>0?U=`成功匹配替换 ${k} 条数据,新增 ${x} 条OCR识别数据`:k>0?U=`成功匹配替换 ${k} 条数据`:U=`成功添加 ${x} 条OCR识别数据`,D.ElMessage.success(U),N.length>0&&Ue("change",{buttonName:"编辑",singleContent:N,content:Y.value,index:s==null?void 0:s.index,parentTableId:s==null?void 0:s.parentTableId,column:Q.value}),v.length>0&&Ue("change",{buttonName:"OCR批量新增",content:Y.value,index:s==null?void 0:s.index,parentTableId:s==null?void 0:s.parentTableId,column:Q.value,ocrRows:v,uploadedFiles:e,ocrResult:a,matchedCount:k,newCount:x}),qa()},qa=()=>{$a.value=!1,aa.value=[],Ma.value=[],Ra.value=[],Fa.value=null,Kl.value=[]},_o=(e,a,r)=>{aa.value[e]&&(aa.value[e][a]=r)},No=(e,a)=>{if(a)Kl.value.includes(e)||Kl.value.push(e);else{const r=Kl.value.indexOf(e);r>-1&&Kl.value.splice(r,1)}},Do=e=>e==null||e===0?"-":`${(Number(e)*100).toFixed(1)}%`,Ao=e=>{if(e==null||e===0)return"#909399";const a=Number(e);return a>=.9?"#67c23a":a>=.7?"#e6a23c":"#f56c6c"},ur=()=>{xa.value=!1,Fl.value=[],Ur.value=null},Eo=async e=>{Za.value=e==null?void 0:e.name;const a=e.raw;Pa.value=URL.createObjectURL(a),Na.value=[{name:Za.value,blobUrl:Pa.value}],_a.value=!0},To=async e=>{const a=Go(e);if(!a||a.length===0){D.ElMessage.warning("暂无图片");return}if(a.length===1){await or(a[0]);return}try{const r=bl.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),o=await Promise.all(a.map(async n=>{const c=await ce.downloadAvatarApi(n),t=URL.createObjectURL(c.data);return{name:za(n),blobUrl:t}}));r.close(),Na.value=o,_a.value=!0}catch(r){console.error("预览图片失败:",r),D.ElMessage.error("预览图片失败,请重试")}},wo=()=>{_a.value=!1,Na.value=[],Pa.value=""},Bo=e=>{Fl.value=Fl.value.filter((a,r)=>r!==e)},Ea=async(e,a,r)=>{var o,n,c,t,i,p,k,x,v,N,U,P,$,S,M;if(Ll.value="",Ca.value=!0,ma.value=!0,Ue("onButtonClick",e,a),Qe.value=[],e==="删除")Ta.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var R,L;(R=Y.value)!=null&&R.find(_=>(_==null?void 0:_.id)===(a==null?void 0:a.id))?Y.value=(L=D.cloneDeep(Y.value))==null?void 0:L.filter(_=>(_==null?void 0:_.id)!==(a==null?void 0:a.id)):Y.value=sr(D.cloneDeep(Y.value),a),Cn(ta.value,da.value,a==null?void 0:a.id),Ye.setTableLoading(s==null?void 0:s.index),Ue("change",{content:Y.value,singleContent:a,index:s==null?void 0:s.index,type:"delete",buttonName:e,column:Q.value})});else if(e==="批量删除"){if(((o=Tl.value)==null?void 0:o.length)===0)return D.ElMessage.warning("请先勾选操作的数据");Ta.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var L,_;const R=(L=Tl.value)==null?void 0:L.map(w=>w.id);Y.value=(_=D.cloneDeep(Y.value))==null?void 0:_.filter(w=>!(R!=null&&R.includes(w.id))),Ye.setTableLoading(s==null?void 0:s.index),Ue("change",{content:Y.value,singleContent:null,selectItems:Tl.value,index:s==null?void 0:s.index,type:"batchDelete",buttonName:e,column:Q.value})})}else if(e==="复制新增"){ml.value="新增";const R=D.cloneDeep(a),L=(n=Q.value)==null?void 0:n.find(u=>u==null?void 0:u.isMainKey),_=L||((c=Q.value)==null?void 0:c[0]),w=(t=_l.value)==null?void 0:t.find(u=>(u==null?void 0:u.label)==="新建");await tr(!0,w,{data:R,firstCol:_})}else if(e==="新增")ml.value="新增",va(""),jl.value=!0;else if(e==="编辑")ml.value="编辑",va(a),jl.value=!0;else if(e==="查看")ml.value="查看",va(a),Ca.value=!1,ma.value=!1,jl.value=!0;else if(e==="查看三维模型"){const R={};for(let _ in a)_!=="id"&&(R[_]=a[_]);let L=(i=Object.values(R))==null?void 0:i[1];Br.setTableShowThree(L)}else if(((p=r==null?void 0:r.extra)==null?void 0:p.type)==="modelExample")ml.value=e,Sa.value=!0;else if(e==="新建"){let R=ea.value,L=[];for(let h in R)h!=null&&h.includes(`loading${((k=ra.value)==null?void 0:k.account)||((x=ra.value)==null?void 0:x.账号)}`)&&(L=[...L,...h]);let _=[];for(let h in R)h!=null&&h.includes(`updateLoading${((v=ra.value)==null?void 0:v.account)||((N=ra.value)==null?void 0:N.账号)}`)&&(_=[..._,...h]);let w=L==null?void 0:L.map(h=>h==null?void 0:h.id);const u=_==null?void 0:_.map(h=>h==null?void 0:h.id);w=[...D.cloneDeep(w),...u],(w==null?void 0:w.length)>0&&(w!=null&&w.every(h=>h!==null&&h))&&await D.batchDeleteInsofDataApi({ids:w});const y=(U=_l.value)==null?void 0:U.find(h=>(h==null?void 0:h.label)==="新建");await tr(!1,y)}else if(e==="修改模板"){let R=D.cloneDeep(Me).value;Ye.setRouteToChildPath(R),sl.setActiveMenuPath(R+fe)}else if(e==="执行")bo(e,a);else if(e!=null&&e.includes("导出")){if(e==="导出选中"&&((P=Tl.value)==null?void 0:P.length)===0)return D.ElMessage.warning(`请先勾选${e}的数据`);if(e==="导出全部"&&(($=Y.value)==null?void 0:$.length)===0)return D.ElMessage.warning("暂无数据导出");const R=(M=(S=Q.value)==null?void 0:S.map(_=>_==null?void 0:_.label))==null?void 0:M.filter(_=>_!=="操作"),L=e==="导出全部"?D.cloneDeep(Y.value):D.cloneDeep(Tl.value);L==null||L.forEach(_=>{_==null||delete _.id}),Hr(L,s==null?void 0:s.compName,R,s==null?void 0:s.compName)}else e==="OCR识别"?(xa.value=!0,Fl.value=[]):e==="迁移"&&(Ze.selectRow=a,Ze.show=!0)},Oo=async e=>{var r,o,n,c,t,i;const a=await D.getInsofDataApi({key:{pageKey:e,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});if(((r=a==null?void 0:a.data)==null?void 0:r.code)===200)return Array.isArray((o=a==null?void 0:a.data)==null?void 0:o.result)&&((c=(n=a==null?void 0:a.data)==null?void 0:n.result)==null?void 0:c.length)>0?(i=(t=a==null?void 0:a.data)==null?void 0:t.result)==null?void 0:i.map(p=>{var k;return{id:p==null?void 0:p.id,...(k=p==null?void 0:p.value)==null?void 0:k.pageData}}):[]},Uo=async(e,a)=>{var r,o,n,c,t,i,p,k,x,v,N,U,P,$,S,M,R,L,_,w;try{let u,y;const h=(r=ea.value[Me.value+fe])==null?void 0:r.filter(C=>{var j;return((j=C==null?void 0:C.key)==null?void 0:j.type)==="structureMethod"}),K=(o=ea.value[Me.value+fe])==null?void 0:o.filter(C=>{var j;return((j=C==null?void 0:C.key)==null?void 0:j.type)==="structure"}),O=h==null?void 0:h.find(C=>{var j,le;return((le=(j=C==null?void 0:C.value)==null?void 0:j.pageData)==null?void 0:le.method)==="保存"});if(!O)return;const J=(i=(t=ea.value[(c=(n=O==null?void 0:O.value)==null?void 0:n.pageData)==null?void 0:c.path])==null?void 0:t.filter(C=>{var j;return((j=C==null?void 0:C.key)==null?void 0:j.type)==="data"}))==null?void 0:i.find(C=>{var j,le,ee,Z;return((le=(j=C==null?void 0:C.value)==null?void 0:j.tableData)==null?void 0:le.算法名称)===((Z=(ee=O==null?void 0:O.value)==null?void 0:ee.pageData)==null?void 0:Z.method)});if(!J)return;const d={buttonName:(k=(p=O==null?void 0:O.value)==null?void 0:p.pageData)==null?void 0:k.method,api:(v=(x=J==null?void 0:J.value)==null?void 0:x.tableData)==null?void 0:v.算法体,content:K==null?void 0:K.map(C=>{var j;return(j=C==null?void 0:C.value)==null?void 0:j.pageData}),extraContent:[],extraValues:(U=(N=O==null?void 0:O.value)==null?void 0:N.pageData)==null?void 0:U.data,methodName:($=(P=O==null?void 0:O.value)==null?void 0:P.pageData)==null?void 0:$.path};if(!e)return;const T={...e,compData:(S=e==null?void 0:e.compData)==null?void 0:S.map(C=>{var j;return(C==null?void 0:C.key)==="formContent"?{...C,contents:(j=C==null?void 0:C.contents)==null?void 0:j.map(le=>(le==null?void 0:le.prop)===a?{...le,value:""}:le)}:C})},ie={key:{pageKey:Me.value+fe,parentTable:"",systemKey:sessionStorage.getItem("systemKey"),type:"structure"},value:{pageData:T}},F=await D.axios.post(d.api,ie,{headers:{"Content-Type":"application/json"}});return((M=F==null?void 0:F.data)==null?void 0:M.code)===200&&(u=(L=(R=F==null?void 0:F.data)==null?void 0:R.result)==null?void 0:L.latestReportCode,y=(w=(_=F==null?void 0:F.data)==null?void 0:_.result)==null?void 0:w.status),{newMainKeyValue:u,newStatus:y}}catch(u){throw D.ElMessage.error(u),new Error(u)}},cr=(e,a,r,o)=>{var n;Ue("contentChange",{contents:(n=e==null?void 0:e.compData)==null?void 0:n.map(c=>{var t;return(c==null?void 0:c.key)==="formContent"?{...c,contents:(t=c==null?void 0:c.contents)==null?void 0:t.map(i=>(i==null?void 0:i.key)===a?{...i,value:r}:ya.value&&(i==null?void 0:i.prop)===ya.prop?{...i,value:ya.value}:i)}:c}),index:e==null?void 0:e.id},o)},ya=l.reactive({prop:"状态",value:""}),Lo=l.ref(["系统自动生成信息","审批意见"]),jo=async(e,a,r)=>{var p,k;let o=e==null?void 0:e[a==null?void 0:a.prop],n=1,c,t;const i=D.cloneDeep(Me).value+fe+o;if(i){ya.value="",c=(p=ea.value[i])==null?void 0:p.filter(N=>{var U;return((U=N==null?void 0:N.key)==null?void 0:U.type)==="structure"});const x=c==null?void 0:c.find(N=>{var U,P,$;return(($=(P=(U=N==null?void 0:N.value)==null?void 0:U.pageData)==null?void 0:P.comp)==null?void 0:$.toUpperCase())==="FORM"});t={...(k=x==null?void 0:x.value)==null?void 0:k.pageData,id:x==null?void 0:x.id};const v=await Uo(t,a==null?void 0:a.prop);if(ya.value=v==null?void 0:v.newStatus,v!=null&&v.newMainKeyValue)return v==null?void 0:v.newMainKeyValue}if(Y.value.some(x=>(x==null?void 0:x[a==null?void 0:a.prop])===o)){const x=o;for(;Y.value.some(v=>(v==null?void 0:v[a==null?void 0:a.prop])===`${x}(${n})`);)n++;o=`${x}(${n})`}return o},tr=async(e,a,r)=>{var t,i,p,k,x,v,N,U;let o,n;const c=await jo(r==null?void 0:r.data,r==null?void 0:r.firstCol);if(e?(o=D.cloneDeep(Me).value+fe+((k=r==null?void 0:r.data)==null?void 0:k[(p=r==null?void 0:r.firstCol)==null?void 0:p.prop]),n=D.cloneDeep(Me).value+fe+c):(o=D.cloneDeep(Me).value+fe,n=D.cloneDeep(o)+`loading${((t=ra.value)==null?void 0:t.account)||((i=ra.value)==null?void 0:i.账号)}`),a){const P=(v=(x=ea.value[n])==null?void 0:x.filter($=>{var S;return((S=$==null?void 0:$.key)==null?void 0:S.parentTable)===""}))==null?void 0:v.map($=>{var S;return{id:$==null?void 0:$.id,...(S=$==null?void 0:$.value)==null?void 0:S.pageData}});if((P==null?void 0:P.length)>0)if(e){const $=P==null?void 0:P.find(S=>{var M;return((M=S==null?void 0:S.comp)==null?void 0:M.toUpperCase())==="FORM"});$&&cr($,(N=r==null?void 0:r.firstCol)==null?void 0:N.label,c,Me.value)}else Ye.setRouteToChildPath(D.cloneDeep(Me).value),sl.setActiveMenuPath(n);else if(await ce.loadingConstruct(o,n,null,null,e?Lo.value:null),e){const $=await Oo(n);if(($==null?void 0:$.length)>0){const S=$==null?void 0:$.find(M=>{var R;return((R=M==null?void 0:M.comp)==null?void 0:R.toUpperCase())==="FORM"});S&&cr(S,(U=r==null?void 0:r.firstCol)==null?void 0:U.label,c,Me.value)}}else Ye.setRouteToChildPath(D.cloneDeep(Me).value),sl.setActiveMenuPath(n)}else e?(Ll.value="",hl.value=r==null?void 0:r.data,ga(!0,r==null?void 0:r.firstCol,c)):(Ye.setRouteToChildPath(D.cloneDeep(Me).value),sl.setActiveMenuPath(n))},Po=()=>{H.value=!1,ua.value=[],be.value=!1},va=e=>{var t,i,p,k,x,v,N,U,P,$,S,M,R,L,_,w,u,y,h,K,O,J;const a=[];let r=[];for(let d in e)Array.isArray(e==null?void 0:e[d])&&r.push(d);qe.value=D.cloneDeep(Q.value),(i=ce.getColumnChild((t=D.cloneDeep(Q.value))==null?void 0:t.filter(d=>(d==null?void 0:d.label)!=="操作")))==null||i.forEach((d,T)=>{var ie,F,C;r.find(j=>j===(d==null?void 0:d.prop))||(d!=null&&d.formType&&((ie=d==null?void 0:d.formType)==null?void 0:ie.toUpperCase())==="SELECT"||d!=null&&d.menuId?a.push({label:(F=d==null?void 0:d.prop)!=null&&F.includes(".")?d==null?void 0:d.prop:(d==null?void 0:d.label)??(d==null?void 0:d.prop)??"",name:(d==null?void 0:d.prop)??"t"+T,prop:d==null?void 0:d.prop,type:"Select",value:(e==null?void 0:e[d==null?void 0:d.prop])??(d==null?void 0:d.value)??"",id:(d==null?void 0:d.id)??T,contents:(d==null?void 0:d.options)??[],width:1,isFormColHidden:d==null?void 0:d.isFormColHidden,relatedValueId:d==null?void 0:d.relatedValueId,disabled:d==null?void 0:d.disabled,optionUrl:{groupSelect:d==null?void 0:d.groupSelect,menuSelect:d==null?void 0:d.formMenuSelect,type:"Select",selectRelateType:d==null?void 0:d.selectRelateType,allSelectionContents:(d==null?void 0:d.allSelectionContents)??[],selectFilter:d==null?void 0:d.selectFilter,menuId:d==null?void 0:d.menuId,filterContent:d==null?void 0:d.filterContent}}):a.push({label:(C=d==null?void 0:d.prop)!=null&&C.includes(".")?d==null?void 0:d.prop:(d==null?void 0:d.label)??(d==null?void 0:d.prop)??"",prop:d==null?void 0:d.prop,name:(d==null?void 0:d.prop)??"t"+T,type:!(d!=null&&d.formType)||(d==null?void 0:d.formType)===""?"Input":d==null?void 0:d.formType,value:(e==null?void 0:e[d==null?void 0:d.prop])??(d==null?void 0:d.value)??"",id:(d==null?void 0:d.id)??T,contents:(d==null?void 0:d.options)??[],width:1,isFormColHidden:d==null?void 0:d.isFormColHidden,disabled:d==null?void 0:d.disabled,relatedValueId:d==null?void 0:d.relatedValueId}))}),e===""||!e||(Ll.value=(e==null?void 0:e.id)??"");let o=ce.getColumnChild((p=D.cloneDeep(Q.value))==null?void 0:p.filter(d=>(d==null?void 0:d.label)!=="操作"));Dl.value&&((k=Dl.value)==null?void 0:k.length)>0&&(Dl.value=(x=D.cloneDeep(Dl).value)==null?void 0:x.map(d=>{var ie;let T=(d==null?void 0:d.prop)||((ie=o==null?void 0:o.find(F=>(F==null?void 0:F.label)===(d==null?void 0:d.label)))==null?void 0:ie.prop);return T&&(d.value=e[T]),d})),ke.value=Dl.value&&((v=Dl.value)==null?void 0:v.length)>0?ce.getTableFormToForm(Dl.value):a;let n=[],c=(N=s.itemData)==null?void 0:N.filter(d=>(d==null?void 0:d.key)==="filterAllType");if((c==null?void 0:c.length)>0&&(n=(c==null?void 0:c.map(T=>T==null?void 0:T.value)).flat()),(n==null?void 0:n.length)>0){let d=(P=n==null?void 0:n.filter(F=>{var C;return(C=F==null?void 0:F.content)==null?void 0:C.includes("@Type")}))==null?void 0:P[((U=n==null?void 0:n.filter(F=>{var C;return(C=F==null?void 0:F.content)==null?void 0:C.includes("@Type")}))==null?void 0:U.length)-1];if(d!=null&&d.content){let F=(M=(S=($=d==null?void 0:d.content)==null?void 0:$.replace(":",ql))==null?void 0:S.split(ql))==null?void 0:M[1];if(((R=F==null?void 0:F.trim())==null?void 0:R.toUpperCase())==="MANUAL"){let C=(y=(u=(L=s.itemData)==null?void 0:L.filter(j=>(j==null?void 0:j.key)==="contentTableId"))==null?void 0:u[((w=(_=s.itemData)==null?void 0:_.filter(j=>(j==null?void 0:j.key)==="contentTableId"))==null?void 0:w.length)-1])==null?void 0:y.contents;ke.value=(h=ke.value)==null?void 0:h.map((j,le)=>{var ee,Z;return(ee=j==null?void 0:j.optionUrl)!=null&&ee.menuId&&(j.type="Select",(Z=j==null?void 0:j.optionUrl)!=null&&Z.menuId&&(j.optionUrl.menuId=j.optionUrl.menuId??C,j.optionUrl.menuFilter=n,ml.value==="新增"&&(j.optionUrl.multiple=!0,j.optionUrl.multipleLimit=5))),j})}}let T=(K=ke.value)==null?void 0:K.filter(F=>{var C,j;return((C=F==null?void 0:F.optionUrl)==null?void 0:C.menuId)&&((j=F==null?void 0:F.optionUrl)==null?void 0:j.menuId)!==""}),ie;if(T==null||T.forEach(F=>{var j,le;if(ie!==void 0)return;let C=(j=F==null?void 0:F.optionUrl)==null?void 0:j.menuId;((le=T==null?void 0:T.filter(ee=>{var Z;return((Z=ee==null?void 0:ee.optionUrl)==null?void 0:Z.menuId)===C}))==null?void 0:le.length)>1&&(ie=C)}),T=T==null?void 0:T.filter(F=>{var C;return((C=F==null?void 0:F.optionUrl)==null?void 0:C.menuId)===ie}),(T==null?void 0:T.length)>1){let F=T==null?void 0:T.map(ee=>ee==null?void 0:ee.prop),C=T==null?void 0:T.map(ee=>ee==null?void 0:ee.label),j=T==null?void 0:T.map(ee=>ee==null?void 0:ee.value),le=(O=D.cloneDeep(T))==null?void 0:O[0];le.label=C==null?void 0:C.join("·"),le.value=j==null?void 0:j.join(" "),le.value.trim()===""&&(le.value=""),le.prop=F==null?void 0:F.join("·"),le.usingType="parent",ke.value.unshift(le),ke.value=(J=ke.value)==null?void 0:J.map(ee=>(F!=null&&F.find(Z=>Z===(ee==null?void 0:ee.prop))&&(ee.isFormColHidden=!0),ee))}}},$o=()=>{var a;const e=(a=V.value)==null?void 0:a.$el;e&&ce.Sortable.create(e,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:r=>{var t;const{oldIndex:o,newIndex:n}=r;if(o===n)return;const c=fa.value.splice(o,1)[0];fa.value.splice(n,0,c),Q.value=(t=Q.value)==null?void 0:t.slice().sort((i,p)=>{if(i.label==="操作")return 1;if(p.label==="操作")return-1;const k=fa.value.findIndex(v=>v.label===i.label),x=fa.value.findIndex(v=>v.label===p.label);return k-x})}})};l.onMounted(()=>{ja.value=window.innerWidth-240*2});const Mo=()=>{l.nextTick(()=>{$o()})},Ja=(e,a)=>{var o;if(!e&&!(e!=null&&e.children))return{contents:e,currentSelectContents:void 0};let r;return e.children=(o=e.children)==null?void 0:o.map(n=>{var c,t;if((n==null?void 0:n.id)===Ll.value){let i={};for(let p in n){let k=(c=a==null?void 0:a.find(x=>(x==null?void 0:x.prop)===p))==null?void 0:c.label;k?i[p]=(t=hl.value)==null?void 0:t[k]:i[p]=n[p]}n=Object.assign(i,hl.value),r=n}else{let i=Ja(n,a);n=i==null?void 0:i.contents,r=i==null?void 0:i.currentSelectContents}return n}),{contents:e,currentSelectContents:r}},dr=(e,a)=>{let r,o;return e!=null&&e.find(n=>(n==null?void 0:n.id)===Ll.value)?r=e==null?void 0:e.map(n=>{var c,t;if((n==null?void 0:n.id)===Ll.value){let i={};for(let p in n){let k=(c=a==null?void 0:a.find(x=>(x==null?void 0:x.prop)===p))==null?void 0:c.label;k?i[p]=(t=hl.value)==null?void 0:t[k]:i[p]=n[p]}n=Object.assign(i,hl.value),o=n}return n}):r=e==null?void 0:e.map(n=>{var c,t,i,p;if((n==null?void 0:n.id)===Ll.value){let k={};for(let x in n){let v=(c=a==null?void 0:a.find(N=>(N==null?void 0:N.prop)===x))==null?void 0:c.label;v?k[x]=(t=hl.value)==null?void 0:t[v]:k[x]=n[x]}n=Object.assign(k,hl.value),o=n}else n=(i=Ja(n,a))==null?void 0:i.contents,o=(p=Ja(n,a))==null?void 0:p.currentSelectContents;return n}),{newContents:r,currentSelectContents:o}},pr=(e,a,r)=>{var o,n;return e[a==null?void 0:a.prop]=r,typeof e.id=="number"&&(e.id=(o=e.id)==null?void 0:o.toString()),e.children&&((n=e.children)==null?void 0:n.length)>0&&(e.children=e.children.map(pr)),e},Wa=e=>{var r;const a=[];return a.push({...e}),e!=null&&e.children&&Array.isArray(e.children)&&((r=e.children)==null||r.forEach(o=>{a.push(...Wa(o))})),(a==null?void 0:a.length)>0?a==null?void 0:a.map(o=>{const n={...o};return delete n.children,n}):[]},ga=(e=!0,a,r)=>{var k,x,v,N,U,P,$,S,M,R,L,_,w,u,y,h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne;let o=ce.getColumnChild((k=D.cloneDeep(Q.value))==null?void 0:k.filter(G=>(G==null?void 0:G.label)!=="操作")),n,c=D.cloneDeep(Y.value);if(!hl.value){jl.value=!1;return}if(Ll.value===""){la.value++;let G;a&&r?G={id:la.value.toString(),[a==null?void 0:a.prop]:r,children:hl.value.children}:G={id:la.value.toString()},G!=null&&G.children&&(G={...G,children:(x=G.children)==null?void 0:x.map(re=>pr(re,a,r))}),c.push(Object.assign(hl.value,G)),n=Object.assign(hl.value,G)}else c=(v=dr(c,o))==null?void 0:v.newContents,n=(N=dr(c,o))==null?void 0:N.currentSelectContents;const t=(U=s.itemData)==null?void 0:U.filter(G=>(G==null?void 0:G.key)==="childTree")[0];if(((P=t==null?void 0:t.contents)==null?void 0:P.length)>0){ml.value="编辑";const G=[];c==null||c.forEach((re,Le)=>{var pe;let se={};if(Array.isArray(re)){let xe=[];re==null||re.filter(Ve=>!(Ve!=null&&Ve.id)).forEach((Ve,A)=>{var I,Re,je,We,f,ae,Pe;if((Re=(I=Al.value)==null?void 0:I[A])!=null&&Re.prop&&!Array.isArray(Ve)){let m={};m[Al.value[A].column]=Ve,ze!=null&&ze.value&&((je=ze==null?void 0:ze.value)==null?void 0:je.length)>0&&((We=ze==null?void 0:ze.value)!=null&&We.find(ge=>JSON.stringify(ge==null?void 0:ge[0])===JSON.stringify(m)))&&(xe=(f=ze==null?void 0:ze.value)==null?void 0:f.find(ge=>JSON.stringify(ge==null?void 0:ge[0])===JSON.stringify(m))),xe&&xe.length>0?se[Al.value[A].prop]=xe!=null&&xe.find(ge=>{var Te;return((Te=Object.keys(ge))==null?void 0:Te[0])===Al.value[A].column})?(ae=xe==null?void 0:xe.find(ge=>{var Te;return((Te=Object.keys(ge))==null?void 0:Te[0])===Al.value[A].column}))==null?void 0:ae[Al.value[A].column]:Ve:se[Al.value[A].prop]=Ve}else Array.isArray(Ve)&&((Pe=Al.value[A])!=null&&Pe.prop?se[Al.value[A].prop]=Ve:se.children=Ha(Ve,Al.value))})}else se=re;if(Array.isArray(re)&&re.some(xe=>xe==null?void 0:xe.id)){const xe=(pe=re==null?void 0:re.find(Ve=>Ve.id))==null?void 0:pe.id;G.push(Object.assign(se,{id:rr(xe)}))}else se.id?G.push(se):G.push(Object.assign(se,{id:Le.toString()}))}),Y.value=gr(G,t,Q.value)}else Y.value=c;yr(Y.value),ta.value=Y.value;const i=_n(ta.value,da.value,c);let p=[];if(ia.value?(p=($=D.cloneDeep(ia).value.singleContent)==null?void 0:$.filter(G=>(G==null?void 0:G.id)!==(n==null?void 0:n.id)),p.push(n)):p=[n],El.value){const G={content:i,singleContent:((S=t==null?void 0:t.contents)==null?void 0:S.length)>0?p==null?void 0:p.flatMap(Wa):p,index:s==null?void 0:s.index,buttonName:"编辑",column:Q.value,parentTableId:s==null?void 0:s.parentTableId};Ye.setCacheUpdatingData(G)}if(e){let G=(_=(L=(R=(M=s.itemData)==null?void 0:M.find(se=>(se==null?void 0:se.key)==="filterAllType"))==null?void 0:R.value)==null?void 0:L.find(se=>(se==null?void 0:se.value)==="onConditionContents"))==null?void 0:_.content,re=(w=s.itemData)==null?void 0:w.filter(se=>(se==null?void 0:se.key)==="filterAllType");re=Array.from(new Map(re.filter(Boolean).map((se,pe)=>[se.value,{...se,_idx:pe}])).values()).sort((se,pe)=>se._idx-pe._idx).map(({_idx:se,...pe})=>pe),re=(u=re==null?void 0:re[(re==null?void 0:re.length)-1])==null?void 0:u.value;const Le={content:i,singleContent:((y=t==null?void 0:t.contents)==null?void 0:y.length)>0?Wa(n):n,index:s==null?void 0:s.index,buttonName:ml.value,column:Q.value,parentTableId:s==null?void 0:s.parentTableId,filter:G,allFilter:re,pathIndex:(K=(h=s.itemData)==null?void 0:h.find(se=>(se==null?void 0:se.key)==="relatedFilter"))==null?void 0:K.index,rowContents:ke.value,addArrayValues:Qe.value};Ye.setTableLoading(s==null?void 0:s.index),jl.value=!1,hl.value=void 0,Ue("change",Le)}if((d=(J=(O=ke.value)==null?void 0:O[0])==null?void 0:J.optionUrl)!=null&&d.menuId){jl.value=!1;let G=(T=s.itemData)==null?void 0:T.filter(re=>(re==null?void 0:re.key)==="filterAllType");if((G==null?void 0:G.length)>0){let re=G==null?void 0:G.map(pe=>pe==null?void 0:pe.value),Le=(C=(F=(ie=re.flat().find(pe=>{var xe;return(xe=pe==null?void 0:pe.content)==null?void 0:xe.includes("@Num")}))==null?void 0:ie.content)==null?void 0:F.split(":"))==null?void 0:C[1];((ee=(le=(j=re.flat().find(pe=>{var xe;return(xe=pe==null?void 0:pe.content)==null?void 0:xe.includes("@Type:")}))==null?void 0:j.content)==null?void 0:le.split(":"))==null?void 0:ee[1])!=="Manual"&&(Le=parseInt(Le),Y.value=(Ne=Y.value)==null?void 0:Ne.slice(((Z=Y.value)==null?void 0:Z.length)-Le,(ve=Y.value)==null?void 0:ve.length))}}};l.onUnmounted(()=>{Q.value=[],Y.value=[],qe.value=[],La.value=[],Dl.value=[],Jl.value=[],ua.value=[],xl.value=[],ke.value=[],Tl.value=[],V.value=null});const fr=async(e,a,r)=>{var k,x,v,N,U,P,$,S,M,R,L;wl.value=r==null?void 0:r.prop;const o=D.cloneDeep(s.itemData),n=o==null?void 0:o.map(_=>{var w;return(_==null?void 0:_.key)==="header"&&((w=_.contents)==null||w.map((u,y)=>{var h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne,G,re,Le,se;return u.type=u!=null&&u.type?u.type:(J=(O=(K=(h=u==null?void 0:u.key)==null?void 0:h.split("$"))==null?void 0:K[1])==null?void 0:O.split("("))!=null&&J[0]?(T=(d=ce.FormType)==null?void 0:d.find(pe=>{var xe,Ve,A,I;return(pe==null?void 0:pe.key)===((I=(A=(Ve=(xe=u==null?void 0:u.key)==null?void 0:xe.split("$"))==null?void 0:Ve[1])==null?void 0:A.split("("))==null?void 0:I[0])}))==null?void 0:T.value:"Input",u.options=u!=null&&u.options?u.options:((C=(F=(ie=u==null?void 0:u.key)==null?void 0:ie.split("$"))==null?void 0:F[1])==null?void 0:C.length)>0?(Z=(ee=wa((le=(j=u==null?void 0:u.key)==null?void 0:j.split("$"))==null?void 0:le[1]))==null?void 0:ee.split(","))==null?void 0:Z.map(pe=>({label:pe,value:pe})):[],(ve=u==null?void 0:u.key)!=null&&ve.includes("$")&&(u.key=(G=(Ne=u==null?void 0:u.key)==null?void 0:Ne.split("$"))==null?void 0:G[0]),u.value=(re=Object.values(a))==null?void 0:re[y],u.optionUrl=u!=null&&u.formMenuSelect&&((Le=u==null?void 0:u.formMenuSelect)==null?void 0:Le.length)>0?{groupSelect:(se=u==null?void 0:u.groupSelect)==null?void 0:se.split(/[::]/).map(pe=>pe.trim()),menuSelect:u==null?void 0:u.formMenuSelect,selectRelateType:"",type:(u==null?void 0:u.formType)??(u!=null&&u.groupSelect?"Select":"")}:null,u})),_});let c=D.cloneDeep(ke.value),t=(x=(k=D.cloneDeep(n))==null?void 0:k.find(_=>(_==null?void 0:_.key)==="header"))==null?void 0:x.contents;c=c==null?void 0:c.map(_=>{var w;return _.value=(w=t==null?void 0:t.find((u,y)=>y===(_==null?void 0:_.id)))==null?void 0:w.value,_});let i="",p=(U=(N=(v=D.cloneDeep(n))==null?void 0:v.find(_=>(_==null?void 0:_.key)==="header"))==null?void 0:N.contents)==null?void 0:U.find((_,w)=>{var u,y,h;return(_==null?void 0:_.label)===wl.value||(w==null?void 0:w.toString())===((h=(y=(u=wl.value)==null?void 0:u.split("a"))==null?void 0:y[1])==null?void 0:h.toString())});if((S=($=(P=D.cloneDeep(n))==null?void 0:P.find(_=>(_==null?void 0:_.key)==="header"))==null?void 0:$.contents)==null||S.forEach(_=>{var w,u,y,h,K;i===""&&((y=(u=(w=_==null?void 0:_.optionUrl)==null?void 0:w.groupSelect)==null?void 0:u[1])!=null&&y.includes("["))&&(i=(K=(h=_==null?void 0:_.optionUrl)==null?void 0:h.groupSelect)==null?void 0:K[1])}),(M=p==null?void 0:p.optionUrl)!=null&&M.menuSelect){let _=await Ba(p),w;if(_==null||_.forEach(u=>{var y,h,K,O,J,d,T,ie,F,C;i===((h=(y=p==null?void 0:p.optionUrl)==null?void 0:y.groupSelect)==null?void 0:h[1])&&((J=(O=(K=p==null?void 0:p.optionUrl)==null?void 0:K.groupSelect)==null?void 0:O[1])!=null&&J.includes("["))&&((C=D.cloneDeep(u))==null?void 0:C[(F=(ie=(T=(d=p==null?void 0:p.optionUrl)==null?void 0:d.groupSelect)==null?void 0:T[1])==null?void 0:ie.replaceAll("[",""))==null?void 0:F.replaceAll("]","")])===(p==null?void 0:p.value)&&(w=u)}),w){let u=D.cloneDeep(c);u=u==null?void 0:u.map(h=>{var K,O,J,d,T,ie,F,C,j,le,ee;return(w!=null&&w[h==null?void 0:h.label]||w!=null&&w[(d=(J=(O=(K=h==null?void 0:h.optionUrl)==null?void 0:K.groupSelect)==null?void 0:O[1])==null?void 0:J.replaceAll("[",""))==null?void 0:d.replaceAll("]","")])&&((F=(ie=(T=h==null?void 0:h.optionUrl)==null?void 0:T.groupSelect)==null?void 0:ie[1])!=null&&F.includes("["))&&(h.value=(w==null?void 0:w[h==null?void 0:h.label])||(w==null?void 0:w[(ee=(le=(j=(C=h==null?void 0:h.optionUrl)==null?void 0:C.groupSelect)==null?void 0:j[1])==null?void 0:le.replaceAll("[",""))==null?void 0:ee.replaceAll("]","")])),h}),Y.value=(R=D.cloneDeep(Y.value))==null?void 0:R.map(h=>{if((h==null?void 0:h.id)===(a==null?void 0:a.id)){const K={};return u==null||u.forEach(O=>{K[O.name]=O.value}),K.id=h==null?void 0:h.id,K}return h});let y=D.cloneDeep(u);y=y==null?void 0:y.map(h=>{var K,O,J,d;return(O=(K=h==null?void 0:h.optionUrl)==null?void 0:K.menuSelect)!=null&&O.some(T=>T==null?void 0:T.includes)&&(h.optionUrl.menuSelect=(d=(J=h==null?void 0:h.optionUrl)==null?void 0:J.menuSelect)==null?void 0:d.map(T=>{var ie,F,C,j;if(T!=null&&T.includes("[")){let le=(F=(ie=T==null?void 0:T.replaceAll("[","").replaceAll("]",""))==null?void 0:ie.split(":"))==null?void 0:F[1];T=(j=(C=D.cloneDeep(u))==null?void 0:C.find(ee=>(ee==null?void 0:ee.label)===le))==null?void 0:j.value}return T})),h}),Y.value=(L=D.cloneDeep(Y.value))==null?void 0:L.map(h=>{if((h==null?void 0:h.id)===(a==null?void 0:a.id)){const K={};return y==null||y.forEach(O=>{K[O.name]=O.value}),K.id=h==null?void 0:h.id,K}return h})}}},Ro=async e=>{var U,P,$,S,M,R,L,_,w,u,y,h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne,G,re,Le,se,pe,xe,Ve;if(!e)return;hl.value=e;const a=D.cloneDeep(s.itemData);let r=a==null?void 0:a.map(A=>{var I,Re,je,We;return(A==null?void 0:A.key)==="header"&&(Array.isArray((I=A.contents)==null?void 0:I[0])?A.contents=(je=ce.getColumnChild((Re=A.contents)==null?void 0:Re[0]))==null?void 0:je.map((f,ae)=>{var Pe,m,ge,Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl,b,q,_e,cl,Nl,tl;return f.type=f!=null&&f.type?f.type:(Te=(ge=(m=(Pe=f==null?void 0:f.key)==null?void 0:Pe.split("$"))==null?void 0:m[1])==null?void 0:ge.split("("))!=null&&Te[0]?(al=(ll=ce.FormType)==null?void 0:ll.find(Ae=>{var gl,ye,B,g;return(Ae==null?void 0:Ae.key)===((g=(B=(ye=(gl=f==null?void 0:f.key)==null?void 0:gl.split("$"))==null?void 0:ye[1])==null?void 0:B.split("("))==null?void 0:g[0])}))==null?void 0:al.value:"Input",f.options=f!=null&&f.options?f.options:((nl=(ol=(rl=f==null?void 0:f.key)==null?void 0:rl.split("$"))==null?void 0:ol[1])==null?void 0:nl.length)>0?(Ee=(Se=wa((el=(il=f==null?void 0:f.key)==null?void 0:il.split("$"))==null?void 0:el[1]))==null?void 0:Se.split(","))==null?void 0:Ee.map(Ae=>({label:Ae,value:Ae})):[],(ul=f==null?void 0:f.key)!=null&&ul.includes("$")&&(f.key=(fl=(pl=f==null?void 0:f.key)==null?void 0:pl.split("$"))==null?void 0:fl[0]),((b=(dl=(vl=ke.value)==null?void 0:vl.find(Ae=>(Ae==null?void 0:Ae.prop)===(f==null?void 0:f.prop)))==null?void 0:dl.optionUrl)==null?void 0:b.multiple)===!0&&!Array.isArray((q=Object.values(e))==null?void 0:q[ae])?f.value=[(_e=Object.values(e))==null?void 0:_e[ae]]:f.value=(cl=Object.values(e))==null?void 0:cl[ae],f.optionUrl=f!=null&&f.formMenuSelect&&((Nl=f==null?void 0:f.formMenuSelect)==null?void 0:Nl.length)>0?{groupSelect:(tl=f==null?void 0:f.groupSelect)==null?void 0:tl.split(/[::]/).map(Ae=>Ae.trim()),menuSelect:f==null?void 0:f.formMenuSelect,selectRelateType:"",type:(f==null?void 0:f.formType)??(f!=null&&f.groupSelect?"Select":"")}:null,f}):A.contents=(We=A.contents)==null?void 0:We.map((f,ae)=>{var Pe,m,ge,Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl,b,q,_e,cl,Nl,tl;return f.type=f!=null&&f.type?f.type:(Te=(ge=(m=(Pe=f==null?void 0:f.key)==null?void 0:Pe.split("$"))==null?void 0:m[1])==null?void 0:ge.split("("))!=null&&Te[0]?(al=(ll=ce.FormType)==null?void 0:ll.find(Ae=>{var gl,ye,B,g;return(Ae==null?void 0:Ae.key)===((g=(B=(ye=(gl=f==null?void 0:f.key)==null?void 0:gl.split("$"))==null?void 0:ye[1])==null?void 0:B.split("("))==null?void 0:g[0])}))==null?void 0:al.value:"Input",f.options=f!=null&&f.options?f.options:((nl=(ol=(rl=f==null?void 0:f.key)==null?void 0:rl.split("$"))==null?void 0:ol[1])==null?void 0:nl.length)>0?(Ee=(Se=wa((el=(il=f==null?void 0:f.key)==null?void 0:il.split("$"))==null?void 0:el[1]))==null?void 0:Se.split(","))==null?void 0:Ee.map(Ae=>({label:Ae,value:Ae})):[],(ul=f==null?void 0:f.key)!=null&&ul.includes("$")&&(f.key=(fl=(pl=f==null?void 0:f.key)==null?void 0:pl.split("$"))==null?void 0:fl[0]),((b=(dl=(vl=ke.value)==null?void 0:vl.find(Ae=>(Ae==null?void 0:Ae.prop)===(f==null?void 0:f.prop)))==null?void 0:dl.optionUrl)==null?void 0:b.multiple)===!0&&!Array.isArray((q=Object.values(e))==null?void 0:q[ae])?f.value=[(_e=Object.values(e))==null?void 0:_e[ae]]:f.value=(cl=Object.values(e))==null?void 0:cl[ae],f.optionUrl=f!=null&&f.formMenuSelect&&((Nl=f==null?void 0:f.formMenuSelect)==null?void 0:Nl.length)>0?{groupSelect:(tl=f==null?void 0:f.groupSelect)==null?void 0:tl.split(/[::]/).map(Ae=>Ae.trim()),menuSelect:f==null?void 0:f.formMenuSelect,selectRelateType:"",type:(f==null?void 0:f.formType)??(f!=null&&f.groupSelect?"Select":"")}:null,f})),A}),o=ke.value,n=(P=(U=D.cloneDeep(r))==null?void 0:U.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:P.contents;if(n=n==null?void 0:n.filter(A=>(A==null?void 0:A.label)!=="操作"),n.push({label:"操作",type:"operate"}),o=o==null?void 0:o.map(A=>{var I;return A.value=A.value??((I=n==null?void 0:n.find((Re,je)=>(Re==null?void 0:Re.prop)===(A==null?void 0:A.name)))==null?void 0:I.value),A}),!pa.value)return;let c="",t=D.cloneDeep(wl.value);($=wl.value)!=null&&$.includes("·")&&(wl.value=(M=(S=wl.value)==null?void 0:S.split("·"))==null?void 0:M[0]);let i=(_=(L=(R=D.cloneDeep(r))==null?void 0:R.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:L.contents)==null?void 0:_.find((A,I)=>{var Re,je,We;return(A==null?void 0:A.prop)===wl.value||(I==null?void 0:I.toString())===((We=(je=(Re=wl.value)==null?void 0:Re.split("a"))==null?void 0:je[1])==null?void 0:We.toString())}),p=(w=i==null?void 0:i.optionUrl)==null?void 0:w.menuSelect,k=!0;(h=(y=(u=D.cloneDeep(r))==null?void 0:u.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:y.contents)==null||h.forEach(A=>{var I,Re,je,We,f,ae;k&&((je=(Re=(I=A==null?void 0:A.optionUrl)==null?void 0:I.groupSelect)==null?void 0:Re[1])!=null&&je.includes("["))&&(c=(f=(We=A==null?void 0:A.optionUrl)==null?void 0:We.groupSelect)==null?void 0:f[1],JSON.stringify(p)===JSON.stringify((ae=A==null?void 0:A.optionUrl)==null?void 0:ae.menuSelect)&&(k=!1))});let x=D.cloneDeep(o),v=X.value;v!=null&&v.find(A=>(i==null?void 0:i.prop)===(A==null?void 0:A.key))&&(v=v==null?void 0:v.filter(A=>(i==null?void 0:i.prop)!==(A==null?void 0:A.key))),v!=null&&v.find(A=>t===(A==null?void 0:A.key))&&(v=v==null?void 0:v.filter(A=>t!==(A==null?void 0:A.key))),x=x==null?void 0:x.map(A=>{var I,Re,je,We,f,ae,Pe,m,ge;return(A==null?void 0:A.type)==="Select"&&(((Re=(I=A==null?void 0:A.optionUrl)==null?void 0:I.allSelectionContents)==null?void 0:Re.length)>0&&(A.optionUrl.contactValue=e),((i==null?void 0:i.prop)===(A==null?void 0:A.prop)||t===(A==null?void 0:A.prop))&&i&&(Array.isArray(i.value)&&((je=i.value)==null?void 0:je.length)>0&&((We=i.value)!=null&&We.every(Te=>typeof Te=="string"))?(v.push({key:A==null?void 0:A.prop,value:[(ae=i.value)==null?void 0:ae[((f=i.value)==null?void 0:f.length)-1]]}),A.selectValue=(Pe=v==null?void 0:v.find(Te=>(Te==null?void 0:Te.key)===(A==null?void 0:A.prop)))==null?void 0:Pe.value):Array.isArray(i.value)&&((m=i.value)==null?void 0:m.length)===0?(v=[],A.selectValue=[],e[A==null?void 0:A.prop]=""):Array.isArray(A.value)&&v.push({key:A==null?void 0:A.prop,value:[(ge=A.value)==null?void 0:ge[(A==null?void 0:A.length)-1]]}))),A.value=e==null?void 0:e[A==null?void 0:A.prop],A}),X.value=v,ke.value=D.cloneDeep(x);let N=(i==null?void 0:i.menuId)??((J=(O=(K=ke.value)==null?void 0:K.find(A=>{var I;return(I=A==null?void 0:A.optionUrl)==null?void 0:I.menuId}))==null?void 0:O.optionUrl)==null?void 0:J.menuId);if((d=i==null?void 0:i.optionUrl)!=null&&d.menuSelect&&pa.value||N){let A=await Ba(i,N),I;if(A==null||A.forEach(f=>{var ae,Pe,m,ge,Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl,b,q,_e,cl,Nl,tl,Ae,gl;if(!N&&c===((Pe=(ae=i==null?void 0:i.optionUrl)==null?void 0:ae.groupSelect)==null?void 0:Pe[1])&&((Te=(ge=(m=i==null?void 0:i.optionUrl)==null?void 0:m.groupSelect)==null?void 0:ge[1])!=null&&Te.includes("["))&&((nl=D.cloneDeep(f))==null?void 0:nl[(ol=(rl=(al=(ll=i==null?void 0:i.optionUrl)==null?void 0:ll.groupSelect)==null?void 0:al[1])==null?void 0:rl.replaceAll("[",""))==null?void 0:ol.replaceAll("]","")])===(i==null?void 0:i.value)&&(I=f),N){let ye=(el=(il=ke.value)==null?void 0:il.find(ue=>{var me;return(i==null?void 0:i.menuId)===((me=ue==null?void 0:ue.optionUrl)==null?void 0:me.menuId)}))==null?void 0:el.prop,B=e[ye];if(ye!=null&&ye.includes("·"))if(!Array.isArray(e[ye]))B=(Ee=(Se=e[ye])==null?void 0:Se.split(" "))==null?void 0:Ee[0],ye=(ul=ye==null?void 0:ye.split("·"))==null?void 0:ul[0];else{ye=(pl=ye==null?void 0:ye.split("·"))==null?void 0:pl[0];let ue=(vl=(fl=x==null?void 0:x.find(me=>(me==null?void 0:me.prop)===ye))==null?void 0:fl.selectValue)==null?void 0:vl[0];B=(dl=ue==null?void 0:ue.split(" "))==null?void 0:dl[0]}let g=(q=(b=x==null?void 0:x.find(ue=>{var me;return(ue==null?void 0:ue.prop)===ye||((me=ue==null?void 0:ue.prop)==null?void 0:me.includes("."+ye))}))==null?void 0:b.selectValue)==null?void 0:q[0];if(ye!=null&&ye.includes(".")&&!f[ye]&&(ye=(cl=ye==null?void 0:ye.split("."))==null?void 0:cl[((_e=ye==null?void 0:ye.split("."))==null?void 0:_e.length)-1]),Array.isArray(B)&&!g&&(g=B==null?void 0:B[0]),f[ye]===(Array.isArray(B)?g:B)&&(i==null?void 0:i.directiveLabel)==="#isMain"){if(t!=null&&t.includes("·")){let ue=t==null?void 0:t.split("·"),me=(gl=(Ae=(tl=Array.isArray(e==null?void 0:e[t])?(Nl=e==null?void 0:e[t])==null?void 0:Nl[0]:e==null?void 0:e[t])==null?void 0:tl.split(" "))==null?void 0:Ae.filter(De=>De&&De!==""))==null?void 0:gl.map(De=>De==null?void 0:De.trim());ue==null||ue.forEach((De,Ge)=>{f[De]=me==null?void 0:me[Ge]})}I=f}}}),kl.value&&(i==null?void 0:i.directiveLabel)==="#isMain"&&(Qe.value=[]),!I){if(kl.value&&(i==null?void 0:i.directiveLabel)==="#isMain")if(t!=null&&t.includes("·")){let f=e,ae=(F=(ie=(T=e==null?void 0:e[t])==null?void 0:T.split(" "))==null?void 0:ie.filter(m=>m&&m!==""))==null?void 0:F.map(m=>m==null?void 0:m.trim());(C=t==null?void 0:t.split("·"))==null||C.forEach((m,ge)=>{f[m]=ae[ge]});let Pe=(j=ke.value)==null?void 0:j.find(m=>(m==null?void 0:m.prop)===t);f[Pe.prop]=[Pe.value],I=f}else{let f=(le=ke.value)==null?void 0:le.find(ae=>(ae==null?void 0:ae.prop)===(i==null?void 0:i.prop));e[f.prop]=[f.value],I=e}else if((i==null?void 0:i.directiveLabel)==="#isMain"){let f={};(ee=ke.value)==null||ee.forEach(ae=>{var Pe,m;(ae==null?void 0:ae.prop)===t?f[ae.prop]=(Pe=ae==null?void 0:ae.selectValue)!=null&&Pe[0]?[(m=ae==null?void 0:ae.selectValue)==null?void 0:m[0]]:"":f[ae.prop]=""}),I=f}}if(I){let f=D.cloneDeep(o);f=f==null?void 0:f.map(m=>{var Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl,b,q,_e,cl,Nl,tl,Ae,gl,ye,B,g,ue,me,De,Ge,Fe,Pl,zl,Vl,Ce;(I!=null&&I[m==null?void 0:m.prop]||I!=null&&I[(rl=(al=(ll=(Te=m==null?void 0:m.optionUrl)==null?void 0:Te.groupSelect)==null?void 0:ll[1])==null?void 0:al.replaceAll("[",""))==null?void 0:rl.replaceAll("]","")])&&((il=(nl=(ol=m==null?void 0:m.optionUrl)==null?void 0:ol.groupSelect)==null?void 0:nl[1])!=null&&il.includes("["))&&(m!=null&&m.relatedValueId)&&(m.value=(I==null?void 0:I[m==null?void 0:m.prop])||(I==null?void 0:I[(ul=(Ee=(Se=(el=m==null?void 0:m.optionUrl)==null?void 0:el.groupSelect)==null?void 0:Se[1])==null?void 0:Ee.replaceAll("[",""))==null?void 0:ul.replaceAll("]","")]));let ge=I==null?void 0:I[m==null?void 0:m.prop];return(pl=m==null?void 0:m.prop)!=null&&pl.includes(".")&&!ge&&((vl=(fl=i==null?void 0:i.prop)==null?void 0:fl.split("."))==null?void 0:vl[0])===((b=(dl=m==null?void 0:m.prop)==null?void 0:dl.split("."))==null?void 0:b[0])&&(ge=(I==null?void 0:I[(Nl=(q=m==null?void 0:m.prop)==null?void 0:q.split("."))==null?void 0:Nl[((cl=(_e=m==null?void 0:m.prop)==null?void 0:_e.split("."))==null?void 0:cl.length)-1]])??(I==null?void 0:I[m==null?void 0:m.prop])),N&&(ge||ge==="")&&(m!=null&&m.relatedValueId)&&ml.value==="新增"&&((m==null?void 0:m.prop)!==(i==null?void 0:i.prop)||t!=null&&t.includes((i==null?void 0:i.prop)+"·")||t!=null&&t.includes("·"+(m==null?void 0:m.prop)))?m.value=ge??(I==null?void 0:I[(ye=(gl=(Ae=(tl=m==null?void 0:m.optionUrl)==null?void 0:tl.groupSelect)==null?void 0:Ae[1])==null?void 0:gl.replaceAll("[",""))==null?void 0:ye.replaceAll("]","")]):(t!=null&&t.includes("·"+(m==null?void 0:m.prop))||t!=null&&t.includes("."))&&(m==null?void 0:m.prop)!==(i==null?void 0:i.prop)&&!Array.isArray((g=(B=ke.value)==null?void 0:B.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:g.value)?m.value=ge??"":((ue=m==null?void 0:m.optionUrl)==null?void 0:ue.multiple)===!0&&!Array.isArray((De=(me=ke.value)==null?void 0:me.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:De.value)?m.value=((Fe=(Ge=ke.value)==null?void 0:Ge.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:Fe.value)===""?[]:[(zl=(Pl=ke.value)==null?void 0:Pl.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:zl.value]:m.value=(Ce=(Vl=ke.value)==null?void 0:Vl.find(Oe=>(Oe==null?void 0:Oe.prop)===(m==null?void 0:m.prop)))==null?void 0:Ce.value,m}),ke.value=D.cloneDeep(f);let ae=D.cloneDeep(f);ae=ae==null?void 0:ae.map(m=>{var ge,Te,ll,al,rl,ol,nl,il,el;return(Te=(ge=m==null?void 0:m.optionUrl)==null?void 0:ge.menuSelect)!=null&&Te.some(Se=>Se==null?void 0:Se.includes("["))&&(m.optionUrl.oldMenuSelect=(al=(ll=D.cloneDeep(m))==null?void 0:ll.optionUrl)==null?void 0:al.menuSelect,m.optionUrl.menuSelect=(ol=(rl=m==null?void 0:m.optionUrl)==null?void 0:rl.menuSelect)==null?void 0:ol.map(Se=>{var Ee,ul,pl,fl;if(Se!=null&&Se.includes("[")){let vl=(ul=(Ee=Se==null?void 0:Se.replaceAll("[","").replaceAll("]",""))==null?void 0:Ee.split(":"))==null?void 0:ul[1];Se=(fl=(pl=D.cloneDeep(f))==null?void 0:pl.find(dl=>(dl==null?void 0:dl.label)===vl))==null?void 0:fl.value}return Se})),((i==null?void 0:i.prop)===(m==null?void 0:m.prop)||t===(m==null?void 0:m.prop))&&Array.isArray(i.value)&&(nl=i.value)!=null&&nl.every(Se=>typeof Se=="string")&&(m.selectValue=((il=v==null?void 0:v.find(Se=>(Se==null?void 0:Se.key)===(m==null?void 0:m.prop)))==null?void 0:il.value)??((el=m.value)==null?void 0:el[0])),m}),ke.value=ae;let Pe={};(Z=ke.value)==null||Z.forEach(m=>{Pe[m.prop]=m==null?void 0:m.value}),hl.value=Pe}let Re=Qe.value,je={};(ve=ke.value)==null||ve.forEach(f=>{var ae,Pe,m,ge,Te,ll,al,rl,ol,nl,il;if(((f==null?void 0:f.directiveLabel)==="#isMain"||(ae=f==null?void 0:f.optionUrl)!=null&&ae.menuId)&&Array.isArray(f==null?void 0:f.value)){if(je[f.prop]||(je[f.prop]=(m=f.value)==null?void 0:m[((Pe=f.value)==null?void 0:Pe.length)-1]),(ge=f==null?void 0:f.prop)!=null&&ge.includes("·")){let el=(al=(ll=(Te=f==null?void 0:f.prop)==null?void 0:Te.split("·"))==null?void 0:ll.filter(Ee=>Ee&&Ee!==""))==null?void 0:al.map(Ee=>Ee==null?void 0:Ee.trim()),Se=(il=(nl=(ol=(rl=f==null?void 0:f.selectValue)==null?void 0:rl[0])==null?void 0:ol.split(" "))==null?void 0:nl.filter(Ee=>Ee&&Ee!==""))==null?void 0:il.map(Ee=>Ee==null?void 0:Ee.trim());el==null||el.forEach((Ee,ul)=>{je=Object.assign({},je,{[Ee]:Se==null?void 0:Se[ul]})})}}else je[f.prop]=(je==null?void 0:je[f==null?void 0:f.prop])??f.value});let We=(Ne=ke.value)==null?void 0:Ne.find(f=>{var ae;return(f==null?void 0:f.directiveLabel)==="#isMain"||((ae=f==null?void 0:f.optionUrl)==null?void 0:ae.menuId)});(i==null?void 0:i.directiveLabel)==="#isMain"&&((re=i==null?void 0:i.value)==null?void 0:re[((G=i==null?void 0:i.value)==null?void 0:G.length)-1])!==""?Re.push({label:i==null?void 0:i.prop,value:(se=i==null?void 0:i.value)==null?void 0:se[((Le=i==null?void 0:i.value)==null?void 0:Le.length)-1],objectValue:je}):((pe=We==null?void 0:We.value)==null?void 0:pe.length)>0&&((Ve=i==null?void 0:i.value)==null?void 0:Ve[((xe=i==null?void 0:i.value)==null?void 0:xe.length)-1])!==""&&(Re=Re==null?void 0:Re.map(f=>{var ae;return(f==null?void 0:f.value)===((ae=We==null?void 0:We.selectValue)==null?void 0:ae[0])&&(f.objectValue=je),f})),Qe.value=Re}pa.value=!0,kl.value=!1},Fo=e=>e?(e==null?void 0:e.toUpperCase())==="INPUT"?"TEXTAREA":e:"TEXTAREA",Ko=e=>{var c,t;const a=(t=(c=Dl.value)==null?void 0:c.find(i=>(i==null?void 0:i.label)===(e==null?void 0:e.label)))==null?void 0:t.multiple,r=e==null?void 0:e.prop;if((e==null?void 0:e.formType)!="Select")return;Y.value.forEach(i=>{const p=i==null?void 0:i[r];a&&Cr.isString(p)&&(i[r]=[p]),!a&&!Cr.isString(p)&&(i[r]="")})},hr=(e,a)=>{var r;return a==null||a.forEach(o=>{e[o==null?void 0:o.prop]=o==null?void 0:o.value}),e.children&&((r=e.children)==null?void 0:r.length)>0&&(e.children=e.children.map(o=>hr(o,a))),e},Ga=e=>{var r,o,n,c,t,i;va("");const a=(r=ke.value)==null?void 0:r.reduce((p,k)=>(p[k.name]=k.value,p),{});if(((o=Object.keys(a))==null?void 0:o.length)>0){hl.value=a,Ll.value="",la.value=(n=Y.value)==null?void 0:n.length,xl.value=(c=_l.value)==null?void 0:c.filter(k=>(k==null?void 0:k.label)!=="新增");const p=(i=(t=qe.value)==null?void 0:t.filter(k=>(k==null?void 0:k.label)!=="操作"))==null?void 0:i.map(k=>{var v,N,U;const x=(N=(v=Dl.value)==null?void 0:v.find(P=>(P==null?void 0:P.label)===(k==null?void 0:k.label)))==null?void 0:N.multiple;return Ko(k),{...k,contents:(k==null?void 0:k.options)??[],optionUrl:k!=null&&k.formMenuSelect&&((U=k==null?void 0:k.formMenuSelect)==null?void 0:U.length)>0?{groupSelect:k==null?void 0:k.groupSelect,menuSelect:k==null?void 0:k.formMenuSelect,selectRelateType:"",type:k==null?void 0:k.formType,multiple:x}:null}});Q.value=p==null?void 0:p.map(k=>hr(k,[{prop:"type",value:"edit"},{prop:"columnType",value:Fo(k==null?void 0:k.formType)||(k==null?void 0:k.columnType)}])),e==="createClick"&&ga(!1)}},oa={START:"开始时间",END:"结束时间",HOURS:"工时"},zo=(e,a)=>Number(ce.dayjs(a).diff(ce.dayjs(e),"day",!0).toFixed(1)),yr=e=>{var c;const a=s.itemData,r=(c=a==null?void 0:a.find(t=>(t==null?void 0:t.key)==="header"))==null?void 0:c.contents,o=new Map;return r==null||r.forEach((t,i)=>{const{label:p}=t;o.set(p,i)}),!o.has(oa.START)||!o.has(oa.END)||!o.has(oa.HOURS)?e:e==null?void 0:e.map(t=>{const i=t==null?void 0:t[oa.START],p=t==null?void 0:t[oa.END],k=zo(i,p);return i&&p&&(t[oa.HOURS]=`${k}天`),t})},vr=(e,a,r=0)=>{if(r>((a==null?void 0:a.length)??""))return e;const o=a==null?void 0:a[r],n=new Map;for(const t of e){const i=t[o];n.has(i)||n.set(i,[]),n.get(i)&&n.get(i).push(t)}const c=[];for(const[t,i]of n){const[p,...k]=i,x={...p};r+1===((a==null?void 0:a.length)??"")?x.children=i==null?void 0:i.map(v=>(v.level=D.cloneDeep(r)+1,v)).filter((v,N)=>N!==0):k.length>0&&(x.children=vr(k,a,r+1)),x.level=r,c.push(x)}return c},gr=(e,a,r)=>{var n;if(!(a!=null&&a.contents)||((n=a==null?void 0:a.contents)==null?void 0:n.length)===0)return e;let o=[];return o=vr(e,a==null?void 0:a.contents,0),o},br=(e,a)=>{var U,P,$,S,M,R,L,_,w,u,y,h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne,G,re,Le,se,pe,xe,Ve,A,I,Re,je,We,f,ae,Pe,m,ge,Te,ll,al,rl,ol,nl,il,el,Se,Ee,ul,pl,fl,vl,dl;const r=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="header");e==null||e.filter(b=>(b==null?void 0:b.key)==="tableIndexColumn")[0];const o=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="childTree")[0];let n=!0;if(($=(P=(U=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="filterAllType"))==null?void 0:U.value)==null?void 0:P.find(b=>(b==null?void 0:b.value)==="onPamButtonContents"))!=null&&$.content){let b=(R=(M=(S=e==null?void 0:e.find(q=>(q==null?void 0:q.key)==="filterAllType"))==null?void 0:S.value)==null?void 0:M.find(q=>(q==null?void 0:q.value)==="onPamButtonContents"))==null?void 0:R.content;b=(L=b==null?void 0:b.split(":"))==null?void 0:L[1],b=(_=b.slice(1,(b==null?void 0:b.length)-1))==null?void 0:_.split(","),n=!!(b!=null&&b.find(q=>q==="操作"))}let c=a;const t=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="page"),i=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="rowButton"),p=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="extraButton"),k=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableContents"),x=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableIndex");Dl.value=(u=(w=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableToForm"))==null?void 0:w[0])==null?void 0:u.contents,Ya.value=(t==null?void 0:t.contents)??!0;let v=[];Xl.value===""?v=r==null?void 0:r[0]:v=(r==null?void 0:r.find(b=>(b==null?void 0:b.selectLabel)==="("+Xl.value+")"))??(r==null?void 0:r.find(b=>!(b!=null&&b.selectLabel)));let N=[];if(Xl.value===""?N=x==null?void 0:x[0]:N=(x==null?void 0:x.find(b=>(b==null?void 0:b.selectLabel)==="("+Xl.value+")"))??(x==null?void 0:x.find(b=>!(b!=null&&b.selectLabel))),((y=v==null?void 0:v.contents)==null?void 0:y.length)>0){let b=[];if(v!=null&&v.contents.some(B=>Array.isArray(B)&&(B==null?void 0:B.find(g=>g.children))))da.value===""?b=(K=(h=ce.getGradeColumns(v==null?void 0:v.contents,n,c))==null?void 0:h[0])==null?void 0:K.filter(B=>!Array.isArray(B)):(da.value.split("-"),b=(O=ce.getGradeColumns(v==null?void 0:v.contents,n,c))==null?void 0:O[0]);else{let B=v!=null&&v.contents.some(g=>Array.isArray(g))?(J=v==null?void 0:v.contents)==null?void 0:J[0]:v==null?void 0:v.contents;B!=null&&B.find(g=>(g==null?void 0:g.label)==="操作")||B.push({label:"操作"}),B==null||B.forEach((g,ue)=>{var Ge,Fe,Pl,zl,Vl;let me="";(Fe=(Ge=Me.value)==null?void 0:Ge.split("/"))==null||Fe.forEach(Ce=>{var Oe,Wl,na;if(Ce!==""){let Sl=(na=(Wl=(Oe=Ce==null?void 0:Ce.split(fe+"updateLoading"))==null?void 0:Oe[0])==null?void 0:Wl.split(fe+"loading"))==null?void 0:na[0];me=me===""?me+Sl:me+"/"+Sl}}),me=me+"/";const De=(Pl=Dl.value)==null?void 0:Pl.find(Ce=>(Ce==null?void 0:Ce.prop)===(g==null?void 0:g.prop));b.push({label:(g==null?void 0:g.label)==="操作"?n?"操作":"":(g==null?void 0:g.label)??"",prop:(g==null?void 0:g.label)==="操作"?"operate":(g==null?void 0:g.prop)??"a"+ue,width:g!=null&&g.width?parseInt(g.width):"",fixed:(g==null?void 0:g.fixed)??void 0,sortable:(g==null?void 0:g.sortable)??!1,filterable:(g==null?void 0:g.filterable)??!1,operable:(g==null?void 0:g.operable)??!1,showSummary:(g==null?void 0:g.showSummary)??!1,align:(g==null?void 0:g.align)??"left",showOverflowTooltip:(g==null?void 0:g.showOverflowTooltip)??!0,isNotDrag:(g==null?void 0:g.isNotDrag)??!1,isEditCol:(g==null?void 0:g.isEditCol)??!1,isOperate:(g==null?void 0:g.isOperate)??!1,id:(g==null?void 0:g.id)??ue,type:(g==null?void 0:g.label)==="操作"?"operate":void 0,formType:(g==null?void 0:g.formType)??(g!=null&&g.groupSelect?"Select":""),isTableColHidden:g==null?void 0:g.isTableColHidden,isFormColHidden:g==null?void 0:g.isFormColHidden,disabled:g==null?void 0:g.disabled,options:(g==null?void 0:g.options)??[],value:(g==null?void 0:g.value)??"",formMenuSelect:(g==null?void 0:g.formMenuSelect)??[],isRoute:(g==null?void 0:g.isRoute)??!1,groupSelect:g!=null&&g.groupSelect?(zl=g==null?void 0:g.groupSelect)==null?void 0:zl.replaceAll('"',"").split(":"):[],isMainKey:(g==null?void 0:g.isMainKey)||(g==null?void 0:g.directiveLabel)==="#isMain",columnType:(De==null?void 0:De.type)||(g==null?void 0:g.columnType)||"TEXTAREA",directiveLabel:g==null?void 0:g.directiveLabel,directiveColor:(g==null?void 0:g.directiveColor)??!1,isExistChild:!!(g!=null&&g.directiveLabel&&(c!=null&&c[me])&&!((Vl=g==null?void 0:g.directiveLabel)!=null&&Vl.includes("@"))&&(g==null?void 0:g.directiveLabel)==="#isMain"),childPath:(g==null?void 0:g.directiveLabel)!=="#isMain"?me:void 0,allSelectionContents:(g==null?void 0:g.allSelectionContents)??[],selectFilter:g==null?void 0:g.selectFilter,menuId:g==null?void 0:g.menuId,filterContent:g==null?void 0:g.filterContent,relatedValueId:g==null?void 0:g.relatedValueId})})}Q.value=ce.getNewColumnChild(b),La.value=ce.getNewColumnChild(b),oe.value=(d=Q.value)==null?void 0:d.map(B=>B==null?void 0:B.label),He.value=(T=Q.value)==null?void 0:T.every(B=>B==null?void 0:B.filterable),he.value=(ie=Q.value)==null?void 0:ie.every(B=>B==null?void 0:B.operable),$e.value=(F=Q.value)==null?void 0:F.every(B=>B==null?void 0:B.sortable);let q=(j=(C=ce.getAllLeafNodes(Q.value))==null?void 0:C.filter(B=>(B==null?void 0:B.type)!=="operate"))==null?void 0:j.map((B,g)=>({prop:(B==null?void 0:B.prop)??"a"+g,column:B.label}));Al.value=q;let _e=[];Xl.value===""?_e=k==null?void 0:k[0]:_e=(k==null?void 0:k.find(B=>(B==null?void 0:B.selectLabel)==="("+Xl.value+")"))??(k==null?void 0:k.find(B=>!(B!=null&&B.selectLabel)));let cl=Array.isArray((le=_e==null?void 0:_e.contents)==null?void 0:le[0])&&((ee=_e==null?void 0:_e.contents)!=null&&ee[0].every(B=>Array.isArray(B)))?(Z=_e==null?void 0:_e.contents)==null?void 0:Z[0]:_e==null?void 0:_e.contents;N!=null&&N.contents&&((ve=N==null?void 0:N.contents)==null?void 0:ve.length)!==0&&(cl=(Ne=D.cloneDeep(cl))==null?void 0:Ne.map((B,g)=>{if(!Array.isArray(B)){let ue={};for(let me in B)me!=="id"&&me!=="index"&&(ue[me]=B[me]);B=Object.values(ue)}return B}));const Nl=!!((G=Q.value)!=null&&G.find(B=>B.prop==="index"));cl=Nr(cl,N==null?void 0:N.contents,Nl);const tl=[];cl==null||cl.forEach((B,g)=>{var me;let ue={};if(Array.isArray(B)){let De=[];B==null||B.filter(Ge=>!(Ge!=null&&Ge.id)).forEach((Ge,Fe)=>{var Pl,zl,Vl,Ce,Oe,Wl;if((Pl=q==null?void 0:q[Fe])!=null&&Pl.prop&&!Array.isArray(Ge)){let na={};na[q[Fe].column]=Ge,ze!=null&&ze.value&&((zl=ze==null?void 0:ze.value)==null?void 0:zl.length)>0&&((Vl=ze==null?void 0:ze.value)!=null&&Vl.find(Sl=>JSON.stringify(Sl==null?void 0:Sl[0])===JSON.stringify(na)))&&(De=(Ce=ze==null?void 0:ze.value)==null?void 0:Ce.find(Sl=>JSON.stringify(Sl==null?void 0:Sl[0])===JSON.stringify(na))),De&&De.length>0?ue[q[Fe].prop]=De!=null&&De.find(Sl=>{var ba;return((ba=Object.keys(Sl))==null?void 0:ba[0])===q[Fe].column})?(Oe=De==null?void 0:De.find(Sl=>{var ba;return((ba=Object.keys(Sl))==null?void 0:ba[0])===q[Fe].column}))==null?void 0:Oe[q[Fe].column]:Ge:ue[q[Fe].prop]=Ge}else Array.isArray(Ge)&&((Wl=q[Fe])!=null&&Wl.prop?ue[q[Fe].prop]=Ge:ue.children=Ha(Ge,q))})}else ue=B;if(Array.isArray(B)&&B.some(De=>De==null?void 0:De.id)){const De=(me=B==null?void 0:B.find(Ge=>Ge.id))==null?void 0:me.id;tl.push(Object.assign(ue,{id:rr(De)}))}else ue.id?tl.push(ue):tl.push(Object.assign(ue,{id:g.toString()}))});try{const B=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),g=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null"),ue=B==null?void 0:B.tableId,me=B==null?void 0:B.compIndex;if(ue&&Array.isArray(g)&&g.length>0&&String(ue)===String(s==null?void 0:s.parentTableId)&&String(me)===String(s==null?void 0:s.index)){const De=new Set(tl.map(Fe=>String(Fe==null?void 0:Fe.id))),Ge=g.filter(Fe=>!De.has(String(Fe)));if(Ge.length>0){const Fe=B==null?void 0:B.pageKey,Pl=Fe!=null&&Fe.startsWith("/")?Fe.substring(1):Fe;((a==null?void 0:a[Fe])||(a==null?void 0:a[Pl])||[]).filter(Ce=>{var Oe,Wl;return((Oe=Ce==null?void 0:Ce.key)==null?void 0:Oe.type)==="data"&&String((Wl=Ce==null?void 0:Ce.key)==null?void 0:Wl.tableId)===String(ue)&&Ge.includes(Ce==null?void 0:Ce.id)}).forEach(Ce=>{var Oe;De.has(String(Ce==null?void 0:Ce.id))||(tl.push({id:Ce==null?void 0:Ce.id,...((Oe=Ce==null?void 0:Ce.value)==null?void 0:Oe.tableData)||{}}),De.add(String(Ce==null?void 0:Ce.id)))})}}}catch{}const Ae=Array.from(((re=Cl.value)==null?void 0:re.values())||[]).filter(B=>(B==null?void 0:B._isOCRRow)&&(B==null?void 0:B._ocrTableId)===(s==null?void 0:s.index));Y.value=gr(tl,o,Q.value),Ul.value=tl,(Le=Ul.value)==null||Le.forEach(B=>{var g;(g=Cl.value)==null||g.set(B.id,B)});const gl=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),ye=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null");if(gl&&Array.isArray(ye)&&ye.length>0&&String(gl==null?void 0:gl.compIndex)===String(s==null?void 0:s.index)){const B=new Set((Ul.value||[]).map(g=>String(g==null?void 0:g.id)));ye.filter(g=>!B.has(String(g)))}if(Ae.length>0){const B=new Set((Y.value||[]).map(ue=>ue==null?void 0:ue.id)),g=Ae.filter(ue=>!B.has(ue.id));g.length>0&&(Y.value=[...Y.value||[],...g],Ul.value=[...Ul.value||[],...g],g.forEach(ue=>{var me;return(me=Cl.value)==null?void 0:me.set(ue.id,ue)}))}}else Q.value=[],qe.value=[],Y.value=[],Ul.value=[],Cl.value=new Map;if(((se=i==null?void 0:i.contents)==null?void 0:se.length)>0)if((Ve=(xe=(pe=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="filterAllType"))==null?void 0:pe.value)==null?void 0:xe.find(b=>(b==null?void 0:b.value)==="onRowButtonContents"))!=null&&Ve.content){let b=(Re=(I=(A=e==null?void 0:e.find(q=>(q==null?void 0:q.key)==="filterAllType"))==null?void 0:A.value)==null?void 0:I.find(q=>(q==null?void 0:q.value)==="onButtonContents"))==null?void 0:Re.content;b=(je=b==null?void 0:b.split(":"))==null?void 0:je[1],b=(We=b.slice(1,(b==null?void 0:b.length)-1))==null?void 0:We.split(","),Jl.value=(f=i==null?void 0:i.contents)==null?void 0:f.filter(q=>b==null?void 0:b.find(_e=>_e===(q==null?void 0:q.label)))}else Jl.value=i==null?void 0:i.contents;else Jl.value=[];if(((ae=p==null?void 0:p.contents)==null?void 0:ae.length)>0)if((ge=(m=(Pe=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="filterAllType"))==null?void 0:Pe.value)==null?void 0:m.find(b=>(b==null?void 0:b.value)==="onButtonContents"))!=null&&ge.content){let b=(al=(ll=(Te=e==null?void 0:e.find(q=>(q==null?void 0:q.key)==="filterAllType"))==null?void 0:Te.value)==null?void 0:ll.find(q=>(q==null?void 0:q.value)==="onButtonContents"))==null?void 0:al.content;if(b=(rl=b==null?void 0:b.split(":"))==null?void 0:rl[1],b=(ol=b.slice(1,(b==null?void 0:b.length)-1))==null?void 0:ol.split(","),xl.value=(nl=p==null?void 0:p.contents)==null?void 0:nl.filter(q=>b==null?void 0:b.find(_e=>_e===(q==null?void 0:q.label))),_l.value=(il=p==null?void 0:p.contents)==null?void 0:il.filter(q=>b==null?void 0:b.find(_e=>_e===(q==null?void 0:q.label))),(el=p==null?void 0:p.contents)!=null&&el.some(q=>(q==null?void 0:q.label)==="OCR识别")&&!((Se=xl.value)!=null&&Se.some(q=>(q==null?void 0:q.label)==="OCR识别"))){const q=(Ee=p==null?void 0:p.contents)==null?void 0:Ee.find(_e=>(_e==null?void 0:_e.label)==="OCR识别");xl.value=[...xl.value,q],_l.value=[..._l.value,q]}Be.value=!!(b!=null&&b.find(q=>q==="搜索")),Xe.value=!!(b!=null&&b.find(q=>q==="块状显示"))}else xl.value=p==null?void 0:p.contents,_l.value=p==null?void 0:p.contents;else xl.value=[],_l.value=[];(ul=xl.value)!=null&&ul.some(b=>(b==null?void 0:b.label)==="OCR识别")||(xl.value=[...xl.value||[],{label:"OCR识别"}]),(pl=_l.value)!=null&&pl.some(b=>(b==null?void 0:b.label)==="OCR识别")||(_l.value=[..._l.value||[],{label:"OCR识别"}]),la.value=((fl=Y==null?void 0:Y.value)==null?void 0:fl.length)??0,yr(Y.value),ta.value=Y.value,El.value&&(Q.value=(dl=(vl=qe.value)==null?void 0:vl.filter(b=>(b==null?void 0:b.label)!=="操作"))==null?void 0:dl.map(b=>{var q;return{...b,type:"edit",optionUrl:b!=null&&b.formMenuSelect&&((q=b==null?void 0:b.formMenuSelect)==null?void 0:q.length)>0?{groupSelect:b==null?void 0:b.groupSelect,menuSelect:b==null?void 0:b.formMenuSelect,selectRelateType:"",type:b==null?void 0:b.formType}:null}}),Ga())};l.watch(()=>[s.itemData,Xl.value,$r.value,da.value,ze==null?void 0:ze.value],async()=>{var e,a,r,o,n,c;if((e=s==null?void 0:s.itemData)!=null&&e.find(t=>(t==null?void 0:t.key)==="columnPath")&&!((a=sa.value)!=null&&a.find(t=>{var i,p;return(t==null?void 0:t.key)===((p=(i=s==null?void 0:s.itemData)==null?void 0:i.find(k=>(k==null?void 0:k.key)==="columnPath"))==null?void 0:p.contents)}))){let t=sa.value,i={key:(o=(r=s==null?void 0:s.itemData)==null?void 0:r.find(p=>(p==null?void 0:p.key)==="columnPath"))==null?void 0:o.contents,value:(c=(n=s==null?void 0:s.itemData)==null?void 0:n.find(p=>(p==null?void 0:p.key)==="columnUsingPath"))==null?void 0:c.contents};t!=null&&t.find(p=>(p==null?void 0:p.key)===(i==null?void 0:i.key))?t=t==null?void 0:t.map(p=>((p==null?void 0:p.key)===(i==null?void 0:i.key)&&(p.value=i.value),p)):t.push(i),Ye.setTableViewContents(t)}br(s.itemData,s.allMapContents)},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.operatingForm,e=>{e!=null&&e.form&&(va(e==null?void 0:e.form),ml.value=e==null?void 0:e.dialogTitle,Ca.value=!0,jl.value=!0)},{immediate:!0,deep:!0});const kr=()=>{var e;(e=Je.value)!=null&&e.includes("read")&&(El.value=!El.value)},Vo=()=>{Da.value=!Da.value};l.watch(()=>{var e;return(e=s==null?void 0:s.config)==null?void 0:e.viewport},e=>{var a;Je.value=e,(e==null?void 0:e.length)===0?El.value=!1:(e!=null&&e.includes("read")||(El.value=!0),e!=null&&e.includes("edit")||(El.value=!1)),we.value=((a=s==null?void 0:s.config)==null?void 0:a.showIndex)||El.value},{immediate:!0}),l.watch(()=>El.value,e=>{var a;e?(Ga("viewChange"),Ye.setCacheUpdatingData(null)):(xl.value=_l.value,Q.value=La.value,ia.value&&(Ye.setTableLoading(s==null?void 0:s.index),Ue("change",ia.value))),de.value=e,we.value=e||((a=s==null?void 0:s.config)==null?void 0:a.showIndex)},{immediate:!0}),l.watch(()=>{var e;return(e=er.value)==null?void 0:e.length},e=>{e===0&&(ne.currentPage=1)}),l.watch(()=>s==null?void 0:s.compNames,e=>{Ze.contents=[{label:"列表名",prop:"groupName",name:"列表名",type:"select",value:"",id:0,contents:e||[],width:1}]},{immediate:!0}),l.ref(!1);const qo=(e,a)=>{var r;Ga("createClick"),a===ne.pageSize&&(ne.currentPage=Math.ceil(((r=Y.value)==null?void 0:r.length)/ne.pageSize))},Jo=(e,a,r)=>{var o;fr(r,e,a),hl.value=D.cloneDeep(e),Ll.value=e==null?void 0:e.id,la.value=(o=Y.value)==null?void 0:o.length,ml.value=typeof(e==null?void 0:e.id)=="string"?"新增":"编辑",ga(!1)},yl=e=>{var p,k,x,v,N,U,P,$,S,M;const{row:a,column:r,item:o,slotData:n}=e;let c=a!=null&&a[r==null?void 0:r.prop]||(a==null?void 0:a[r==null?void 0:r.prop])===0?((k=(p=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:p[0])==null?void 0:k.contents)??((a==null?void 0:a[r==null?void 0:r.prop])===0?"0":a==null?void 0:a[r==null?void 0:r.prop]):((v=(x=a==null?void 0:a[o==null?void 0:o.prop])==null?void 0:x[0])==null?void 0:v.contents)??(a==null?void 0:a[o==null?void 0:o.prop])??((U=(N=n==null?void 0:n[o==null?void 0:o.prop])==null?void 0:N[0])==null?void 0:U.contents)??(n==null?void 0:n[o==null?void 0:o.prop])??((S=($=a==null?void 0:a[(P=o==null?void 0:o.child)==null?void 0:P.prop])==null?void 0:$[0])==null?void 0:S.contents)??(a==null?void 0:a[(M=o==null?void 0:o.child)==null?void 0:M.prop]),i=Array.isArray(c)&&!(c!=null&&c.every(R=>typeof R=="string"||typeof R=="number"))?"查看":c;return i=Array.isArray(i)?i.join(","):i,i},Wo=e=>{var k,x,v,N,U,P,$,S,M,R;const{row:a,column:r,item:o,slotData:n}=e;let c=a!=null&&a[r==null?void 0:r.prop]?((x=(k=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:k[0])==null?void 0:x.contents)??(a==null?void 0:a[r==null?void 0:r.prop]):((N=(v=a==null?void 0:a[o==null?void 0:o.prop])==null?void 0:v[0])==null?void 0:N.contents)??(a==null?void 0:a[o==null?void 0:o.prop])??((P=(U=n==null?void 0:n[o==null?void 0:o.prop])==null?void 0:U[0])==null?void 0:P.contents)??(n==null?void 0:n[o==null?void 0:o.prop])??((M=(S=a==null?void 0:a[($=o==null?void 0:o.child)==null?void 0:$.prop])==null?void 0:S[0])==null?void 0:M.contents)??(a==null?void 0:a[(R=o==null?void 0:o.child)==null?void 0:R.prop]);const i=Array.isArray(c)&&!(c!=null&&c.every(L=>typeof L=="string"||typeof L=="number")),p=Array.isArray(c)&&(c==null?void 0:c.find(L=>L==null?void 0:L.url));return i&&p},Go=e=>{var t,i,p,k,x,v,N,U,P,$;const{row:a,column:r,item:o,slotData:n}=e||{};let c=a!=null&&a[r==null?void 0:r.prop]?((i=(t=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:t[0])==null?void 0:i.contents)??(a==null?void 0:a[r==null?void 0:r.prop]):((k=(p=a==null?void 0:a[o==null?void 0:o.prop])==null?void 0:p[0])==null?void 0:k.contents)??(a==null?void 0:a[o==null?void 0:o.prop])??((v=(x=n==null?void 0:n[o==null?void 0:o.prop])==null?void 0:x[0])==null?void 0:v.contents)??(n==null?void 0:n[o==null?void 0:o.prop])??((P=(U=a==null?void 0:a[(N=o==null?void 0:o.child)==null?void 0:N.prop])==null?void 0:U[0])==null?void 0:P.contents)??(a==null?void 0:a[($=o==null?void 0:o.child)==null?void 0:$.prop]);return Array.isArray(c)?(c==null?void 0:c.filter(S=>(S==null?void 0:S.url)||(S==null?void 0:S.downloadUrl)))??[]:[]},Ho=(e,a)=>e.find(r=>Object.values(r).some(o=>o===a));return l.watch(()=>wr.value,async e=>{if(e){sl.setContentLoading(!0),await l.nextTick();const a=Ho(Y.value,e==null?void 0:e.data);if(!a)return sl.setContentLoading(!1);await ir(e==null?void 0:e.data,null,a,{data:e==null?void 0:e.data,isMainKey:!0}),sl.setContentLoading(!1)}},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.cacheNewData,e=>{var a;e&&(Array.isArray(e)?e.forEach(r=>{var o,n,c,t,i,p,k;if((r==null?void 0:r.compId)===(s==null?void 0:s.index)&&(r!=null&&r.resId)&&((o=r==null?void 0:r.data)!=null&&o.id)&&(Y.value=(n=Y.value)==null?void 0:n.map(x=>{var v;return(x==null?void 0:x.id)===((v=r==null?void 0:r.data)==null?void 0:v.id)?{...x,id:r==null?void 0:r.resId}:x}),(i=(c=Cl.value)==null?void 0:c.has)!=null&&i.call(c,(t=r==null?void 0:r.data)==null?void 0:t.id))){const x=Cl.value.get((p=r==null?void 0:r.data)==null?void 0:p.id);Cl.value.delete((k=r==null?void 0:r.data)==null?void 0:k.id),Cl.value.set(r==null?void 0:r.resId,{...x,id:r==null?void 0:r.resId})}}):(e==null?void 0:e.compId)===(s==null?void 0:s.index)&&(Y.value=(a=Y.value)==null?void 0:a.map(r=>{var o;return(r==null?void 0:r.id)===((o=e==null?void 0:e.data)==null?void 0:o.id)?{...r,id:e==null?void 0:e.resId}:r})))},{immediate:!0,deep:!0}),(e,a)=>{var R,L,_,w;const r=l.resolveComponent("svg-icon"),o=l.resolveComponent("el-popover"),n=l.resolveComponent("el-switch"),c=l.resolveComponent("el-checkbox"),t=l.resolveComponent("el-radio"),i=l.resolveComponent("el-radio-group"),p=l.resolveComponent("el-checkbox-group"),k=l.resolveComponent("el-button"),x=l.resolveComponent("LookComponent"),v=l.resolveComponent("el-icon"),N=l.resolveComponent("el-upload"),U=l.resolveComponent("el-alert"),P=l.resolveComponent("el-table-column"),$=l.resolveComponent("el-input"),S=l.resolveComponent("el-table"),M=l.resolveDirective("loading");return l.openBlock(),l.createElementBlock("div",Dn,[Ia.value?(l.openBlock(),l.createBlock(bl.ssTable,{id:"excel-table",pageObj:ne,showIndex:we.value,isTree:(R=W.compItem)==null?void 0:R.isTree,summaryInfo:Rl,columns:Q.value,defaultSort:E,isCardViewport:Da.value,checkedColumns:oe.value,key:Ka.value+JSON.stringify(Q.value),tableData:er.value,isEditViewport:El.value,isShowPagination:Ya.value,isShowEdit:!1,isShowDelete:!1,allowSelect:de.value,onDbClickRow:co,extraButton:xl.value,rowButton:Jl.value,cacheExtraButtons:_l.value,isClearSelection:((L=Tl.value)==null?void 0:L.length)===0,onDoCurrentChange:qr,onDoSizeChange:Jr,onContentClick:ir,onRowClick:po,onSelectChange:Zr,onCellChange:Jo,onChange:fr,onPreview:ar,onSubmitEditingTable:Yr,onHandleColEditChange:Qr,onHandleColTypeChange:Xr,onClickButton:Ea},l.createSlots({headerButton:l.withCtx(u=>{var y,h;return[W.showHeader?(l.openBlock(),l.createBlock(hn,{key:0,pageLayout:W.pageLayout,lockingPage:l.unref(ka)===l.unref(Me),filterValues:nr.value,selectNums:(y=Tl.value)==null?void 0:y.length,dataNums:(h=Y.value)==null?void 0:h.length,compName:W.compName,isDevMode:W.isDevMode,buttons:u.buttons,onButtonClick:a[1]||(a[1]=K=>Ea(K,"",{})),columns:Q.value,onFilter:uo,onGetImportData:Gr,level:W.level,filterShow:Be.value},null,8,["pageLayout","lockingPage","filterValues","selectNums","dataNums","compName","isDevMode","buttons","columns","level","filterShow"])):l.createCommentVNode("",!0)]}),viewport:l.withCtx(()=>{var u,y,h,K;return[((u=Y.value)==null?void 0:u.length)>0&&W.allowOperate&&Xe.value?(l.openBlock(),l.createElementBlock("div",Tn,[(y=Je.value)!=null&&y.includes("read")&&((h=Je.value)!=null&&h.includes("edit"))&&((K=Jl.value)!=null&&K.some(O=>(O==null?void 0:O.label)==="编辑"))&&!Da.value&&l.unref(ka)!==l.unref(Me)?(l.openBlock(),l.createElementBlock("span",{key:0,title:"编辑表格",onClick:kr},[l.createVNode(r,{name:"editTable",class:"view-icon"})])):l.createCommentVNode("",!0),l.createElementVNode("span",{title:"卡片视图",onClick:Vo},[l.createVNode(r,{name:"cardViewport",class:"view-icon"})])])):l.createCommentVNode("",!0)]}),rowCreate:l.withCtx(({row:u,index:y})=>[l.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:h=>qo(u,y)},[l.createVNode(r,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,wn)]),operateCol:l.withCtx(()=>[l.createVNode(o,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"hover",onShow:Mo},{reference:l.withCtx(()=>[l.createElementVNode("span",Bn,[l.createVNode(r,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:l.withCtx(()=>[l.createElementVNode("div",On,[a[13]||(a[13]=l.createElementVNode("div",{class:"group-title"},"表格操作",-1)),l.createVNode(n,{"model-value":$e.value,"active-text":"排序","inactive-text":"",style:{"margin-right":"8px"},onChange:a[3]||(a[3]=u=>lo(u,"sortable"))},null,8,["model-value"]),a[14]||(a[14]=l.createElementVNode("div",{class:"group-title"},"表格列操作",-1)),l.createVNode(p,{modelValue:oe.value,"onUpdate:modelValue":a[4]||(a[4]=u=>oe.value=u),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:V},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(fa.value,u=>(l.openBlock(),l.createElementBlock("div",{style:{display:"flex","align-items":"center"},key:u.label},[l.createVNode(c,{value:u.label,style:{width:"100%",marginRight:0}},{default:l.withCtx(()=>[l.createElementVNode("span",{title:u.label,style:{display:"inline-block",width:"250px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},l.toDisplayString(u.label),9,Un)]),_:2},1032,["value"]),l.createVNode(o,{"popper-class":"col-operate-popover",title:"列操作",placement:"left",teleported:!1,trigger:"hover"},{reference:l.withCtx(()=>[l.createVNode(r,{name:"colOperate",style:{width:"15px",height:"15px",cursor:"pointer",color:"grey",position:"absolute",right:"40px"}})]),default:l.withCtx(()=>{var y;return[l.createElementVNode("div",Ln,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((y=Object.keys(u))==null?void 0:y.filter(h=>{var K;return(K=$l.value)==null?void 0:K.find(O=>(O==null?void 0:O.value)===h)}),h=>{var K,O;return l.openBlock(),l.createElementBlock("div",{key:h},[Bl[h]=="radio"?(l.openBlock(),l.createElementBlock("div",jn,[a[12]||(a[12]=l.createElementVNode("div",null,"固定:",-1)),l.createVNode(i,{"model-value":u==null?void 0:u[h],onChange:J=>lr(J,h,u)},{default:l.withCtx(()=>{var J,d;return[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((d=(J=$l.value)==null?void 0:J.find(T=>(T==null?void 0:T.value)===h))==null?void 0:d.options,T=>(l.openBlock(),l.createBlock(t,{key:T==null?void 0:T.value,label:T==null?void 0:T.value,value:T==null?void 0:T.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(T==null?void 0:T.label),1)]),_:2},1032,["label","value"]))),128))]}),_:2},1032,["model-value","onChange"])])):l.createCommentVNode("",!0),Bl[h]=="switch"?(l.openBlock(),l.createBlock(n,{key:1,"model-value":u==null?void 0:u[h],"active-text":(O=(K=$l.value)==null?void 0:K.find(J=>(J==null?void 0:J.value)===h))==null?void 0:O.label,onChange:J=>lr(J,h,u)},null,8,["model-value","active-text","onChange"])):l.createCommentVNode("",!0)])}),128))])]}),_:2},1024),l.createElementVNode("span",Pn,[l.createVNode(r,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px"}})])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),content:l.withCtx(u=>{var y,h,K,O,J,d,T,ie,F,C,j,le,ee,Z,ve,Ne,G,re,Le,se;return[((y=u==null?void 0:u.column)==null?void 0:y.label)==="OCR图片"||((h=u==null?void 0:u.column)==null?void 0:h.prop)==="OCR图片"?(l.openBlock(),l.createElementBlock("div",$n,[l.createVNode(r,{name:"query",style:{width:"20px",height:"20px",color:"var(--ssComponent-theme-color)",cursor:"pointer"},onClick:l.withModifiers(pe=>To(u),["stop"]),title:"查看OCR图片"},null,8,["onClick"])])):Wo(u)?(l.openBlock(),l.createBlock(o,{key:1,"popper-class":"file-popover",placement:"right",trigger:"hover",effect:"light",width:"auto"},{reference:l.withCtx(()=>[l.createElementVNode("span",Mn,l.toDisplayString(yl(u)),1)]),default:l.withCtx(()=>{var pe,xe;return[l.createElementVNode("div",Rn,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((xe=u==null?void 0:u.row)==null?void 0:xe[(pe=u==null?void 0:u.column)==null?void 0:pe.prop],Ve=>(l.openBlock(),l.createElementBlock("div",Fn,[l.createElementVNode("div",{class:"prop-url",title:ha(Ve),onClick:A=>or(Ve)},l.toDisplayString(ha(Ve)),9,Kn),l.createElementVNode("div",{class:"prop-download",onClick:A=>oo(Ve)}," 下载 ",8,zn)]))),256))])]}),_:2},1024)):(l.openBlock(),l.createElementBlock("div",{key:2,style:l.normalizeStyle({color:!Array.isArray(yl(u))&&((O=(K=yl(u))==null?void 0:K.toString())!=null&&O.includes(".txt")||(d=(J=yl(u))==null?void 0:J.toString())!=null&&d.includes(".cpt")||(ie=(T=yl(u))==null?void 0:T.toString())!=null&&ie.includes(".cyd"))?"var(--vertical-menuitem-active-bg)":"",textDecoration:!Array.isArray(yl(u))&&((C=(F=yl(u))==null?void 0:F.toString())!=null&&C.includes(".txt")||(le=(j=yl(u))==null?void 0:j.toString())!=null&&le.includes(".cpt")||(Z=(ee=yl(u))==null?void 0:ee.toString())!=null&&Z.includes(".cyd"))?"underline":"",cursor:!Array.isArray(yl(u))&&((Ne=(ve=yl(u))==null?void 0:ve.toString())!=null&&Ne.includes(".txt")||(re=(G=yl(u))==null?void 0:G.toString())!=null&&re.includes(".cpt")||(se=(Le=yl(u))==null?void 0:Le.toString())!=null&&se.includes(".cyd"))?"pointer":"",marginLeft:(u==null?void 0:u.colIndex)===0?`${((u==null?void 0:u.level)??0)*20}px`:0}),onClick:pe=>Vr(yl(u))},l.toDisplayString(yl(u)===0?"0":yl(u)),13,Vn))]}),_:2},[((_=Jl.value)==null?void 0:_.length)>0&&l.unref(ka)!==l.unref(Me)?{name:"actions",fn:l.withCtx(({item:u})=>[l.createVNode(o,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:l.withCtx(()=>[l.createVNode(r,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"},onClick:a[0]||(a[0]=l.withModifiers(()=>{},["stop"]))})]),default:l.withCtx(()=>[l.createElementVNode("div",An,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(no(Jl.value,u),(y,h)=>(l.openBlock(),l.createElementBlock("div",{class:"menu-config-item",key:h,onClick:l.withModifiers(K=>Ea(y==null?void 0:y.label,u,{extra:y}),["stop"])},[l.createElementVNode("div",{style:l.normalizeStyle({color:y==null?void 0:y.textColor}),class:"extra-button-label"},l.toDisplayString(y==null?void 0:y.label),5)],8,En))),128))])]),_:2},1024)]),key:"0"}:void 0,((w=Y.value)==null?void 0:w.length)>0?{name:"batchButton",fn:l.withCtx(u=>[l.withDirectives(l.createVNode(vn,{lockingPage:l.unref(ka)===l.unref(Me),buttons:u.buttons,selectTableItems:Tl.value,onButtonClick:a[2]||(a[2]=y=>Ea(y,"",{}))},null,8,["lockingPage","buttons","selectTableItems"]),[[l.vShow,de.value]]),l.withDirectives(l.createElementVNode("div",null,null,512),[[l.vShow,!de.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(Zl.ssDialog,{title:ml.value,visible:jl.value,width:Rr.value,onBeforeDestroy:ao,style:{height:"74%"}},{default:l.withCtx(()=>[l.createElementVNode("div",qn,[l.createVNode(bl.ssForm,{rowContents:ke.value,isEnableWrap:!1,showOperator:!1,onChange:Ro,onFixChangeValue:so,onClickTrigger:ro,isEdit:ma.value,onBlurChange:Ir,onCreate:eo,onTagChange:zr},null,8,["rowContents","isEdit"])])]),footer:l.withCtx(()=>[Ca.value?(l.openBlock(),l.createElementBlock("div",Jn,[l.createVNode(k,{onClick:a[5]||(a[5]=u=>jl.value=!1),id:"themeBorderButton"},{default:l.withCtx(()=>a[15]||(a[15]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[15]}),l.createVNode(k,{class:"ok-button",onClick:a[6]||(a[6]=u=>ga(!0)),id:"themeButton"},{default:l.withCtx(()=>a[16]||(a[16]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[16]})])):l.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),l.createVNode(Zl.ssDialog,{title:ml.value,visible:Sa.value,width:ja.value,onBeforeDestroy:a[8]||(a[8]=u=>Sa.value=!1)},{default:l.withCtx(()=>[l.createVNode(Sn)]),footer:l.withCtx(()=>[l.createElementVNode("div",Wn,[l.createVNode(k,{onClick:a[7]||(a[7]=u=>Sa.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:l.withCtx(()=>a[17]||(a[17]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[17]}),l.createVNode(k,{class:"ok-button",onClick:fo,id:"themeButton"},{default:l.withCtx(()=>a[18]||(a[18]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[18]})])]),_:1},8,["title","visible","width"]),Hl.value?(l.openBlock(),l.createBlock(bl.ssFilePreview,{key:1,fileDataList:Il.value,onDestroy:to},null,8,["fileDataList"])):l.createCommentVNode("",!0),H.value?(l.openBlock(),l.createBlock(Zl.ssDialog,{key:2,visible:H.value,onBeforeDestroy:Po,style:{height:"80vh",width:"80vw"},"body-class":"three-dialog-body","footer-class":"three-dialog-footer"},{default:l.withCtx(()=>[l.createVNode(Sr.ThreeViewerHost,{files:ua.value,threeData:Ke.value},null,8,["files","threeData"])]),_:1},8,["visible"])):l.createCommentVNode("",!0),l.createVNode(Zl.ssDialog,{visible:e.componentVisible,onBeforeDestroy:a[9]||(a[9]=u=>e.componentVisible=!1),width:ja.value,style:{height:"70vh"}},{default:l.withCtx(()=>[l.createVNode(x,{dialogItem:Yl.value},null,8,["dialogItem"])]),_:1},8,["visible","width"]),l.createVNode(Zl.ssDialog,{title:"上传OCR图片",visible:xa.value,onBeforeDestroy:ur,width:"600px"},{default:l.withCtx(()=>[l.withDirectives((l.openBlock(),l.createElementBlock("div",Gn,[l.createVNode(N,{"file-list":Fl.value,"onUpdate:fileList":a[10]||(a[10]=u=>Fl.value=u),multiple:"",drag:"",action:"","auto-upload":!1,limit:20,accept:"image/*","on-change":So,class:"upload-content"},{tip:l.withCtx(()=>a[19]||(a[19]=[l.createElementVNode("div",{class:"el-upload__tip tip-content"}," 请上传图片文件,大小不超过10MB ",-1)])),default:l.withCtx(()=>[l.createVNode(v,{class:"el-icon--upload"},{default:l.withCtx(()=>[l.createVNode(l.unref(D.upload_filled_default))]),_:1}),a[20]||(a[20]=l.createElementVNode("div",{class:"el-upload__text"},[l.createTextVNode(" 将图片拖到此处或"),l.createElementVNode("em",null,"点击上传")],-1))]),file:l.withCtx(({file:u,index:y})=>[l.createElementVNode("div",Hn,[l.createElementVNode("div",{class:"upload-content-title",style:{flex:"1",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},title:u==null?void 0:u.name},l.toDisplayString(u==null?void 0:u.name),9,Qn),l.createElementVNode("div",Xn,[l.createVNode(r,{class:"icon-blue",name:"EyeFill",style:{width:"15px",height:"15px",cursor:"pointer",color:"var(--ssform-label-color)"},onClick:h=>Eo(u),title:"预览"},null,8,["onClick"]),l.createVNode(r,{class:"icon-blue",name:"Cancel",style:{width:"15px",height:"15px",cursor:"pointer",color:"var(--ssform-label-color)"},onClick:h=>Bo(y),title:"删除"},null,8,["onClick"])])])]),_:1},8,["file-list"])])),[[M,Ql.value]])]),footer:l.withCtx(()=>[l.createElementVNode("div",Yn,[l.createVNode(k,{onClick:ur,id:"themeBorderButton",disabled:Ql.value},{default:l.withCtx(()=>a[21]||(a[21]=[l.createTextVNode("取消")])),_:1,__:[21]},8,["disabled"]),l.createVNode(k,{class:"ok-button",onClick:Co,id:"themeButton",disabled:Ql.value},{default:l.withCtx(()=>a[22]||(a[22]=[l.createTextVNode("确认")])),_:1,__:[22]},8,["disabled"])])]),_:1},8,["visible"]),_a.value?(l.openBlock(),l.createBlock(bl.ssFilePreview,{key:3,fileDataList:Na.value,onDestroy:wo},null,8,["fileDataList"])):l.createCommentVNode("",!0),l.createVNode(Zl.ssDialog,{title:"OCR识别结果预览",visible:$a.value,onBeforeDestroy:qa,width:"90%",style:{maxWidth:"1200px"}},{default:l.withCtx(()=>[l.createElementVNode("div",Zn,[l.createElementVNode("div",In,[l.createVNode(U,{title:"请核对识别结果,您可以修改字段值后点击确认添加到表格。在表头勾选字段用于匹配并替换现有数据",type:"info",closable:!1,"show-icon":""})]),l.createElementVNode("div",ei,[l.createVNode(S,{data:aa.value,border:"",stripe:"","max-height":"400",style:{width:"100%"}},{default:l.withCtx(()=>[l.createVNode(P,{type:"index",label:"序号",width:"60",fixed:""}),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Ma.value,u=>(l.openBlock(),l.createBlock(P,{key:u.prop,prop:u.prop,"min-width":u.minWidth||120,"class-name":u.isAccuracy?"accuracy-column":""},{header:l.withCtx(()=>[l.createElementVNode("div",li,[u.isAccuracy?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(c,{key:0,"model-value":Kl.value.includes(u.prop),onChange:y=>No(u.prop,y),onClick:a[11]||(a[11]=l.withModifiers(()=>{},["stop"]))},null,8,["model-value","onChange"])),l.createElementVNode("span",null,l.toDisplayString(u.label),1)])]),default:l.withCtx(({row:y,$index:h})=>[u.isAccuracy?(l.openBlock(),l.createElementBlock("span",{key:0,class:"accuracy-value",style:l.normalizeStyle({color:Ao(y[u.prop]),fontWeight:500})},l.toDisplayString(Do(y[u.prop])),5)):(l.openBlock(),l.createBlock($,{key:1,modelValue:y[u.prop],"onUpdate:modelValue":K=>y[u.prop]=K,size:"small",placeholder:"请输入"+u.label,onChange:K=>_o(h,u.prop,K)},null,8,["modelValue","onUpdate:modelValue","placeholder","onChange"]))]),_:2},1032,["prop","min-width","class-name"]))),128))]),_:1},8,["data"])])])]),footer:l.withCtx(()=>[l.createElementVNode("div",ai,[l.createVNode(k,{onClick:qa,id:"themeBorderButton"},{default:l.withCtx(()=>a[23]||(a[23]=[l.createTextVNode("取消")])),_:1,__:[23]}),l.createVNode(k,{class:"ok-button",onClick:xo,id:"themeButton"},{default:l.withCtx(()=>a[24]||(a[24]=[l.createTextVNode("确认")])),_:1,__:[24]})])]),_:1},8,["visible"]),l.createVNode(Zl.ssDialog,{title:Ze.title,visible:Ze.show,width:Ze.width,onBeforeDestroy:ko},{default:l.withCtx(()=>[l.createElementVNode("div",ri,[l.createVNode(bl.ssForm,{rowContents:Ze==null?void 0:Ze.contents,formRules:Ze==null?void 0:Ze.formRules,showOperator:!1,buttonValue:Ze.buttonValue,isEdit:ma.value,isStartJustify:!1,isEnableWrap:!1,onOnButtonClick:mo},null,8,["rowContents","formRules","buttonValue","isEdit"])])]),_:1},8,["title","visible","width"])])}}},ni=Oa._export_sfc(oi,[["__scopeId","data-v-1d35a8e8"]]);exports.formGetOptions=wa;exports.getSelectRow=Ba;exports.ssTable=ni;exports.useFormComp=Er;exports.useFormToTableComp=_r;