ss-component-new 1.3.76 → 1.3.78

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 (117) hide show
  1. package/dist/{MTLLoader-DYLUvPra.js → MTLLoader-Bkr7rTJW.js} +1 -1
  2. package/dist/{MTLLoader-D1uo8mcW.cjs → MTLLoader-ByAfB26z.cjs} +1 -1
  3. package/dist/{OrbitControls-B4mz4dJ8.cjs → OrbitControls-BcfNtf3a.cjs} +1 -1
  4. package/dist/{OrbitControls-Cd9ZVfIV.js → OrbitControls-goGQ9Lfs.js} +1 -1
  5. package/dist/{URDFLoader-BfRhERaC.js → URDFLoader-d1AzVQ5F.js} +2 -2
  6. package/dist/{URDFLoader-BnH2w4x6.cjs → URDFLoader-nyfij85d.cjs} +1 -1
  7. package/dist/{animationData-CjVloDDN.cjs → animationData-Cew-c11l.cjs} +1 -1
  8. package/dist/{animationData-CO_7EKV4.js → animationData-Sok20fOI.js} +2 -2
  9. package/dist/{array-Xb-5MHCa.js → array-BkHYCyls.js} +45 -45
  10. package/dist/{array-DtmeNOPn.cjs → array-CCxIPliQ.cjs} +1 -1
  11. package/dist/{iconfont-CD3omIZU.js → iconfont-CJoblcL2.js} +2 -2
  12. package/dist/{iconfont-CkpU7gNh.cjs → iconfont-DZ9KiHjj.cjs} +1 -1
  13. package/dist/{index-IYg_iR8H.cjs → index-2B1wHje0.cjs} +1 -1
  14. package/dist/{index-C55GyDvp.js → index-5CdDKPk6.js} +2 -2
  15. package/dist/{index-B_kCqo4M.cjs → index-AHbRUQqE.cjs} +1 -1
  16. package/dist/{index-B-A_4_n_.cjs → index-B7cNKrrU.cjs} +1 -1
  17. package/dist/{index-CFCn1Gpd.cjs → index-BAelm3VG.cjs} +1 -1
  18. package/dist/index-BFvOrU__.cjs +19 -0
  19. package/dist/{index-lz-ekKYh.js → index-BHrQS0PO.js} +1 -1
  20. package/dist/{index-wv1wwLNX.cjs → index-BIbLwf-J.cjs} +1 -1
  21. package/dist/{index-BLqnYCsi.js → index-BPmWhs0O.js} +2 -2
  22. package/dist/{index-pWdzgg-b.cjs → index-BQ5LLLCI.cjs} +1 -1
  23. package/dist/{index-BQEvzo4s.cjs → index-BQWGBLrD.cjs} +1 -1
  24. package/dist/{index-DJg5d7ei.cjs → index-BRPLPxlx.cjs} +1 -1
  25. package/dist/{index-CW-lwsDk.cjs → index-BVh3Ylgt.cjs} +1 -1
  26. package/dist/{index-C5WqP8vL.cjs → index-BZqkclA9.cjs} +1 -1
  27. package/dist/{index-BRyE_Lab.cjs → index-BgKqiFcg.cjs} +1 -1
  28. package/dist/{index-BkipVGFw.js → index-Bj7H-CHU.js} +4 -4
  29. package/dist/{index-DtJC43XK.cjs → index-BysdHzB7.cjs} +1 -1
  30. package/dist/{index-CVCJuzlD.cjs → index-C036vLtM.cjs} +1 -1
  31. package/dist/index-C5pQXH0_.cjs +11 -0
  32. package/dist/{index-C-iUVY59.js → index-CGpIY6jB.js} +2074 -2021
  33. package/dist/{index-DxGZaHuy.js → index-CI8pzqx6.js} +6 -6
  34. package/dist/{index-jiFqoYN9.js → index-CIGrCpB_.js} +8 -8
  35. package/dist/{index-j1S7YTh5.cjs → index-CInkQ8cP.cjs} +1 -1
  36. package/dist/index-CM8Na0Nb.js +12905 -0
  37. package/dist/{index-BrLLsp39.js → index-CNLUhFlr.js} +2 -2
  38. package/dist/{index-Dysx8GkS.js → index-CST5bbhY.js} +3 -3
  39. package/dist/{index-mdJtPr2-.js → index-CWY9HxrG.js} +1 -1
  40. package/dist/{index-DYqVJN3W.js → index-ChiYyt8L.js} +2 -2
  41. package/dist/index-CjCqvZ07.cjs +11 -0
  42. package/dist/index-Cuw9DLEb.cjs +1 -0
  43. package/dist/{index-CI_UVQ4Z.js → index-D0aKEqnU.js} +4 -4
  44. package/dist/{index-5dvr_F6Q.cjs → index-D7GkHVm4.cjs} +1 -1
  45. package/dist/{index-DhSdgyHz.cjs → index-D8DcUSsZ.cjs} +1 -1
  46. package/dist/{index-u7JCx5KX.cjs → index-D8k54p_x.cjs} +1 -1
  47. package/dist/{index-COyNONVE.js → index-D9hditHi.js} +11 -7
  48. package/dist/{index-BFtGkyJf.js → index-DBh4mbmL.js} +3881 -3898
  49. package/dist/{index-DcqWejmU.cjs → index-DHdrBDP4.cjs} +1 -1
  50. package/dist/{index-Cfzc5_ZK.js → index-DLGxv8po.js} +4 -4
  51. package/dist/{index-nlfIt66y.cjs → index-DXxZIqBP.cjs} +1 -1
  52. package/dist/{index-X_HnLtRC.js → index-DaWzSNzm.js} +1 -1
  53. package/dist/{index-BLeSUjbB.js → index-DijK6RWK.js} +4 -4
  54. package/dist/{index-BulgFj9c.cjs → index-DilZmA-l.cjs} +1 -1
  55. package/dist/{index-B_uWA5AJ.js → index-Dld88iXe.js} +1 -1
  56. package/dist/{index-CeXyg5Rl.cjs → index-Dlob1bxY.cjs} +1 -1
  57. package/dist/{index-0HSo1RHX.js → index-DmeZpSGM.js} +5 -5
  58. package/dist/{index-CMdeEau9.js → index-DnMPqjrX.js} +4 -4
  59. package/dist/{index-DPjDv9Ws.cjs → index-DsymuEzu.cjs} +13 -13
  60. package/dist/{index-B5i-XCGU.js → index-Dyhg1YNv.js} +1 -1
  61. package/dist/{index-C3gtImRs.js → index-EtZh1qtq.js} +2 -2
  62. package/dist/{index-ChBgkXqb.js → index-G0nsjixB.js} +8 -8
  63. package/dist/{index-BYyFrGfX.js → index-JAXzKk2F.js} +1 -1
  64. package/dist/{index-jkHlUTog.js → index-K1n-pA4G.js} +2545 -2616
  65. package/dist/index-KEXDCkKc.js +8139 -0
  66. package/dist/{index-B-nrai8J.cjs → index-M_FLMoBh.cjs} +1 -1
  67. package/dist/index-TvWbGp-2.cjs +1 -0
  68. package/dist/{index-sHmgudEg.js → index-XSETNP_T.js} +1 -1
  69. package/dist/{index-D03MbrNK.cjs → index-cKFeu5XW.cjs} +1 -1
  70. package/dist/{index-CAD9KqHl.cjs → index-eUZKu-7F.cjs} +1 -1
  71. package/dist/{index-BfOeLrc4.cjs → index-fwa9LBX5.cjs} +1 -1
  72. package/dist/{index-vURW-4ky.js → index-oJEY_fSN.js} +12 -12
  73. package/dist/{index--D0Thf0J.js → index-rCV_Ea-P.js} +1 -1
  74. package/dist/{index-DMfz6Qrm.js → index-t9jd4l9Q.js} +2 -2
  75. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dj8zYuMh.cjs → index.vue_vue_type_style_index_0_scoped_afbdd7b2_lang-Ceq-4YAl.cjs} +49 -49
  76. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CU0erI7U.js → index.vue_vue_type_style_index_0_scoped_afbdd7b2_lang-DljCMBcU.js} +2076 -2071
  77. package/dist/{index.vue_vue_type_style_index_1_lang-DsZZR0tg.cjs → index.vue_vue_type_style_index_1_lang-D9kYnXoD.cjs} +1 -1
  78. package/dist/{index.vue_vue_type_style_index_1_lang-CCQPqKHr.js → index.vue_vue_type_style_index_1_lang-DDUoM--M.js} +5 -5
  79. package/dist/{isString-DhPkQDQg.cjs → isString-Cdf6R00a.cjs} +1 -1
  80. package/dist/{isString-Bn5VcA2n.js → isString-D4Yi9bDE.js} +1 -1
  81. package/dist/{main-j2YKSWX-.cjs → main-DDI-kRzh.cjs} +3 -3
  82. package/dist/{main-BLk4Mfi1.js → main-DKugsEJQ.js} +4 -4
  83. package/dist/{menuIndex-D332F0dw.cjs → menuIndex-BVHXKOLk.cjs} +1 -1
  84. package/dist/{menuIndex-BJ1CSzli.js → menuIndex-BvSKgV5f.js} +1 -1
  85. package/dist/obj/model.mtl +42 -0
  86. package/dist/obj/model.obj +26110 -0
  87. package/dist/ss-component.cjs +1 -1
  88. package/dist/ss-component.css +2 -2
  89. package/dist/ss-component.js +11 -11
  90. package/dist/ss-component2.cjs +1 -1
  91. package/dist/ss-component2.js +13 -13
  92. package/dist/{threeModel-C3N_ghfY.cjs → threeModel-BC_JZ1RV.cjs} +1 -1
  93. package/dist/{threeModel-v33sxEBl.js → threeModel-BwWSWObs.js} +6 -6
  94. package/dist/{threePreview-DNw547cG.js → threePreview-CfyAicAQ.js} +5 -5
  95. package/dist/{threePreview-Dif-1kRY.cjs → threePreview-mSNaLCWp.cjs} +1 -1
  96. package/dist/{threeSceneView-iXMcW_Z9.cjs → threeSceneView-66dCWgEi.cjs} +1 -1
  97. package/dist/{threeSceneView-BkGy9bnz.js → threeSceneView-Dbr2KLMM.js} +11 -11
  98. package/dist/{threeSceneViewForCPMPIP-Bjimwk9q.cjs → threeSceneViewForCPMPIP-BzMYLFuK.cjs} +1 -1
  99. package/dist/{threeSceneViewForCPMPIP-qP-6IJzE.js → threeSceneViewForCPMPIP-tPswynXd.js} +9 -9
  100. package/dist/{threeTrackPathView-Cqrx2pEK.cjs → threeTrackPathView-C65T-bEd.cjs} +1 -1
  101. package/dist/{threeTrackPathView-wK0hwn3B.js → threeTrackPathView-CZt3mY2y.js} +6 -6
  102. package/dist/{threeViewerHost-B2fHt8c2.js → threeViewerHost-D2qSyCw-.js} +3 -3
  103. package/dist/{threeViewerHost-RuZpxQGN.cjs → threeViewerHost-DtuM2v2G.cjs} +1 -1
  104. package/dist/{urdfTree-i-8eGN0m.js → urdfTree-BCj0sPXo.js} +1 -1
  105. package/dist/{urdfTree-CnVw_qic.cjs → urdfTree-UVAVh9q0.cjs} +1 -1
  106. package/dist/{workpieceTreePanel-auNIy7t8.cjs → workpieceTreePanel-BtxWzOMx.cjs} +1 -1
  107. package/dist/{workpieceTreePanel-Cy1eCrLl.js → workpieceTreePanel-CrpY18jo.js} +4 -4
  108. package/package.json +1 -1
  109. package/public/obj/model.mtl +42 -0
  110. package/public/obj/model.obj +26110 -0
  111. package/dist/index-BGuyjj26.cjs +0 -1
  112. package/dist/index-CLTriF5O.cjs +0 -11
  113. package/dist/index-CSUpvfmH.js +0 -12750
  114. package/dist/index-CcJb2uXu.js +0 -8191
  115. package/dist/index-DbFGGKSI.cjs +0 -1
  116. package/dist/index-Dc6Q0f3F.cjs +0 -11
  117. package/dist/index-HCKkRTvn.cjs +0 -19
@@ -0,0 +1,19 @@
1
+ "use strict";var Ss=Object.defineProperty;var Ns=(t,o,l)=>o in t?Ss(t,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[o]=l;var Jt=(t,o,l)=>Ns(t,typeof o!="symbol"?o+"":o,l);const e=require("vue"),E=require("./index-C5pQXH0_.cjs"),Re=require("./index.vue_vue_type_style_index_0_scoped_afbdd7b2_lang-Ceq-4YAl.cjs"),de=require("./index-fwa9LBX5.cjs"),Ft=require("./index-DsymuEzu.cjs"),to=require("./index.vue_vue_type_style_index_1_lang-D9kYnXoD.cjs"),Da=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Sa=require("./index-eUZKu-7F.cjs"),ao=require("./threeViewerHost-DtuM2v2G.cjs"),tl=require("./index-TvWbGp-2.cjs");require("./index-D7GkHVm4.cjs");const _o=require("./index-BZqkclA9.cjs"),no=require("./isString-Cdf6R00a.cjs");var lo=E.Symbol?E.Symbol.isConcatSpreadable:void 0;function ws(t){return E.isArray(t)||de.isArguments(t)||!!(lo&&t&&t[lo])}function xs(t,o,l,i,c){var v=-1,g=t.length;for(l||(l=ws),c||(c=[]);++v<g;){var r=t[v];l(r)?de.arrayPush(c,r):c[c.length]=r}return c}function _s(t){var o=t==null?0:t.length;return o?xs(t):[]}function Bs(t){return Re.setToString(Re.overRest(t,void 0,_s),t+"")}function Ts(t,o){return t!=null&&o in Object(t)}function As(t,o,l){o=E.castPath(o,t);for(var i=-1,c=o.length,v=!1;++i<c;){var g=E.toKey(o[i]);if(!(v=t!=null&&l(t,g)))break;t=t[g]}return v||++i!=c?v:(c=t==null?0:t.length,!!c&&de.isLength(c)&&de.isIndex(g,c)&&(E.isArray(t)||de.isArguments(t)))}function Os(t,o){return t!=null&&As(t,o,Ts)}function Ds(t,o,l,i){if(!E.isObject(t))return t;o=E.castPath(o,t);for(var c=-1,v=o.length,g=v-1,r=t;r!=null&&++c<v;){var D=E.toKey(o[c]),U=l;if(D==="__proto__"||D==="constructor"||D==="prototype")return t;if(c!=g){var re=r[D];U=void 0,U===void 0&&(U=E.isObject(re)?re:de.isIndex(o[c+1])?[]:{})}de.assignValue(r,D,U),r=r[D]}return t}function Ms(t,o,l){for(var i=-1,c=o.length,v={};++i<c;){var g=o[i],r=E.baseGet(t,g);l(r,g)&&Ds(v,E.castPath(g,t),r)}return v}function $s(t,o){return Ms(t,o,function(l,i){return Os(t,i)})}var Ls=Bs(function(t,o){return t==null?{}:$s(t,o)});const sl="update:modelValue",oo="change",ro="input";let _n;const Vs=t=>{var o;if(!E.isClient)return 0;if(_n!==void 0)return _n;const l=document.createElement("div");l.className=`${t}-scrollbar__wrap`,l.style.visibility="hidden",l.style.width="100px",l.style.position="absolute",l.style.top="-9999px",document.body.appendChild(l);const i=l.offsetWidth;l.style.overflow="scroll";const c=document.createElement("div");c.style.width="100%",l.appendChild(c);const v=c.offsetWidth;return(o=l.parentNode)==null||o.removeChild(l),_n=i-v,_n},Is=()=>E.isClient&&/firefox/i.test(window.navigator.userAgent);let Zt;const Ps={height:"0",visibility:"hidden",overflow:Is()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},Rs=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function Us(t){const o=window.getComputedStyle(t),l=o.getPropertyValue("box-sizing"),i=Number.parseFloat(o.getPropertyValue("padding-bottom"))+Number.parseFloat(o.getPropertyValue("padding-top")),c=Number.parseFloat(o.getPropertyValue("border-bottom-width"))+Number.parseFloat(o.getPropertyValue("border-top-width"));return{contextStyle:Rs.map(g=>[g,o.getPropertyValue(g)]),paddingSize:i,borderSize:c,boxSizing:l}}function so(t,o=1,l){var i;Zt||(Zt=document.createElement("textarea"),document.body.appendChild(Zt));const{paddingSize:c,borderSize:v,boxSizing:g,contextStyle:r}=Us(t);r.forEach(([ne,_e])=>Zt==null?void 0:Zt.style.setProperty(ne,_e)),Object.entries(Ps).forEach(([ne,_e])=>Zt==null?void 0:Zt.style.setProperty(ne,_e,"important")),Zt.value=t.value||t.placeholder||"";let D=Zt.scrollHeight;const U={};g==="border-box"?D=D+v:g==="content-box"&&(D=D-c),Zt.value="";const re=Zt.scrollHeight-c;if(E.isNumber(o)){let ne=re*o;g==="border-box"&&(ne=ne+c+v),D=Math.max(ne,D),U.minHeight=`${ne}px`}if(E.isNumber(l)){let ne=re*l;g==="border-box"&&(ne=ne+c+v),D=Math.min(ne,D)}return U.height=`${D}px`,(i=Zt.parentNode)==null||i.removeChild(Zt),Zt=void 0,U}const Fs=E.buildProps({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),zs=t=>Ls(Fs,t),js=E.buildProps({id:{type:String,default:void 0},size:E.useSizeProp,disabled:Boolean,modelValue:{type:E.definePropType([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:E.definePropType([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:E.iconPropType},prefixIcon:{type:E.iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:E.definePropType([Object,Array,String]),default:()=>E.mutable({})},autofocus:Boolean,rows:{type:Number,default:2},...zs(["ariaLabel"])}),Hs={[sl]:t=>E.isString(t),input:t=>E.isString(t),change:t=>E.isString(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},Ks=["class","style"],Ws=/^on[A-Z]/,qs=(t={})=>{const{excludeListeners:o=!1,excludeKeys:l}=t,i=e.computed(()=>((l==null?void 0:l.value)||[]).concat(Ks)),c=e.getCurrentInstance();return c?e.computed(()=>{var v;return E.fromPairs(Object.entries((v=c.proxy)==null?void 0:v.$attrs).filter(([g])=>!i.value.includes(g)&&!(o&&Ws.test(g))))}):(E.debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),e.computed(()=>({})))},il={prefix:Math.floor(Math.random()*1e4),current:0},Ys=Symbol("elIdInjection"),Gs=()=>e.getCurrentInstance()?e.inject(Ys,il):il,ul=t=>{const o=Gs();!E.isClient&&o===il&&E.debugWarn("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
2
+ usage: app.provide(ID_INJECTION_KEY, {
3
+ prefix: number,
4
+ current: number,
5
+ })`);const l=E.useGetDerivedNamespace();return E.computedEager(()=>e.unref(t)||`${l.value}-id-${o.prefix}-${o.current++}`)},hl=Symbol("formContextKey"),Bo=Symbol("formItemContextKey"),To=()=>{const t=e.inject(hl,void 0),o=e.inject(Bo,void 0);return{form:t,formItem:o}},Js=(t,{formItemContext:o,disableIdGeneration:l,disableIdManagement:i})=>{l||(l=e.ref(!1)),i||(i=e.ref(!1));const c=e.ref();let v;const g=e.computed(()=>{var r;return!!(!(t.label||t.ariaLabel)&&o&&o.inputIds&&((r=o.inputIds)==null?void 0:r.length)<=1)});return e.onMounted(()=>{v=e.watch([e.toRef(t,"id"),l],([r,D])=>{const U=r??(D?void 0:ul().value);U!==c.value&&(o!=null&&o.removeInputId&&(c.value&&o.removeInputId(c.value),!(i!=null&&i.value)&&!D&&U&&o.addInputId(U)),c.value=U)},{immediate:!0})}),e.onUnmounted(()=>{v&&v(),o!=null&&o.removeInputId&&c.value&&o.removeInputId(c.value)}),{isLabeledByFormItem:g,inputId:c}},Ao=t=>{const o=e.getCurrentInstance();return e.computed(()=>{var l,i;return(i=(l=o==null?void 0:o.proxy)==null?void 0:l.$props)==null?void 0:i[t]})},Oo=(t,o={})=>{const l=e.ref(void 0),i=o.prop?l:Ao("size"),c=o.global?l:E.useGlobalSize(),v=o.form?{size:void 0}:e.inject(hl,void 0),g=o.formItem?{size:void 0}:e.inject(Bo,void 0);return e.computed(()=>i.value||e.unref(t)||(g==null?void 0:g.size)||(v==null?void 0:v.size)||c.value||"")},Vn=t=>{const o=Ao("disabled"),l=e.inject(hl,void 0);return e.computed(()=>o.value||e.unref(t)||(l==null?void 0:l.disabled)||!1)},Xs='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',Qs=t=>process.env.NODE_ENV==="test"?!0:getComputedStyle(t).position==="fixed"?!1:t.offsetParent!==null,io=t=>Array.from(t.querySelectorAll(Xs)).filter(o=>ml(o)&&Qs(o)),ml=t=>{if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.tabIndex<0||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true")return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return!(t.type==="hidden"||t.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}};function Zs(t,{beforeFocus:o,afterFocus:l,beforeBlur:i,afterBlur:c}={}){const v=e.getCurrentInstance(),{emit:g}=v,r=e.shallowRef(),D=Vn(),U=e.ref(!1),re=ee=>{E.isFunction$1(o)&&o(ee)||U.value||(U.value=!0,g("focus",ee),l==null||l())},ne=ee=>{var x;E.isFunction$1(i)&&i(ee)||ee.relatedTarget&&((x=r.value)!=null&&x.contains(ee.relatedTarget))||(U.value=!1,g("blur",ee),c==null||c())},_e=ee=>{var x,J;(x=r.value)!=null&&x.contains(document.activeElement)&&r.value!==document.activeElement||ml(ee.target)||D.value||(J=t.value)==null||J.focus()};return e.watch([r,D],([ee,x])=>{ee&&(x?ee.removeAttribute("tabindex"):ee.setAttribute("tabindex","-1"))}),E.useEventListener(r,"focus",re,!0),E.useEventListener(r,"blur",ne,!0),E.useEventListener(r,"click",_e,!0),process.env.NODE_ENV==="test"&&e.onMounted(()=>{const ee=E.isElement(t.value)?t.value:document.querySelector("input,textarea");ee&&(E.useEventListener(ee,"focus",re,!0),E.useEventListener(ee,"blur",ne,!0))}),{isFocused:U,wrapperRef:r,handleFocus:re,handleBlur:ne}}const ei=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t);function ti({afterComposition:t,emit:o}){const l=e.ref(!1),i=r=>{o==null||o("compositionstart",r),l.value=!0},c=r=>{var D;o==null||o("compositionupdate",r);const U=(D=r.target)==null?void 0:D.value,re=U[U.length-1]||"";l.value=!ei(re)},v=r=>{o==null||o("compositionend",r),l.value&&(l.value=!1,e.nextTick(()=>t(r)))};return{isComposing:l,handleComposition:r=>{r.type==="compositionend"?v(r):c(r)},handleCompositionStart:i,handleCompositionUpdate:c,handleCompositionEnd:v}}function ai(t){let o;function l(){if(t.value==null)return;const{selectionStart:c,selectionEnd:v,value:g}=t.value;if(c==null||v==null)return;const r=g.slice(0,Math.max(0,c)),D=g.slice(Math.max(0,v));o={selectionStart:c,selectionEnd:v,value:g,beforeTxt:r,afterTxt:D}}function i(){if(t.value==null||o==null)return;const{value:c}=t.value,{beforeTxt:v,afterTxt:g,selectionStart:r}=o;if(v==null||g==null||r==null)return;let D=c.length;if(c.endsWith(g))D=c.length-g.length;else if(c.startsWith(v))D=v.length;else{const U=v[r-1],re=c.indexOf(U,r-1);re!==-1&&(D=re+1)}t.value.setSelectionRange(D,D)}return[l,i]}const Do="ElInput",ni=e.defineComponent({name:Do,inheritAttrs:!1}),li=e.defineComponent({...ni,props:js,emits:Hs,setup(t,{expose:o,emit:l}){const i=t,c=e.useAttrs(),v=qs(),g=e.useSlots(),r=e.computed(()=>[i.type==="textarea"?J.b():x.b(),x.m(_e.value),x.is("disabled",ee.value),x.is("exceed",Le.value),{[x.b("group")]:g.prepend||g.append,[x.m("prefix")]:g.prefix||i.prefixIcon,[x.m("suffix")]:g.suffix||i.suffixIcon||i.clearable||i.showPassword,[x.bm("suffix","password-clear")]:we.value&&tt.value,[x.b("hidden")]:i.type==="hidden"},c.class]),D=e.computed(()=>[x.e("wrapper"),x.is("focus",ye.value)]),{form:U,formItem:re}=To(),{inputId:ne}=Js(i,{formItemContext:re}),_e=Oo(),ee=Vn(),x=E.useNamespace("input"),J=E.useNamespace("textarea"),G=e.shallowRef(),fe=e.shallowRef(),ae=e.ref(!1),F=e.ref(!1),L=e.ref(),K=e.shallowRef(i.inputStyle),z=e.computed(()=>G.value||fe.value),{wrapperRef:ce,isFocused:ye,handleFocus:Te,handleBlur:T}=Zs(z,{beforeFocus(){return ee.value},afterBlur(){var me;i.validateEvent&&((me=re==null?void 0:re.validate)==null||me.call(re,"blur").catch(Xe=>E.debugWarn(Xe)))}}),We=e.computed(()=>{var me;return(me=U==null?void 0:U.statusIcon)!=null?me:!1}),He=e.computed(()=>(re==null?void 0:re.validateState)||""),bt=e.computed(()=>He.value&&E.ValidateComponentsMap[He.value]),R=e.computed(()=>F.value?E.view_default:E.hide_default),ut=e.computed(()=>[c.style]),Me=e.computed(()=>[i.inputStyle,K.value,{resize:i.resize}]),se=e.computed(()=>_o.isNil(i.modelValue)?"":String(i.modelValue)),we=e.computed(()=>i.clearable&&!ee.value&&!i.readonly&&!!se.value&&(ye.value||ae.value)),tt=e.computed(()=>i.showPassword&&!ee.value&&!!se.value),Ce=e.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!ee.value&&!i.readonly&&!i.showPassword),Se=e.computed(()=>se.value.length),Le=e.computed(()=>!!Ce.value&&Se.value>Number(i.maxlength)),ct=e.computed(()=>!!g.suffix||!!i.suffixIcon||we.value||i.showPassword||Ce.value||!!He.value&&We.value),[Ct,$t]=ai(G);E.useResizeObserver(fe,me=>{if(da(),!Ce.value||i.resize!=="both")return;const Xe=me[0],{width:pa}=Xe.contentRect;L.value={right:`calc(100% - ${pa+15+6}px)`}});const Et=()=>{const{type:me,autosize:Xe}=i;if(!(!E.isClient||me!=="textarea"||!fe.value))if(Xe){const pa=E.isObject$1(Xe)?Xe.minRows:void 0,Vt=E.isObject$1(Xe)?Xe.maxRows:void 0,ta=so(fe.value,pa,Vt);K.value={overflowY:"hidden",...ta},e.nextTick(()=>{fe.value.offsetHeight,K.value=ta})}else K.value={minHeight:so(fe.value).minHeight}},da=(me=>{let Xe=!1;return()=>{var pa;if(Xe||!i.autosize)return;((pa=fe.value)==null?void 0:pa.offsetParent)===null||(me(),Xe=!0)}})(Et),Ve=()=>{const me=z.value,Xe=i.formatter?i.formatter(se.value):se.value;!me||me.value===Xe||(me.value=Xe)},Na=async me=>{Ct();let{value:Xe}=me.target;if(i.formatter&&i.parser&&(Xe=i.parser(Xe)),!pn.value){if(Xe===se.value){Ve();return}l(sl,Xe),l(ro,Xe),await e.nextTick(),Ve(),$t()}},Ka=me=>{let{value:Xe}=me.target;i.formatter&&i.parser&&(Xe=i.parser(Xe)),l(oo,Xe)},{isComposing:pn,handleCompositionStart:ft,handleCompositionUpdate:ot,handleCompositionEnd:wa}=ti({emit:l,afterComposition:Na}),Ma=()=>{Ct(),F.value=!F.value,setTimeout($t)},kl=()=>{var me;return(me=z.value)==null?void 0:me.focus()},xa=()=>{var me;return(me=z.value)==null?void 0:me.blur()},fn=me=>{ae.value=!1,l("mouseleave",me)},le=me=>{ae.value=!0,l("mouseenter",me)},jt=me=>{l("keydown",me)},Lt=()=>{var me;(me=z.value)==null||me.select()},ea=()=>{l(sl,""),l(oo,""),l("clear"),l(ro,"")};return e.watch(()=>i.modelValue,()=>{var me;e.nextTick(()=>Et()),i.validateEvent&&((me=re==null?void 0:re.validate)==null||me.call(re,"change").catch(Xe=>E.debugWarn(Xe)))}),e.watch(se,()=>Ve()),e.watch(()=>i.type,async()=>{await e.nextTick(),Ve(),Et()}),e.onMounted(()=>{!i.formatter&&i.parser&&E.debugWarn(Do,"If you set the parser, you also need to set the formatter."),Ve(),e.nextTick(Et)}),o({input:G,textarea:fe,ref:z,textareaStyle:Me,autosize:e.toRef(i,"autosize"),isComposing:pn,focus:kl,blur:xa,select:Lt,clear:ea,resizeTextarea:Et}),(me,Xe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(r),{[e.unref(x).bm("group","append")]:me.$slots.append,[e.unref(x).bm("group","prepend")]:me.$slots.prepend}]),style:e.normalizeStyle(e.unref(ut)),onMouseenter:le,onMouseleave:fn},[e.createCommentVNode(" input "),me.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createCommentVNode(" prepend slot "),me.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(x).be("group","prepend"))},[e.renderSlot(me.$slots,"prepend")],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"wrapperRef",ref:ce,class:e.normalizeClass(e.unref(D))},[e.createCommentVNode(" prefix slot "),me.$slots.prefix||me.prefixIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(x).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(x).e("prefix-inner"))},[e.renderSlot(me.$slots,"prefix"),me.prefixIcon?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:0,class:e.normalizeClass(e.unref(x).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(me.prefixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(ne),ref_key:"input",ref:G,class:e.unref(x).e("inner")},e.unref(v),{minlength:me.minlength,maxlength:me.maxlength,type:me.showPassword?F.value?"text":"password":me.type,disabled:e.unref(ee),readonly:me.readonly,autocomplete:me.autocomplete,tabindex:me.tabindex,"aria-label":me.ariaLabel,placeholder:me.placeholder,style:me.inputStyle,form:me.form,autofocus:me.autofocus,role:me.containerRole,onCompositionstart:e.unref(ft),onCompositionupdate:e.unref(ot),onCompositionend:e.unref(wa),onInput:Na,onChange:Ka,onKeydown:jt}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","onCompositionstart","onCompositionupdate","onCompositionend"]),e.createCommentVNode(" suffix slot "),e.unref(ct)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(x).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(x).e("suffix-inner"))},[!e.unref(we)||!e.unref(tt)||!e.unref(Ce)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(me.$slots,"suffix"),me.suffixIcon?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:0,class:e.normalizeClass(e.unref(x).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(me.suffixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],64)):e.createCommentVNode("v-if",!0),e.unref(we)?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:1,class:e.normalizeClass([e.unref(x).e("icon"),e.unref(x).e("clear")]),onMousedown:e.withModifiers(e.unref(E.NOOP),["prevent"]),onClick:ea},{default:e.withCtx(()=>[e.createVNode(e.unref(E.circle_close_default))]),_:1},8,["class","onMousedown"])):e.createCommentVNode("v-if",!0),e.unref(tt)?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:2,class:e.normalizeClass([e.unref(x).e("icon"),e.unref(x).e("password")]),onClick:Ma},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(R))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),e.unref(Ce)?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(x).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(x).e("count-inner"))},e.toDisplayString(e.unref(Se))+" / "+e.toDisplayString(me.maxlength),3)],2)):e.createCommentVNode("v-if",!0),e.unref(He)&&e.unref(bt)&&e.unref(We)?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:4,class:e.normalizeClass([e.unref(x).e("icon"),e.unref(x).e("validateIcon"),e.unref(x).is("loading",e.unref(He)==="validating")])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(bt))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0)],2),e.createCommentVNode(" append slot "),me.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(x).be("group","append"))},[e.renderSlot(me.$slots,"append")],2)):e.createCommentVNode("v-if",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" textarea "),e.createElementVNode("textarea",e.mergeProps({id:e.unref(ne),ref_key:"textarea",ref:fe,class:[e.unref(J).e("inner"),e.unref(x).is("focus",e.unref(ye))]},e.unref(v),{minlength:me.minlength,maxlength:me.maxlength,tabindex:me.tabindex,disabled:e.unref(ee),readonly:me.readonly,autocomplete:me.autocomplete,style:e.unref(Me),"aria-label":me.ariaLabel,placeholder:me.placeholder,form:me.form,autofocus:me.autofocus,rows:me.rows,role:me.containerRole,onCompositionstart:e.unref(ft),onCompositionupdate:e.unref(ot),onCompositionend:e.unref(wa),onInput:Na,onFocus:e.unref(Te),onBlur:e.unref(T),onChange:Ka,onKeydown:jt}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),e.unref(Ce)?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(L.value),class:e.normalizeClass(e.unref(x).e("count"))},e.toDisplayString(e.unref(Se))+" / "+e.toDisplayString(me.maxlength),7)):e.createCommentVNode("v-if",!0)],64))],38))}});var oi=E._export_sfc(li,[["__file","input.vue"]]);const ri=E.withInstall(oi),al="focus-trap.focus-after-trapped",nl="focus-trap.focus-after-released",si="focus-trap.focusout-prevented",uo={cancelable:!0,bubbles:!1},ii={cancelable:!0,bubbles:!1},co="focusAfterTrapped",po="focusAfterReleased",ui=Symbol("elFocusTrap"),gl=e.ref(),In=e.ref(0),yl=e.ref(0);let Bn=0;const Mo=t=>{const o=[],l=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const c=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||c?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)o.push(l.currentNode);return o},fo=(t,o)=>{for(const l of t)if(!ci(l,o))return l},ci=(t,o)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(o&&t===o)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1},di=t=>{const o=Mo(t),l=fo(o,t),i=fo(o.reverse(),t);return[l,i]},pi=t=>t instanceof HTMLInputElement&&"select"in t,Ta=(t,o)=>{if(t&&t.focus){const l=document.activeElement;let i=!1;E.isElement(t)&&!ml(t)&&!t.getAttribute("tabindex")&&(t.setAttribute("tabindex","-1"),i=!0),t.focus({preventScroll:!0}),yl.value=window.performance.now(),t!==l&&pi(t)&&o&&t.select(),E.isElement(t)&&i&&t.removeAttribute("tabindex")}};function vo(t,o){const l=[...t],i=t.indexOf(o);return i!==-1&&l.splice(i,1),l}const fi=()=>{let t=[];return{push:i=>{const c=t[0];c&&i!==c&&c.pause(),t=vo(t,i),t.unshift(i)},remove:i=>{var c,v;t=vo(t,i),(v=(c=t[0])==null?void 0:c.resume)==null||v.call(c)}}},vi=(t,o=!1)=>{const l=document.activeElement;for(const i of t)if(Ta(i,o),document.activeElement!==l)return},ho=fi(),hi=()=>In.value>yl.value,Tn=()=>{gl.value="pointer",In.value=window.performance.now()},mo=()=>{gl.value="keyboard",In.value=window.performance.now()},mi=()=>(e.onMounted(()=>{Bn===0&&(document.addEventListener("mousedown",Tn),document.addEventListener("touchstart",Tn),document.addEventListener("keydown",mo)),Bn++}),e.onBeforeUnmount(()=>{Bn--,Bn<=0&&(document.removeEventListener("mousedown",Tn),document.removeEventListener("touchstart",Tn),document.removeEventListener("keydown",mo))}),{focusReason:gl,lastUserFocusTimestamp:In,lastAutomatedFocusTimestamp:yl}),An=t=>new CustomEvent(si,{...ii,detail:t});let ja=[];const go=t=>{t.code===E.EVENT_CODE.esc&&ja.forEach(o=>o(t))},gi=t=>{e.onMounted(()=>{ja.length===0&&document.addEventListener("keydown",go),E.isClient&&ja.push(t)}),e.onBeforeUnmount(()=>{ja=ja.filter(o=>o!==t),ja.length===0&&E.isClient&&document.removeEventListener("keydown",go)})},yi=e.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[co,po,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:o}){const l=e.ref();let i,c;const{focusReason:v}=mi();gi(x=>{t.trapped&&!g.paused&&o("release-requested",x)});const g={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},r=x=>{if(!t.loop&&!t.trapped||g.paused)return;const{code:J,altKey:G,ctrlKey:fe,metaKey:ae,currentTarget:F,shiftKey:L}=x,{loop:K}=t,z=J===E.EVENT_CODE.tab&&!G&&!fe&&!ae,ce=document.activeElement;if(z&&ce){const ye=F,[Te,T]=di(ye);if(Te&&T){if(!L&&ce===T){const He=An({focusReason:v.value});o("focusout-prevented",He),He.defaultPrevented||(x.preventDefault(),K&&Ta(Te,!0))}else if(L&&[Te,ye].includes(ce)){const He=An({focusReason:v.value});o("focusout-prevented",He),He.defaultPrevented||(x.preventDefault(),K&&Ta(T,!0))}}else if(ce===ye){const He=An({focusReason:v.value});o("focusout-prevented",He),He.defaultPrevented||x.preventDefault()}}};e.provide(ui,{focusTrapRef:l,onKeydown:r}),e.watch(()=>t.focusTrapEl,x=>{x&&(l.value=x)},{immediate:!0}),e.watch([l],([x],[J])=>{x&&(x.addEventListener("keydown",r),x.addEventListener("focusin",re),x.addEventListener("focusout",ne)),J&&(J.removeEventListener("keydown",r),J.removeEventListener("focusin",re),J.removeEventListener("focusout",ne))});const D=x=>{o(co,x)},U=x=>o(po,x),re=x=>{const J=e.unref(l);if(!J)return;const G=x.target,fe=x.relatedTarget,ae=G&&J.contains(G);t.trapped||fe&&J.contains(fe)||(i=fe),ae&&o("focusin",x),!g.paused&&t.trapped&&(ae?c=G:Ta(c,!0))},ne=x=>{const J=e.unref(l);if(!(g.paused||!J))if(t.trapped){const G=x.relatedTarget;!_o.isNil(G)&&!J.contains(G)&&setTimeout(()=>{if(!g.paused&&t.trapped){const fe=An({focusReason:v.value});o("focusout-prevented",fe),fe.defaultPrevented||Ta(c,!0)}},0)}else{const G=x.target;G&&J.contains(G)||o("focusout",x)}};async function _e(){await e.nextTick();const x=e.unref(l);if(x){ho.push(g);const J=x.contains(document.activeElement)?i:document.activeElement;if(i=J,!x.contains(J)){const fe=new Event(al,uo);x.addEventListener(al,D),x.dispatchEvent(fe),fe.defaultPrevented||e.nextTick(()=>{let ae=t.focusStartEl;E.isString(ae)||(Ta(ae),document.activeElement!==ae&&(ae="first")),ae==="first"&&vi(Mo(x),!0),(document.activeElement===J||ae==="container")&&Ta(x)})}}}function ee(){const x=e.unref(l);if(x){x.removeEventListener(al,D);const J=new CustomEvent(nl,{...uo,detail:{focusReason:v.value}});x.addEventListener(nl,U),x.dispatchEvent(J),!J.defaultPrevented&&(v.value=="keyboard"||!hi()||x.contains(document.activeElement))&&Ta(i??document.body),x.removeEventListener(nl,U),ho.remove(g)}}return e.onMounted(()=>{t.trapped&&_e(),e.watch(()=>t.trapped,x=>{x?_e():ee()})}),e.onBeforeUnmount(()=>{t.trapped&&ee(),l.value&&(l.value.removeEventListener("keydown",r),l.value.removeEventListener("focusin",re),l.value.removeEventListener("focusout",ne),l.value=void 0)}),{onKeydown:r}}});function bi(t,o,l,i,c,v){return e.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var ki=E._export_sfc(yi,[["render",bi],["__file","focus-trap.vue"]]);const $o=Symbol("buttonGroupContextKey"),Ci=({from:t,replacement:o,scope:l,version:i,ref:c,type:v="API"},g)=>{e.watch(()=>e.unref(g),r=>{r&&E.debugWarn(l,`[${v}] ${t} is about to be deprecated in version ${i}, please use ${o} instead.
6
+ For more detail, please visit: ${c}
7
+ `)},{immediate:!0})},Ei=(t,o)=>{Ci({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},e.computed(()=>t.type==="text"));const l=e.inject($o,void 0),i=E.useGlobalConfig("button"),{form:c}=To(),v=Oo(e.computed(()=>l==null?void 0:l.size)),g=Vn(),r=e.ref(),D=e.useSlots(),U=e.computed(()=>{var G;return t.type||(l==null?void 0:l.type)||((G=i.value)==null?void 0:G.type)||""}),re=e.computed(()=>{var G,fe,ae;return(ae=(fe=t.autoInsertSpace)!=null?fe:(G=i.value)==null?void 0:G.autoInsertSpace)!=null?ae:!1}),ne=e.computed(()=>{var G,fe,ae;return(ae=(fe=t.plain)!=null?fe:(G=i.value)==null?void 0:G.plain)!=null?ae:!1}),_e=e.computed(()=>{var G,fe,ae;return(ae=(fe=t.round)!=null?fe:(G=i.value)==null?void 0:G.round)!=null?ae:!1}),ee=e.computed(()=>t.tag==="button"?{ariaDisabled:g.value||t.loading,disabled:g.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),x=e.computed(()=>{var G;const fe=(G=D.default)==null?void 0:G.call(D);if(re.value&&(fe==null?void 0:fe.length)===1){const ae=fe[0];if((ae==null?void 0:ae.type)===e.Text){const F=ae.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(F.trim())}}return!1});return{_disabled:g,_size:v,_type:U,_ref:r,_props:ee,_plain:ne,_round:_e,shouldAddSpace:x,handleClick:G=>{if(g.value||t.loading){G.stopPropagation();return}t.nativeType==="reset"&&(c==null||c.resetFields()),o("click",G)}}},Si=["default","primary","success","warning","info","danger","text",""],Ni=["button","submit","reset"],cl=E.buildProps({size:E.useSizeProp,disabled:Boolean,type:{type:String,values:Si,default:""},icon:{type:E.iconPropType},nativeType:{type:String,values:Ni,default:"button"},loading:Boolean,loadingIcon:{type:E.iconPropType,default:()=>E.loading_default},plain:{type:Boolean,default:void 0},text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:E.definePropType([String,Object]),default:"button"}}),wi={click:t=>t instanceof MouseEvent};function zt(t,o){xi(t)&&(t="100%");var l=_i(t);return t=o===360?t:Math.min(o,Math.max(0,parseFloat(t))),l&&(t=parseInt(String(t*o),10)/100),Math.abs(t-o)<1e-6?1:(o===360?t=(t<0?t%o+o:t%o)/parseFloat(String(o)):t=t%o/parseFloat(String(o)),t)}function On(t){return Math.min(1,Math.max(0,t))}function xi(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function _i(t){return typeof t=="string"&&t.indexOf("%")!==-1}function Lo(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Dn(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Ia(t){return t.length===1?"0"+t:String(t)}function Bi(t,o,l){return{r:zt(t,255)*255,g:zt(o,255)*255,b:zt(l,255)*255}}function yo(t,o,l){t=zt(t,255),o=zt(o,255),l=zt(l,255);var i=Math.max(t,o,l),c=Math.min(t,o,l),v=0,g=0,r=(i+c)/2;if(i===c)g=0,v=0;else{var D=i-c;switch(g=r>.5?D/(2-i-c):D/(i+c),i){case t:v=(o-l)/D+(o<l?6:0);break;case o:v=(l-t)/D+2;break;case l:v=(t-o)/D+4;break}v/=6}return{h:v,s:g,l:r}}function ll(t,o,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?t+(o-t)*(6*l):l<1/2?o:l<2/3?t+(o-t)*(2/3-l)*6:t}function Ti(t,o,l){var i,c,v;if(t=zt(t,360),o=zt(o,100),l=zt(l,100),o===0)c=l,v=l,i=l;else{var g=l<.5?l*(1+o):l+o-l*o,r=2*l-g;i=ll(r,g,t+1/3),c=ll(r,g,t),v=ll(r,g,t-1/3)}return{r:i*255,g:c*255,b:v*255}}function bo(t,o,l){t=zt(t,255),o=zt(o,255),l=zt(l,255);var i=Math.max(t,o,l),c=Math.min(t,o,l),v=0,g=i,r=i-c,D=i===0?0:r/i;if(i===c)v=0;else{switch(i){case t:v=(o-l)/r+(o<l?6:0);break;case o:v=(l-t)/r+2;break;case l:v=(t-o)/r+4;break}v/=6}return{h:v,s:D,v:g}}function Ai(t,o,l){t=zt(t,360)*6,o=zt(o,100),l=zt(l,100);var i=Math.floor(t),c=t-i,v=l*(1-o),g=l*(1-c*o),r=l*(1-(1-c)*o),D=i%6,U=[l,g,v,v,r,l][D],re=[r,l,l,g,v,v][D],ne=[v,v,r,l,l,g][D];return{r:U*255,g:re*255,b:ne*255}}function ko(t,o,l,i){var c=[Ia(Math.round(t).toString(16)),Ia(Math.round(o).toString(16)),Ia(Math.round(l).toString(16))];return i&&c[0].startsWith(c[0].charAt(1))&&c[1].startsWith(c[1].charAt(1))&&c[2].startsWith(c[2].charAt(1))?c[0].charAt(0)+c[1].charAt(0)+c[2].charAt(0):c.join("")}function Oi(t,o,l,i,c){var v=[Ia(Math.round(t).toString(16)),Ia(Math.round(o).toString(16)),Ia(Math.round(l).toString(16)),Ia(Di(i))];return c&&v[0].startsWith(v[0].charAt(1))&&v[1].startsWith(v[1].charAt(1))&&v[2].startsWith(v[2].charAt(1))&&v[3].startsWith(v[3].charAt(1))?v[0].charAt(0)+v[1].charAt(0)+v[2].charAt(0)+v[3].charAt(0):v.join("")}function Di(t){return Math.round(parseFloat(t)*255).toString(16)}function Co(t){return aa(t)/255}function aa(t){return parseInt(t,16)}function Mi(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var dl={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function $i(t){var o={r:0,g:0,b:0},l=1,i=null,c=null,v=null,g=!1,r=!1;return typeof t=="string"&&(t=Ii(t)),typeof t=="object"&&(Ea(t.r)&&Ea(t.g)&&Ea(t.b)?(o=Bi(t.r,t.g,t.b),g=!0,r=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ea(t.h)&&Ea(t.s)&&Ea(t.v)?(i=Dn(t.s),c=Dn(t.v),o=Ai(t.h,i,c),g=!0,r="hsv"):Ea(t.h)&&Ea(t.s)&&Ea(t.l)&&(i=Dn(t.s),v=Dn(t.l),o=Ti(t.h,i,v),g=!0,r="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(l=t.a)),l=Lo(l),{ok:g,format:t.format||r,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a:l}}var Li="[-\\+]?\\d+%?",Vi="[-\\+]?\\d*\\.\\d+%?",Oa="(?:".concat(Vi,")|(?:").concat(Li,")"),ol="[\\s|\\(]+(".concat(Oa,")[,|\\s]+(").concat(Oa,")[,|\\s]+(").concat(Oa,")\\s*\\)?"),rl="[\\s|\\(]+(".concat(Oa,")[,|\\s]+(").concat(Oa,")[,|\\s]+(").concat(Oa,")[,|\\s]+(").concat(Oa,")\\s*\\)?"),ia={CSS_UNIT:new RegExp(Oa),rgb:new RegExp("rgb"+ol),rgba:new RegExp("rgba"+rl),hsl:new RegExp("hsl"+ol),hsla:new RegExp("hsla"+rl),hsv:new RegExp("hsv"+ol),hsva:new RegExp("hsva"+rl),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Ii(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var o=!1;if(dl[t])t=dl[t],o=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var l=ia.rgb.exec(t);return l?{r:l[1],g:l[2],b:l[3]}:(l=ia.rgba.exec(t),l?{r:l[1],g:l[2],b:l[3],a:l[4]}:(l=ia.hsl.exec(t),l?{h:l[1],s:l[2],l:l[3]}:(l=ia.hsla.exec(t),l?{h:l[1],s:l[2],l:l[3],a:l[4]}:(l=ia.hsv.exec(t),l?{h:l[1],s:l[2],v:l[3]}:(l=ia.hsva.exec(t),l?{h:l[1],s:l[2],v:l[3],a:l[4]}:(l=ia.hex8.exec(t),l?{r:aa(l[1]),g:aa(l[2]),b:aa(l[3]),a:Co(l[4]),format:o?"name":"hex8"}:(l=ia.hex6.exec(t),l?{r:aa(l[1]),g:aa(l[2]),b:aa(l[3]),format:o?"name":"hex"}:(l=ia.hex4.exec(t),l?{r:aa(l[1]+l[1]),g:aa(l[2]+l[2]),b:aa(l[3]+l[3]),a:Co(l[4]+l[4]),format:o?"name":"hex8"}:(l=ia.hex3.exec(t),l?{r:aa(l[1]+l[1]),g:aa(l[2]+l[2]),b:aa(l[3]+l[3]),format:o?"name":"hex"}:!1)))))))))}function Ea(t){return!!ia.CSS_UNIT.exec(String(t))}var Pi=function(){function t(o,l){o===void 0&&(o=""),l===void 0&&(l={});var i;if(o instanceof t)return o;typeof o=="number"&&(o=Mi(o)),this.originalInput=o;var c=$i(o);this.originalInput=o,this.r=c.r,this.g=c.g,this.b=c.b,this.a=c.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=l.format)!==null&&i!==void 0?i:c.format,this.gradientType=l.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=c.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var o=this.toRgb();return(o.r*299+o.g*587+o.b*114)/1e3},t.prototype.getLuminance=function(){var o=this.toRgb(),l,i,c,v=o.r/255,g=o.g/255,r=o.b/255;return v<=.03928?l=v/12.92:l=Math.pow((v+.055)/1.055,2.4),g<=.03928?i=g/12.92:i=Math.pow((g+.055)/1.055,2.4),r<=.03928?c=r/12.92:c=Math.pow((r+.055)/1.055,2.4),.2126*l+.7152*i+.0722*c},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(o){return this.a=Lo(o),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var o=this.toHsl().s;return o===0},t.prototype.toHsv=function(){var o=bo(this.r,this.g,this.b);return{h:o.h*360,s:o.s,v:o.v,a:this.a}},t.prototype.toHsvString=function(){var o=bo(this.r,this.g,this.b),l=Math.round(o.h*360),i=Math.round(o.s*100),c=Math.round(o.v*100);return this.a===1?"hsv(".concat(l,", ").concat(i,"%, ").concat(c,"%)"):"hsva(".concat(l,", ").concat(i,"%, ").concat(c,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var o=yo(this.r,this.g,this.b);return{h:o.h*360,s:o.s,l:o.l,a:this.a}},t.prototype.toHslString=function(){var o=yo(this.r,this.g,this.b),l=Math.round(o.h*360),i=Math.round(o.s*100),c=Math.round(o.l*100);return this.a===1?"hsl(".concat(l,", ").concat(i,"%, ").concat(c,"%)"):"hsla(".concat(l,", ").concat(i,"%, ").concat(c,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(o){return o===void 0&&(o=!1),ko(this.r,this.g,this.b,o)},t.prototype.toHexString=function(o){return o===void 0&&(o=!1),"#"+this.toHex(o)},t.prototype.toHex8=function(o){return o===void 0&&(o=!1),Oi(this.r,this.g,this.b,this.a,o)},t.prototype.toHex8String=function(o){return o===void 0&&(o=!1),"#"+this.toHex8(o)},t.prototype.toHexShortString=function(o){return o===void 0&&(o=!1),this.a===1?this.toHexString(o):this.toHex8String(o)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var o=Math.round(this.r),l=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(o,", ").concat(l,", ").concat(i,")"):"rgba(".concat(o,", ").concat(l,", ").concat(i,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var o=function(l){return"".concat(Math.round(zt(l,255)*100),"%")};return{r:o(this.r),g:o(this.g),b:o(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var o=function(l){return Math.round(zt(l,255)*100)};return this.a===1?"rgb(".concat(o(this.r),"%, ").concat(o(this.g),"%, ").concat(o(this.b),"%)"):"rgba(".concat(o(this.r),"%, ").concat(o(this.g),"%, ").concat(o(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var o="#"+ko(this.r,this.g,this.b,!1),l=0,i=Object.entries(dl);l<i.length;l++){var c=i[l],v=c[0],g=c[1];if(o===g)return v}return!1},t.prototype.toString=function(o){var l=!!o;o=o??this.format;var i=!1,c=this.a<1&&this.a>=0,v=!l&&c&&(o.startsWith("hex")||o==="name");return v?o==="name"&&this.a===0?this.toName():this.toRgbString():(o==="rgb"&&(i=this.toRgbString()),o==="prgb"&&(i=this.toPercentageRgbString()),(o==="hex"||o==="hex6")&&(i=this.toHexString()),o==="hex3"&&(i=this.toHexString(!0)),o==="hex4"&&(i=this.toHex8String(!0)),o==="hex8"&&(i=this.toHex8String()),o==="name"&&(i=this.toName()),o==="hsl"&&(i=this.toHslString()),o==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(o){o===void 0&&(o=10);var l=this.toHsl();return l.l+=o/100,l.l=On(l.l),new t(l)},t.prototype.brighten=function(o){o===void 0&&(o=10);var l=this.toRgb();return l.r=Math.max(0,Math.min(255,l.r-Math.round(255*-(o/100)))),l.g=Math.max(0,Math.min(255,l.g-Math.round(255*-(o/100)))),l.b=Math.max(0,Math.min(255,l.b-Math.round(255*-(o/100)))),new t(l)},t.prototype.darken=function(o){o===void 0&&(o=10);var l=this.toHsl();return l.l-=o/100,l.l=On(l.l),new t(l)},t.prototype.tint=function(o){return o===void 0&&(o=10),this.mix("white",o)},t.prototype.shade=function(o){return o===void 0&&(o=10),this.mix("black",o)},t.prototype.desaturate=function(o){o===void 0&&(o=10);var l=this.toHsl();return l.s-=o/100,l.s=On(l.s),new t(l)},t.prototype.saturate=function(o){o===void 0&&(o=10);var l=this.toHsl();return l.s+=o/100,l.s=On(l.s),new t(l)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(o){var l=this.toHsl(),i=(l.h+o)%360;return l.h=i<0?360+i:i,new t(l)},t.prototype.mix=function(o,l){l===void 0&&(l=50);var i=this.toRgb(),c=new t(o).toRgb(),v=l/100,g={r:(c.r-i.r)*v+i.r,g:(c.g-i.g)*v+i.g,b:(c.b-i.b)*v+i.b,a:(c.a-i.a)*v+i.a};return new t(g)},t.prototype.analogous=function(o,l){o===void 0&&(o=6),l===void 0&&(l=30);var i=this.toHsl(),c=360/l,v=[this];for(i.h=(i.h-(c*o>>1)+720)%360;--o;)i.h=(i.h+c)%360,v.push(new t(i));return v},t.prototype.complement=function(){var o=this.toHsl();return o.h=(o.h+180)%360,new t(o)},t.prototype.monochromatic=function(o){o===void 0&&(o=6);for(var l=this.toHsv(),i=l.h,c=l.s,v=l.v,g=[],r=1/o;o--;)g.push(new t({h:i,s:c,v})),v=(v+r)%1;return g},t.prototype.splitcomplement=function(){var o=this.toHsl(),l=o.h;return[this,new t({h:(l+72)%360,s:o.s,l:o.l}),new t({h:(l+216)%360,s:o.s,l:o.l})]},t.prototype.onBackground=function(o){var l=this.toRgb(),i=new t(o).toRgb(),c=l.a+i.a*(1-l.a);return new t({r:(l.r*l.a+i.r*i.a*(1-l.a))/c,g:(l.g*l.a+i.g*i.a*(1-l.a))/c,b:(l.b*l.a+i.b*i.a*(1-l.a))/c,a:c})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(o){for(var l=this.toHsl(),i=l.h,c=[this],v=360/o,g=1;g<o;g++)c.push(new t({h:(i+g*v)%360,s:l.s,l:l.l}));return c},t.prototype.equals=function(o){return this.toRgbString()===new t(o).toRgbString()},t}();function Ba(t,o=20){return t.mix("#141414",o).toString()}function Ri(t){const o=Vn(),l=E.useNamespace("button");return e.computed(()=>{let i={},c=t.color;if(c){const v=c.match(/var\((.*?)\)/);v&&(c=window.getComputedStyle(window.document.documentElement).getPropertyValue(v[1]));const g=new Pi(c),r=t.dark?g.tint(20).toString():Ba(g,20);if(t.plain)i=l.cssVarBlock({"bg-color":t.dark?Ba(g,90):g.tint(90).toString(),"text-color":c,"border-color":t.dark?Ba(g,50):g.tint(50).toString(),"hover-text-color":`var(${l.cssVarName("color-white")})`,"hover-bg-color":c,"hover-border-color":c,"active-bg-color":r,"active-text-color":`var(${l.cssVarName("color-white")})`,"active-border-color":r}),o.value&&(i[l.cssVarBlockName("disabled-bg-color")]=t.dark?Ba(g,90):g.tint(90).toString(),i[l.cssVarBlockName("disabled-text-color")]=t.dark?Ba(g,50):g.tint(50).toString(),i[l.cssVarBlockName("disabled-border-color")]=t.dark?Ba(g,80):g.tint(80).toString());else{const D=t.dark?Ba(g,30):g.tint(30).toString(),U=g.isDark()?`var(${l.cssVarName("color-white")})`:`var(${l.cssVarName("color-black")})`;if(i=l.cssVarBlock({"bg-color":c,"text-color":U,"border-color":c,"hover-bg-color":D,"hover-text-color":U,"hover-border-color":D,"active-bg-color":r,"active-border-color":r}),o.value){const re=t.dark?Ba(g,50):g.tint(50).toString();i[l.cssVarBlockName("disabled-bg-color")]=re,i[l.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${l.cssVarName("color-white")})`,i[l.cssVarBlockName("disabled-border-color")]=re}}}return i})}const Ui=e.defineComponent({name:"ElButton"}),Fi=e.defineComponent({...Ui,props:cl,emits:wi,setup(t,{expose:o,emit:l}){const i=t,c=Ri(i),v=E.useNamespace("button"),{_ref:g,_size:r,_type:D,_disabled:U,_props:re,_plain:ne,_round:_e,shouldAddSpace:ee,handleClick:x}=Ei(i,l),J=e.computed(()=>[v.b(),v.m(D.value),v.m(r.value),v.is("disabled",U.value),v.is("loading",i.loading),v.is("plain",ne.value),v.is("round",_e.value),v.is("circle",i.circle),v.is("text",i.text),v.is("link",i.link),v.is("has-bg",i.bg)]);return o({ref:g,size:r,type:D,disabled:U,shouldAddSpace:ee}),(G,fe)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(G.tag),e.mergeProps({ref_key:"_ref",ref:g},e.unref(re),{class:e.unref(J),style:e.unref(c),onClick:e.unref(x)}),{default:e.withCtx(()=>[G.loading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[G.$slots.loading?e.renderSlot(G.$slots,"loading",{key:0}):(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:1,class:e.normalizeClass(e.unref(v).is("loading"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(G.loadingIcon)))]),_:1},8,["class"]))],64)):G.icon||G.$slots.icon?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:1},{default:e.withCtx(()=>[G.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(G.icon),{key:0})):e.renderSlot(G.$slots,"icon",{key:1})]),_:3})):e.createCommentVNode("v-if",!0),G.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass({[e.unref(v).em("text","expand")]:e.unref(ee)})},[e.renderSlot(G.$slots,"default")],2)):e.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var zi=E._export_sfc(Fi,[["__file","button.vue"]]);const ji={size:cl.size,type:cl.type},Hi=e.defineComponent({name:"ElButtonGroup"}),Ki=e.defineComponent({...Hi,props:ji,setup(t){const o=t;e.provide($o,e.reactive({size:e.toRef(o,"size"),type:e.toRef(o,"type")}));const l=E.useNamespace("button");return(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l).b("group"))},[e.renderSlot(i.$slots,"default")],2))}});var Vo=E._export_sfc(Ki,[["__file","button-group.vue"]]);const Wi=E.withInstall(zi,{ButtonGroup:Vo});E.withNoopInstall(Vo);var Mn=(t=>(t[t.TEXT=1]="TEXT",t[t.CLASS=2]="CLASS",t[t.STYLE=4]="STYLE",t[t.PROPS=8]="PROPS",t[t.FULL_PROPS=16]="FULL_PROPS",t[t.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",t[t.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",t[t.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",t[t.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",t[t.NEED_PATCH=512]="NEED_PATCH",t[t.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",t[t.HOISTED=-1]="HOISTED",t[t.BAIL=-2]="BAIL",t))(Mn||{});const Io=t=>{if(!t)return{onClick:E.NOOP,onMousedown:E.NOOP,onMouseup:E.NOOP};let o=!1,l=!1;return{onClick:g=>{o&&l&&t(g),o=l=!1},onMousedown:g=>{o=g.target===g.currentTarget},onMouseup:g=>{l=g.target===g.currentTarget}}},qi=E.buildProps({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:E.definePropType([String,Array,Object])},zIndex:{type:E.definePropType([String,Number])}}),Yi={click:t=>t instanceof MouseEvent},Gi="overlay";var Ji=e.defineComponent({name:"ElOverlay",props:qi,emits:Yi,setup(t,{slots:o,emit:l}){const i=E.useNamespace(Gi),c=D=>{l("click",D)},{onClick:v,onMousedown:g,onMouseup:r}=Io(t.customMaskEvent?void 0:c);return()=>t.mask?e.createVNode("div",{class:[i.b(),t.overlayClass],style:{zIndex:t.zIndex},onClick:v,onMousedown:g,onMouseup:r},[e.renderSlot(o,"default")],Mn.STYLE|Mn.CLASS|Mn.PROPS,["onClick","onMouseup","onMousedown"]):e.h("div",{class:t.overlayClass,style:{zIndex:t.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[e.renderSlot(o,"default")])}});const Xi=Ji,Qi=(t,o,l,i)=>{const c={offsetX:0,offsetY:0},v=(ne,_e)=>{if(t.value){const{offsetX:ee,offsetY:x}=c,J=t.value.getBoundingClientRect(),G=J.left,fe=J.top,ae=J.width,F=J.height,L=document.documentElement.clientWidth,K=document.documentElement.clientHeight,z=-G+ee,ce=-fe+x,ye=L-G-ae+ee,Te=K-fe-(F<K?F:0)+x;i!=null&&i.value||(ne=Math.min(Math.max(ne,z),ye),_e=Math.min(Math.max(_e,ce),Te)),c.offsetX=ne,c.offsetY=_e,t.value.style.transform=`translate(${E.addUnit(ne)}, ${E.addUnit(_e)})`}},g=ne=>{const _e=ne.clientX,ee=ne.clientY,{offsetX:x,offsetY:J}=c,G=ae=>{const F=x+ae.clientX-_e,L=J+ae.clientY-ee;v(F,L)},fe=()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",fe)};document.addEventListener("mousemove",G),document.addEventListener("mouseup",fe)},r=()=>{o.value&&t.value&&(o.value.addEventListener("mousedown",g),window.addEventListener("resize",re))},D=()=>{o.value&&t.value&&(o.value.removeEventListener("mousedown",g),window.removeEventListener("resize",re))},U=()=>{c.offsetX=0,c.offsetY=0,t.value&&(t.value.style.transform="")},re=()=>{const{offsetX:ne,offsetY:_e}=c;v(ne,_e)};return e.onMounted(()=>{e.watchEffect(()=>{l.value?r():D()})}),e.onBeforeUnmount(()=>{D()}),{resetPosition:U,updatePosition:re}},Zi=(t,o={})=>{e.isRef(t)||E.throwError("[useLockscreen]","You need to pass a ref param to this function");const l=o.ns||E.useNamespace("popup"),i=e.computed(()=>l.bm("parent","hidden"));if(!E.isClient||E.hasClass(document.body,i.value))return;let c=0,v=!1,g="0";const r=()=>{setTimeout(()=>{typeof document>"u"||v&&document&&(document.body.style.width=g,E.removeClass(document.body,i.value))},200)};e.watch(t,D=>{if(!D){r();return}v=!E.hasClass(document.body,i.value),v&&(g=document.body.style.width,E.addClass(document.body,i.value)),c=Vs(l.namespace.value);const U=document.documentElement.clientHeight<document.body.scrollHeight,re=E.getStyle(document.body,"overflowY");c>0&&(U||re==="scroll")&&v&&(document.body.style.width=`calc(100% - ${c}px)`)}),e.onScopeDispose(()=>r())},eu=t=>["",...E.componentSizes].includes(t),pl="_trap-focus-children",Pa=[],Eo=t=>{var o;if(Pa.length===0)return;const l=Pa[Pa.length-1][pl];if(l.length>0&&t.code===E.EVENT_CODE.tab){if(l.length===1){t.preventDefault(),document.activeElement!==l[0]&&l[0].focus();return}const i=t.shiftKey,c=t.target===l[0],v=t.target===l[l.length-1];if(c&&i&&(t.preventDefault(),l[l.length-1].focus()),v&&!i&&(t.preventDefault(),l[0].focus()),process.env.NODE_ENV==="test"){const g=l.indexOf(t.target);g!==-1&&((o=l[i?g-1:g+1])==null||o.focus())}}},tu={beforeMount(t){t[pl]=io(t),Pa.push(t),Pa.length<=1&&document.addEventListener("keydown",Eo)},updated(t){e.nextTick(()=>{t[pl]=io(t)})},unmounted(){Pa.shift(),Pa.length===0&&document.removeEventListener("keydown",Eo)}},au=e.defineComponent({name:"ElMessageBox",directives:{TrapFocus:tu},components:{ElButton:Wi,ElFocusTrap:ki,ElInput:ri,ElOverlay:Xi,ElIcon:E.ElIcon,...E.TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:eu},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(t,{emit:o}){const{locale:l,zIndex:i,ns:c,size:v}=E.useGlobalComponentSettings("message-box",e.computed(()=>t.buttonSize)),{t:g}=l,{nextZIndex:r}=i,D=e.ref(!1),U=e.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:e.markRaw(E.loading_default),cancelButtonLoadingIcon:e.markRaw(E.loading_default),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:r()}),re=e.computed(()=>{const Me=U.type;return{[c.bm("icon",Me)]:Me&&E.TypeComponentsMap[Me]}}),ne=ul(),_e=ul(),ee=e.computed(()=>{const Me=U.type;return U.icon||Me&&E.TypeComponentsMap[Me]||""}),x=e.computed(()=>!!U.message),J=e.ref(),G=e.ref(),fe=e.ref(),ae=e.ref(),F=e.ref(),L=e.computed(()=>U.confirmButtonClass);e.watch(()=>U.inputValue,async Me=>{await e.nextTick(),t.boxType==="prompt"&&Me&&He()},{immediate:!0}),e.watch(()=>D.value,Me=>{var se,we;Me&&(t.boxType!=="prompt"&&(U.autofocus?fe.value=(we=(se=F.value)==null?void 0:se.$el)!=null?we:J.value:fe.value=J.value),U.zIndex=r()),t.boxType==="prompt"&&(Me?e.nextTick().then(()=>{var tt;ae.value&&ae.value.$el&&(U.autofocus?fe.value=(tt=bt())!=null?tt:J.value:fe.value=J.value)}):(U.editorErrorMessage="",U.validateError=!1))});const K=e.computed(()=>t.draggable),z=e.computed(()=>t.overflow);Qi(J,G,K,z),e.onMounted(async()=>{await e.nextTick(),t.closeOnHashChange&&window.addEventListener("hashchange",ce)}),e.onBeforeUnmount(()=>{t.closeOnHashChange&&window.removeEventListener("hashchange",ce)});function ce(){D.value&&(D.value=!1,e.nextTick(()=>{U.action&&o("action",U.action)}))}const ye=()=>{t.closeOnClickModal&&We(U.distinguishCancelAndClose?"close":"cancel")},Te=Io(ye),T=Me=>{if(U.inputType!=="textarea")return Me.preventDefault(),We("confirm")},We=Me=>{var se;t.boxType==="prompt"&&Me==="confirm"&&!He()||(U.action=Me,U.beforeClose?(se=U.beforeClose)==null||se.call(U,Me,U,ce):ce())},He=()=>{if(t.boxType==="prompt"){const Me=U.inputPattern;if(Me&&!Me.test(U.inputValue||""))return U.editorErrorMessage=U.inputErrorMessage||g("el.messagebox.error"),U.validateError=!0,!1;const se=U.inputValidator;if(E.isFunction$1(se)){const we=se(U.inputValue);if(we===!1)return U.editorErrorMessage=U.inputErrorMessage||g("el.messagebox.error"),U.validateError=!0,!1;if(E.isString(we))return U.editorErrorMessage=we,U.validateError=!0,!1}}return U.editorErrorMessage="",U.validateError=!1,!0},bt=()=>{var Me,se;const we=(Me=ae.value)==null?void 0:Me.$refs;return(se=we==null?void 0:we.input)!=null?se:we==null?void 0:we.textarea},R=()=>{We("close")},ut=()=>{t.closeOnPressEscape&&R()};return t.lockScroll&&Zi(D),{...e.toRefs(U),ns:c,overlayEvent:Te,visible:D,hasMessage:x,typeClass:re,contentId:ne,inputId:_e,btnSize:v,iconComponent:ee,confirmButtonClasses:L,rootRef:J,focusStartRef:fe,headerRef:G,inputRef:ae,confirmRef:F,doClose:ce,handleClose:R,onCloseRequested:ut,handleWrapperClick:ye,handleInputEnter:T,handleAction:We,t:g}}});function nu(t,o,l,i,c,v){const g=e.resolveComponent("el-icon"),r=e.resolveComponent("el-input"),D=e.resolveComponent("el-button"),U=e.resolveComponent("el-focus-trap"),re=e.resolveComponent("el-overlay");return e.openBlock(),e.createBlock(e.Transition,{name:"fade-in-linear",onAfterLeave:ne=>t.$emit("vanish"),persisted:""},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(re,{"z-index":t.zIndex,"overlay-class":[t.ns.is("message-box"),t.modalClass],mask:t.modal},{default:e.withCtx(()=>[e.createElementVNode("div",{role:"dialog","aria-label":t.title,"aria-modal":"true","aria-describedby":t.showInput?void 0:t.contentId,class:e.normalizeClass(`${t.ns.namespace.value}-overlay-message-box`),onClick:t.overlayEvent.onClick,onMousedown:t.overlayEvent.onMousedown,onMouseup:t.overlayEvent.onMouseup},[e.createVNode(U,{loop:"",trapped:t.visible,"focus-trap-el":t.rootRef,"focus-start-el":t.focusStartRef,onReleaseRequested:t.onCloseRequested},{default:e.withCtx(()=>[e.createElementVNode("div",{ref:"rootRef",class:e.normalizeClass([t.ns.b(),t.customClass,t.ns.is("draggable",t.draggable),{[t.ns.m("center")]:t.center}]),style:e.normalizeStyle(t.customStyle),tabindex:"-1",onClick:e.withModifiers(()=>{},["stop"])},[t.title!==null&&t.title!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,ref:"headerRef",class:e.normalizeClass([t.ns.e("header"),{"show-close":t.showClose}])},[e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("title"))},[t.iconComponent&&t.center?(e.openBlock(),e.createBlock(g,{key:0,class:e.normalizeClass([t.ns.e("status"),t.typeClass])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),e.createElementVNode("span",null,e.toDisplayString(t.title),1)],2),t.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(t.ns.e("headerbtn")),"aria-label":t.t("el.messagebox.close"),onClick:ne=>t.handleAction(t.distinguishCancelAndClose?"close":"cancel"),onKeydown:e.withKeys(e.withModifiers(ne=>t.handleAction(t.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[e.createVNode(g,{class:e.normalizeClass(t.ns.e("close"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.closeIcon||"close")))]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{id:t.contentId,class:e.normalizeClass(t.ns.e("content"))},[e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("container"))},[t.iconComponent&&!t.center&&t.hasMessage?(e.openBlock(),e.createBlock(g,{key:0,class:e.normalizeClass([t.ns.e("status"),t.typeClass])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),t.hasMessage?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.ns.e("message"))},[e.renderSlot(t.$slots,"default",{},()=>[t.dangerouslyUseHTMLString?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.showInput?"label":"p"),{key:1,for:t.showInput?t.inputId:void 0,innerHTML:t.message},null,8,["for","innerHTML"])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.showInput?"label":"p"),{key:0,for:t.showInput?t.inputId:void 0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.dangerouslyUseHTMLString?"":t.message),1)]),_:1},8,["for"]))])],2)):e.createCommentVNode("v-if",!0)],2),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("input"))},[e.createVNode(r,{id:t.inputId,ref:"inputRef",modelValue:t.inputValue,"onUpdate:modelValue":ne=>t.inputValue=ne,type:t.inputType,placeholder:t.inputPlaceholder,"aria-invalid":t.validateError,class:e.normalizeClass({invalid:t.validateError}),onKeydown:e.withKeys(t.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("errormsg")),style:e.normalizeStyle({visibility:t.editorErrorMessage?"visible":"hidden"})},e.toDisplayString(t.editorErrorMessage),7)],2),[[e.vShow,t.showInput]])],10,["id"]),e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("btns"))},[t.showCancelButton?(e.openBlock(),e.createBlock(D,{key:0,loading:t.cancelButtonLoading,"loading-icon":t.cancelButtonLoadingIcon,class:e.normalizeClass([t.cancelButtonClass]),round:t.roundButton,size:t.btnSize,onClick:ne=>t.handleAction("cancel"),onKeydown:e.withKeys(e.withModifiers(ne=>t.handleAction("cancel"),["prevent"]),["enter"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelButtonText||t.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):e.createCommentVNode("v-if",!0),e.withDirectives(e.createVNode(D,{ref:"confirmRef",type:"primary",loading:t.confirmButtonLoading,"loading-icon":t.confirmButtonLoadingIcon,class:e.normalizeClass([t.confirmButtonClasses]),round:t.roundButton,disabled:t.confirmButtonDisabled,size:t.btnSize,onClick:ne=>t.handleAction("confirm"),onKeydown:e.withKeys(e.withModifiers(ne=>t.handleAction("confirm"),["prevent"]),["enter"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.confirmButtonText||t.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[e.vShow,t.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[e.vShow,t.visible]])]),_:3},8,["onAfterLeave"])}var lu=E._export_sfc(au,[["render",nu],["__file","index.vue"]]);const dn=new Map,ou=t=>{let o=document.body;return t.appendTo&&(E.isString(t.appendTo)&&(o=document.querySelector(t.appendTo)),E.isElement(t.appendTo)&&(o=t.appendTo),E.isElement(o)||(E.debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),o=document.body)),o},ru=(t,o,l=null)=>{const i=e.createVNode(lu,t,E.isFunction$1(t.message)||e.isVNode(t.message)?{default:E.isFunction$1(t.message)?t.message:()=>t.message}:null);return i.appContext=l,e.render(i,o),ou(t).appendChild(o.firstElementChild),i.component},su=()=>document.createElement("div"),iu=(t,o)=>{const l=su();t.onVanish=()=>{e.render(null,l),dn.delete(c)},t.onAction=v=>{const g=dn.get(c);let r;t.showInput?r={value:c.inputValue,action:v}:r=v,t.callback?t.callback(r,i.proxy):v==="cancel"||v==="close"?t.distinguishCancelAndClose&&v!=="cancel"?g.reject("close"):g.reject("cancel"):g.resolve(r)};const i=ru(t,l,o),c=i.proxy;for(const v in t)E.hasOwn(t,v)&&!E.hasOwn(c.$props,v)&&(v==="closeIcon"&&E.isObject$1(t[v])?c[v]=e.markRaw(t[v]):c[v]=t[v]);return c.visible=!0,c};function Ha(t,o=null){if(!E.isClient)return Promise.reject();let l;return E.isString(t)||e.isVNode(t)?t={message:t}:l=t.callback,new Promise((i,c)=>{const v=iu(t,o??Ha._context);dn.set(v,{options:t,callback:l,resolve:i,reject:c})})}const uu=["alert","confirm","prompt"],cu={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};uu.forEach(t=>{Ha[t]=du(t)});function du(t){return(o,l,i,c)=>{let v="";return E.isObject$1(l)?(i=l,v=""):E.isUndefined(l)?v="":v=l,Ha(Object.assign({title:v,message:o,type:"",...cu[t]},i,{boxType:t}),c)}}Ha.close=()=>{dn.forEach((t,o)=>{o.doClose()}),dn.clear()};Ha._context=null;const Aa=Ha;Aa.install=t=>{Aa._context=t._context,t.config.globalProperties.$msgbox=Aa,t.config.globalProperties.$messageBox=Aa,t.config.globalProperties.$alert=Aa.alert,t.config.globalProperties.$confirm=Aa.confirm,t.config.globalProperties.$prompt=Aa.prompt};const fl=Aa,$n=t=>t.match(/\((.*)\)/)[1],So={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200},trigger:{type:String,default:"click"}},setup(t){const o=t,l=e.ref(null),i=e.ref(!1),c=e.ref(null);return e.watch(()=>o==null?void 0:o.isVisible,()=>{i.value=o==null?void 0:o.isVisible},{deep:!0,immediate:!0}),e.watch(()=>c.value,()=>{e.nextTick(()=>{var v,g;(g=(v=l.value)==null?void 0:v.updatePopper)==null||g.call(v)})},{deep:!0,immediate:!0}),(v,g)=>{const r=e.resolveComponent("el-popover");return e.openBlock(),e.createBlock(r,{visible:i.value,"onUpdate:visible":g[0]||(g[0]=D=>i.value=D),trigger:o.trigger,title:o==null?void 0:o.title,placement:o==null?void 0:o.placement,width:o==null?void 0:o.width,ref_key:"popOverRef",ref:l},{reference:e.withCtx(()=>[e.createElementVNode("div",null,[e.renderSlot(v.$slots,"reference",{ref_key:"referenceRef",ref:c})])]),default:e.withCtx(()=>[e.createElementVNode("div",null,[e.renderSlot(v.$slots,"content")])]),_:3},8,["visible","trigger","title","placement","width"])}}};function pu(t,o,l,i={}){if(!t||!o||!l||l.length!==4)return;const c=t.getContext("2d");if(!c)return;const{color:v="rgba(255, 235, 59, 0.3)",strokeWidth:g=2,fillOpacity:r=.2}=i,D=t.getBoundingClientRect(),U=o.getBoundingClientRect(),re=o.naturalWidth,ne=o.naturalHeight,_e=U.width/re,ee=U.height/ne,x=Math.min(_e,ee),J=re*x,G=ne*x,fe=(D.width-J)/2,ae=(D.height-G)/2,F=l.map(([K,z])=>{const ce=fe+K*J,ye=ae+z*G;return{x:ce,y:ye}});c.clearRect(0,0,t.width,t.height),c.beginPath(),c.moveTo(F[0].x,F[0].y);for(let K=1;K<F.length;K++)c.lineTo(F[K].x,F[K].y);c.closePath();const L=v.replace(/[\d.]+\)$/,`${r})`);c.fillStyle=L,c.fill(),c.strokeStyle=v.replace(/[\d.]+\)$/,"1)"),c.lineWidth=g,c.stroke()}function za(t){if(!t)return;const o=t.getContext("2d");o&&o.clearRect(0,0,t.width,t.height)}function No(t,o){if(!t||!o)return null;const l=t[o];return!l||!l.bboxNorm||!Array.isArray(l.bboxNorm)||l.bboxNorm.length!==4?null:{bboxNorm:l.bboxNorm,imageName:l.imageName||""}}const fu={key:0,class:"img-preview-body"},vu={class:"img-preview-header"},hu={class:"img-header-left"},mu={class:"img-name"},gu={key:0,class:"img-header-right"},yu={class:"img-index"},bu={key:0,class:"img-thumb-list"},ku=["onClick"],Cu={key:1,class:"thumb-placeholder"},Eu={class:"thumb-name"},Su={class:"img-preview-container"},Nu={key:0,class:"img-placeholder"},wu={key:2,class:"img-placeholder"},xu={key:0},_u={key:1},Bu={key:1,class:"img-placeholder"},Tu=e.defineComponent({__name:"imgPreview",props:{visible:{type:Boolean,default:!1},images:{type:Array,default:()=>[]},defaultImageName:{type:String,default:""},fieldMeta:{type:Object,default:()=>({})},focusedFieldName:{type:String,default:""}},emits:["update:visible","close"],setup(t,{emit:o}){const l=t,i=o,c=e.computed({get:()=>l.visible,set:Ce=>i("update:visible",Ce)});let v=!1,g="",r=0,D=0,U=0,re=0,ne=0,_e=0,ee=null;const x=Ce=>{var Le,ct;const Se=(ct=(Le=Ce==null?void 0:Ce.target)==null?void 0:Le.closest)==null?void 0:ct.call(Le,".el-dialog");return Se||document.querySelector(".ocr-img-preview-dialog.el-dialog")},J=Ce=>{if(!Ce||Ce==="none")return{tx:0,ty:0};let Se=Ce.match(/matrix\(([^)]+)\)/);if(Se){const Le=Se[1].split(",").map(ct=>Number(ct.trim()));return{tx:(Le==null?void 0:Le[4])||0,ty:(Le==null?void 0:Le[5])||0}}if(Se=Ce.match(/matrix3d\(([^)]+)\)/),Se){const Le=Se[1].split(",").map(ct=>Number(ct.trim()));return{tx:(Le==null?void 0:Le[12])||0,ty:(Le==null?void 0:Le[13])||0}}return Se=Ce.match(/translate\(\s*([-\d.]+)px\s*,\s*([-\d.]+)px\s*\)/),Se?{tx:Number(Se[1])||0,ty:Number(Se[2])||0}:{tx:0,ty:0}},G=(Ce,Se,Le)=>{Ce.style.transform=`translate(${Se}px, ${Le}px)`},fe=(Ce,Se)=>{const Le=x(Ce);if(!Le)return;v=!0,ee=Le,g=Se,r=Ce.clientX,D=Ce.clientY;const ct=Le.getBoundingClientRect();U=ct.width,re=ct.height;const Ct=window.getComputedStyle(Le),{tx:$t,ty:Et}=J(Ct.transform);ne=$t,_e=Et,document.addEventListener("mousemove",ae),document.addEventListener("mouseup",F)},ae=Ce=>{if(!v||!ee)return;const Se=Ce.clientX-r,Le=Ce.clientY-D,ct=360,Ct=420;let $t=U,Et=re,mt=ne,da=_e;if(g.includes("right")&&($t=Math.max(ct,U+Se)),g.includes("bottom")&&(Et=Math.max(Ct,re+Le)),g.includes("left")){const Ve=U-Se;Ve<ct?($t=ct,mt=ne+(U-ct)):($t=Ve,mt=ne+Se)}if(g.includes("top")){const Ve=re-Le;Ve<Ct?(Et=Ct,da=_e+(re-Ct)):(Et=Ve,da=_e+Le)}ee.style.width=`${$t}px`,ee.style.height=`${Et}px`,G(ee,mt,da)},F=()=>{v=!1,g="",ee=null,document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",F)},L=e.ref([]),K=e.ref(!1);e.watch(()=>l.images,async Ce=>{if(!Array.isArray(Ce)||Ce.length===0){L.value=[];return}K.value=!0;const Se=[];for(const Le of Ce)if(Le.url&&!Le.url.startsWith("blob:")&&!Le.url.startsWith("http"))try{const ct=await Re.downloadFile(Le.url),Ct=URL.createObjectURL(ct);Se.push({...Le,blobUrl:Ct})}catch(ct){console.error(`Failed to load image for preview: ${Le.url}`,ct),Se.push({...Le,blobUrl:""})}else Se.push({...Le,blobUrl:Le.url});L.value=Se,K.value=!1},{deep:!0,immediate:!0});const z=e.ref(0),ce=e.ref(null),ye=e.ref(null),Te=e.computed(()=>L.value[z.value]||null),T=()=>{if(!L.value.length){z.value=0;return}if(l.defaultImageName){const Ce=L.value.findIndex(Se=>(Se==null?void 0:Se.name)===l.defaultImageName);z.value=Ce>=0?Ce:0}else z.value=0},We=Ce=>{if(!L.value.length)return;const Se=Math.max(0,Math.min(Ce,L.value.length-1));z.value=Se},He=()=>We(z.value-1),bt=()=>We(z.value+1),R=Ce=>{if(!Ce)return;const Se=L.value.findIndex(Le=>(Le==null?void 0:Le.name)===Ce);Se>=0&&(z.value=Se)},ut=()=>{if(!ye.value)return;const Ce=ye.value.parentElement;if(!Ce)return;const Se=Ce.getBoundingClientRect();ye.value.width=Se.width,ye.value.height=Se.height},Me=()=>{var ct,Ct;if(!ye.value||!ce.value||!l.focusedFieldName){ye.value&&za(ye.value);return}const Ce=(ct=ce.value.$el)==null?void 0:ct.querySelector("img");if(!Ce)return;if(!Ce.complete||Ce.naturalWidth===0){Ce.onload=()=>{e.nextTick(()=>{Me()})};return}const Se=((Ct=Te.value)==null?void 0:Ct.name)||"",Le=No(l.fieldMeta,l.focusedFieldName);if(!Le){za(ye.value);return}if(Le.imageName!==Se){za(ye.value);return}ut(),pu(ye.value,Ce,Le.bboxNorm)},se=()=>{e.nextTick(()=>{ut(),Me()})};e.watch(()=>l.focusedFieldName,()=>{if(!c.value)return;const Ce=No(l.fieldMeta,l.focusedFieldName);Ce!=null&&Ce.imageName&&R(Ce.imageName),e.nextTick(()=>{Me()})}),e.watch(()=>{var Ce;return(Ce=Te.value)==null?void 0:Ce.name},()=>{c.value&&e.nextTick(()=>{ye.value&&za(ye.value),Me()})}),e.watch(()=>l.visible,Ce=>{Ce?(T(),e.nextTick(()=>{ut(),Me()})):ye.value&&za(ye.value)}),e.watch(()=>l.defaultImageName,()=>{c.value&&T()});let we=null;e.onMounted(()=>{var Ce;typeof ResizeObserver<"u"&&(we=new ResizeObserver(()=>{ut(),e.nextTick(()=>{Me()})}),(Ce=ye.value)!=null&&Ce.parentElement&&we.observe(ye.value.parentElement))}),e.onUnmounted(()=>{we&&(we.disconnect(),we=null),document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",F)});const tt=()=>{ye.value&&za(ye.value),i("update:visible",!1),i("close")};return(Ce,Se)=>{const Le=e.resolveComponent("el-button"),ct=e.resolveComponent("el-image"),Ct=e.resolveComponent("Loading"),$t=e.resolveComponent("el-icon"),Et=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(Et,{modelValue:c.value,"onUpdate:modelValue":Se[8]||(Se[8]=mt=>c.value=mt),title:"文件预览",class:"ocr-img-preview-dialog",width:"460px",modal:!1,"modal-penetrable":!0,draggable:!0,overflow:!0,"append-to-body":"",onClose:tt},{default:e.withCtx(()=>{var mt,da;return[e.createElementVNode("div",{class:"resizable-handle top",onMousedown:Se[0]||(Se[0]=e.withModifiers(Ve=>fe(Ve,"top"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle right",onMousedown:Se[1]||(Se[1]=e.withModifiers(Ve=>fe(Ve,"right"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle bottom",onMousedown:Se[2]||(Se[2]=e.withModifiers(Ve=>fe(Ve,"bottom"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle left",onMousedown:Se[3]||(Se[3]=e.withModifiers(Ve=>fe(Ve,"left"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle top-left",onMousedown:Se[4]||(Se[4]=e.withModifiers(Ve=>fe(Ve,"top-left"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle top-right",onMousedown:Se[5]||(Se[5]=e.withModifiers(Ve=>fe(Ve,"top-right"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle bottom-left",onMousedown:Se[6]||(Se[6]=e.withModifiers(Ve=>fe(Ve,"bottom-left"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle bottom-right",onMousedown:Se[7]||(Se[7]=e.withModifiers(Ve=>fe(Ve,"bottom-right"),["stop"]))},null,32),Te.value?(e.openBlock(),e.createElementBlock("div",fu,[e.createElementVNode("div",vu,[e.createElementVNode("div",hu,[e.createElementVNode("span",mu,e.toDisplayString(Te.value.name?Te.value.name+(Te.value.url&&Te.value.url.lastIndexOf(".")!==-1?Te.value.url.substring(Te.value.url.lastIndexOf(".")):""):""),1)]),L.value.length>1?(e.openBlock(),e.createElementBlock("div",gu,[e.createVNode(Le,{size:"small",disabled:z.value===0,onClick:He},{default:e.withCtx(()=>Se[9]||(Se[9]=[e.createTextVNode("上一张")])),_:1,__:[9]},8,["disabled"]),e.createElementVNode("span",yu,e.toDisplayString(z.value+1)+" / "+e.toDisplayString(L.value.length),1),e.createVNode(Le,{size:"small",disabled:z.value===L.value.length-1,onClick:bt},{default:e.withCtx(()=>Se[10]||(Se[10]=[e.createTextVNode("下一张")])),_:1,__:[10]},8,["disabled"])])):e.createCommentVNode("",!0)]),L.value.length>1?(e.openBlock(),e.createElementBlock("div",bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(Ve,Na)=>(e.openBlock(),e.createElementBlock("div",{key:(Ve.name||"")+"-"+Na,class:e.normalizeClass(["img-thumb-item",{active:Na===z.value}]),onClick:Ka=>We(Na)},[Ve!=null&&Ve.blobUrl?(e.openBlock(),e.createBlock(ct,{key:0,src:Ve.blobUrl,fit:"cover",class:"thumb-image","preview-src-list":[Ve.blobUrl],"initial-index":0},null,8,["src","preview-src-list"])):(e.openBlock(),e.createElementBlock("div",Cu,"加载失败")),e.createElementVNode("div",Eu,e.toDisplayString(Ve.name||"-"),1)],10,ku))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Su,[K.value?(e.openBlock(),e.createElementBlock("div",Nu,[e.createVNode($t,{class:"is-loading"},{default:e.withCtx(()=>[e.createVNode(Ct)]),_:1}),Se[11]||(Se[11]=e.createElementVNode("span",null,"图片加载中...",-1))])):(mt=Te.value)!=null&&mt.blobUrl?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(ct,{ref_key:"imageRef",ref:ce,src:Te.value.blobUrl,fit:"contain",class:"preview-image","preview-src-list":[Te.value.blobUrl],onLoad:se},null,8,["src","preview-src-list"]),e.createElementVNode("canvas",{ref_key:"canvasRef",ref:ye,class:"highlight-canvas"},null,512)],64)):(e.openBlock(),e.createElementBlock("div",wu,[(da=Te.value)!=null&&da.url?(e.openBlock(),e.createElementBlock("span",xu,"图片加载失败")):(e.openBlock(),e.createElementBlock("span",_u,"暂无图片"))]))])])):(e.openBlock(),e.createElementBlock("div",Bu,"暂无图片"))]}),_:1},8,["modelValue"])}}}),Au=Da._export_sfc(Tu,[["__scopeId","data-v-ba7393bf"]]),Ou={class:"cert-preview-body"},Du={key:0,class:"pdf-preview-container"},Mu={class:"thumbs"},$u=["onClick"],Lu={class:"thumb-img"},Vu=["src"],Iu={key:1,class:"thumb-loading"},Pu={class:"thumb-title"},Ru={class:"viewer"},Uu={key:0,class:"viewer-img-wrap"},Fu=["src"],zu={key:1,class:"viewer-loading"},ju=e.defineComponent({__name:"CertificatePreview",props:{visible:{type:Boolean},versions:{}},emits:["update:visible"],setup(t,{emit:o}){const l=t,i=o,c=e.ref(""),v=e.ref(""),g=e.computed(()=>(l.versions||[]).find(x=>String(x.versionId)===String(c.value))),r=e.ref({}),D=e.ref(""),U=e.ref("证书附件.pdf"),re=()=>{try{Object.values(r.value||{}).forEach(x=>{x&&URL.revokeObjectURL(x)}),D.value&&URL.revokeObjectURL(D.value)}catch{}r.value={},D.value=""},ne=async x=>{if(!x||x.fileType==="pdf")return;const J=Array.isArray(x.images)?x.images:[];for(const G of J){const fe=G==null?void 0:G.url;if(!(!fe||r.value[fe]))try{const ae=await Re.downloadAvatarApi({url:fe}),F=URL.createObjectURL(ae.data);r.value={...r.value,[fe]:F}}catch{}}},_e=async x=>{if(!x||x.fileType!=="pdf"){D.value="";return}const J=x.sourceUrl||"";if(!J){D.value="";return}if(D.value){try{URL.revokeObjectURL(D.value)}catch{}D.value=""}try{const G=await Re.downloadAvatarApi({url:J}),fe=URL.createObjectURL(G.data);D.value=fe;const ae=x.certNo?String(x.certNo):"";U.value=ae?`${ae}.pdf`:"证书附件.pdf"}catch{D.value=""}};e.watch(()=>l.visible,async x=>{var G;if(!x){re();return}const J=(G=l.versions)==null?void 0:G[0];c.value=(J==null?void 0:J.versionId)||"",await ne(J),await _e(J)},{immediate:!0}),e.watch(()=>c.value,async()=>{var J,G;const x=g.value;if(!x){v.value="",D.value="";return}if(x.fileType==="pdf"){v.value="",await _e(x);return}D.value="",v.value=((G=(J=x.images)==null?void 0:J[0])==null?void 0:G.url)||"",await ne(x)},{immediate:!0});const ee=()=>{i("update:visible",!1),re()};return e.onBeforeUnmount(()=>{re()}),(x,J)=>{const G=e.resolveComponent("el-empty"),fe=e.resolveComponent("el-tab-pane"),ae=e.resolveComponent("el-tabs"),F=e.resolveComponent("el-button"),L=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(L,{"model-value":x.visible,title:"证书附件预览",width:"1100px","close-on-click-modal":!1,onClose:ee},{footer:e.withCtx(()=>[e.createVNode(F,{id:"themeBorderButton",onClick:ee},{default:e.withCtx(()=>J[1]||(J[1]=[e.createTextVNode("关闭")])),_:1,__:[1]})]),default:e.withCtx(()=>[x.versions&&x.versions.length>0?(e.openBlock(),e.createBlock(ae,{key:0,modelValue:c.value,"onUpdate:modelValue":J[0]||(J[0]=K=>c.value=K),type:"card",class:"cert-version-tabs"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.versions,K=>(e.openBlock(),e.createBlock(fe,{key:K.versionId,name:K.versionId,label:K.label},{default:e.withCtx(()=>[e.createElementVNode("div",Ou,[K.fileType==="pdf"?(e.openBlock(),e.createElementBlock("div",Du,[D.value?(e.openBlock(),e.createBlock(Ft.SsFilePreview,{key:1,fileName:U.value,blobUrl:D.value},null,8,["fileName","blobUrl"])):(e.openBlock(),e.createBlock(G,{key:0,description:"加载中"}))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Mu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.images||[],z=>(e.openBlock(),e.createElementBlock("div",{key:z.url,class:e.normalizeClass(["thumb",{active:z.url===v.value}]),onClick:ce=>v.value=z.url},[e.createElementVNode("div",Lu,[r.value[z.url]?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.value[z.url]},null,8,Vu)):(e.openBlock(),e.createElementBlock("div",Iu,"加载中"))]),e.createElementVNode("div",Pu,e.toDisplayString(z.name),1)],10,$u))),128))]),e.createElementVNode("div",Ru,[v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[r.value[v.value]?(e.openBlock(),e.createElementBlock("div",Uu,[e.createElementVNode("img",{class:"viewer-img",src:r.value[v.value]},null,8,Fu)])):(e.openBlock(),e.createElementBlock("div",zu,"加载中"))],64)):(e.openBlock(),e.createBlock(G,{key:0,description:"暂无图片"}))])],64))])]),_:2},1032,["name","label"]))),128))]),_:1},8,["modelValue"])):(e.openBlock(),e.createBlock(G,{key:1,description:"暂无可预览的证书附件"}))]),_:1},8,["model-value"])}}}),Hu=Da._export_sfc(ju,[["__scopeId","data-v-daf2bb2b"]]),Ku={class:"ocr-candidate-wrap"},Wu={class:"ocr-candidate-left"},qu={key:0},Yu={key:1},Gu={key:2},Ju={key:3},Xu={key:0,class:"ocr-candidate-right"},Qu={class:"ocr-candidate-actions"},Zu={class:"dialog-footer"},ec={__name:"OCRCandidateDialog",props:{visible:{type:Boolean,default:!1},candidates:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},nameProp:{type:String,default:""},mfrProp:{type:String,default:""}},emits:["update:visible","submit"],setup(t,{emit:o}){const l=(ae=[])=>{const F=[],L=K=>{(K||[]).forEach(z=>{if(!z)return;const ce=z.children||z.childrens||z.columns;Array.isArray(ce)&&ce.length>0?L(ce):F.push(z)})};return L(ae),F},i=t,c=o,v=e.ref([]),g=e.ref(0),r=e.ref("");e.watch(()=>i.candidates,ae=>{var F,L;v.value=(ae||[]).map(K=>({...K,selectedTargetId:(K==null?void 0:K.selectedTargetId)||"",__decision:K==null?void 0:K.__decision})),g.value=0,r.value=((L=(F=v.value)==null?void 0:F[0])==null?void 0:L.selectedTargetId)||""},{immediate:!0,deep:!0}),e.watch(()=>i.visible,ae=>{var F,L;ae&&(g.value=0,r.value=((L=(F=v.value)==null?void 0:F[0])==null?void 0:L.selectedTargetId)||"")});const D=e.computed(()=>{var F;const ae=Number(g.value||0);return((F=v.value||[])==null?void 0:F[ae])||null}),U=e.computed(()=>(l(i.columns||[])||[]).filter(L=>L&&L.prop).filter(L=>L.type!=="operate"&&L.label!=="操作"&&L.prop!=="operate")),re=ae=>{if(!ae)return;const F=(v.value||[]).findIndex(L=>(L==null?void 0:L.idx)===(ae==null?void 0:ae.idx));F>-1&&(g.value=F,r.value=(ae==null?void 0:ae.selectedTargetId)||"")},ne=ae=>{if(!ae){r.value="";return}r.value=String((ae==null?void 0:ae.id)??"")},_e=(ae,F="")=>{const L=Number(g.value||0),K=v.value||[],z=K[L];z&&(z.__decision=ae,z.selectedTargetId=F,r.value=F,v.value=[...K])},ee=()=>_e("skip",""),x=()=>_e("add",""),J=()=>{if(!r.value){E.ElMessage.warning("请先选择要替换的目标记录");return}_e("replace",r.value)},G=()=>{c("update:visible",!1)},fe=()=>{const ae=v.value||[];if(ae.find(L=>(L==null?void 0:L.__decision)==="replace"&&!(L!=null&&L.selectedTargetId))){E.ElMessage.warning("存在“替换”但未选择目标记录的条目,请处理后再提交");return}c("submit",ae),c("update:visible",!1)};return(ae,F)=>{const L=e.resolveComponent("el-table-column"),K=e.resolveComponent("el-table"),z=e.resolveComponent("el-button"),ce=e.resolveComponent("el-alert");return e.openBlock(),e.createBlock(Sa.ssDialog,{title:"OCR候选匹配",visible:t.visible,"close-on-click-modal":!1,width:"90%",style:{maxWidth:"1200px"},onBeforeDestroy:G},{default:e.withCtx(()=>{var ye,Te;return[e.createElementVNode("div",Ku,[e.createElementVNode("div",Wu,[F[0]||(F[0]=e.createElementVNode("div",{class:"ocr-candidate-title"},"待处理OCR行(可跳过)",-1)),e.createVNode(K,{data:v.value,border:"",stripe:"","max-height":"420",style:{width:"100%"},"highlight-current-row":"",onCurrentChange:re},{default:e.withCtx(()=>[e.createVNode(L,{type:"index",label:"序号",width:"60"}),e.createVNode(L,{label:"编号","min-width":"140"},{default:e.withCtx(({row:T})=>[e.createTextVNode(e.toDisplayString((T==null?void 0:T.ocrNo)||"-"),1)]),_:1}),e.createVNode(L,{label:"候选数",width:"90"},{default:e.withCtx(({row:T})=>[e.createTextVNode(e.toDisplayString(((T==null?void 0:T.candidates)||[]).length),1)]),_:1}),e.createVNode(L,{label:"处理状态",width:"120"},{default:e.withCtx(({row:T})=>[(T==null?void 0:T.__decision)==="replace"?(e.openBlock(),e.createElementBlock("span",qu,"替换")):(T==null?void 0:T.__decision)==="add"?(e.openBlock(),e.createElementBlock("span",Yu,"新增")):(T==null?void 0:T.__decision)==="skip"?(e.openBlock(),e.createElementBlock("span",Gu,"跳过")):(e.openBlock(),e.createElementBlock("span",Ju,"未处理"))]),_:1})]),_:1},8,["data"])]),v.value&&v.value.length>0?(e.openBlock(),e.createElementBlock("div",Xu,[F[4]||(F[4]=e.createElementVNode("div",{class:"ocr-candidate-title"},"当前行候选记录(同编号)",-1)),e.createElementVNode("div",Qu,[e.createVNode(z,{id:"themeBorderButton",onClick:ee},{default:e.withCtx(()=>F[1]||(F[1]=[e.createTextVNode("跳过本行")])),_:1,__:[1]}),e.createVNode(z,{id:"themeBorderButton",onClick:x},{default:e.withCtx(()=>F[2]||(F[2]=[e.createTextVNode("新增本行")])),_:1,__:[2]}),e.createVNode(z,{class:"ok-button",id:"themeButton",onClick:J,disabled:!r.value},{default:e.withCtx(()=>F[3]||(F[3]=[e.createTextVNode("替换选中记录")])),_:1,__:[3]},8,["disabled"])]),(((ye=D.value)==null?void 0:ye.candidates)||[]).length===0?(e.openBlock(),e.createBlock(ce,{key:0,title:"该编号暂无候选记录,可选择“新增本行”或“跳过本行”。",type:"info",closable:!1,"show-icon":"",style:{margin:"8px 0"}})):e.createCommentVNode("",!0),e.createVNode(K,{data:((Te=D.value)==null?void 0:Te.candidates)||[],border:"",stripe:"","max-height":"360",style:{width:"100%"},onCurrentChange:ne,"highlight-current-row":""},{default:e.withCtx(()=>[e.createVNode(L,{type:"index",label:"序号",width:"60"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,T=>(e.openBlock(),e.createBlock(L,{key:T.prop,label:T.label,prop:T.prop,"min-width":T.minWidth||160},null,8,["label","prop","min-width"]))),128))]),_:1},8,["data"])])):e.createCommentVNode("",!0)])]}),footer:e.withCtx(()=>[e.createElementVNode("div",Zu,[e.createVNode(z,{id:"themeBorderButton",onClick:G},{default:e.withCtx(()=>F[5]||(F[5]=[e.createTextVNode("取消")])),_:1,__:[5]}),e.createVNode(z,{class:"ok-button",id:"themeButton",onClick:fe},{default:e.withCtx(()=>F[6]||(F[6]=[e.createTextVNode("提交已处理")])),_:1,__:[6]})])]),_:1},8,["visible"])}}},tc=Da._export_sfc(ec,[["__scopeId","data-v-8c9b4cd2"]]),ac={class:"ocr-preview-content"},nc={class:"ocr-preview-tip"},lc={class:"ocr-preview-table"},oc={style:{display:"flex","align-items":"center",gap:"8px"}},rc={class:"dialog-footer"},sc={__name:"OCRResultPreviewDialog",props:{visible:{type:Boolean,default:!1},ocrPreviewData:{type:Array,default:()=>[]},ocrPreviewColumns:{type:Array,default:()=>[]},ocrSelectedFields:{type:Array,default:()=>[]}},emits:["update:visible","update:ocrPreviewData","update:ocrSelectedFields","confirm","fieldChange"],setup(t,{emit:o}){const l=t,i=o,c=e.ref([]),v=e.ref([]),g=e.ref([]);e.watch(()=>l.visible,ee=>{ee&&(c.value=JSON.parse(JSON.stringify(l.ocrPreviewData)),v.value=JSON.parse(JSON.stringify(l.ocrPreviewColumns)),g.value=[...l.ocrSelectedFields])});const r=(ee,x)=>{const J=[...g.value];if(x)J.includes(ee)||J.push(ee);else{const G=J.indexOf(ee);G>-1&&J.splice(G,1)}g.value=J,i("update:ocrSelectedFields",J)},D=(ee,x,J)=>{i("fieldChange",{rowIndex:ee,prop:x,value:J})},U=()=>{i("update:ocrPreviewData",c.value),i("confirm",c.value),i("update:visible",!1)},re=()=>{i("update:visible",!1)},ne=ee=>typeof ee!="number"?"-":`${(ee*100).toFixed(1)}%`,_e=ee=>typeof ee!="number"?"#606266":ee>=.9?"#67c23a":ee>=.7?"#e6a23c":"#f56c6c";return(ee,x)=>{const J=e.resolveComponent("el-alert"),G=e.resolveComponent("el-table-column"),fe=e.resolveComponent("el-checkbox"),ae=e.resolveComponent("el-input"),F=e.resolveComponent("el-table"),L=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(Sa.ssDialog,{title:"OCR识别结果预览",visible:t.visible,onBeforeDestroy:re,width:"90%",style:{maxWidth:"1200px"}},{default:e.withCtx(()=>[e.createElementVNode("div",ac,[e.createElementVNode("div",nc,[e.createVNode(J,{title:"请核对识别结果。系统将按 编号+名称+制造厂 规则匹配并替换;未唯一命中但有编号的,将进入候选选择;无编号则直接新增。",type:"info",closable:!1,"show-icon":""})]),e.createElementVNode("div",lc,[e.createVNode(F,{data:c.value,border:"",stripe:"","max-height":"400",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(G,{type:"index",label:"序号",width:"60",fixed:""}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,K=>(e.openBlock(),e.createBlock(G,{key:K.prop,prop:K.prop,"min-width":K.minWidth||230,"class-name":K.isAccuracy?"accuracy-column":""},{header:e.withCtx(()=>[e.createElementVNode("div",oc,[K.isAccuracy?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(fe,{key:0,"model-value":g.value.includes(K.prop),onChange:z=>r(K.prop,z),onClick:x[0]||(x[0]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onChange"])),e.createElementVNode("span",null,e.toDisplayString(K.label),1)])]),default:e.withCtx(({row:z,$index:ce})=>[K.isAccuracy?(e.openBlock(),e.createElementBlock("span",{key:0,class:"accuracy-value",style:e.normalizeStyle({color:_e(z[K.prop]),fontWeight:500})},e.toDisplayString(ne(z[K.prop])),5)):(e.openBlock(),e.createBlock(ae,{key:1,modelValue:z[K.prop],"onUpdate:modelValue":ye=>z[K.prop]=ye,size:"small",placeholder:"请输入"+K.label,onChange:ye=>D(ce,K.prop,ye)},null,8,["modelValue","onUpdate:modelValue","placeholder","onChange"]))]),_:2},1032,["prop","min-width","class-name"]))),128))]),_:1},8,["data"])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",rc,[e.createVNode(L,{onClick:re,id:"themeBorderButton"},{default:e.withCtx(()=>x[1]||(x[1]=[e.createTextVNode("取消")])),_:1,__:[1]}),e.createVNode(L,{class:"ok-button",onClick:U,id:"themeButton"},{default:e.withCtx(()=>x[2]||(x[2]=[e.createTextVNode("确认")])),_:1,__:[2]})])]),_:1},8,["visible"])}}},ic=Da._export_sfc(sc,[["__scopeId","data-v-df66eb1f"]]),uc={key:0,class:"extra-button-content"},cc={class:"table-operator-wrap"},dc={key:0,class:"extra-button-filter"},pc={class:"form-content-value"},fc={key:1,class:"extra-header"},vc=["onClick"],hc={class:"table-op-text"},mc={class:"table-op-text"},gc={class:"drop-menu",style:{width:"120px"}},yc=["onClick"],bc={key:0},kc={key:1},Cc=["onClick"],Ec={class:"table-op-text"},Sc={key:1,class:"extra-button-content tabs-button-wrapper"},Nc={class:"table-operator-wrap"},wc={class:"extra-button-filter"},xc={class:"form-content-value"},_c={key:0,class:"extra-header"},Bc={class:"table-op-action"},Tc={class:"table-op-text"},Ac={class:"drop-menu",style:{width:"120px"}},Oc={key:0},Dc={key:1},Mc=["onClick"],$c={class:"table-op-text"},Lc={__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(t,{emit:o}){const l=o,i=t,c=e.ref(""),v=e.ref(!1),g=e.ref([]),r=e.ref([{label:"清空",background:"#999999"},{label:"确认"}]),D=[{label:"新增",icon:"new"},{label:"导入",icon:"import_101"},{label:"导出",icon:"export_101"},{label:"OCR识别",icon:"OCR识别"},{label:"切换视图",icon:"cardViewport_101"}],U=F=>{const L=F.raw;if(!L)return;const K=new FileReader;K.onload=z=>{try{const ce=new Uint8Array(z.target.result),ye=Re.readSync(ce,{type:"array"}),Te=ye.SheetNames[0],T=ye.Sheets[Te],He=Re.utils.decode_range(T["!ref"]).e.c+1,bt=new Array(He).fill(""),R=[];for(const Me in T){if(Me[0]==="!")continue;const{r:se,c:we}=Re.utils.decode_cell(Me);let tt=T[Me].v;if(T[Me].t==="n"&&tt>0&&tt<1e6&&(tt=new Date((tt-25569)*86400*1e3).toISOString().split("T")[0]),(tt==null||tt==="")&&(tt=""),se===0)bt[we]=tt;else{if(!R[se-1]){R[se-1]={};for(let Ce=0;Ce<He;Ce++)R[se-1][`col_${Ce}`]=""}R[se-1][`col_${we}`]=tt}}for(let Me=0;Me<He;Me++)bt[Me]===void 0&&(bt[Me]="");const ut=R==null?void 0:R[0];if(!(ut!=null&&ut.hasOwnProperty("col_0")))return E.ElMessage.error("导入的数据列不匹配,请检查是否错位");l("getImportData",bt,R)}catch(ce){throw E.ElMessage.error(ce.message),new Error(ce.message)}},K.readAsArrayBuffer(L)},re=F=>{var K;const L=(K=g.value)==null?void 0:K.reduce((z,ce,ye)=>(ye===0?z[ce.label]=F:z[ce.label]=ce==null?void 0:ce.value,z),{});l("filter",L,F,!0)},ne=(F,L={})=>{l("buttonClick",F,"",L)},_e=F=>{var L,K;g.value=(K=(L=Re.getColumnChild(de.cloneDeep(F)))==null?void 0:L.filter(z=>(z==null?void 0:z.label)!==""&&(z==null?void 0:z.label)!=="操作"))==null?void 0:K.map(z=>({label:(z==null?void 0:z.label)??"",value:"",name:(z==null?void 0:z.label)??"",isFormColHidden:z==null?void 0:z.isTableColHidden,width:2}))},ee=e.ref(!1),x=F=>{var L;if((F==null?void 0:F.buttonName)==="确认"&&(l("filter",F==null?void 0:F.content),ee.value=(F==null?void 0:F.content)&&Object.values(F==null?void 0:F.content).length>0),(F==null?void 0:F.buttonName)==="清空"){const K=de.cloneDeep(F==null?void 0:F.content);for(const z in K)K[z]="";g.value=(L=g.value)==null?void 0:L.map(z=>({...z,value:""})),l("filter",K),ee.value=!1}v.value=!1},J=()=>{v.value=!v.value},G=()=>{var L,K;g.value=(L=g.value)==null?void 0:L.map(z=>({...z,value:""}));const F=(K=g.value)==null?void 0:K.reduce((z,ce)=>(z[ce.label]=ce.value,z),{});l("filter",F)},fe=e.ref(null);let ae;return ae=F=>{var ce;if(!v.value)return;const L=(ce=fe==null?void 0:fe.value)==null?void 0:ce.$el,K=L==null?void 0:L.contains(F.target);let z=!1;document.querySelectorAll(".el-popover, .el-popper").forEach(ye=>{ye.contains(F.target)&&(z=!0)}),!K&&!z&&(v.value=!1)},e.onMounted(()=>{document.addEventListener("click",ae),_e(i.columns)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",ae)}),e.watch(()=>i.columns,()=>{_e(i.columns)},{deep:!0,immediate:!0}),(F,L)=>{var T,We,He,bt;const K=e.resolveComponent("el-icon"),z=e.resolveComponent("svg-icon"),ce=e.resolveComponent("el-input"),ye=e.resolveComponent("el-upload"),Te=e.resolveComponent("el-button");return t.pageLayout==="vertical"?(e.openBlock(),e.createElementBlock("div",uc,[e.createElementVNode("div",{class:e.normalizeClass(t.compName?"table-name-wrap":""),style:e.normalizeStyle({background:(i==null?void 0:i.level)>1?"transparent":"var(--ssgroup-background)",paddingLeft:((i==null?void 0:i.level)-1)*12+"px",fontWeight:600-((i==null?void 0:i.level)-1)*100>=400?600-((i==null?void 0:i.level)-1)*100:400,fontSize:17-(i==null?void 0:i.level)>=14?17-(i==null?void 0:i.level)+"px":"14px"})},e.toDisplayString(t.compName),7),e.createElementVNode("div",cc,[i!=null&&i.filterShow?(e.openBlock(),e.createElementBlock("div",dc,[e.createVNode(So,{trigger:"manual",ref_key:"popOverRef",ref:fe,title:"",width:800,placement:"bottom-start",isVisible:v.value,"onUpdate:isVisible":L[1]||(L[1]=R=>v.value=R)},{reference:e.withCtx(()=>{var R,ut,Me,se;return[e.createVNode(ce,{modelValue:c.value,"onUpdate:modelValue":L[0]||(L[0]=we=>c.value=we),style:{"min-width":"80px"},placeholder:ee.value?(Me=(ut=(R=t.filterValues)==null?void 0:R.filter(we=>we))==null?void 0:ut.slice(0,3))==null?void 0:Me.join("/"):"搜索","prefix-icon":e.unref(E.search_default),clearable:"",onInput:re,disabled:((se=g.value)==null?void 0:se.length)===0},{suffix:e.withCtx(()=>{var we,tt;return[!c.value&&((tt=(we=t.filterValues)==null?void 0:we.filter(Ce=>Ce))!=null&&tt.join("/"))?(e.openBlock(),e.createBlock(K,{key:0,style:{cursor:"pointer"},onClick:G},{default:e.withCtx(()=>[e.createVNode(e.unref(E.circle_close_default))]),_:1})):e.createCommentVNode("",!0)]}),append:e.withCtx(()=>[e.createElementVNode("span",{title:"条件查询",onClick:e.withModifiers(J,["stop"])},[e.createVNode(z,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:e.withCtx(()=>[e.createElementVNode("div",pc,[(e.openBlock(),e.createBlock(Ft.ssForm,{rowContents:g.value,buttonValue:r.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:r.value,isStartJustify:!1,onOnButtonClick:x},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])])):e.createCommentVNode("",!0),t.buttons&&((T=t.buttons)==null?void 0:T.length)>0?(e.openBlock(),e.createElementBlock("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((We=t.buttons)==null?void 0:We.filter(R=>t.isDevMode||(R==null?void 0:R.label)!=="修改模板"),(R,ut)=>{var Me;return e.openBlock(),e.createElementBlock("div",{class:"extra-contents",key:ut},[(R==null?void 0:R.type)==="upload"?(e.openBlock(),e.createBlock(ye,{key:0,class:"upload-button-wrap","on-change":U,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1,disabled:!!t.lockingPage},{default:e.withCtx(()=>{var se;return[e.createElementVNode("div",{class:e.normalizeClass(["table-op-action",{"is-disabled":!!t.lockingPage}]),onClick:we=>ne(R==null?void 0:R.label)},[e.createVNode(z,{class:"table-op-icon",name:(se=D==null?void 0:D.find(we=>(we==null?void 0:we.label)===(R==null?void 0:R.label)))==null?void 0:se.icon},null,8,["name"]),e.createElementVNode("span",hc,e.toDisplayString(R==null?void 0:R.label),1)],10,vc)]}),_:2},1032,["disabled"])):e.createCommentVNode("",!0),(R==null?void 0:R.type)==="popover"?(e.openBlock(),e.createBlock(Ft._sfc_main,{key:1},{dropTitle:e.withCtx(()=>{var se;return[(R==null?void 0:R.type)==="popover"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["table-op-action",{"is-disabled":!!t.lockingPage}])},[e.createVNode(z,{class:"table-op-icon",name:(se=D==null?void 0:D.find(we=>(we==null?void 0:we.label)===(R==null?void 0:R.label)))==null?void 0:se.icon},null,8,["name"]),e.createElementVNode("span",mc,e.toDisplayString(R==null?void 0:R.label),1)],2)):e.createCommentVNode("",!0)]}),dropMenu:e.withCtx(()=>[e.createElementVNode("div",gc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R==null?void 0:R.contents,se=>{var we,tt;return e.openBlock(),e.createElementBlock("div",{key:se==null?void 0:se.label,class:e.normalizeClass(["table-op-drop-item",{"is-disabled":!!t.lockingPage}]),onClick:Ce=>!t.lockingPage&&ne(se==null?void 0:se.label)},[e.createTextVNode(e.toDisplayString(se==null?void 0:se.label),1),(we=se==null?void 0:se.label)!=null&&we.includes("选中")?(e.openBlock(),e.createElementBlock("span",bc,"("+e.toDisplayString(t.selectNums)+")",1)):e.createCommentVNode("",!0),(tt=se==null?void 0:se.label)!=null&&tt.includes("全部")?(e.openBlock(),e.createElementBlock("span",kc,"("+e.toDisplayString(t.dataNums)+")",1)):e.createCommentVNode("",!0)],10,yc)}),128))])]),_:2},1024)):e.createCommentVNode("",!0),!(R!=null&&R.type)||(R==null?void 0:R.type)==="methodButton"?(e.openBlock(),e.createElementBlock("div",{key:2,id:"themeButton",class:e.normalizeClass(["table-op-action",{"is-disabled":!!t.lockingPage}]),onClick:se=>!t.lockingPage&&ne(R==null?void 0:R.label,R)},[e.createVNode(z,{class:"table-op-icon",name:(Me=D==null?void 0:D.find(se=>(se==null?void 0:se.label)===(R==null?void 0:R.label)))==null?void 0:Me.icon},null,8,["name"]),e.createElementVNode("span",Ec,e.toDisplayString(R==null?void 0:R.label),1)],10,Cc)):e.createCommentVNode("",!0)])}),128))])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",Sc,[e.createElementVNode("div",Nc,[e.createElementVNode("div",wc,[e.createVNode(So,{trigger:"manual",ref_key:"popOverRef",ref:fe,title:"",width:800,placement:"bottom-start",isVisible:v.value,"onUpdate:isVisible":L[3]||(L[3]=R=>v.value=R)},{reference:e.withCtx(()=>{var R,ut,Me,se;return[e.createVNode(ce,{modelValue:c.value,"onUpdate:modelValue":L[2]||(L[2]=we=>c.value=we),style:{"min-width":"80px"},placeholder:ee.value?(Me=(ut=(R=t.filterValues)==null?void 0:R.filter(we=>we))==null?void 0:ut.slice(0,3))==null?void 0:Me.join("/"):"搜索","prefix-icon":e.unref(E.search_default),clearable:"",onInput:re,disabled:((se=g.value)==null?void 0:se.length)===0},{suffix:e.withCtx(()=>{var we,tt;return[!c.value&&((tt=(we=t.filterValues)==null?void 0:we.filter(Ce=>Ce))!=null&&tt.join("/"))?(e.openBlock(),e.createBlock(K,{key:0,style:{cursor:"pointer"},onClick:G},{default:e.withCtx(()=>[e.createVNode(e.unref(E.circle_close_default))]),_:1})):e.createCommentVNode("",!0)]}),append:e.withCtx(()=>[e.createElementVNode("span",{title:"条件查询",onClick:e.withModifiers(J,["stop"])},[e.createVNode(z,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:e.withCtx(()=>[e.createElementVNode("div",xc,[(e.openBlock(),e.createBlock(Ft.ssForm,{rowContents:g.value,buttonValue:r.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:r.value,isStartJustify:!1,onOnButtonClick:x},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),t.buttons&&((He=t.buttons)==null?void 0:He.length)>0?(e.openBlock(),e.createElementBlock("div",_c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((bt=t.buttons)==null?void 0:bt.filter(R=>t.isDevMode||(R==null?void 0:R.label)!=="修改模板"),(R,ut)=>{var Me;return e.openBlock(),e.createElementBlock("div",{class:"extra-contents",key:ut},[(R==null?void 0:R.type)==="upload"?(e.openBlock(),e.createBlock(ye,{key:0,class:"upload-button-wrap","on-change":U,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1},{default:e.withCtx(()=>{var se;return[e.createElementVNode("div",Bc,[e.createVNode(z,{class:"table-op-icon",name:(se=D==null?void 0:D.find(we=>(we==null?void 0:we.label)===(R==null?void 0:R.label)))==null?void 0:se.icon},null,8,["name"]),e.createElementVNode("span",Tc,e.toDisplayString(R==null?void 0:R.label),1)])]}),_:2},1024)):e.createCommentVNode("",!0),(R==null?void 0:R.type)==="popover"?(e.openBlock(),e.createBlock(Ft._sfc_main,{key:1},{dropTitle:e.withCtx(()=>[(R==null?void 0:R.type)==="popover"?(e.openBlock(),e.createBlock(Te,{key:0,style:{background:"transparent",color:"#000000"}},{icon:e.withCtx(()=>{var se;return[e.createVNode(z,{class:"table-op-icon",name:(se=D==null?void 0:D.find(we=>(we==null?void 0:we.label)===(R==null?void 0:R.label)))==null?void 0:se.icon},null,8,["name"])]}),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(R==null?void 0:R.label),1)]),_:2},1024)):e.createCommentVNode("",!0)]),dropMenu:e.withCtx(()=>[e.createElementVNode("div",Ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R==null?void 0:R.contents,se=>(e.openBlock(),e.createBlock(Te,{key:se==null?void 0:se.label,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:we=>ne(se==null?void 0:se.label)},{default:e.withCtx(()=>{var we,tt;return[e.createTextVNode(e.toDisplayString(se==null?void 0:se.label),1),(we=se==null?void 0:se.label)!=null&&we.includes("选中")?(e.openBlock(),e.createElementBlock("span",Oc,"("+e.toDisplayString(t.selectNums)+")",1)):e.createCommentVNode("",!0),(tt=se==null?void 0:se.label)!=null&&tt.includes("全部")?(e.openBlock(),e.createElementBlock("span",Dc,"("+e.toDisplayString(t.dataNums)+")",1)):e.createCommentVNode("",!0)]}),_:2},1032,["onClick"]))),128))])]),_:2},1024)):e.createCommentVNode("",!0),!(R!=null&&R.type)||(R==null?void 0:R.type)==="methodButton"?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["table-op-action",{"is-disabled":!!t.lockingPage}]),id:"themeButton",onClick:se=>!t.lockingPage&&ne(R==null?void 0:R.label,R)},[e.createVNode(z,{class:"table-op-icon",name:(Me=D==null?void 0:D.find(se=>(se==null?void 0:se.label)===(R==null?void 0:R.label)))==null?void 0:Me.icon},null,8,["name"]),e.createElementVNode("span",$c,e.toDisplayString(R==null?void 0:R.label),1)],10,Mc)):e.createCommentVNode("",!0)])}),128))])):e.createCommentVNode("",!0)])]))}}},Vc=Da._export_sfc(Lc,[["__scopeId","data-v-9d73f66c"]]),Po=de.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(t){this.selectArray=t},setSelectString(t){this.selectString=t}}}),Ic={class:"calculator-content"},Pc={class:"calculator-child"},Rc={class:"calculator-child"},Uc=e.defineComponent({__name:"calculator",setup(t){const o=e.ref(),l=e.ref();return e.onMounted(()=>{o.value=[{type:"Upload",label:"输入",name:"input"}],l.value=[{type:"Upload",label:"输出",name:"output"}]}),(i,c)=>(e.openBlock(),e.createElementBlock("div",Ic,[e.createElementVNode("div",Pc,[e.createVNode(Ft.ssForm,{rowContents:o.value,isRowFlex:!0},null,8,["rowContents"])]),e.createElementVNode("div",Rc,[e.createVNode(Ft.ssForm,{rowContents:l.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),Fc=Da._export_sfc(Uc,[["__scopeId","data-v-73db0fe7"]]),vl=(t,o)=>{let l=t,i=o;return Array.isArray(l)&&(l=l==null?void 0:l.map((c,v)=>{if(Array.isArray(c)){let g={};return c=c==null?void 0:c.forEach((r,D)=>{var U;(U=i==null?void 0:i[D])!=null&&U.prop?g[i[D].prop]=r:Array.isArray(r)&&(g.children=vl(r,i))}),Object.assign(g,{id:v})}else return c})),l},Ro=(t,o,l)=>{let i=t,c=o;return i=i==null?void 0:i.map((v,g)=>{var r,D;return!Array.isArray(v)||!((r=c==null?void 0:c[g])!=null&&r.label)&&!l||(v.unshift(((D=c==null?void 0:c[g])==null?void 0:D.label)??""),v.some(U=>Array.isArray(U))&&(v=v==null?void 0:v.map(U=>{var re;return Array.isArray(U)&&(U=Ro(U,(re=c==null?void 0:c[g])==null?void 0:re.children,l)),U}))),v}),i},zc=(t,o,l)=>{if(o==="")return t==null?void 0:t.filter(i=>(i==null?void 0:i.id)!==l);{const i=o.split("-");return jc(t,i,l)}},jc=(t,o,l)=>{let i=t,c=o;return(c==null?void 0:c.length)===0?i=i==null?void 0:i.filter(v=>v.id!==l):i=i==null?void 0:i.map(v=>(v.id.toString()===(c==null?void 0:c[0])&&(c==null||c.shift(),v=Uo(v,c,l)),v)),i},Uo=(t,o,l)=>{var v,g;let i=t,c=o;return(c==null?void 0:c.length)===0?i.children=(v=i.children)==null?void 0:v.filter(r=>r.id!==l):i.children=(g=i.children)==null?void 0:g.map(r=>(r.id.toString()===(c==null?void 0:c[0])&&(c==null||c.shift(),r=Uo(r,c,l)),r)),i},Hc=(t,o,l)=>{if(o==="")return l;{const i=o.split("-");return Kc(t,i,l)}},Kc=(t,o,l)=>{let i=t,c=o;return(c==null?void 0:c.length)===0?i=l:i=i==null?void 0:i.map(v=>(v.id.toString()===(c==null?void 0:c[0])&&(c==null||c.shift(),v=Fo(v,c,l)),v)),i},Fo=(t,o,l)=>{var v;let i=t,c=o;return(c==null?void 0:c.length)===0?i.children=l:i.children=(v=i.children)==null?void 0:v.map(g=>(g.id.toString()===(c==null?void 0:c[0])&&(c==null||c.shift(),g=Fo(g,c,l)),g)),i};class Wc{constructor(o={}){Jt(this,"url");Jt(this,"heartbeatInterval");Jt(this,"socket",null);Jt(this,"isConnected",!1);Jt(this,"heartTimer",null);Jt(this,"canvas",null);Jt(this,"ctx",null);Jt(this,"mainCamCutMode",0);Jt(this,"pMainShowStartX",0);Jt(this,"pMainShowStartY",0);Jt(this,"onLog");Jt(this,"onDevCount");Jt(this,"onCameraStatus");Jt(this,"onPhoto");this.url=o.url??"ws://127.0.0.1:22225",this.heartbeatInterval=o.heartbeatInterval??3e3}init(o,l,i){var g;(g=this.canvas)!=null&&g.parentNode&&this.canvas.parentNode.removeChild(this.canvas);const c=document.createElement("canvas");c.style.border="solid 1px #A0A0A0",c.id="MainCamCanvas",c.width=l,c.height=i;const v=c.getContext("2d");if(!v)throw new Error("无法获取 CanvasRenderingContext2D");o.appendChild(c),this.canvas=c,this.ctx=v}async connect(){this.socket&&(this.socket.readyState===WebSocket.OPEN||this.socket.readyState===WebSocket.CONNECTING)||await new Promise((o,l)=>{const i=new WebSocket(this.url);i.binaryType="arraybuffer",i.onopen=()=>{this.socket=i,this.isConnected=!0,this.startHeartbeat(),this.log("socket.onopen"),o()},i.onerror=c=>{this.isConnected=!1,this.log("socket.onerror"),l(c)},i.onclose=()=>{this.isConnected=!1,this.stopHeartbeat(),this.log("socket.onclose")},i.onmessage=c=>{this.handleMessage(c)}})}destroy(){var o;this.stopHeartbeat();try{this.closeCamera()}catch{}if(this.socket){try{this.socket.onmessage=null}catch{}try{this.socket.onopen=null}catch{}try{this.socket.onerror=null}catch{}try{this.socket.onclose=null}catch{}try{this.socket.close()}catch{}this.socket=null}this.isConnected=!1,(o=this.canvas)!=null&&o.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null,this.ctx=null}getDevCount(){this.sendBytes(new Uint8Array([119,136,80]))}openCamera(o=0,l=1280,i=720){if(!this.canvas)throw new Error("请先 init() 传入容器并创建 canvas");const c=new Uint8Array(12);c[0]=119,c[1]=136,c[2]=1,c[3]=o,c[4]=this.canvas.width>>8&255,c[5]=this.canvas.width&255,c[6]=this.canvas.height>>8&255,c[7]=this.canvas.height&255,c[8]=l>>8&255,c[9]=l&255,c[10]=i>>8&255,c[11]=i&255,this.sendBytes(c)}closeCamera(){this.sendBytes(new Uint8Array([119,136,2,0]))}photo(){const c=new Uint8Array(12);c[0]=119,c[1]=136,c[2]=16,c[3]=0,c[4]=0,c[5]=0,c[6]=0,c[7]=0,c[8]=1,c[9]=0,c[10]=0,c[11]=0,this.sendBytes(c)}bestSize(){this.sendBytes(new Uint8Array([119,136,5,0]))}rotateLeft(){this.sendBytes(new Uint8Array([119,136,7,0]))}rotateRight(){this.sendBytes(new Uint8Array([119,136,8,0]))}focus(){this.sendBytes(new Uint8Array([119,136,48,0]))}log(o){var l;(l=this.onLog)==null||l.call(this,o)}sendBytes(o){if(!this.socket||this.socket.readyState!==WebSocket.OPEN||!this.isConnected)throw new Error("socket 未连接");this.socket.send(o.buffer)}startHeartbeat(){this.stopHeartbeat(),this.heartTimer=window.setInterval(()=>{this.log("heartCheck...........")},this.heartbeatInterval)}stopHeartbeat(){this.heartTimer&&(clearInterval(this.heartTimer),this.heartTimer=null)}handleMessage(o){var c,v,g,r,D;const l=new Uint8Array(o.data);if(l.length<=0)return;if(l[0]===17&&l[1]===17&&l[2]===17){this.log("heart socket!!!!");return}if(l[0]!==85||l[1]!==102)return;const i=l[2];if(i===80){const U=l[3],re=l.length-4,ne=new Uint8Array(re);for(let x=0;x<re;x++)ne[x]=l[4+x];const ee=decodeURIComponent(this.byteToString(ne)).split("|");(c=this.onDevCount)==null||c.call(this,U,ee);return}if(i===1){l[3]===1&&((v=this.onCameraStatus)==null||v.call(this,"opened")),l[3]===3&&((g=this.onCameraStatus)==null||g.call(this,"closed"));return}if(i===16){if(l[3]===1){const re=l[4]*256+l[5],ne=l[6]*65536+l[7]*256+l[8];let _e="";if(re>0){const J=new Uint8Array(re);for(let G=0;G<re;G++)J[G]=l[9+G];_e=decodeURIComponent(this.byteToString(J))}const ee=new Uint8Array(ne);for(let J=0;J<ne;J++)ee[J]=l[9+re+J];const x=this.uint8ArrayToString(ee);(r=this.onPhoto)==null||r.call(this,{flag:0,imgPath:_e,base64:x})}l[3]===2&&((D=this.onPhoto)==null||D.call(this,{flag:2,imgPath:"",base64:""}));return}if(i===204){if(!this.canvas||!this.ctx)return;const U=l[3]*256+l[4],re=l[5]*256+l[6];this.pMainShowStartX=l[7]*256+l[8],this.pMainShowStartY=l[9]*256+l[10],this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);const ne=this.ctx.createImageData(U,re);let _e=11;for(let ee=0;ee<ne.data.length;ee+=4)ne.data[ee+0]=l[_e],ne.data[ee+1]=l[_e+1],ne.data[ee+2]=l[_e+2],ne.data[ee+3]=255,_e+=3;this.ctx.putImageData(ne,this.pMainShowStartX,this.pMainShowStartY),this.mainCamCutMode;return}}uint8ArrayToString(o){let l="";for(let i=0;i<o.length;i++)l+=String.fromCharCode(o[i]);return l}byteToString(o){let l="";for(let i=0;i<o.length;i++)l+=String.fromCharCode(o[i]);return l}}const qc={style:{display:"flex",gap:"16px",height:"100%"}},Yc={key:0,style:{color:"var(--el-text-color-secondary)"}},Gc={style:{width:"420px",display:"flex","flex-direction":"column",gap:"16px"}},Jc={style:{border:"1px solid var(--el-border-color)","border-radius":"4px",padding:"12px"}},Xc={ref:"pictureBox",style:{height:"220px",border:"1px dashed var(--el-border-color)","border-radius":"4px",display:"flex","align-items":"center","justify-content":"center",background:"var(--el-fill-color-lighter)",position:"relative",overflow:"hidden"}},Qc={key:0,style:{color:"var(--el-text-color-secondary)"}},Zc=["src"],ed={style:{border:"1px solid var(--el-border-color)","border-radius":"4px",padding:"12px",flex:"1","min-height":"0",display:"flex","flex-direction":"column"}},td={class:"dialog-footer"},ad=e.defineComponent({__name:"index",props:{visible:{type:Boolean,default:!1}},emits:["confirm","cancel"],setup(t,{emit:o}){const l=t,i=o,c=e.ref(null),v=e.ref(!1),g=e.ref(""),r=e.ref(""),D=new Wc({url:"ws://127.0.0.1:22225"});function U(L,K){var We;const z=L.split(","),ce=((We=z[0].match(/:(.*?);/))==null?void 0:We[1])??"image/jpeg",ye=atob(z[1]);let Te=ye.length;const T=new Uint8Array(Te);for(;Te--;)T[Te]=ye.charCodeAt(Te);return new File([T],K,{type:ce})}function re(){D.onLog=L=>{console.log("[GPY]",L)},D.onDevCount=(L,K)=>{if(r.value+=`设备数量=${L},设备=${K.join(",")}
8
+ `,L>0){r.value+=`检测到设备,正在打开摄像头...
9
+ `;try{D.openCamera(0,1280,720)}catch(z){r.value+=`打开摄像头失败:${(z==null?void 0:z.message)??z}
10
+ `}}else r.value+=`未检测到高拍仪设备!
11
+ `},D.onCameraStatus=L=>{L==="opened"?(v.value=!0,r.value+=`摄像头已打开
12
+ `):(v.value=!1,r.value+=`摄像头已关闭
13
+ `)},D.onPhoto=L=>{L.flag===0&&L.base64?(g.value=`data:image/jpeg;base64,${L.base64}`,r.value+=`拍照完成,已接收图片
14
+ `):r.value+=`拍照失败 flag=${L.flag}
15
+ `}}const ne=async()=>{if(await e.nextTick(),!c.value)return;_e(),re();const L=c.value.getBoundingClientRect();D.init(c.value,Math.floor(L.width),Math.floor(L.height)),r.value+=`正在连接设备服务...
16
+ `,await D.connect(),r.value+=`正在获取设备数量...
17
+ `,D.getDevCount()},_e=()=>{try{D.destroy()}catch(L){console.error(L)}v.value=!1,g.value="",r.value=""};e.watch(()=>l.visible,L=>{L?ne():_e()});const ee=()=>{try{D.bestSize()}catch(L){console.error(L)}},x=()=>{try{D.rotateLeft()}catch(L){console.error(L)}},J=()=>{try{D.rotateRight()}catch(L){console.error(L)}},G=()=>{try{D.focus()}catch(L){console.error(L)}},fe=()=>{r.value+=`正在拍照...
18
+ `;try{D.photo()}catch(L){r.value+=`拍照调用失败:${(L==null?void 0:L.message)??L}
19
+ `}},ae=()=>{if(g.value){const L=U(g.value,"gpy-capture.jpg");i("confirm",L)}else i("confirm",null)},F=()=>{_e(),i("cancel")};return(L,K)=>{const z=e.resolveComponent("el-input"),ce=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(Sa.ssDialog,{title:"扫描录入",visible:l.visible,onBeforeDestroy:F,width:"1200px",style:{height:"80%"}},{default:e.withCtx(()=>[e.createElementVNode("div",qc,[e.createElementVNode("div",{ref_key:"cameraBox",ref:c,style:{flex:"1","min-width":"0",border:"1px solid var(--el-border-color)","border-radius":"4px",position:"relative",overflow:"hidden",display:"flex","align-items":"center","justify-content":"center",background:"var(--el-fill-color-lighter)"}},[v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Yc,"初始化摄像头..."))],512),e.createElementVNode("div",Gc,[e.createElementVNode("div",Jc,[K[0]||(K[0]=e.createElementVNode("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"拍照图片",-1)),e.createElementVNode("div",Xc,[g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qc,"暂无图片")),g.value?(e.openBlock(),e.createElementBlock("img",{key:1,src:g.value,style:{"max-width":"100%","max-height":"100%","object-fit":"contain"},alt:"captured image"},null,8,Zc)):e.createCommentVNode("",!0)],512)]),e.createElementVNode("div",ed,[K[1]||(K[1]=e.createElementVNode("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"操作记录",-1)),e.createVNode(z,{type:"textarea",value:r.value,readonly:"",rows:10,placeholder:"设备操作记录...",style:{flex:"1"}},null,8,["value"])])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",td,[e.createVNode(ce,{onClick:ee,disabled:!v.value,id:"themeBorderButton"},{default:e.withCtx(()=>K[2]||(K[2]=[e.createTextVNode("适屏")])),_:1,__:[2]},8,["disabled"]),e.createVNode(ce,{onClick:x,disabled:!v.value,id:"themeBorderButton"},{default:e.withCtx(()=>K[3]||(K[3]=[e.createTextVNode("左旋")])),_:1,__:[3]},8,["disabled"]),e.createVNode(ce,{onClick:J,disabled:!v.value,id:"themeBorderButton"},{default:e.withCtx(()=>K[4]||(K[4]=[e.createTextVNode("右旋")])),_:1,__:[4]},8,["disabled"]),e.createVNode(ce,{onClick:G,disabled:!v.value,id:"themeBorderButton"},{default:e.withCtx(()=>K[5]||(K[5]=[e.createTextVNode("对焦")])),_:1,__:[5]},8,["disabled"]),e.createVNode(ce,{onClick:fe,disabled:!v.value,id:"themeButton"},{default:e.withCtx(()=>K[6]||(K[6]=[e.createTextVNode("拍照")])),_:1,__:[6]},8,["disabled"]),K[9]||(K[9]=e.createElementVNode("div",{style:{flex:"1"}},null,-1)),e.createVNode(ce,{onClick:ae,disabled:!g.value,id:"themeButton"},{default:e.withCtx(()=>K[7]||(K[7]=[e.createTextVNode("确认")])),_:1,__:[7]},8,["disabled"]),e.createVNode(ce,{onClick:F,id:"themeBorderButton"},{default:e.withCtx(()=>K[8]||(K[8]=[e.createTextVNode("取消")])),_:1,__:[8]})])]),_:1},8,["visible"])}}}),nd=Da._export_sfc(ad,[["__scopeId","data-v-cfe79109"]]),zo=de.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(t){this.objUrl=t},setBlobUrls(t){this.blobUrls=t}}}),Ln=async(t,o)=>{var g,r,D,U,re,ne,_e,ee,x,J,G,fe,ae,F,L,K,z;let l=(r=(g=de.cloneDeep(t))==null?void 0:g.optionUrl)==null?void 0:r.menuSelect,i=[];l==null||l.forEach(ce=>{});let c="",v=await Re.menuToParent(l);if(v==null||v.forEach(ce=>{var ye,Te,T,We;(ce==null?void 0:ce.name)===(((We=(T=(Te=(ye=de.cloneDeep(t))==null?void 0:ye.optionUrl)==null?void 0:Te.groupSelect)==null?void 0:T[0])==null?void 0:We.replaceAll("'",""))??"")&&(c=ce==null?void 0:ce.id)}),o){c=o;const ce=await E.getInsofDataApi({id:c}),ye=(ne=(re=(U=(D=ce==null?void 0:ce.data)==null?void 0:D.result)==null?void 0:U[0])==null?void 0:re.key)==null?void 0:ne.pageKey;v=await Re.getItemData(ye,sessionStorage.getItem("systemKey"),"")}if(c!==""){let ce;o?ce=(_e=v==null?void 0:v.find(T=>(T==null?void 0:T.id)===o))==null?void 0:_e.compData:ce=(ee=v==null?void 0:v.find(T=>{var We,He,bt,R;return(T==null?void 0:T.name)===(((He=(We=t==null?void 0:t.groupSelect)==null?void 0:We.split(":"))==null?void 0:He[0])||((R=(bt=t==null?void 0:t.optionUrl)==null?void 0:bt.groupSelect)==null?void 0:R[0]))}))==null?void 0:ee.compData;let ye=(J=(x=ce==null?void 0:ce.find(T=>(T==null?void 0:T.key)==="header"))==null?void 0:x.contents)==null?void 0:J.map(T=>T==null?void 0:T.label);(fe=(G=ce==null?void 0:ce.find(T=>(T==null?void 0:T.key)==="header"))==null?void 0:G.contents)!=null&&fe.every(T=>Array.isArray(T))&&(ye=(L=Re.getColumnChild((F=(ae=ce==null?void 0:ce.find(T=>(T==null?void 0:T.key)==="header"))==null?void 0:ae.contents)==null?void 0:F[0]))==null?void 0:L.map(T=>T==null?void 0:T.prop));let Te=(z=(K=ce==null?void 0:ce.find(T=>(T==null?void 0:T.key)==="tableContents"))==null?void 0:K.contents)==null?void 0:z.map(T=>{if(Array.isArray(T))T=T==null?void 0:T.filter(We=>!(We!=null&&We.id));else{let We={};for(let He in T)He!=="id"&&(We[He]=T==null?void 0:T[He]);T=We}return T});Te==null||Te.forEach(T=>{Array.isArray(T)?i.push(Re.getValueToObjectValue(T,ye)):i.push(T)})}return i},ld="col-operate",bl=t=>`${ld}-${t}`,od=(t,o)=>{const l=new Map;t.forEach(c=>{const{prop:v}=c;l.set(v,c)});const i=c=>{Array.isArray(c)&&c.forEach(v=>{const{prop:g}=v||{},r=l.get(g);rd(r,v),Array.isArray(v==null?void 0:v.children)&&v.children.length>0&&i(v.children)})};return i(o),o},rd=(t,o)=>(t&&(o.sortable=t==null?void 0:t.sortable,o.filterable=t==null?void 0:t.filterable,o.showSummary=t==null?void 0:t.showSummary,o.operable=t==null?void 0:t.operable,o.fixed=t==null?void 0:t.fixed),o),sd=(t,o)=>{const{sortable:l=!1,filterable:i=!1,showSummary:c=!1,operable:v=!1,fixed:g=!1}=o||{};return{prop:t,sortable:l,filterable:i,showSummary:c,operable:v,fixed:g}},id=async t=>{var v,g;if(!t)return;const o=bl(t),l=await E.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),uniqueKey:o}}),i=(v=l==null?void 0:l.data)==null?void 0:v.code,c=(g=l==null?void 0:l.data)==null?void 0:g.result;if(i==200)return c==null?void 0:c[0]},ud=async t=>{var v,g,r,D;if(!t)return;const o=bl(t),l=await E.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),uniqueKey:o}}),i=(v=l==null?void 0:l.data)==null?void 0:v.code,c=(g=l==null?void 0:l.data)==null?void 0:g.result;return i==200?(D=(r=c==null?void 0:c[0])==null?void 0:r.value)==null?void 0:D.columns:[]},cd=async(t,o)=>{if(!t||!o)return;const l=bl(t);return await E.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),uniqueKey:l},value:{columns:o}})},dd=async(t,o)=>!t||!o?void 0:await E.updateInsofDataApi({id:t,value:{columns:o}}),wo=async(t,o)=>{const l=sessionStorage.getItem("systemKey");if(!t||!o||!l)return;const i=await id(t);return i?await dd(i==null?void 0:i.id,o):await cd(t,o)},pd={class:"table-content"},fd={class:"menu-config-wrap"},vd=["onClick"],hd={key:0,class:"viewport-wrap"},md=["onClick"],gd={title:"选择显示列信息"},yd={class:"menu-config-wrap",style:{padding:"0 0 0 16px","box-sizing":"border-box","min-height":"200px",width:"400px",overflow:"auto",position:"relative"}},bd=["title"],kd={class:"col-operate-wrap"},Cd={key:0,class:"col-operate-radio-wrapper"},Ed={title:"拖拽排序列",style:{cursor:"move",color:"grey",position:"absolute",right:"15px"}},Sd={key:0,style:{display:"flex","justify-content":"center","align-items":"center"}},Nd={class:"pop-view"},wd={class:"pop-wrapper"},xd={class:"file-list-pop"},_d=["title","onClick"],Bd=["onClick"],Td=["onClick"],Ad={class:"form-content"},Od={key:0,class:"dialog-footer"},Dd={class:"dialog-footer"},Md={class:"ocr-dialog-content"},$d={class:"ocr-steps"},Ld={key:0,class:"ocr-action-buttons"},Vd={key:1,class:"ocr-preview-area"},Id={class:"ocr-file-grid"},Pd={class:"file-thumbnail"},Rd=["src"],Ud={key:1,class:"thumbnail-placeholder"},Fd={class:"progress-svg",viewBox:"0 0 36 36"},zd=["stroke","stroke-width","stroke-dasharray"],jd={key:0,class:"progress-icon"},Hd=["onClick"],Kd={class:"file-name"},Wd={key:0,class:"ocr-recognize-button"},qd={key:2,class:"ocr-progress-section"},Yd={key:3,class:"ocr-confirm-area"},Gd={class:"ocr-preview-tip"},Jd={class:"ocr-preview-table"},Xd={style:{display:"flex","align-items":"center",gap:"8px"}},Qd={key:0},Zd={key:4,class:"ocr-success-area"},ep={key:0,class:"ocr-dialog-footer"},tp={class:"form-content"},xo="ss-ocr-upload-history",ap="ss-ocr-cert-history-v1",np={__name:"index",props:{pageLayout:{type:String,default:"vertical"},related:{type:Array,default:[]},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:!0},allowOperate:{type:Boolean,default:!0},allMapContents:{type:Object,default:()=>{}}},emits:["getSliceContLength","clickMainKey","change","contentChange","onButtonClick","contentClick","pageChange","rowClick","routeUrl"],setup(t,{emit:o}){var Zl;const l=e.ref([]),i=zo(de.pinia),c=e.ref(null),v=e.ref(new Set),g=e.ref(new Map),r=t,D=e.ref((r==null?void 0:r.allowSelect)??!0),U=e.ref(((Zl=r==null?void 0:r.config)==null?void 0:Zl.showIndex)??!0),re=e.ref(),ne=e.ref(!0),_e=e.ref(!1),ee=e.ref([]),x={sortable:"switch",filterable:"switch",showSummary:"switch",operable:"switch",fixed:"radio"},J=e.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"}]}]),G=Re.useOriginalState(de.pinia);let fe="$R";const{originalPath:ae}=de.storeToRefs(G),F=ae.value,L=e.computed(()=>{var n;const a=(n=Re.getAllLeafNodes(T.value)||[])==null?void 0:n.filter(s=>(s==null?void 0:s.type)!=="operate"&&(s==null?void 0:s.label)!=="操作"&&(s==null?void 0:s.prop)!=="operate");return a.length>0?a.every(s=>!!(s!=null&&s.sortable)):!1});e.computed(()=>{var n;return(n=T.value)==null?void 0:n.every(s=>s==null?void 0:s.filterable)}),e.computed(()=>{var n;return(n=T.value)==null?void 0:n.every(s=>s==null?void 0:s.operable)});const K=e.ref(!0),z=e.ref([]),ce=e.reactive({column:{},status:!1,text:"合计"}),ye=e.reactive({currentPage:1,pageSize:10,total:0,pageSizes:[5,10,20,50,100]}),Te=o,T=e.ref([]),We=e.ref([]),He=e.ref([]),bt=e.reactive({prop:"",order:null}),R=e.ref([]),ut=e.ref(!1),Me=e.ref(!1),se=e.ref(null),{isUseBackdrop:we,initTrackFileType:tt,getFileExtension:Ce,setData:Se,getFileInfo:Le,getFilesInfo:ct}=ao.useThreeSystem(),Ct=e.ref([]),$t=e.ref(!1),Et=e.ref(),mt=de.useMenuState(),{importLoading:da,activeMenuPath:Ve,contentLoading:Na,linkMenuInfo:Ka}=de.storeToRefs(mt),pn=Re.useTableComp(de.pinia),ft=de.useModelComp(de.pinia),{extraContents:ot,cacheUpdatingData:wa,tableViewContents:Ma,tableLoading:kl,pageMapState:xa,lockingPage:fn}=de.storeToRefs(ft),le=e.ref([]),jt=e.ref([]),Lt=e.ref(new Map);e.ref(!1);const ea=e.ref("");e.ref();const me=e.ref(!0),Xe=e.ref(0),pa=e.ref(!0),Vt=e.ref(""),ta=e.ref(!1);e.ref([]);const jo=e.ref({label:"查看三维模型"}),vn=e.ref(!1),Pn=e.ref(),na=e.ref([]),fa=e.ref([]),hn=e.ref(!1),Wa=e.ref([]),St=e.ref([]),Nt=e.ref([]),qe=e.ref([]),va=e.ref([]),Ho=()=>{try{const a=localStorage.getItem(xo),n=a?JSON.parse(a):[];va.value=Array.isArray(n)?n:[]}catch{va.value=[]}},Ko=()=>{try{localStorage.setItem(xo,JSON.stringify(va.value||[]))}catch{}},Cl=a=>{var m,p,b;if(!a)return;const n=a.url||((m=a==null?void 0:a.uploadResult)==null?void 0:m.url)||"",s=a.name||((p=a==null?void 0:a.uploadResult)==null?void 0:p.name)||((b=a==null?void 0:a.uploadResult)==null?void 0:b.fileName)||"";if(!n&&!s)return;const u={name:s,url:n,ts:Date.now()},d=String(u.name||"").trim().toLowerCase(),f=(va.value||[]).findIndex(k=>String((k==null?void 0:k.name)||"").trim().toLowerCase()===d);f>-1&&va.value.splice(f,1),va.value.unshift(u),va.value.length>20&&(va.value=va.value.slice(0,20)),Ko()};Ho();const mn=(a,n)=>`${ap}:${String(a??"")}:${String(n??"")}`,gn=(a,n)=>{try{const s=sessionStorage.getItem(mn(a,n)),u=s?JSON.parse(s):[];return Array.isArray(u)?u:[]}catch{return[]}},El=(a,n,s)=>{try{sessionStorage.setItem(mn(a,n),JSON.stringify(Array.isArray(s)?s:[]))}catch{}},yn=(a,n,s)=>{if(!n)return;const u=gn(a,n),d=[s,...u||[]].filter(Boolean).slice(0,5);return El(a,n,d),d},Wo=(a,n,s)=>{if(!n||!s)return;const u=mn(a,n),d=mn(a,s);try{const f=sessionStorage.getItem(u);if(!f)return;const m=(()=>{try{const k=JSON.parse(f);return Array.isArray(k)?k:[]}catch{return[]}})(),p=gn(a,s),b=[...m,...p||[]].filter(Boolean).sort((k,M)=>Number((M==null?void 0:M.ts)||0)-Number((k==null?void 0:k.ts)||0)).slice(0,5);sessionStorage.setItem(d,JSON.stringify(b)),sessionStorage.removeItem(u)}catch{}},Rn=e.ref(!1),ua=e.ref(!1),ht=e.ref([]),qo=e.ref(null);e.ref(!1),e.ref([]),e.ref(""),e.ref("");const Un=e.ref(!1),Sl=e.ref([]),It=e.ref(1),bn=e.ref(new Map),kn=e.ref(new Map),ha=e.ref(0),Fn=e.ref(!1),ma=e.ref([]),zn=e.ref([]),Cn=a=>{var n;try{const s=(n=Re.getAllLeafNodes(T.value)||[])==null?void 0:n.filter(u=>(u==null?void 0:u.type)!=="operate"&&(u==null?void 0:u.label)!=="操作"&&(u==null?void 0:u.prop)!=="operate");return(s==null?void 0:s.find(u=>(u==null?void 0:u.prop)===a||(u==null?void 0:u.label)===a))||null}catch{return null}},Yo=a=>{const n=Cn(a),s=(n==null?void 0:n.formType)||(n==null?void 0:n.columnType)||"Input";return Ft.getComponent(s)||Ft.getComponent("Input")},Nl=e.ref([]),wl=e.ref(null),ga=e.ref([]),$a=e.ref(null),qa=e.ref(""),La=e.ref(!1),Ya=e.ref([]),jn=e.ref(""),En=e.ref(!1),Sn=e.ref([]),Ra=e.ref([]),ya=e.ref([]),Hn=e.ref(null),xl=e.ref([]),_l=e.ref("");e.computed(()=>{var a;try{const n=(a=Re.getAllLeafNodes(T.value)||[])==null?void 0:a.filter(u=>(u==null?void 0:u.type)!=="operate"&&(u==null?void 0:u.label)!=="操作"&&(u==null?void 0:u.prop)!=="operate"),s=new Map;return n==null||n.forEach(u=>{u!=null&&u.label&&(u!=null&&u.prop)&&s.set(u.label,u.prop)}),s.get("编号")||""}catch{return""}});const Go=e.computed(()=>{var a;try{const n=(a=Re.getAllLeafNodes(T.value)||[])==null?void 0:a.filter(u=>(u==null?void 0:u.type)!=="operate"&&(u==null?void 0:u.label)!=="操作"&&(u==null?void 0:u.prop)!=="operate"),s=new Map;return n==null||n.forEach(u=>{u!=null&&u.label&&(u!=null&&u.prop)&&s.set(u.label,u.prop)}),s.get("名称")||""}catch{return""}}),Jo=e.computed(()=>{var a;try{const n=(a=Re.getAllLeafNodes(T.value)||[])==null?void 0:a.filter(u=>(u==null?void 0:u.type)!=="operate"&&(u==null?void 0:u.label)!=="操作"&&(u==null?void 0:u.prop)!=="operate"),s=new Map;return n==null||n.forEach(u=>{u!=null&&u.label&&(u!=null&&u.prop)&&s.set(u.label,u.prop)}),s.get("制造厂")||""}catch{return""}}),Bl=()=>{En.value=!1,Sn.value=[],Ra.value=[],ya.value=[],Hn.value=null,xl.value=[],_l.value=""},Xo=(a,n)=>{const s=(a==null?void 0:a.ocrRow)||{};for(const d of Object.keys(s))d==="id"||d==="_isOCRRow"||d==="_ocrTableId"||(n[d]=s[d]);const u=jt.value.find(d=>d.id===n.id);if(u)for(const d of Object.keys(s))d==="id"||d==="_isOCRRow"||d==="_ocrTableId"||(u[d]=s[d]);Lt.value&&Lt.value.set(n.id,n),yn(r==null?void 0:r.index,n.id,a==null?void 0:a.versionItem),Ra.value=[...Ra.value||[],JSON.parse(JSON.stringify(n))]},Qo=a=>{const n=Array.isArray(a)?a:Sn.value||[];if(n.length===0){Bl();return}if(n.find(f=>(f==null?void 0:f.__decision)==="replace"&&!(f!=null&&f.selectedTargetId))){E.ElMessage.warning("存在“替换”但未选择目标记录的条目,请处理后再提交");return}n.forEach(f=>{var p;const m=f==null?void 0:f.__decision;if(!(!m||m==="skip")){if(m==="add"){yn(r==null?void 0:r.index,(p=f==null?void 0:f.ocrRow)==null?void 0:p.id,f==null?void 0:f.versionItem),ya.value=[...ya.value||[],f.ocrRow];return}if(m==="replace"){const b=f==null?void 0:f.selectedTargetId,k=(le.value||[]).find(M=>String(M==null?void 0:M.id)===String(b));if(!k)return;Xo(f,k)}}}),(Ra.value||[]).length>0&&(le.value=[...le.value||[]]),(ya.value||[]).length>0&&(le.value=[...le.value||[],...ya.value||[]],jt.value=[...jt.value||[],...ya.value||[]],(ya.value||[]).forEach(f=>{var m,p;return(p=(m=Lt.value)==null?void 0:m.set)==null?void 0:p.call(m,f.id,f)})),Ua.value=le.value;const u=Ra.value||[],d=ya.value||[];if(u.length>0&&Te("change",{buttonName:"编辑",singleContent:u,content:le.value,index:r==null?void 0:r.index,parentTableId:r==null?void 0:r.parentTableId,column:T.value}),d.length>0){const f=Hn.value;Te("change",{buttonName:"OCR批量新增",content:le.value,index:r==null?void 0:r.index,parentTableId:r==null?void 0:r.parentTableId,column:T.value,ocrRows:d,relatedContents:r==null?void 0:r.related,uploadedFiles:(Array.isArray(f==null?void 0:f.result)?f.result:[]).map(m=>(Array.isArray(m==null?void 0:m.图片信息)?m.图片信息:[]).map(p=>({url:(p==null?void 0:p.url)||"",name:(p==null?void 0:p.name)||"",fileName:(p==null?void 0:p.name)||""})).filter(p=>p.url)),ocrResult:f,matchedCount:(u||[]).length,newCount:(d||[]).length})}E.ElMessage.success("已提交候选处理结果"),Bl()},Ga=to.createOCRService(),Zo=e.computed(()=>Ga.getConfig()),la=e.ref(),Ht=e.ref(),er=Po(de.pinia),Ua=e.ref(),Kn=e.ref(0),tr=Re.useUnit(de.pinia),{selectIndex:ar,selectMenu:Wn,selectTitle:op}=de.storeToRefs(tr),{selectString:Va}=de.storeToRefs(er),nr=de.useLoginState(de.pinia),{loginUserInfo:ba}=de.storeToRefs(nr),lr=e.ref(720),Kt=e.ref(!1),Nn=e.ref(!1),ca=e.ref([]),oa=e.ref(),Ja=e.ref(!0),Tl=e.ref(!0),or=e.ref([]),rr=e.inject("contentRef");e.provide("contentRef",rr),e.watch(()=>{var a;return(a=le.value)==null?void 0:a.length},a=>{ye.total=a}),e.watch(()=>Ma.value,async()=>{var n,s,u,d,f,m,p,b,k,M,$,V,q,Y,pe,ue,I;if(((n=Ma.value)==null?void 0:n.length)===0||!((s=r==null?void 0:r.itemData)!=null&&s.find(he=>(he==null?void 0:he.key)==="columnPath"))||!((u=r==null?void 0:r.itemData)!=null&&u.find(he=>(he==null?void 0:he.key)==="pageColumn")))return;let a=(k=(b=(p=(m=(f=(d=r==null?void 0:r.itemData)==null?void 0:d.find(he=>(he==null?void 0:he.key)==="pageColumn"))==null?void 0:f.contents)==null?void 0:m.split("["))==null?void 0:p[1])==null?void 0:b.split("]"))==null?void 0:k[0];((q=(V=($=(M=r==null?void 0:r.itemData)==null?void 0:M.find(he=>(he==null?void 0:he.key)==="pageColumn"))==null?void 0:$.contents)==null?void 0:V.split("["))==null?void 0:q[0])+((pe=(Y=Ma.value)==null?void 0:Y.find(he=>(he==null?void 0:he.key)===a))==null?void 0:pe.value),(I=(ue=r==null?void 0:r.itemData)==null?void 0:ue.find(he=>(he==null?void 0:he.key)==="pageGroup"))==null||I.contents,Ql(compData,r.allMapContents)},{deep:!0});const sr=async(a,n)=>{var s,u;try{let d;const f={type:"data",pageKey:r!=null&&r.parentTableId?(s=d==null?void 0:d.key)==null?void 0:s.pageKey:Ve.value,tableId:(r==null?void 0:r.parentTableId)||(r==null?void 0:r.index),systemKey:sessionStorage.getItem("systemKey")},m=n==null?void 0:n.map(k=>{const M=Object.keys(k),$={};return M.forEach((V,q)=>{$[a[q]]=k[V]}),$}),p=m==null?void 0:m.map(k=>({key:f,value:{tableData:k}})),b=await E.batchAddInsofDataApi({dataList:p});((u=b==null?void 0:b.data)==null?void 0:u.code)===200?(ft.setRefreshCurStructure(!0),E.ElMessage.success("导入数据成功")):E.ElMessage.error("导入数据响应失败")}catch(d){throw E.ElMessage.error("导入数据处理失败"),new Error(d)}},ir=async a=>{var f,m,p,b,k,M,$;let n=He.value;n!=null&&n.find(V=>(a==null?void 0:a.key)===(V==null?void 0:V.key))&&(n=n==null?void 0:n.filter(V=>(a==null?void 0:a.key)!==(V==null?void 0:V.key))),n.push({key:a==null?void 0:a.key,value:[(m=a==null?void 0:a.value)==null?void 0:m[((f=a==null?void 0:a.value)==null?void 0:f.length)-1]]});let s=qe.value;s=s==null?void 0:s.map(V=>{var q,Y;return(V==null?void 0:V.type)==="Select"&&(a==null?void 0:a.key)===(V==null?void 0:V.prop)&&Array.isArray(V.value)&&(q=V.value)!=null&&q.every(pe=>typeof pe=="string")&&(V.selectValue=(Y=n==null?void 0:n.find(pe=>(pe==null?void 0:pe.key)===(V==null?void 0:V.prop)))==null?void 0:Y.value),V});let u=(b=(p=s==null?void 0:s.find(V=>(V==null?void 0:V.prop)===(a==null?void 0:a.key)))==null?void 0:p.optionUrl)==null?void 0:b.menuId,d=s==null?void 0:s.find(V=>(V==null?void 0:V.prop)===(a==null?void 0:a.key));if(u){let V=await Ln(d==null?void 0:d.optionUrl,u),q,Y=z.value,pe=($=(M=(k=qe.value)==null?void 0:k.find(ue=>{var I;return(I=d==null?void 0:d.optionUrl)==null?void 0:I.menuId}))==null?void 0:M.selectValue)==null?void 0:$[0];if(V==null||V.forEach(ue=>{var I,he,j,A,h,C,w,_,ie,H;if(u){let Ne=(he=(I=qe.value)==null?void 0:I.find(te=>{var Fe,ge;return((Fe=d==null?void 0:d.optionUrl)==null?void 0:Fe.menuId)===((ge=te==null?void 0:te.optionUrl)==null?void 0:ge.menuId)}))==null?void 0:he.prop,y=(A=(j=s==null?void 0:s.find(te=>(te==null?void 0:te.prop)===Ne))==null?void 0:j.selectValue)==null?void 0:A[0];Ne!=null&&Ne.includes("·")&&(Ne=(h=Ne==null?void 0:Ne.split("·"))==null?void 0:h[0],y=(ie=(_=(w=a==null?void 0:a.value)==null?void 0:w[((C=a==null?void 0:a.value)==null?void 0:C.length)-1])==null?void 0:_.split(" "))==null?void 0:ie[0]),Y!=null&&Y.find(te=>(te==null?void 0:te.value)===pe)?q=(H=Y==null?void 0:Y.find(te=>(te==null?void 0:te.value)===pe))==null?void 0:H.objectValue:ue[Ne]===y&&(q=ue)}}),q){let ue=s;ue=ue==null?void 0:ue.map(I=>{var he,j,A,h,C,w;return u&&(q!=null&&q[I==null?void 0:I.prop])&&Vt.value==="新增"&&(I==null?void 0:I.prop)!==(d==null?void 0:d.prop)?I.value=(q==null?void 0:q[I==null?void 0:I.prop])||(q==null?void 0:q[(h=(A=(j=(he=I==null?void 0:I.optionUrl)==null?void 0:he.groupSelect)==null?void 0:j[1])==null?void 0:A.replaceAll("[",""))==null?void 0:h.replaceAll("]","")]):I.value=(w=(C=qe.value)==null?void 0:C.find(_=>(_==null?void 0:_.prop)===(I==null?void 0:I.prop)))==null?void 0:w.value,I}),qe.value=ue}}He.value=n},ur=async a=>{var n,s,u,d,f;if((n=a==null?void 0:a.toString())!=null&&n.includes(".txt")||(s=a==null?void 0:a.toString())!=null&&s.includes(".cpt")||(u=a==null?void 0:a.toString())!=null&&u.includes(".cyd")){const m=await E.axios.get(a,{responseType:"blob",headers:{"Content-Type":"application/json"}}),p=new Blob([m.data],{type:"application/octet-stream;charset=UTF-8"});let b=URL.createObjectURL(p);Et.value=[{name:(f=a==null?void 0:a.split("/"))==null?void 0:f[((d=a==null?void 0:a.split("/"))==null?void 0:d.length)-1],blobUrl:b}],$t.value=!0}};e.onBeforeUnmount(()=>{Tl.value=!1;let a=Kn.value;Kn.value=a+1});const wn=e.reactive({prop:"",order:null}),cr=e.computed(()=>{const a=(le.value??[]).slice(),n=wn.prop||bt.prop,s=wn.order||bt.order;if(!n||!s)return a;const u=s==="ascending",d=m=>{if(n)return m&&Object.prototype.hasOwnProperty.call(m,n)?m[n]:n.includes(".")?n.split(".").reduce((p,b)=>p==null?p:p[b],m):m==null?void 0:m[n]},f=m=>{if(m==null)return{ok:!1,value:NaN};if(typeof m=="number")return{ok:Number.isFinite(m),value:m};const p=String(m).trim();if(p==="")return{ok:!1,value:NaN};const b=p.replace(/[,\s]/g,"");if(!/^[+-]?(\d+\.?\d*|\.\d+)$/.test(b))return{ok:!1,value:NaN};const k=Number(b);return{ok:Number.isFinite(k),value:k}};return a.sort((m,p)=>{const b=d(m),k=d(p);if(b==null&&k==null)return 0;if(b==null)return u?-1:1;if(k==null)return u?1:-1;const M=f(b),$=f(k);if(M.ok&&$.ok)return u?M.value-$.value:$.value-M.value;const V=h=>{if(h==null)return{ok:!1,value:NaN};const C=String(h).trim();if(C==="")return{ok:!1,value:NaN};const w=C.match(/^(-)?(\d+):(\d{1,2}):(\d{1,2})$/);if(!w)return{ok:!1,value:NaN};const _=w[1]?-1:1,ie=Number(w[2]),H=Number(w[3]),Ne=Number(w[4]);return[ie,H,Ne].some(y=>Number.isNaN(y))?{ok:!1,value:NaN}:H>=60||Ne>=60?{ok:!1,value:NaN}:{ok:!0,value:_*(ie*3600+H*60+Ne)}},q=V(b),Y=V(k);if(q.ok&&Y.ok)return u?q.value-Y.value:Y.value-q.value;const pe=new Date(b).getTime(),ue=new Date(k).getTime(),I=!Number.isNaN(pe),he=!Number.isNaN(ue);if(I&&he)return u?pe-ue:ue-pe;const j=String(b),A=String(k);return u?j.localeCompare(A):A.localeCompare(j)})}),Al=e.computed(()=>{var s;const a=(ye.currentPage-1)*ye.pageSize,n=a+ye.pageSize;return Te("getSliceContLength",ye),(s=cr.value)==null?void 0:s.slice(a,n)}),dr=a=>{ye.currentPage=a,Te("getSliceContLength",ye)},pr=a=>{var u;ye.pageSize=a;const n=((u=le.value)==null?void 0:u.length)??0,s=a>0?Math.ceil(n/a):1;ye.currentPage>s&&(ye.currentPage=s||1,E.ElMessage.warning("当前页超出范围,已自动跳转到最后一页")),Te("getSliceContLength",ye)},fr=({prop:a,order:n})=>{wn.prop=a,wn.order=n,ye.currentPage=1},vr=(a,n)=>{var m,p;const s=(p=(m=T.value)==null?void 0:m.map(b=>b==null?void 0:b.prop))==null?void 0:p.filter(b=>b!=="operate");let u;const d=(a==null?void 0:a.length)===(s==null?void 0:s.length);if(a!=null&&a.includes("序号"))return E.ElMessage.error("导入的数据不需要包含序号列");if(u=d?a:a.slice(0,s==null?void 0:s.length),!(u==null?void 0:u.every(b=>s==null?void 0:s.find(k=>b===k))))return E.ElMessage.error("导入的数据表头不匹配");sr(u,n)},hr=(a,n)=>{var s;ft.setRefreshCurStructure(!1),((s=T.value)==null?void 0:s.length)===0||vr(a,n)},mr=(a,n,s,u)=>{const d=[],f=[],m=k=>Object.keys(k).length;for(const k in a)if(a[k]!==void 0){const M=a[k],$=[];for(const[V,q]of Object.entries(M))$.push(q),f.length<m(M)&&f.push(V);d.push($)}d.unshift(f);const p=Re.utils.aoa_to_sheet(d),b=Re.utils.book_new();Re.utils.book_append_sheet(b,p,u),Re.writeFileSync(b,`${n}.xlsx`),ca.value=[]},Ol=async(a,n,s,u=!1,d)=>{var f,m,p,b,k,M,$,V;try{ft.setRefreshCurStructure(!1);const q=await E.getInsofDataApi({id:r==null?void 0:r.index});if(((f=q==null?void 0:q.data)==null?void 0:f.code)===200){let Y=(k=(b=(p=(m=q==null?void 0:q.data)==null?void 0:m.result)==null?void 0:p[0])==null?void 0:b.value)==null?void 0:k.pageData;u?Y={...Y,compData:($=Y==null?void 0:Y.compData)==null?void 0:$.map(ue=>{var I;return(ue==null?void 0:ue.key)==="header"?{...ue,contents:(I=ue==null?void 0:ue.contents)==null?void 0:I.map(he=>({...he,[a]:s}))}:ue})}:Y={...Y,compData:(M=Y==null?void 0:Y.compData)==null?void 0:M.map(ue=>{var I,he;return(ue==null?void 0:ue.key)==="header"?{...ue,contents:(I=ue==null?void 0:ue.contents)==null?void 0:I.map(j=>{if(Array.isArray(j))j=j==null?void 0:j.map(A=>(A==null?void 0:A.prop)===(n==null?void 0:n.prop)?{...A,[a]:s}:A);else if((j==null?void 0:j.prop)===(n==null?void 0:n.prop))return{...j,[a]:s};return j})}:(ue==null?void 0:ue.key)==="tableToForm"&&d?{...ue,contents:(he=ue==null?void 0:ue.contents)==null?void 0:he.map(j=>(j==null?void 0:j.prop)===(n==null?void 0:n.prop)?{...j,[d]:s}:j)}:ue})};const pe=await E.updateInsofDataApi({id:r==null?void 0:r.index,value:{pageData:Y}});((V=pe==null?void 0:pe.data)==null?void 0:V.code)===200?(E.ElMessage.success("编辑成功"),ft.setRefreshCurStructure(!0)):E.ElMessage.error("编辑响应失败")}}catch(q){E.ElMessage.error(q)}},gr=async(a,n)=>{await Ol("label",n,a)},yr=async(a,n)=>{await Ol("columnType",n,a,!1,"type")},br=async({newRow:a,targetIndex:n})=>{var d;const u=(ye.currentPage-1)*ye.pageSize+(n??0);a._isTemp=!0,le.value.splice(u,0,a),await e.nextTick(),g.value.has(a.id)||g.value.set(a.id,de.cloneDeep(a)),le.value=(d=le.value)==null?void 0:d.map(f=>({...f,tableEditType:(f==null?void 0:f.id)===a.id?"edit":(f==null?void 0:f.tableEditType)??"text"})),v.value.add(a.id),Kt.value=!0},kr=async()=>{var u,d,f,m,p;const a=Array.from(v.value||[]);if(a.length===0)return;const n=[],s=[];if(a.forEach(b=>{var $;const k=($=le.value)==null?void 0:$.find(V=>(V==null?void 0:V.id)===b);if(!k)return;if(k!=null&&k._isTemp){const V=le.value.findIndex(pe=>(pe==null?void 0:pe.id)===b),Y={id:(V>=0?V+1:le.value.length+1).toString()};for(let pe in k)pe!=="index"&&pe!=="_isTemp"&&pe!=="tableEditType"&&pe!=="id"&&(Y[pe]=k[pe]);n.push(Y);return}const M={};for(let V in k)V!=="id"&&V!=="index"&&(M[V]=k[V]);s.push({id:k.id,value:{tableData:M}})}),ft.setTableLoading(r==null?void 0:r.index),s.length>0){const b=s.map(M=>{const $={id:M.id,...M.value.tableData};return delete $._isOCRRow,delete $._ocrTableId,delete $._isTemp,delete $.tableEditType,delete $.index,$}),k=[{tableName:(u=r==null?void 0:r.related)==null?void 0:u.find(M=>M==null?void 0:M.includes("content")),tableContents:b}];try{await tl.pageBatchUpdateApi({platId:parseInt((d=ba.value)==null?void 0:d.plat_id),changeContents:k})}catch(M){E.ElMessage.error(((m=(f=M==null?void 0:M.response)==null?void 0:f.data)==null?void 0:m.message)||(M==null?void 0:M.message)||"保存失败"),ft.setTableLoading(!1);return}}if(n.length>0){const b={fixContent:n,buttonName:"新增",relatedContents:r==null?void 0:r.related};Te("change",b)}E.ElMessage.success("保存成功"),v.value.clear(),g.value.clear(),le.value=(p=le.value)==null?void 0:p.map(b=>({...b,tableEditType:"text"})),Kt.value=!1,ft.setRefreshCurStructure(!0)},qn=e.ref(!1),Cr=async()=>{if(wa.value){Kt.value=!1;return}if(!qn.value){qn.value=!0;try{Array.from(v.value||[]).length>0?await kr():Kt.value=!1}finally{Promise.resolve().then(()=>{qn.value=!1})}}},Er=a=>{ca.value=a},Sr=(a,n)=>{oa.value===n?Ja.value=!1:Ja.value=!0,oa.value=n==null?void 0:n.changeProp},Nr=a=>{if(!a)return;const{item:n,value:s}=a,u=qe.value.find(d=>d.prop==n.prop);u&&u.contents.push({label:s,value:s})},Xa=e.computed(()=>{var s,u,d;const a=(s=T.value)==null?void 0:s.some(f=>f==null?void 0:f.filterable);return document.documentElement.style.setProperty("--ssTable-header-filter-display",a?"inline-block":"none"),(d=(u=T.value)==null?void 0:u.filter(f=>(f==null?void 0:f.label)!=="操作"))==null?void 0:d.map(f=>({...f,filterable:!!(f!=null&&f.filterable),showSummary:!!(f!=null&&f.showSummary),operable:!!(f!=null&&f.operable),fixed:f==null?void 0:f.fixed}))}),Dl=async(a,n,s)=>{const u=de.cloneDeep(T.value);await e.nextTick();const d=u==null?void 0:u.map(m=>(s==null?void 0:s.label)===(m==null?void 0:m.label)?{...m,[n]:a}:m),f=Yn(d);await wo(r.index,f),T.value=d,We.value=f},Yn=a=>{var d;const n=a||[];return((d=Re.getAllLeafNodes(n)||[])==null?void 0:d.filter(f=>(f==null?void 0:f.prop)&&(f==null?void 0:f.type)!=="operate"&&(f==null?void 0:f.label)!=="操作"&&(f==null?void 0:f.prop)!=="operate")).map(f=>{const{prop:m}=f;return sd(m,f)})},wr=async a=>{let n=await ud(r.index);n||(n=Yn(a)),We.value=n},xr=async(a,n)=>{const s=de.cloneDeep(T.value),u=m=>Array.isArray(m)?m.map(p=>{const b=Array.isArray(p==null?void 0:p.children)&&p.children.length>0,k={...p};return(k==null?void 0:k.prop)==="operate"||(k==null?void 0:k.label)==="操作"||(k==null?void 0:k.type)==="operate"?(k.sortable=!1,k.filterable=!1,k.operable=!1):k.sortable=b?!1:!!a,b&&(k.children=u(k.children)),k}):m,d=u(s),f=Yn(d);await wo(r.index,f),T.value=d,We.value=f},_r=()=>{ta.value=!1},Br=a=>{Te("clickTrigger",a)},Ml=async a=>{var f,m,p,b,k,M,$,V,q,Y,pe,ue,I,he,j;const n=a==null?void 0:a.row,s=a==null?void 0:a.rowData,u=a==null?void 0:a.suffix;if((f=n==null?void 0:n.toString())!=null&&f.includes(".urdf")||a!=null&&a.isUrdf||u!=null&&u.includes(".urdf")){if(n.includes(",")){E.ElMessage.error("当前版本仅允许单个urdf预览!");return}if(we(n)){const h={files:[Le(n)],data:{}};Se(h);return}Wa.value=[{url:n,extension:Ce(n)}],Me.value=!0,se.value={data:de.cloneDeep(s)},ut.value=!0;return}let d=[];if((m=n==null?void 0:n.toString())!=null&&m.includes(".stl")||(p=n==null?void 0:n.toString())!=null&&p.includes(".STL")||(b=n==null?void 0:n.toString())!=null&&b.includes(".obj")||(k=n==null?void 0:n.toString())!=null&&k.includes(".mtl")){const A=(M=n==null?void 0:n.toString())==null?void 0:M.split(","),h=ct(A),C=h==null?void 0:h[0];if(we(C==null?void 0:C.extension)){Se({files:h,data:{}});return}Wa.value=h,Me.value=!1,ut.value=!0;return}if(($=n==null?void 0:n.toString())!=null&&$.includes(".stl")||(V=n==null?void 0:n.toString())!=null&&V.includes(".STL")||(q=n==null?void 0:n.toString())!=null&&q.includes(".obj")||(Y=n==null?void 0:n.toString())!=null&&Y.includes(".mtl")||u!=null&&u.includes(".stl")||u!=null&&u.includes(".STL")||u!=null&&u.includes(".obj")||u!=null&&u.includes(".mtl")){let A,h=[],C={};if(Array.isArray(n)?A=n:A=n==null?void 0:n.split(","),A==null||A.forEach(w=>{w.includes(".mtl")?h.push(w):C.blob=C.blob?C.blob+","+w:w}),(h==null?void 0:h.length)>0&&(C.mtlBlobs=h),u&&(C.suffix=u),(ue=(pe=Object.values(C))==null?void 0:pe[0])!=null&&ue.includes("http:"))d.push(C);else{const w=new Blob([C.blob],{type:"application/octet-stream;charset=UTF-8"});let _=URL.createObjectURL(w),ie="";(I=n==null?void 0:n.split("/"))==null||I.forEach((H,Ne)=>{var y;Ne===((y=n==null?void 0:n.split("/"))==null?void 0:y.length)-1&&(ie=H)}),(he=C.blob)!=null&&he.includes(".stl")&&(ie=(ie==null?void 0:ie.replaceAll(">",""))+".urdf"),Et.value=[{name:ie,blobUrl:_}],$t.value=!0}}else{const A=await E.axios.get(n,{responseType:"blob",headers:{"Content-Type":"application/json"}}),h=new Blob([A.data],{type:"application/octet-stream;charset=UTF-8"});let C=URL.createObjectURL(h),w="";if((j=n==null?void 0:n.split("/"))==null||j.forEach((_,ie)=>{var H;ie===((H=n==null?void 0:n.split("/"))==null?void 0:H.length)-1&&(w=_)}),we(w)){const _=tt(w),ie=Le(n);Se({files:[ie],data:{trackFileType:_}});return}Et.value=[{name:w,blobUrl:C}],$t.value=!0}(d==null?void 0:d.length)>0&&i.setBlobUrls(d)},Qa=a=>{var u,d,f,m;if(a!=null&&a.downloadUrl)return a==null?void 0:a.name;const n=(m=(u=a==null?void 0:a.url)==null?void 0:u.split("."))==null?void 0:m[((f=(d=a==null?void 0:a.url)==null?void 0:d.split("."))==null?void 0:f.length)-1];return(a==null?void 0:a.name)+"."+n},$l=a=>{if(!a)return"未知文件";try{const u=Qa(a);if(typeof u=="string"&&u.includes("."))return u}catch{}const n=(a==null?void 0:a.fileName)||(a==null?void 0:a.name)||"未知文件",s=(a==null?void 0:a.suffix)||"";return n.includes(".")?n:`${n}${s}`},Ll=a=>{if(a==null||typeof a=="number"||typeof a!="string")return a;const n=a.match(/^(\d+)\_(\d+)$/);if(!n)return a;const s=Number(n[1]),u=Number(n[2]);return!Number.isFinite(s)||!Number.isFinite(u)?a:String(s*1e3+u)},Tr=async a=>{let n=null,s=null;if(a!=null&&a.id){const d=Ft.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"});try{const f=await Re.downloadAvatarApi(a);n=URL.createObjectURL(f.data),s=$l(a)}finally{d.close()}}else if(a!=null&&a.downloadUrl){const d=await Gn(),f=Ft.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),m=await E.axios.post(a==null?void 0:a.url,null,{responseType:"blob",headers:{Authorization:d,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}).finally(()=>{f.close()}),p=new Blob([m.data],{type:"application/octet-stream;charset=UTF-8"});n=URL.createObjectURL(p),s=a==null?void 0:a.name}else{const d=await Re.downloadAvatarApi({url:a==null?void 0:a.url});!a.url.toUpperCase().includes(".OBJ")&&!a.url.toUpperCase().includes(".STL")&&!a.url.toUpperCase().includes(".MTL")&&!a.url.toUpperCase().includes(".URDF")?(n=URL.createObjectURL(d.data),s=Qa(a)):n=a==null?void 0:a.url}if(we(n)){const d={row:`${n}`,suffix:Ce(s)};Ml(d);return}const u={name:s,blobUrl:n};Et.value=[u],$t.value=!0},Ar=async a=>{let n=null,s=null;if(a!=null&&a.id){const f=await Re.downloadAvatarApi(a);n=URL.createObjectURL(f.data),s=$l(a)}else if(a!=null&&a.downloadUrl){const f=await Gn(),m=await E.axios.post(a==null?void 0:a.url,null,{responseType:"blob",headers:{Authorization:f,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}),p=new Blob([m.data],{type:"application/octet-stream;charset=UTF-8"});n=URL.createObjectURL(p),s=a==null?void 0:a.name}else{const f=await Re.downloadAvatarApi({url:a==null?void 0:a.url});n=URL.createObjectURL(f.data),s=Qa(a)}const u={name:s,blobUrl:n},d=document.createElement("a");d.href=u.blobUrl,d.download=u.name,d.style.display="none",document.body.appendChild(d),d.click(),setTimeout(()=>{document.body.removeChild(d)},100)},Or=(a,n)=>{var u;if(Object.values(n).length===0)return;let s=a;return Object.values(n).find(d=>{var f,m,p;return((f=d==null?void 0:d.toString())==null?void 0:f.includes(".txt"))||((m=d==null?void 0:d.toString())==null?void 0:m.includes(".cpt"))||((p=d==null?void 0:d.toString())==null?void 0:p.includes(".obj"))})?s=[...a,jo.value]:(u=r==null?void 0:r.config)!=null&&u.allowMove&&(s=[...a,{label:"迁移"}]),s},Dr=(a,n={})=>[...a==null?void 0:a.values()].filter(s=>Object.keys(n).every(u=>{var m;const d=s[u],f=(m=n[u])==null?void 0:m.toLowerCase();return f&&d&&typeof d=="string"?d.toLowerCase().includes(f):!0})),Mr=()=>{_e.value=!0},Vl=e.ref([]),$r=async(a,n,s=!1)=>{var u;if(a){if(ft.setTableLoading(!0),Vl.value=Object.values(a),a&&((u=Object.values(a))!=null&&u.every(d=>!d)))return le.value=jt.value;if(s){le.value=[...Lt.value.values()].filter(d=>Object.values(d).some(f=>typeof f=="string"?f==null?void 0:f.toLowerCase().includes(n==null?void 0:n.toLowerCase()):!1));return}le.value=Dr(Lt.value,a),ft.setTableLoading(!1)}},Lr=async a=>{var s;if(!a)return;const n=a==null?void 0:a.id;n!=null&&(v.value.clear(),g.value.clear(),g.value.has(n)||g.value.set(n,de.cloneDeep(a)),le.value=(s=le.value)==null?void 0:s.map(u=>({...u,tableEditType:(u==null?void 0:u.id)===n?"edit":"text"})),v.value.add(n),Kt.value=!0)},Il=async(a,n,s,u)=>{u!=null&&u.isExistChild&&Te("clickMainKey",a)},Vr=()=>{$t.value=!1},Ir=a=>{Te("rowClick",a)};e.watch(()=>r.changedContent,()=>{var s,u;if(!r.changedContent)return;let a=(s=le.value)==null?void 0:s.map(d=>{var f;return d.id===((f=r.changedContent)==null?void 0:f.id)&&(d={...r.changedContent,id:r.changedContent.newId?r.changedContent.newId:r.changedContent.id},delete d.newId),d});const n=(u=r.itemData)==null?void 0:u.map(d=>((d==null?void 0:d.key)==="tableContents"&&(d.contents=a),d));le.value=a,Te("contentChange",{contents:n,index:r.index}),Te("change",{content:a,index:r==null?void 0:r.index,buttonName:"",id:r==null?void 0:r.index})},{deep:!0,immediate:!0});const Pr=()=>{},Rr=async()=>{const a=Ve.value,n=sessionStorage.getItem("systemKey"),s=await Re.getItemData(a,n,""),u=(s==null?void 0:s.find(p=>(p==null?void 0:p.name)==="方法明细"))||(s==null?void 0:s[0]),d=(u==null?void 0:u.compData)||[],f=d==null?void 0:d.find(p=>{const b=p==null?void 0:p.key;return b==="formContent"||b==="tableContents"});return f==null?void 0:f.contents},Gn=async()=>`Bearer ${E.Local.get("access-token")}`,Ur=async(a,{token:n,inputData:s}={})=>await E.axios.post(a,s,{headers:{Authorization:n}}).catch(d=>(mt.setImportLoading(!1),Promise.reject(d))),Fr=a=>{var u;let n={};const s=[];return n.form={},(u=de.cloneDeep(a))==null||u.forEach((d,f)=>{var m,p,b,k,M,$,V,q,Y,pe,ue,I,he,j;if((d==null?void 0:d.comp)==="Table"){(p=(m=d==null?void 0:d.compData)==null?void 0:m.find(w=>(w==null?void 0:w.key)==="header"))==null||p.contents;let A=(M=(k=(b=d==null?void 0:d.compData)==null?void 0:b.find(w=>(w==null?void 0:w.key)==="tableContents"))==null?void 0:k.contents)==null?void 0:M.map(w=>w.slice(1));(pe=(Y=(q=(V=($=d==null?void 0:d.compData)==null?void 0:$.find(w=>(w==null?void 0:w.key)==="header"))==null?void 0:V.contents)==null?void 0:q[0])==null?void 0:Y[0])==null||pe.label;let h=(I=(ue=d==null?void 0:d.compData)==null?void 0:ue.find(w=>(w==null?void 0:w.key)==="header"))==null?void 0:I.contents,C=[];A==null||A.forEach(w=>{let _=[];w==null||w.forEach((ie,H)=>{var y;let Ne={};((y=h[H])==null?void 0:y.label)!=="操作"&&(Ne[h[H].label]=ie,_.push(Ne))}),C.push(_)}),n[d.name]=C}else{const A=(j=(he=d.compData)==null?void 0:he.find(h=>(h==null?void 0:h.key)==="formContent"))==null?void 0:j.contents;A==null||A.forEach(h=>{var C,w;if(h.prop!==""){let _=h==null?void 0:h.value;Array.isArray(_)?_=((C=_==null?void 0:_[0])==null?void 0:C.oldUrl)||"http://222.92.178.198:62001/"+((w=_==null?void 0:_[0])==null?void 0:w.url):_=_.toString(),h={key:(h==null?void 0:h.prop)??(h==null?void 0:h.label),value:_},s.push(h)}})}}),n.form=Re.getFormContents(s),n},zr=a=>{const n=[],s=u=>{u&&typeof u=="object"&&!Array.isArray(u)?Object.values(u).forEach(s):n.push(u)};return s(a),n},jr=async(a,n,s)=>{var h,C,w,_,ie,H,Ne,y,te,Fe,ge,ve,ke,Ue,Ie,X,xe;mt.setImportLoading(!0),ft.setFreshContent(!1);let u=await Rr().catch(W=>(mt.setImportLoading(!1),Promise.reject(W)));u=u==null?void 0:u.filter(W=>{var Be;return((Be=W==null?void 0:W.find($e=>$e==null?void 0:$e.id))==null?void 0:Be.id)===(n==null?void 0:n.id)});let d=Re.getEqualChild([(h=T.value)==null?void 0:h.filter(W=>(W==null?void 0:W.label)!=="操作")]);const f=(w=(C=Re.tableToForm(u,d))==null?void 0:C[0])==null?void 0:w.find(W=>{const Be=W==null?void 0:W.key;return Be==="Interface"||Be==="方法体"}),m=f==null?void 0:f.value;if(!m){console.log("未搜索到isMain, 缺少算法执行接口"),mt.setImportLoading(!1);return}const p=T.value?Re.getEqualChild([T.value]):[],b=p.find(W=>{const Be=W==null?void 0:W.prop;return Be==="Input1"||Be==="输入数据.输入1"||Be==="样本输入数据"}),k=b==null?void 0:b.prop;let M=n==null?void 0:n[k];const $=await Gn().catch(W=>(mt.setImportLoading(!1),Promise.reject(W)));let V=!0,q="";(_=T.value)==null||_.forEach(W=>{(W==null?void 0:W.prop)===k&&(V=!!(W!=null&&W.childPath),q=W==null?void 0:W.childPath)});let Y="";if(V){let W=(H=(ie=T.value)==null?void 0:ie.find(oe=>(oe==null?void 0:oe.isMainKey)===!0))==null?void 0:H.prop;Y=n==null?void 0:n[W];let Be=q==null?void 0:q.split(F),$e=[];Be==null||Be.forEach((oe,Ye)=>{(Be==null?void 0:Be.length)-1===Ye&&$e.push(Y),$e.push(oe)}),$e=$e==null?void 0:$e[0];let Pe=await Re.getItemData($e,sessionStorage.getItem("systemKey"),""),Ee=Pe==null?void 0:Pe.filter(oe=>(oe==null?void 0:oe.name)===k);Ee=Ee==null?void 0:Ee.map(oe=>{var Ye;return oe.compData=(Ye=oe==null?void 0:oe.compData)==null?void 0:Ye.map(Je=>{var P;return(Je==null?void 0:Je.key)==="tableContents"&&(Je.contents=(P=Je==null?void 0:Je.contents)==null?void 0:P.filter(be=>(be==null?void 0:be[1])===(n==null?void 0:n[k]))),Je}),oe}),(!Ee||(Ee==null?void 0:Ee.length)===0)&&(Ee=Pe,Ee=Ee==null?void 0:Ee.map(oe=>{var Ye;return oe.compData=(Ye=oe==null?void 0:oe.compData)==null?void 0:Ye.map(Je=>{var P;return(Je==null?void 0:Je.key)==="tableContents"&&(Je.contents=(P=Je==null?void 0:Je.contents)==null?void 0:P.filter(be=>{var et,Qe;return(be==null?void 0:be[1])===(n==null?void 0:n[(Qe=(et=T==null?void 0:T.value)==null?void 0:et[0])==null?void 0:Qe.prop])})),Je}),oe})),M=Fr(Ee)}const pe=await Ur(m,{token:$,inputData:M}).catch(W=>(mt.setImportLoading(!1),Promise.reject(W))),ue=(Ne=pe==null?void 0:pe.data)==null?void 0:Ne.data,I=p.find(W=>(W==null?void 0:W.prop)==="Output1"),he=I==null?void 0:I.prop;let j=[],A=[];if(ue&&((y=Object.values(ue))==null?void 0:y.length)>0){let W=[];const Be=new FormData,$e=(te=zr(ue))==null?void 0:te.map(async Ee=>{var oe,Ye;if(!Array.isArray(Ee)&&(Ee!=null&&Ee.includes("http"))){let Je=await E.axios.get(Ee,{responseType:"blob"}),P=(Ye=Ee==null?void 0:Ee.split("/"))==null?void 0:Ye[((oe=Ee==null?void 0:Ee.split("/"))==null?void 0:oe.length)-1];Be.append("files",Je.data,P)}else W.push(Ee)});if(await Promise.all($e),!Re.isFormDataEmpty(Be)){let Ee=await Re.uploadAmountApi(Be),oe=(ge=(Fe=Ee==null?void 0:Ee.data)==null?void 0:Fe.result)==null?void 0:ge.map(Ye=>{var Je,P,be,et,Qe,vt;return{name:(vt=(Qe=(et=(Je=Ye==null?void 0:Ye.url)==null?void 0:Je.split("/"))==null?void 0:et[((be=(P=Ye==null?void 0:Ye.url)==null?void 0:P.split("/"))==null?void 0:be.length)-1])==null?void 0:Qe.split("."))==null?void 0:vt[0],url:Ye==null?void 0:Ye.url}});W=[...W,...oe]}let Pe={};for(let Ee in n)Ee!=="id"&&(Pe[Ee]=n[Ee]);Pe[he]=W,A.push({id:n==null?void 0:n.id,value:{tableData:Pe}})}if((A==null?void 0:A.length)>0){const W=A.map($e=>{const Pe={id:$e.id,...$e.value.tableData};return delete Pe._isOCRRow,delete Pe._ocrTableId,delete Pe._isTemp,delete Pe.tableEditType,delete Pe.index,Pe}),Be=[{tableName:(ve=r==null?void 0:r.related)==null?void 0:ve.find($e=>$e==null?void 0:$e.includes("content")),tableContents:W}];await tl.pageBatchUpdateApi({platId:parseInt((ke=ba.value)==null?void 0:ke.plat_id),changeContents:Be})}if((j==null?void 0:j.length)>0)try{await tl.pageBatchAddApi({platId:parseInt((Ue=ba.value)==null?void 0:Ue.plat_id),changeContents:[{tableName:(Ie=r==null?void 0:r.related)==null?void 0:Ie.find(W=>W==null?void 0:W.includes("content")),tableContents:j.map(W=>{var $e,Pe,Ee;const Be={id:(($e=W==null?void 0:W.key)==null?void 0:$e.id)??((Pe=W==null?void 0:W.key)==null?void 0:Pe.rowId)??(W==null?void 0:W.id),...((Ee=W==null?void 0:W.value)==null?void 0:Ee.tableData)||{}};return delete Be._isOCRRow,delete Be._ocrTableId,delete Be._isTemp,delete Be.tableEditType,delete Be.index,Be})}]})}catch(W){E.ElMessage.error(((xe=(X=W==null?void 0:W.response)==null?void 0:X.data)==null?void 0:xe.message)||(W==null?void 0:W.message)||"保存失败"),ft.setTableLoading(!1);return}an(!0),mt.setImportLoading(!1),ft.setFreshContent(!0)},Pl=(a,n)=>(a=a==null?void 0:a.map(s=>{var u,d;return s!=null&&s.children&&((u=s.children)!=null&&u.find(f=>f.id===(n==null?void 0:n.id))?s.children=(d=s.children)==null?void 0:d.filter(f=>(f==null?void 0:f.id)!==(n==null?void 0:n.id)):s.children=Pl(s.children,n)),s}),a),xn=e.ref(!1),Hr=()=>{xn.value=!0},Kr=async a=>{var n,s,u,d;if(xn.value=!1,a){const f={name:a.name||"capture.jpg",url:URL.createObjectURL(a),raw:a,uid:Date.now()+Math.random()};ht.value.push(f),ka(f,"uploading"),_a(f,0);try{const m=new FormData;m.append("file",a,f.name);const p=await Ft.uploadFileApi(m);f.uploadResult=((n=p==null?void 0:p.data)==null?void 0:n.result)||{name:f.name,url:"",fileName:f.name},Cl({name:((s=f.uploadResult)==null?void 0:s.name)||f.name,url:((u=f.uploadResult)==null?void 0:u.url)||"",id:(d=f.uploadResult)==null?void 0:d.id}),ka(f,"uploaded"),_a(f,100)}catch(m){console.error("文件上传失败:",m),E.ElMessage.error(`文件 ${f.name} 上传失败,请重试`),ka(f,"pending"),_a(f,0);const p=ht.value.findIndex(b=>b.uid===f.uid);p>-1&&ht.value.splice(p,1)}}},yt=e.reactive({title:"迁移至",show:!1,width:"20%",selectRow:null,from:r==null?void 0:r.index,to:null,contents:[],formRules:{groupName:[{required:!0,message:"输入不能为空",trigger:"blur"},{validator:(a,n,s)=>{n===(r==null?void 0:r.index)?s(new Error("选择源不能和目标源一致")):s()}}]},buttonValue:[{label:"取消",background:"#999999",color:"var(--ssbutton-theme-color)"},{label:"确认",background:"var(--ssbutton-theme-bg)",color:"var(--ssbutton-theme-color)"}]}),Wr=()=>{yt.show=!1},qr=a=>{var n,s;if((a==null?void 0:a.buttonName)==="取消")return yt.show=!1;yt.to=a==null?void 0:a.content,!(!(r!=null&&r.index)||!((n=yt.to)!=null&&n.groupName))&&(r==null?void 0:r.index)!==((s=yt.to)==null?void 0:s.groupName)&&(Te("change",{buttonName:"迁移",value:{from:yt.from,to:yt.to,data:yt.selectRow}}),yt.show=!1)},Rl=async a=>{var n,s,u,d;if(a){if(!Ga.validateFileSize(a.raw)){E.ElMessage.warning(`文件大小不能超过 ${Zo.value.maxSize}MB`);const f=ht.value.findIndex(m=>m.uid===a.uid);f>-1&&ht.value.splice(f,1),Jn();return}if(!Ga.validateFileType(a.raw)){E.ElMessage.warning("请上传图片文件");const f=ht.value.findIndex(m=>m.uid===a.uid);f>-1&&ht.value.splice(f,1),Jn();return}ka(a,"uploading"),_a(a,0);try{const f=new FormData;f.append("file",a.raw,a.name);const m=await Ft.uploadFileApi(f);a.uploadResult=((n=m==null?void 0:m.data)==null?void 0:n.result)||{name:a.name,url:"",fileName:a.name},Cl({name:((s=a.uploadResult)==null?void 0:s.name)||a.name,url:((u=a.uploadResult)==null?void 0:u.url)||"",id:(d=a.uploadResult)==null?void 0:d.id}),ka(a,"uploaded"),_a(a,100)}catch(f){console.error("文件上传失败:",f),E.ElMessage.error(`文件 ${a.name} 上传失败,请重试`),ka(a,"pending"),_a(a,0);const m=ht.value.findIndex(p=>p.uid===a.uid);m>-1&&ht.value.splice(m,1)}finally{Jn()}}},Jn=()=>{e.nextTick(()=>{const a=document.querySelector('.ocr-upload-input input[type="file"]');a&&(a.value="")})},Ul=async()=>{var s,u;if(sessionStorage.setItem("ocr_root_table_id",String((r==null?void 0:r.index)??"")),ht.value.length===0){E.ElMessage.warning("请先选择要上传的图片");return}if(ht.value.filter(d=>{const f=Wt(d);return f!=="uploaded"&&f!=="completed"}).length>0){E.ElMessage.warning("请等待所有文件上传完成后再开始识别");return}ua.value=!0,ha.value=0;let n=null;try{ht.value.forEach(I=>{ka(I,"processing")});const d=Math.floor(Math.random()*10)+90;n=setInterval(()=>{ha.value<d?ha.value+=1:clearInterval(n)},50);const f=ht.value.map(I=>{var he,j,A;return{name:((he=I.uploadResult)==null?void 0:he.name)||I.name,url:((j=I.uploadResult)==null?void 0:j.url)||"",fileName:((A=I.uploadResult)==null?void 0:A.fileName)||I.name}}),m=Ga.extractTableHeaders(T.value),p=f.map(I=>({name:(I==null?void 0:I.fileName)||(I==null?void 0:I.name),url:(I==null?void 0:I.url)||""})),b=await Ga.recognize(p,m);console.log(b,"ocrResult"),clearInterval(n),ha.value=d;const k=Array.isArray(b==null?void 0:b.result)?b.result:[];if(k.length===0){E.ElMessage.warning("OCR识别未返回有效数据"),ua.value=!1;return}const M=new Set,$=[];k.forEach((I,he)=>{const j=I!=null&&I.数据&&typeof(I==null?void 0:I.数据)=="object"?I.数据:{},A=Array.isArray(I==null?void 0:I.图片信息)?I.图片信息:[],h=new Map;A.forEach(w=>{w!=null&&w.name&&h.set(w.name,w.url||"")});const C={_index:he,_certType:(I==null?void 0:I.证书类型)||"",_certNo:(I==null?void 0:I.证书编号)||"",_ocrImages:A,__ocrFieldMeta:{}};Object.entries(j).forEach(([w,_])=>{let ie="",H=0,Ne=[],y="";_&&typeof _=="object"&&!Array.isArray(_)?(ie=(_==null?void 0:_.value)??"",H=(_==null?void 0:_.score)??0,Ne=Array.isArray(_==null?void 0:_.bboxNorm)?_==null?void 0:_.bboxNorm:[],y=(_==null?void 0:_.imageName)||""):Array.isArray(_)&&_.length>=2?(ie=_[0]??"",H=_[1]??0):(ie=_??"",H=0),C[w]=ie,C[`${w}_accuracy`]=H,M.add(w),C.__ocrFieldMeta[w]={value:ie,score:H,bboxNorm:Ne,imageName:y,imageUrl:y&&h.get(y)||"",images:A}}),$.push(C)});const V=[],q=new Set;$.forEach(I=>{I&&M.forEach(he=>{const j=I[`${he}_accuracy`];(typeof j=="number"?j>0:j!=null&&String(j).trim()!==""&&String(j)!=="0")&&q.add(he)})}),M.forEach(I=>{V.push({prop:I,label:I,editable:!0,minWidth:230}),q.has(I)&&V.push({prop:`${I}_accuracy`,label:"准确率",editable:!1,minWidth:100,isAccuracy:!0})}),ht.value.forEach(I=>{ka(I,"completed")}),ha.value=100,zn.value=V,ma.value=$,Nl.value=f,wl.value=b;const Y=["系统编号","设备名称","制造厂"],pe=V.filter(I=>I&&!I.isAccuracy&&typeof I.prop=="string").map(I=>I.prop),ue=["系统编号","设备名称","制造厂"];ga.value=pe.filter(I=>ue.includes(I)),console.log("[OCR] 默认勾选字段 props:",ga.value),It.value=2,ua.value=!1,Fn.value=!1}catch(d){console.error("OCR处理失败:",d),n&&(clearInterval(n),n=null),E.ElMessage.error(((u=(s=d==null?void 0:d.response)==null?void 0:s.data)==null?void 0:u.message)||"OCR识别失败,请重试"),ua.value=!1,ha.value=0,ht.value.forEach(f=>{ka(f,"pending"),_a(f,0)})}},Za=a=>{if(a==null)return"";let n=String(a);return n=n.replace(/\s+/g," ").trim(),n=n.replace(/[!-~]/g,s=>String.fromCharCode(s.charCodeAt(0)-65248)),n=n.replace(/ /g," "),n=n.replace(/^(编号|No\.?|NO\.?|no\.?|SN\.?|sn\.?|序列号)\s*[::]?\s*/i,""),n},Fl=()=>{var I,he;const a=Nl.value,n=wl.value,s=ma.value;if(!s||s.length===0){E.ElMessage.warning("暂无数据可添加");return}const u=(I=Re.getAllLeafNodes(T.value)||[])==null?void 0:I.filter(j=>(j==null?void 0:j.type)!=="operate"&&(j==null?void 0:j.label)!=="操作"&&(j==null?void 0:j.prop)!=="operate"),d=new Map,f=new Map,m=(he=u==null?void 0:u.find(j=>(j==null?void 0:j.label)==="证书附件"))==null?void 0:he.prop;u==null||u.forEach(j=>{j!=null&&j.label&&(j!=null&&j.prop)&&(d.set(j.label,j.prop),f.set(j.prop,j.label))});const p=Date.now(),b=j=>String(p*1e3+j);let k=0,M=0;const $=[],V=[],q=d.get("编号"),Y=d.get("名称"),pe=d.get("制造厂"),ue=[];if(s.forEach((j,A)=>{var Ue,Ie;const h={id:b(A),_isOCRRow:!0,_ocrTableId:r==null?void 0:r.index};for(const[X,xe]of d.entries())Object.prototype.hasOwnProperty.call(j,X)&&(h[xe]=j[X]);if(m){const X=Array.isArray((Ie=(Ue=n==null?void 0:n.result)==null?void 0:Ue[A])==null?void 0:Ie.图片信息)?n.result[A].图片信息:[];h[m]=X.map(xe=>({url:(xe==null?void 0:xe.url)||"",name:(xe==null?void 0:xe.name)||"",fileName:(xe==null?void 0:xe.name)||""})).filter(xe=>xe.url)}const C=(Array.isArray(n==null?void 0:n.result)?n.result[A]:null)||null,w=(Array.isArray(a)?a[A]:null)||null,_=(w==null?void 0:w.url)||"",ie=(w==null?void 0:w.fileName)||(w==null?void 0:w.name)||"",H=String(ie).toLowerCase().endsWith(".pdf")||String(_).toLowerCase().endsWith(".pdf"),Ne={ts:Date.now(),versionId:String(Date.now())+"_"+String(A),label:new Date().toLocaleString(),certType:(C==null?void 0:C.证书类型)||"",certNo:(C==null?void 0:C.证书编号)||"",fileType:H?"pdf":"image",sourceUrl:H?_:"",images:Array.isArray(C==null?void 0:C.图片信息)?C.图片信息.map(X=>({name:(X==null?void 0:X.name)||"",url:(X==null?void 0:X.url)||""})).filter(X=>X.url):[]},y=X=>{var W,Be,$e,Pe;for(const[Ee,oe]of d.entries())Object.prototype.hasOwnProperty.call(h,oe)&&oe!=="_isOCRRow"&&oe!=="_ocrTableId"&&oe!=="id"&&(X[oe]=h[oe]);if(m){const Ee=Array.isArray((Be=(W=n==null?void 0:n.result)==null?void 0:W[A])==null?void 0:Be.图片信息)?n.result[A].图片信息:[];X[m]=Ee.map(oe=>({url:(oe==null?void 0:oe.url)||"",name:(oe==null?void 0:oe.name)||"",fileName:(oe==null?void 0:oe.name)||""})).filter(oe=>oe.url)}const xe=jt.value.find(Ee=>Ee.id===X.id);if(xe){for(const[Ee,oe]of d.entries())Object.prototype.hasOwnProperty.call(h,oe)&&oe!=="_isOCRRow"&&oe!=="_ocrTableId"&&oe!=="id"&&(xe[oe]=h[oe]);if(m){const Ee=Array.isArray((Pe=($e=n==null?void 0:n.result)==null?void 0:$e[A])==null?void 0:Pe.图片信息)?n.result[A].图片信息:[];xe[m]=Ee.map(oe=>({url:(oe==null?void 0:oe.url)||"",name:(oe==null?void 0:oe.name)||"",fileName:(oe==null?void 0:oe.name)||""})).filter(oe=>oe.url)}}Lt.value&&Lt.value.set(X.id,X),yn(r==null?void 0:r.index,X.id,Ne),V.push(JSON.parse(JSON.stringify(X))),k++},te=X=>Za(X?h==null?void 0:h[X]:""),Fe=te(q),ge=te(Y),ve=te(pe);if(!!(q&&Y&&pe&&Fe&&ge&&ve)){const X=(le.value||[]).find(xe=>{const W=Za(q?xe==null?void 0:xe[q]:""),Be=Za(Y?xe==null?void 0:xe[Y]:""),$e=Za(pe?xe==null?void 0:xe[pe]:"");return W&&Be&&$e&&W===Fe&&Be===ge&&$e===ve});if(X){y(X);return}}if(Fe&&q){const X=(le.value||[]).filter(xe=>{const W=Za(q?xe==null?void 0:xe[q]:"");return W&&W===Fe});ue.push({idx:A,ocrRow:h,versionItem:Ne,ocrNo:Fe,candidates:X});return}yn(r==null?void 0:r.index,h.id,Ne),$.push(h),M++}),V.length>0&&(le.value=[...le.value||[]]),$.length>0&&(le.value=[...le.value||[],...$],jt.value=[...jt.value||[],...$],$.forEach(j=>{var A,h;return(h=(A=Lt.value)==null?void 0:A.set)==null?void 0:h.call(A,j.id,j)})),Ua.value=le.value,(ue||[]).length>0){Sn.value=(ue||[]).map(j=>({...j,selectedTargetId:""})),En.value=!0,Ra.value=V,ya.value=$,Hn.value=n,xl.value=a,_l.value=m||"",k>0&&E.ElMessage.success(`已唯一匹配并准备覆盖 ${k} 条数据(请在候选弹窗确认后提交)`);return}k>0&&E.ElMessage.success(`成功匹配替换 ${k} 条数据`),V.length>0&&Te("change",{buttonName:"编辑",singleContent:V,content:le.value,index:r==null?void 0:r.index,parentTableId:r==null?void 0:r.parentTableId,column:T.value}),$.length>0&&Te("change",{buttonName:"OCR批量新增",content:le.value,index:r==null?void 0:r.index,parentTableId:r==null?void 0:r.parentTableId,column:T.value,ocrRows:$,relatedContents:r==null?void 0:r.related,uploadedFiles:(Array.isArray(n==null?void 0:n.result)?n.result:[]).map(j=>(Array.isArray(j==null?void 0:j.图片信息)?j.图片信息:[]).map(A=>({url:(A==null?void 0:A.url)||"",name:(A==null?void 0:A.name)||"",fileName:(A==null?void 0:A.name)||""})).filter(A=>A.url)),ocrResult:n,matchedCount:k,newCount:M})},zl=(a,n,s)=>{ma.value[a]&&(ma.value[a][n]=s)},Yr=(a,n)=>{if(n)ga.value.includes(a)||ga.value.push(a);else{const s=ga.value.indexOf(a);s>-1&&ga.value.splice(s,1)}},Gr=a=>a==null||a===0?"-":`${(Number(a)*100).toFixed(1)}%`,Jr=a=>{if(a==null||a===0)return"#909399";const n=Number(a);return n>=.9?"#67c23a":n>=.7?"#e6a23c":"#f56c6c"},jl=a=>{var s,u,d,f;if($a.value===a){$a.value=null,La.value=!1,qa.value="";return}$a.value=a,qa.value="";const n=(s=ma.value)==null?void 0:s[a];if(n&&Array.isArray(n._ocrImages)&&n._ocrImages.length>0){Ya.value=n._ocrImages.map(b=>({name:(b==null?void 0:b.name)||"",url:(b==null?void 0:b.url)||""})).filter(b=>b.name||b.url);const m=n.__ocrFieldMeta||{},p=(u=Object.values(m))==null?void 0:u.find(b=>b==null?void 0:b.imageName);jn.value=(p==null?void 0:p.imageName)||((f=(d=Ya.value)==null?void 0:d[0])==null?void 0:f.name)||"",La.value=Ya.value.length>0}else Ya.value=[],La.value=!1,jn.value=""},Xr=()=>{Rn.value=!1,ht.value=[],qo.value=null,It.value=1,bn.value.clear(),kn.value.clear(),ha.value=0,La.value=!1},Qr=a=>a.raw?URL.createObjectURL(a.raw):a.url?a.url:"",Wt=a=>{const n=a.uid||a.name;return bn.value.get(n)||"pending"},Zr=a=>{const n=a.uid||a.name;return kn.value.get(n)||0},_a=(a,n)=>{const s=a.uid||a.name;kn.value.set(s,Math.min(100,Math.max(0,n)))},es=a=>{const n=Wt(a),s=100.53;if(n==="completed"||n==="uploaded")return`${s} ${s}`;if(n==="uploading"){const u=Zr(a);return`${s*(u/100)} ${s}`}else if(n==="processing")return`${s*.5} ${s}`;return`0 ${s}`},ka=(a,n)=>{const s=a.uid||a.name;bn.value.set(s,n),(n==="completed"||n==="uploaded")&&_a(a,100)},ts=()=>{e.nextTick(()=>{const a=document.querySelector('.ocr-upload-input input[type="file"]');if(a)a.value="",a.click();else{const n=document.createElement("input");n.type="file",n.multiple=!0,n.accept="image/*,application/pdf",n.style.display="none",n.onchange=async s=>{const u=Array.from(s.target.files||[]);for(const d of u){const f={name:d.name,raw:d,uid:Date.now()+Math.random()};ht.value.push(f),await Rl(f)}s.target.value="",document.body.removeChild(n)},document.body.appendChild(n),n.click()}})},as=()=>{It.value>1&&It.value--},ns=()=>{It.value===1?ht.value.length>0&&!ua.value&&Ul():It.value===2&&(Fl(),It.value=3)},ls=async a=>{const{row:n}=a||{},s=n==null?void 0:n.id;if(!s){E.ElMessage.warning("暂无可预览数据");return}let u=gn(r==null?void 0:r.index,s);if(!u||u.length===0){const d=sessionStorage.getItem("ocr_root_table_id"),f=d!==null?Number(d):null;if(f!=null&&f!==""&&!Number.isNaN(f)){const m=gn(f,s);Array.isArray(m)&&m.length>0&&(El(r==null?void 0:r.index,s,m),u=m)}}if(!u||u.length===0){E.ElMessage.warning("暂无可预览数据");return}Sl.value=u,Un.value=!0},os=a=>{ht.value=ht.value.filter((n,s)=>s!==a)},Xn=async(a,n,s)=>{var u,d,f,m,p,b,k,M,$,V,q,Y,pe,ue,I,he,j;if(ea.value="",hn.value=!0,me.value=!0,Te("onButtonClick",a,n),z.value=[],a==="删除")fl.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var A,h;(A=le.value)!=null&&A.find(C=>(C==null?void 0:C.id)===(n==null?void 0:n.id))?le.value=(h=de.cloneDeep(le.value))==null?void 0:h.filter(C=>(C==null?void 0:C.id)!==(n==null?void 0:n.id)):le.value=Pl(de.cloneDeep(le.value),n),zc(Ua.value,Wn.value,n==null?void 0:n.id),ft.setTableLoading(r==null?void 0:r.index),Te("change",{content:le.value,fixContent:[n],index:r==null?void 0:r.index,type:"delete",buttonName:a,column:T.value,relatedContents:r==null?void 0:r.related})});else if(a==="批量删除"){if(((u=ca.value)==null?void 0:u.length)===0)return E.ElMessage.warning("请先勾选操作的数据");fl.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var h,C;const A=(h=ca.value)==null?void 0:h.map(w=>w.id);le.value=(C=de.cloneDeep(le.value))==null?void 0:C.filter(w=>!(A!=null&&A.includes(w.id))),ft.setTableLoading(r==null?void 0:r.index),Te("change",{content:le.value,singleContent:null,selectItems:ca.value,index:r==null?void 0:r.index,type:"batchDelete",buttonName:a,column:T.value})})}else if(a==="复制新增"){Vt.value="新增";const A=de.cloneDeep(n),h=(d=T.value)==null?void 0:d.find(_=>_==null?void 0:_.isMainKey),C=h||((f=T.value)==null?void 0:f[0]),w=(m=Nt.value)==null?void 0:m.find(_=>(_==null?void 0:_.label)==="新建");await Hl(!0,w,{data:A,firstCol:C})}else if(a==="新增")Vt.value="新增",tn(""),ta.value=!0;else if(a==="编辑")Vt.value="编辑",tn(n),ta.value=!0;else if(a==="查看")Vt.value="查看",tn(n),hn.value=!1,me.value=!1,ta.value=!0;else if(a==="查看三维模型"){const A={};for(let C in n)C!=="id"&&(A[C]=n[C]);let h=(p=Object.values(A))==null?void 0:p[1];pn.setTableShowThree(h)}else if(a==="切换视图")ys();else if(((b=s==null?void 0:s.extra)==null?void 0:b.type)==="modelExample")Vt.value=a,vn.value=!0;else if(a==="新建"){let A=xa.value,h=[];for(let H in A)H!=null&&H.includes(`loading${((k=ba.value)==null?void 0:k.account)||((M=ba.value)==null?void 0:M.账号)}`)&&(h=[...h,...H]);let C=[];for(let H in A)H!=null&&H.includes(`updateLoading${(($=ba.value)==null?void 0:$.account)||((V=ba.value)==null?void 0:V.账号)}`)&&(C=[...C,...H]);let w=h==null?void 0:h.map(H=>H==null?void 0:H.id);const _=C==null?void 0:C.map(H=>H==null?void 0:H.id);w=[...de.cloneDeep(w),..._],(w==null?void 0:w.length)>0&&(w!=null&&w.every(H=>H!==null&&H))&&await E.batchDeleteInsofDataApi({ids:w});const ie=(q=Nt.value)==null?void 0:q.find(H=>(H==null?void 0:H.label)==="新建");await Hl(!1,ie)}else if(a==="修改模板"){let A=de.cloneDeep(Ve).value;ft.setRouteToChildPath(A),mt.setActiveMenuPath(A+F)}else if(a==="执行")jr(a,n);else if(a!=null&&a.includes("导出")){if(a==="导出选中"&&((Y=ca.value)==null?void 0:Y.length)===0)return E.ElMessage.warning(`请先勾选${a}的数据`);if(a==="导出全部"&&((pe=le.value)==null?void 0:pe.length)===0)return E.ElMessage.warning("暂无数据导出");const A=(I=(ue=T.value)==null?void 0:ue.map(C=>C==null?void 0:C.label))==null?void 0:I.filter(C=>C!=="操作"),h=a==="导出全部"?de.cloneDeep(le.value):de.cloneDeep(ca.value);h==null||h.forEach(C=>{C==null||delete C.id}),mr(h,r==null?void 0:r.compName,A,r==null?void 0:r.compName)}else if(a==="OCR识别")Rn.value=!0,ht.value=[],It.value=1,bn.value.clear(),kn.value.clear(),ha.value=0;else if(a==="迁移")yt.selectRow=n,yt.show=!0;else if(((he=s==null?void 0:s.extra)==null?void 0:he.type)==="methodButton"){let A=n;n===""&&(A=de.cloneDeep(le.value));let h=await to.loadingValueContent(A,T==null?void 0:T.value,a,r==null?void 0:r.index);s!=null&&s.index?le.value=(j=le.value)==null?void 0:j.map((C,w)=>(w===(s==null?void 0:s.index)&&(C=h==null?void 0:h[0]),C)):le.value=h}},rs=async(a,n)=>{var s,u,d,f,m,p,b,k,M,$,V,q,Y,pe,ue,I,he,j,A,h;try{let C,w;const _=(s=xa.value[Ve.value+F])==null?void 0:s.filter(ve=>{var ke;return((ke=ve==null?void 0:ve.key)==null?void 0:ke.type)==="structureMethod"}),ie=(u=xa.value[Ve.value+F])==null?void 0:u.filter(ve=>{var ke;return((ke=ve==null?void 0:ve.key)==null?void 0:ke.type)==="structure"}),H=_==null?void 0:_.find(ve=>{var ke,Ue;return((Ue=(ke=ve==null?void 0:ve.value)==null?void 0:ke.pageData)==null?void 0:Ue.method)==="保存"});if(!H)return;const Ne=(p=(m=xa.value[(f=(d=H==null?void 0:H.value)==null?void 0:d.pageData)==null?void 0:f.path])==null?void 0:m.filter(ve=>{var ke;return((ke=ve==null?void 0:ve.key)==null?void 0:ke.type)==="data"}))==null?void 0:p.find(ve=>{var ke,Ue,Ie,X;return((Ue=(ke=ve==null?void 0:ve.value)==null?void 0:ke.tableData)==null?void 0:Ue.算法名称)===((X=(Ie=H==null?void 0:H.value)==null?void 0:Ie.pageData)==null?void 0:X.method)});if(!Ne)return;const y={buttonName:(k=(b=H==null?void 0:H.value)==null?void 0:b.pageData)==null?void 0:k.method,api:($=(M=Ne==null?void 0:Ne.value)==null?void 0:M.tableData)==null?void 0:$.算法体,content:ie==null?void 0:ie.map(ve=>{var ke;return(ke=ve==null?void 0:ve.value)==null?void 0:ke.pageData}),extraContent:[],extraValues:(q=(V=H==null?void 0:H.value)==null?void 0:V.pageData)==null?void 0:q.data,methodName:(pe=(Y=H==null?void 0:H.value)==null?void 0:Y.pageData)==null?void 0:pe.path};if(!a)return;const te={...a,compData:(ue=a==null?void 0:a.compData)==null?void 0:ue.map(ve=>{var ke;return(ve==null?void 0:ve.key)==="formContent"?{...ve,contents:(ke=ve==null?void 0:ve.contents)==null?void 0:ke.map(Ue=>(Ue==null?void 0:Ue.prop)===n?{...Ue,value:""}:Ue)}:ve})},Fe={key:{pageKey:Ve.value+F,parentTable:"",systemKey:sessionStorage.getItem("systemKey"),type:"structure"},value:{pageData:te}},ge=await E.axios.post(y.api,Fe,{headers:{"Content-Type":"application/json"}});return((I=ge==null?void 0:ge.data)==null?void 0:I.code)===200&&(C=(j=(he=ge==null?void 0:ge.data)==null?void 0:he.result)==null?void 0:j.latestReportCode,w=(h=(A=ge==null?void 0:ge.data)==null?void 0:A.result)==null?void 0:h.status),{newMainKeyValue:C,newStatus:w}}catch(C){throw E.ElMessage.error(C),new Error(C)}},ss=(a,n,s,u)=>{var d;Te("contentChange",{contents:(d=a==null?void 0:a.compData)==null?void 0:d.map(f=>{var m;return(f==null?void 0:f.key)==="formContent"?{...f,contents:(m=f==null?void 0:f.contents)==null?void 0:m.map(p=>(p==null?void 0:p.key)===n?{...p,value:s}:en.value&&(p==null?void 0:p.prop)===en.prop?{...p,value:en.value}:p)}:f}),index:a==null?void 0:a.id},u)},en=e.reactive({prop:"状态",value:""}),is=e.ref(["系统自动生成信息","审批意见"]),us=async(a,n,s)=>{var b,k;let u=a==null?void 0:a[n==null?void 0:n.prop],d=1,f,m;const p=de.cloneDeep(Ve).value+F+u;if(p){en.value="",f=(b=xa.value[p])==null?void 0:b.filter(V=>{var q;return((q=V==null?void 0:V.key)==null?void 0:q.type)==="structure"});const M=f==null?void 0:f.find(V=>{var q,Y,pe;return((pe=(Y=(q=V==null?void 0:V.value)==null?void 0:q.pageData)==null?void 0:Y.comp)==null?void 0:pe.toUpperCase())==="FORM"});m={...(k=M==null?void 0:M.value)==null?void 0:k.pageData,id:M==null?void 0:M.id};const $=await rs(m,n==null?void 0:n.prop);if(en.value=$==null?void 0:$.newStatus,$!=null&&$.newMainKeyValue)return $==null?void 0:$.newMainKeyValue}if(le.value.some(M=>(M==null?void 0:M[n==null?void 0:n.prop])===u)){const M=u;for(;le.value.some($=>($==null?void 0:$[n==null?void 0:n.prop])===`${M}(${d})`);)d++;u=`${M}(${d})`}return u},Hl=async(a,n,s)=>{var m,p,b,k,M,$,V;let u,d;const f=await us(s==null?void 0:s.data,s==null?void 0:s.firstCol);if(a?(u=de.cloneDeep(Ve).value+F+((k=s==null?void 0:s.data)==null?void 0:k[(b=s==null?void 0:s.firstCol)==null?void 0:b.prop]),d=de.cloneDeep(Ve).value+F+f):(u=de.cloneDeep(Ve).value+F,d=de.cloneDeep(u)+`loading${((m=ba.value)==null?void 0:m.account)||((p=ba.value)==null?void 0:p.账号)}`),n){const q=($=(M=xa.value[d])==null?void 0:M.filter(Y=>{var pe;return((pe=Y==null?void 0:Y.key)==null?void 0:pe.parentTable)===""}))==null?void 0:$.map(Y=>{var pe;return{id:Y==null?void 0:Y.id,...(pe=Y==null?void 0:Y.value)==null?void 0:pe.pageData}});if((q==null?void 0:q.length)>0)if(a){const Y=q==null?void 0:q.find(pe=>{var ue;return((ue=pe==null?void 0:pe.comp)==null?void 0:ue.toUpperCase())==="FORM"});Y&&ss(Y,(V=s==null?void 0:s.firstCol)==null?void 0:V.label,f,Ve.value)}else ft.setRouteToChildPath(de.cloneDeep(Ve).value),mt.setActiveMenuPath(d);else await Re.loadingConstruct(u,d,null,null,a?is.value:null),a||(ft.setRouteToChildPath(de.cloneDeep(Ve).value),mt.setActiveMenuPath(d))}else a?(ea.value="",Ht.value=s==null?void 0:s.data,an(!0,s==null?void 0:s.firstCol,f)):(ft.setRouteToChildPath(de.cloneDeep(Ve).value),mt.setActiveMenuPath(d))},cs=()=>{ut.value=!1,Wa.value=[],Me.value=!1},tn=a=>{var m,p,b,k,M,$,V,q,Y,pe,ue,I,he,j,A,h,C,w,_,ie,H,Ne;const n=[];let s=[];for(let y in a)Array.isArray(a==null?void 0:a[y])&&s.push(y);R.value=de.cloneDeep(T.value),(p=Re.getColumnChild((m=de.cloneDeep(T.value))==null?void 0:m.filter(y=>(y==null?void 0:y.label)!=="操作")))==null||p.forEach((y,te)=>{var Fe,ge,ve;s.find(ke=>ke===(y==null?void 0:y.prop))||(y!=null&&y.formType&&((Fe=y==null?void 0:y.formType)==null?void 0:Fe.toUpperCase())==="SELECT"||y!=null&&y.menuId?n.push({label:(ge=y==null?void 0:y.prop)!=null&&ge.includes(".")?y==null?void 0:y.prop:(y==null?void 0:y.label)??(y==null?void 0:y.prop)??"",name:(y==null?void 0:y.prop)??"t"+te,prop:y==null?void 0:y.prop,type:"Select",value:(a==null?void 0:a[y==null?void 0:y.prop])??(y==null?void 0:y.value)??"",id:(y==null?void 0:y.id)??te,contents:(y==null?void 0:y.options)??[],width:1,isFormColHidden:y==null?void 0:y.isFormColHidden,relatedValueId:y==null?void 0:y.relatedValueId,disabled:y==null?void 0:y.disabled,menus:y==null?void 0:y.menus,groups:y==null?void 0:y.groups,words:y==null?void 0:y.words,allSelectionContents:(y==null?void 0:y.allSelectionContents)??[],filterContent:y==null?void 0:y.filterContent,disabled:(y==null?void 0:y.prop)==="disabled"?!0:y==null?void 0:y.disabled}):n.push({label:(ve=y==null?void 0:y.prop)!=null&&ve.includes(".")?y==null?void 0:y.prop:(y==null?void 0:y.label)??(y==null?void 0:y.prop)??"",prop:y==null?void 0:y.prop,name:(y==null?void 0:y.prop)??"t"+te,type:!(y!=null&&y.formType)||(y==null?void 0:y.formType)===""?"Input":y==null?void 0:y.formType,value:(a==null?void 0:a[y==null?void 0:y.prop])??(y==null?void 0:y.value)??"",id:(y==null?void 0:y.id)??te,contents:(y==null?void 0:y.options)??[],width:1,isFormColHidden:y==null?void 0:y.isFormColHidden,disabled:(y==null?void 0:y.prop)==="disabled"?!0:y==null?void 0:y.disabled,relatedValueId:y==null?void 0:y.relatedValueId,menus:y==null?void 0:y.menus,groups:y==null?void 0:y.groups,words:y==null?void 0:y.words}))}),a===""||!a||(ea.value=(a==null?void 0:a.id)??"");let u=Re.getColumnChild((b=de.cloneDeep(T.value))==null?void 0:b.filter(y=>(y==null?void 0:y.label)!=="操作"));na.value&&((k=na.value)==null?void 0:k.length)>0&&(na.value=(M=de.cloneDeep(na).value)==null?void 0:M.map(y=>{var Fe;let te=(y==null?void 0:y.prop)||((Fe=u==null?void 0:u.find(ge=>(ge==null?void 0:ge.label)===(y==null?void 0:y.label)))==null?void 0:Fe.prop);return te&&(y.value=a[te]),y})),qe.value=na.value&&(($=na.value)==null?void 0:$.length)>0?Re.getTableFormToForm(na.value):n;let d=[],f=(V=r.itemData)==null?void 0:V.filter(y=>(y==null?void 0:y.key)==="filterAllType");if((f==null?void 0:f.length)>0&&(d=(f==null?void 0:f.map(te=>te==null?void 0:te.value)).flat()),(d==null?void 0:d.length)>0){let y=(Y=d==null?void 0:d.filter(ge=>{var ve;return(ve=ge==null?void 0:ge.content)==null?void 0:ve.includes("@Type")}))==null?void 0:Y[((q=d==null?void 0:d.filter(ge=>{var ve;return(ve=ge==null?void 0:ge.content)==null?void 0:ve.includes("@Type")}))==null?void 0:q.length)-1];if(y!=null&&y.content){let ge=(I=(ue=(pe=y==null?void 0:y.content)==null?void 0:pe.replace(":",fe))==null?void 0:ue.split(fe))==null?void 0:I[1];if(((he=ge==null?void 0:ge.trim())==null?void 0:he.toUpperCase())==="MANUAL"){let ve=(w=(C=(j=r.itemData)==null?void 0:j.filter(ke=>(ke==null?void 0:ke.key)==="contentTableId"))==null?void 0:C[((h=(A=r.itemData)==null?void 0:A.filter(ke=>(ke==null?void 0:ke.key)==="contentTableId"))==null?void 0:h.length)-1])==null?void 0:w.contents;qe.value=(_=qe.value)==null?void 0:_.map((ke,Ue)=>{var Ie,X;return(Ie=ke==null?void 0:ke.optionUrl)!=null&&Ie.menuId&&(ke.type="Select",(X=ke==null?void 0:ke.optionUrl)!=null&&X.menuId&&(ke.optionUrl.menuId=ke.optionUrl.menuId??ve,ke.optionUrl.menuFilter=d,Vt.value==="新增"&&(ke.optionUrl.multiple=!0,ke.optionUrl.multipleLimit=5))),ke})}}let te=(ie=qe.value)==null?void 0:ie.filter(ge=>{var ve,ke;return((ve=ge==null?void 0:ge.optionUrl)==null?void 0:ve.menuId)&&((ke=ge==null?void 0:ge.optionUrl)==null?void 0:ke.menuId)!==""}),Fe;if(te==null||te.forEach(ge=>{var ke,Ue;if(Fe!==void 0)return;let ve=(ke=ge==null?void 0:ge.optionUrl)==null?void 0:ke.menuId;((Ue=te==null?void 0:te.filter(Ie=>{var X;return((X=Ie==null?void 0:Ie.optionUrl)==null?void 0:X.menuId)===ve}))==null?void 0:Ue.length)>1&&(Fe=ve)}),te=te==null?void 0:te.filter(ge=>{var ve;return((ve=ge==null?void 0:ge.optionUrl)==null?void 0:ve.menuId)===Fe}),(te==null?void 0:te.length)>1){let ge=te==null?void 0:te.map(Ie=>Ie==null?void 0:Ie.prop),ve=te==null?void 0:te.map(Ie=>Ie==null?void 0:Ie.label),ke=te==null?void 0:te.map(Ie=>Ie==null?void 0:Ie.value),Ue=(H=de.cloneDeep(te))==null?void 0:H[0];Ue.label=ve==null?void 0:ve.join("·"),Ue.value=ke==null?void 0:ke.join(" "),Ue.value.trim()===""&&(Ue.value=""),Ue.prop=ge==null?void 0:ge.join("·"),Ue.usingType="parent",qe.value.unshift(Ue),qe.value=(Ne=qe.value)==null?void 0:Ne.map(Ie=>(ge!=null&&ge.find(X=>X===(Ie==null?void 0:Ie.prop))&&(Ie.isFormColHidden=!0),Ie))}}},ds=()=>{var n;const a=(n=c.value)==null?void 0:n.$el;a&&Re.Sortable.create(a,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:s=>{var m;const{oldIndex:u,newIndex:d}=s;if(u===d)return;const f=Xa.value.splice(u,1)[0];Xa.value.splice(d,0,f),T.value=(m=T.value)==null?void 0:m.slice().sort((p,b)=>{if(p.label==="操作")return 1;if(b.label==="操作")return-1;const k=Xa.value.findIndex($=>$.label===p.label),M=Xa.value.findIndex($=>$.label===b.label);return k-M})}})};e.onMounted(()=>{Pn.value=window.innerWidth-240*2});const ps=()=>{e.nextTick(()=>{ds()})},Qn=(a,n)=>{var u;if(!a&&!(a!=null&&a.children))return{contents:a,currentSelectContents:void 0};let s;return a.children=(u=a.children)==null?void 0:u.map(d=>{var f,m;if((d==null?void 0:d.id)===ea.value){let p={};for(let b in d){let k=(f=n==null?void 0:n.find(M=>(M==null?void 0:M.prop)===b))==null?void 0:f.label;k?p[b]=(m=Ht.value)==null?void 0:m[k]:p[b]=d[b]}d=Object.assign(p,Ht.value),s=d}else{let p=Qn(d,n);d=p==null?void 0:p.contents,s=p==null?void 0:p.currentSelectContents}return d}),{contents:a,currentSelectContents:s}},Kl=(a,n)=>{let s,u;return a!=null&&a.find(d=>(d==null?void 0:d.id)===ea.value)?s=a==null?void 0:a.map(d=>{var f,m;if((d==null?void 0:d.id)===ea.value){let p={};for(let b in d){let k=(f=n==null?void 0:n.find(M=>(M==null?void 0:M.prop)===b))==null?void 0:f.label;k?p[b]=(m=Ht.value)==null?void 0:m[k]:p[b]=d[b]}d=Object.assign(p,Ht.value),u=d}return d}):s=a==null?void 0:a.map(d=>{var f,m,p,b;if((d==null?void 0:d.id)===ea.value){let k={};for(let M in d){let $=(f=n==null?void 0:n.find(V=>(V==null?void 0:V.prop)===M))==null?void 0:f.label;$?k[M]=(m=Ht.value)==null?void 0:m[$]:k[M]=d[M]}d=Object.assign(k,Ht.value),u=d}else d=(p=Qn(d,n))==null?void 0:p.contents,u=(b=Qn(d,n))==null?void 0:b.currentSelectContents;return d}),{newContents:s,currentSelectContents:u}},Wl=(a,n,s)=>{var u,d;return a[n==null?void 0:n.prop]=s,typeof a.id=="number"&&(a.id=(u=a.id)==null?void 0:u.toString()),a.children&&((d=a.children)==null?void 0:d.length)>0&&(a.children=a.children.map(Wl)),a},ql=a=>{var s;const n=[];return n.push({...a}),a!=null&&a.children&&Array.isArray(a.children)&&((s=a.children)==null||s.forEach(u=>{n.push(...ql(u))})),(n==null?void 0:n.length)>0?n==null?void 0:n.map(u=>{const d={...u};return delete d.children,d}):[]},an=(a=!0,n,s)=>{var k,M,$,V,q,Y,pe,ue,I,he,j,A,h,C,w,_,ie,H,Ne,y,te,Fe,ge,ve,ke,Ue,Ie;let u=Re.getColumnChild((k=de.cloneDeep(T.value))==null?void 0:k.filter(X=>(X==null?void 0:X.label)!=="操作")),d,f=de.cloneDeep(le.value);if(!Ht.value){ta.value=!1;return}if(ea.value===""){Xe.value++;let X;n&&s?X={id:Xe.value.toString(),[n==null?void 0:n.prop]:s,children:Ht.value.children}:X={id:Xe.value.toString()},X!=null&&X.children&&(X={...X,children:(M=X.children)==null?void 0:M.map(xe=>Wl(xe,n,s))}),f.push(Object.assign(Ht.value,X)),d=Object.assign(Ht.value,X)}else f=($=Kl(f,u))==null?void 0:$.newContents,d=(V=Kl(f,u))==null?void 0:V.currentSelectContents;const m=(q=r.itemData)==null?void 0:q.filter(X=>(X==null?void 0:X.key)==="childTree")[0];if(((Y=m==null?void 0:m.contents)==null?void 0:Y.length)>0){Vt.value="编辑";const X=[];f==null||f.forEach((xe,W)=>{var $e;let Be={};if(Array.isArray(xe)){let Pe=[];xe==null||xe.filter(Ee=>!(Ee!=null&&Ee.id)).forEach((Ee,oe)=>{var Ye,Je,P,be,et,Qe,vt;if((Je=(Ye=la.value)==null?void 0:Ye[oe])!=null&&Je.prop&&!Array.isArray(Ee)){let S={};S[la.value[oe].column]=Ee,ot!=null&&ot.value&&((P=ot==null?void 0:ot.value)==null?void 0:P.length)>0&&((be=ot==null?void 0:ot.value)!=null&&be.find(Ae=>JSON.stringify(Ae==null?void 0:Ae[0])===JSON.stringify(S)))&&(Pe=(et=ot==null?void 0:ot.value)==null?void 0:et.find(Ae=>JSON.stringify(Ae==null?void 0:Ae[0])===JSON.stringify(S))),Pe&&Pe.length>0?Be[la.value[oe].prop]=Pe!=null&&Pe.find(Ae=>{var Ze;return((Ze=Object.keys(Ae))==null?void 0:Ze[0])===la.value[oe].column})?(Qe=Pe==null?void 0:Pe.find(Ae=>{var Ze;return((Ze=Object.keys(Ae))==null?void 0:Ze[0])===la.value[oe].column}))==null?void 0:Qe[la.value[oe].column]:Ee:Be[la.value[oe].prop]=Ee}else Array.isArray(Ee)&&((vt=la.value[oe])!=null&&vt.prop?Be[la.value[oe].prop]=Ee:Be.children=vl(Ee,la.value))})}else Be=xe;if(Array.isArray(xe)&&xe.some(Pe=>Pe==null?void 0:Pe.id)){const Pe=($e=xe==null?void 0:xe.find(Ee=>Ee.id))==null?void 0:$e.id;X.push(Object.assign(Be,{id:Ll(Pe)}))}else Be.id?X.push(Be):X.push(Object.assign(Be,{id:W.toString()}))}),le.value=Xl(X,m,T.value)}else le.value=f;Gl(le.value),Ua.value=le.value;const p=Hc(Ua.value,Wn.value,f);let b=[];if(wa.value?(b=(pe=de.cloneDeep(wa).value.singleContent)==null?void 0:pe.filter(X=>(X==null?void 0:X.id)!==(d==null?void 0:d.id)),b.push(d)):b=[d],Kt.value){const X={content:p,singleContent:((ue=m==null?void 0:m.contents)==null?void 0:ue.length)>0?b==null?void 0:b.flatMap(ql):b,index:r==null?void 0:r.index,buttonName:"编辑",column:T.value,parentTableId:r==null?void 0:r.parentTableId};ft.setCacheUpdatingData(X)}if(a){(A=(j=(he=(I=r.itemData)==null?void 0:I.find(W=>(W==null?void 0:W.key)==="filterAllType"))==null?void 0:he.value)==null?void 0:j.find(W=>(W==null?void 0:W.value)==="onConditionContents"))==null||A.content;let X=(h=r.itemData)==null?void 0:h.filter(W=>(W==null?void 0:W.key)==="filterAllType");X=Array.from(new Map(X.filter(Boolean).map((W,Be)=>[W.value,{...W,_idx:Be}])).values()).sort((W,Be)=>W._idx-Be._idx).map(({_idx:W,...Be})=>Be),X=(C=X==null?void 0:X[(X==null?void 0:X.length)-1])==null?void 0:C.value;const xe={fixContent:[d],buttonName:Vt.value,relatedContents:r==null?void 0:r.related};ft.setTableLoading(r==null?void 0:r.index),ta.value=!1,Ht.value=void 0,Te("change",xe)}if((ie=(_=(w=qe.value)==null?void 0:w[0])==null?void 0:_.optionUrl)!=null&&ie.menuId){ta.value=!1;let X=(H=r.itemData)==null?void 0:H.filter(xe=>(xe==null?void 0:xe.key)==="filterAllType");if((X==null?void 0:X.length)>0){let xe=X==null?void 0:X.map($e=>$e==null?void 0:$e.value),W=(te=(y=(Ne=xe.flat().find($e=>{var Pe;return(Pe=$e==null?void 0:$e.content)==null?void 0:Pe.includes("@Num")}))==null?void 0:Ne.content)==null?void 0:y.split(":"))==null?void 0:te[1];((ve=(ge=(Fe=xe.flat().find($e=>{var Pe;return(Pe=$e==null?void 0:$e.content)==null?void 0:Pe.includes("@Type:")}))==null?void 0:Fe.content)==null?void 0:ge.split(":"))==null?void 0:ve[1])!=="Manual"&&(W=parseInt(W),le.value=(Ie=le.value)==null?void 0:Ie.slice(((ke=le.value)==null?void 0:ke.length)-W,(Ue=le.value)==null?void 0:Ue.length))}}};e.onUnmounted(()=>{T.value=[],le.value=[],R.value=[],Ct.value=[],na.value=[],fa.value=[],Wa.value=[],St.value=[],qe.value=[],ca.value=[],c.value=null});const Zn=async(a,n,s)=>{var k,M,$,V,q,Y,pe,ue,I,he,j;oa.value=s==null?void 0:s.prop;const u=de.cloneDeep(r.itemData),d=u==null?void 0:u.map(A=>{var h;return(A==null?void 0:A.key)==="header"&&((h=A.contents)==null||h.map((C,w)=>{var _,ie,H,Ne,y,te,Fe,ge,ve,ke,Ue,Ie,X,xe,W,Be,$e,Pe,Ee;return C.type=C!=null&&C.type?C.type:(Ne=(H=(ie=(_=C==null?void 0:C.key)==null?void 0:_.split("$"))==null?void 0:ie[1])==null?void 0:H.split("("))!=null&&Ne[0]?(te=(y=Re.FormType)==null?void 0:y.find(oe=>{var Ye,Je,P,be;return(oe==null?void 0:oe.key)===((be=(P=(Je=(Ye=C==null?void 0:C.key)==null?void 0:Ye.split("$"))==null?void 0:Je[1])==null?void 0:P.split("("))==null?void 0:be[0])}))==null?void 0:te.value:"Input",C.options=C!=null&&C.options?C.options:((ve=(ge=(Fe=C==null?void 0:C.key)==null?void 0:Fe.split("$"))==null?void 0:ge[1])==null?void 0:ve.length)>0?(X=(Ie=$n((Ue=(ke=C==null?void 0:C.key)==null?void 0:ke.split("$"))==null?void 0:Ue[1]))==null?void 0:Ie.split(","))==null?void 0:X.map(oe=>({label:oe,value:oe})):[],(xe=C==null?void 0:C.key)!=null&&xe.includes("$")&&(C.key=(Be=(W=C==null?void 0:C.key)==null?void 0:W.split("$"))==null?void 0:Be[0]),C.value=($e=Object.values(n))==null?void 0:$e[w],C.optionUrl=C!=null&&C.formMenuSelect&&((Pe=C==null?void 0:C.formMenuSelect)==null?void 0:Pe.length)>0?{groupSelect:(Ee=C==null?void 0:C.groupSelect)==null?void 0:Ee.split(/[::]/).map(oe=>oe.trim()),menuSelect:C==null?void 0:C.formMenuSelect,selectRelateType:"",type:(C==null?void 0:C.formType)??(C!=null&&C.groupSelect?"Select":"")}:null,C})),A});let f=de.cloneDeep(qe.value),m=(M=(k=de.cloneDeep(d))==null?void 0:k.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:M.contents;f=f==null?void 0:f.map(A=>{var h;return A.value=(h=m==null?void 0:m.find((C,w)=>w===(A==null?void 0:A.id)))==null?void 0:h.value,A});let p="",b=(q=(V=($=de.cloneDeep(d))==null?void 0:$.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:V.contents)==null?void 0:q.find((A,h)=>{var C,w,_;return(A==null?void 0:A.label)===oa.value||(h==null?void 0:h.toString())===((_=(w=(C=oa.value)==null?void 0:C.split("a"))==null?void 0:w[1])==null?void 0:_.toString())});if((ue=(pe=(Y=de.cloneDeep(d))==null?void 0:Y.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:pe.contents)==null||ue.forEach(A=>{var h,C,w,_,ie;p===""&&((w=(C=(h=A==null?void 0:A.optionUrl)==null?void 0:h.groupSelect)==null?void 0:C[1])!=null&&w.includes("["))&&(p=(ie=(_=A==null?void 0:A.optionUrl)==null?void 0:_.groupSelect)==null?void 0:ie[1])}),(I=b==null?void 0:b.optionUrl)!=null&&I.menuSelect){let A=await Ln(b),h;if(A==null||A.forEach(C=>{var w,_,ie,H,Ne,y,te,Fe,ge,ve;p===((_=(w=b==null?void 0:b.optionUrl)==null?void 0:w.groupSelect)==null?void 0:_[1])&&((Ne=(H=(ie=b==null?void 0:b.optionUrl)==null?void 0:ie.groupSelect)==null?void 0:H[1])!=null&&Ne.includes("["))&&((ve=de.cloneDeep(C))==null?void 0:ve[(ge=(Fe=(te=(y=b==null?void 0:b.optionUrl)==null?void 0:y.groupSelect)==null?void 0:te[1])==null?void 0:Fe.replaceAll("[",""))==null?void 0:ge.replaceAll("]","")])===(b==null?void 0:b.value)&&(h=C)}),h){let C=de.cloneDeep(f);C=C==null?void 0:C.map(_=>{var ie,H,Ne,y,te,Fe,ge,ve,ke,Ue,Ie;return(h!=null&&h[_==null?void 0:_.label]||h!=null&&h[(y=(Ne=(H=(ie=_==null?void 0:_.optionUrl)==null?void 0:ie.groupSelect)==null?void 0:H[1])==null?void 0:Ne.replaceAll("[",""))==null?void 0:y.replaceAll("]","")])&&((ge=(Fe=(te=_==null?void 0:_.optionUrl)==null?void 0:te.groupSelect)==null?void 0:Fe[1])!=null&&ge.includes("["))&&(_.value=(h==null?void 0:h[_==null?void 0:_.label])||(h==null?void 0:h[(Ie=(Ue=(ke=(ve=_==null?void 0:_.optionUrl)==null?void 0:ve.groupSelect)==null?void 0:ke[1])==null?void 0:Ue.replaceAll("[",""))==null?void 0:Ie.replaceAll("]","")])),_}),le.value=(he=de.cloneDeep(le.value))==null?void 0:he.map(_=>{if((_==null?void 0:_.id)===(n==null?void 0:n.id)){const ie={};return C==null||C.forEach(H=>{ie[H.name]=H.value}),ie.id=_==null?void 0:_.id,ie}return _});let w=de.cloneDeep(C);w=w==null?void 0:w.map(_=>{var ie,H,Ne,y;return(H=(ie=_==null?void 0:_.optionUrl)==null?void 0:ie.menuSelect)!=null&&H.some(te=>te==null?void 0:te.includes)&&(_.optionUrl.menuSelect=(y=(Ne=_==null?void 0:_.optionUrl)==null?void 0:Ne.menuSelect)==null?void 0:y.map(te=>{var Fe,ge,ve,ke;if(te!=null&&te.includes("[")){let Ue=(ge=(Fe=te==null?void 0:te.replaceAll("[","").replaceAll("]",""))==null?void 0:Fe.split(":"))==null?void 0:ge[1];te=(ke=(ve=de.cloneDeep(C))==null?void 0:ve.find(Ie=>(Ie==null?void 0:Ie.label)===Ue))==null?void 0:ke.value}return te})),_}),le.value=(j=de.cloneDeep(le.value))==null?void 0:j.map(_=>{if((_==null?void 0:_.id)===(n==null?void 0:n.id)){const ie={};return w==null||w.forEach(H=>{ie[H.name]=H.value}),ie.id=_==null?void 0:_.id,ie}return _})}}},fs=async a=>{var q,Y,pe,ue,I,he,j,A,h,C,w,_,ie,H,Ne,y,te,Fe,ge,ve,ke,Ue,Ie,X,xe,W,Be,$e,Pe,Ee,oe,Ye,Je;if(!a)return;Ht.value=a;const n=de.cloneDeep(r.itemData);let s=n==null?void 0:n.map(P=>{var be,et,Qe,vt;return(P==null?void 0:P.key)==="header"&&(Array.isArray((be=P.contents)==null?void 0:be[0])?P.contents=(Qe=Re.getColumnChild((et=P.contents)==null?void 0:et[0]))==null?void 0:Qe.map((S,Ae)=>{var Ze,B,lt,wt,xt,_t,Bt,Tt,At,Ot,N,Z,ze,Dt,dt,st,kt,Rt,Mt,Xt,Yt,Gt,Q,O;return S.type=S!=null&&S.type?S.type:(wt=(lt=(B=(Ze=S==null?void 0:S.key)==null?void 0:Ze.split("$"))==null?void 0:B[1])==null?void 0:lt.split("("))!=null&&wt[0]?(_t=(xt=Re.FormType)==null?void 0:xt.find(Oe=>{var pt,De,Ge,Ke;return(Oe==null?void 0:Oe.key)===((Ke=(Ge=(De=(pt=S==null?void 0:S.key)==null?void 0:pt.split("$"))==null?void 0:De[1])==null?void 0:Ge.split("("))==null?void 0:Ke[0])}))==null?void 0:_t.value:"Input",S.options=S!=null&&S.options?S.options:((At=(Tt=(Bt=S==null?void 0:S.key)==null?void 0:Bt.split("$"))==null?void 0:Tt[1])==null?void 0:At.length)>0?(ze=(Z=$n((N=(Ot=S==null?void 0:S.key)==null?void 0:Ot.split("$"))==null?void 0:N[1]))==null?void 0:Z.split(","))==null?void 0:ze.map(Oe=>({label:Oe,value:Oe})):[],(Dt=S==null?void 0:S.key)!=null&&Dt.includes("$")&&(S.key=(st=(dt=S==null?void 0:S.key)==null?void 0:dt.split("$"))==null?void 0:st[0]),((Mt=(Rt=(kt=qe.value)==null?void 0:kt.find(Oe=>(Oe==null?void 0:Oe.prop)===(S==null?void 0:S.prop)))==null?void 0:Rt.optionUrl)==null?void 0:Mt.multiple)===!0&&!Array.isArray((Xt=Object.values(a))==null?void 0:Xt[Ae])?S.value=[(Yt=Object.values(a))==null?void 0:Yt[Ae]]:S.value=(Gt=Object.values(a))==null?void 0:Gt[Ae],S.optionUrl=S!=null&&S.formMenuSelect&&((Q=S==null?void 0:S.formMenuSelect)==null?void 0:Q.length)>0?{groupSelect:(O=S==null?void 0:S.groupSelect)==null?void 0:O.split(/[::]/).map(Oe=>Oe.trim()),menuSelect:S==null?void 0:S.formMenuSelect,selectRelateType:"",type:(S==null?void 0:S.formType)??(S!=null&&S.groupSelect?"Select":"")}:null,S}):P.contents=(vt=P.contents)==null?void 0:vt.map((S,Ae)=>{var Ze,B,lt,wt,xt,_t,Bt,Tt,At,Ot,N,Z,ze,Dt,dt,st,kt,Rt,Mt,Xt,Yt,Gt,Q,O;return S.type=S!=null&&S.type?S.type:(wt=(lt=(B=(Ze=S==null?void 0:S.key)==null?void 0:Ze.split("$"))==null?void 0:B[1])==null?void 0:lt.split("("))!=null&&wt[0]?(_t=(xt=Re.FormType)==null?void 0:xt.find(Oe=>{var pt,De,Ge,Ke;return(Oe==null?void 0:Oe.key)===((Ke=(Ge=(De=(pt=S==null?void 0:S.key)==null?void 0:pt.split("$"))==null?void 0:De[1])==null?void 0:Ge.split("("))==null?void 0:Ke[0])}))==null?void 0:_t.value:"Input",S.options=S!=null&&S.options?S.options:((At=(Tt=(Bt=S==null?void 0:S.key)==null?void 0:Bt.split("$"))==null?void 0:Tt[1])==null?void 0:At.length)>0?(ze=(Z=$n((N=(Ot=S==null?void 0:S.key)==null?void 0:Ot.split("$"))==null?void 0:N[1]))==null?void 0:Z.split(","))==null?void 0:ze.map(Oe=>({label:Oe,value:Oe})):[],(Dt=S==null?void 0:S.key)!=null&&Dt.includes("$")&&(S.key=(st=(dt=S==null?void 0:S.key)==null?void 0:dt.split("$"))==null?void 0:st[0]),((Mt=(Rt=(kt=qe.value)==null?void 0:kt.find(Oe=>(Oe==null?void 0:Oe.prop)===(S==null?void 0:S.prop)))==null?void 0:Rt.optionUrl)==null?void 0:Mt.multiple)===!0&&!Array.isArray((Xt=Object.values(a))==null?void 0:Xt[Ae])?S.value=[(Yt=Object.values(a))==null?void 0:Yt[Ae]]:S.value=(Gt=Object.values(a))==null?void 0:Gt[Ae],S.optionUrl=S!=null&&S.formMenuSelect&&((Q=S==null?void 0:S.formMenuSelect)==null?void 0:Q.length)>0?{groupSelect:(O=S==null?void 0:S.groupSelect)==null?void 0:O.split(/[::]/).map(Oe=>Oe.trim()),menuSelect:S==null?void 0:S.formMenuSelect,selectRelateType:"",type:(S==null?void 0:S.formType)??(S!=null&&S.groupSelect?"Select":"")}:null,S})),P}),u=qe.value,d=(Y=(q=de.cloneDeep(s))==null?void 0:q.find(P=>(P==null?void 0:P.key)==="header"))==null?void 0:Y.contents;if(d=d==null?void 0:d.filter(P=>(P==null?void 0:P.label)!=="操作"),d.push({label:"操作",type:"operate"}),u=u==null?void 0:u.map(P=>{var be;return P.value=P.value??((be=d==null?void 0:d.find((et,Qe)=>(et==null?void 0:et.prop)===(P==null?void 0:P.name)))==null?void 0:be.value),P}),!Ja.value)return;let f="",m=de.cloneDeep(oa.value);(pe=oa.value)!=null&&pe.includes("·")&&(oa.value=(I=(ue=oa.value)==null?void 0:ue.split("·"))==null?void 0:I[0]);let p=(A=(j=(he=de.cloneDeep(s))==null?void 0:he.find(P=>(P==null?void 0:P.key)==="header"))==null?void 0:j.contents)==null?void 0:A.find((P,be)=>{var et,Qe,vt;return(P==null?void 0:P.prop)===oa.value||(be==null?void 0:be.toString())===((vt=(Qe=(et=oa.value)==null?void 0:et.split("a"))==null?void 0:Qe[1])==null?void 0:vt.toString())}),b=(h=p==null?void 0:p.optionUrl)==null?void 0:h.menuSelect,k=!0;(_=(w=(C=de.cloneDeep(s))==null?void 0:C.find(P=>(P==null?void 0:P.key)==="header"))==null?void 0:w.contents)==null||_.forEach(P=>{var et,Qe,vt,S,Ae,Ze,B;let be=(Qe=(et=P==null?void 0:P.optionUrl)==null?void 0:et.groupSelect)==null?void 0:Qe[1];!be&&!Array.isArray((vt=P==null?void 0:P.optionUrl)==null?void 0:vt.groupSelect)&&(be=(Ze=(Ae=(S=P==null?void 0:P.optionUrl)==null?void 0:S.groupSelect)==null?void 0:Ae.split(":"))==null?void 0:Ze[1]),k&&(be!=null&&be.includes("["))&&(f=be,JSON.stringify(b)===JSON.stringify((B=P==null?void 0:P.optionUrl)==null?void 0:B.menuSelect)&&(k=!1))});let M=de.cloneDeep(u),$=He.value;$!=null&&$.find(P=>(p==null?void 0:p.prop)===(P==null?void 0:P.key))&&($=$==null?void 0:$.filter(P=>(p==null?void 0:p.prop)!==(P==null?void 0:P.key))),$!=null&&$.find(P=>m===(P==null?void 0:P.key))&&($=$==null?void 0:$.filter(P=>m!==(P==null?void 0:P.key))),M=M==null?void 0:M.map(P=>{var be,et,Qe,vt,S,Ae,Ze,B;return(P==null?void 0:P.type)==="Select"&&(((be=P==null?void 0:P.allSelectionContents)==null?void 0:be.length)>0&&(P.contactValue=a),((p==null?void 0:p.prop)===(P==null?void 0:P.prop)||m===(P==null?void 0:P.prop))&&p&&(Array.isArray(p.value)&&((et=p.value)==null?void 0:et.length)>0&&((Qe=p.value)!=null&&Qe.every(lt=>typeof lt=="string"))?($.push({key:P==null?void 0:P.prop,value:[(S=p.value)==null?void 0:S[((vt=p.value)==null?void 0:vt.length)-1]]}),P.selectValue=(Ae=$==null?void 0:$.find(lt=>(lt==null?void 0:lt.key)===(P==null?void 0:P.prop)))==null?void 0:Ae.value):Array.isArray(p.value)&&((Ze=p.value)==null?void 0:Ze.length)===0?($=[],P.selectValue=[],a[P==null?void 0:P.prop]=""):Array.isArray(P.value)&&$.push({key:P==null?void 0:P.prop,value:[(B=P.value)==null?void 0:B[(P==null?void 0:P.length)-1]]}))),P.value=a==null?void 0:a[P==null?void 0:P.prop],P}),He.value=$,qe.value=de.cloneDeep(M);let V=(p==null?void 0:p.menuId)??((Ne=(H=(ie=qe.value)==null?void 0:ie.find(P=>{var be;return(be=P==null?void 0:P.optionUrl)==null?void 0:be.menuId}))==null?void 0:H.optionUrl)==null?void 0:Ne.menuId);if((y=p==null?void 0:p.optionUrl)!=null&&y.menuSelect&&Ja.value||V){let P=await Ln(p,V),be;if(P==null||P.forEach(S=>{var Ae,Ze,B,lt,wt,xt,_t,Bt,Tt,At,Ot,N,Z,ze,Dt,dt,st,kt,Rt,Mt,Xt,Yt,Gt,Q,O,Oe,pt;if(!V&&f===((Ze=(Ae=p==null?void 0:p.optionUrl)==null?void 0:Ae.groupSelect)==null?void 0:Ze[1])&&((wt=(lt=(B=p==null?void 0:p.optionUrl)==null?void 0:B.groupSelect)==null?void 0:lt[1])!=null&&wt.includes("["))&&((At=de.cloneDeep(S))==null?void 0:At[(Tt=(Bt=(_t=(xt=p==null?void 0:p.optionUrl)==null?void 0:xt.groupSelect)==null?void 0:_t[1])==null?void 0:Bt.replaceAll("[",""))==null?void 0:Tt.replaceAll("]","")])===(p==null?void 0:p.value)&&(be=S),V){let De=(N=(Ot=qe.value)==null?void 0:Ot.find(it=>{var gt;return(p==null?void 0:p.menuId)===((gt=it==null?void 0:it.optionUrl)==null?void 0:gt.menuId)}))==null?void 0:N.prop,Ge=a[De];if(De!=null&&De.includes("·"))if(!Array.isArray(a[De]))Ge=(ze=(Z=a[De])==null?void 0:Z.split(" "))==null?void 0:ze[0],De=(Dt=De==null?void 0:De.split("·"))==null?void 0:Dt[0];else{De=(dt=De==null?void 0:De.split("·"))==null?void 0:dt[0];let it=(kt=(st=M==null?void 0:M.find(gt=>(gt==null?void 0:gt.prop)===De))==null?void 0:st.selectValue)==null?void 0:kt[0];Ge=(Rt=it==null?void 0:it.split(" "))==null?void 0:Rt[0]}let Ke=(Xt=(Mt=M==null?void 0:M.find(it=>{var gt;return(it==null?void 0:it.prop)===De||((gt=it==null?void 0:it.prop)==null?void 0:gt.includes("."+De))}))==null?void 0:Mt.selectValue)==null?void 0:Xt[0];if(De!=null&&De.includes(".")&&!S[De]&&(De=(Gt=De==null?void 0:De.split("."))==null?void 0:Gt[((Yt=De==null?void 0:De.split("."))==null?void 0:Yt.length)-1]),Array.isArray(Ge)&&!Ke&&(Ke=Ge==null?void 0:Ge[0]),S[De]===(Array.isArray(Ge)?Ke:Ge)&&(p==null?void 0:p.directiveLabel)==="#isMain"){if(m!=null&&m.includes("·")){let it=m==null?void 0:m.split("·"),gt=(pt=(Oe=(O=Array.isArray(a==null?void 0:a[m])?(Q=a==null?void 0:a[m])==null?void 0:Q[0]:a==null?void 0:a[m])==null?void 0:O.split(" "))==null?void 0:Oe.filter(Pt=>Pt&&Pt!==""))==null?void 0:pt.map(Pt=>Pt==null?void 0:Pt.trim());it==null||it.forEach((Pt,at)=>{S[Pt]=gt==null?void 0:gt[at]})}be=S}}}),_e.value&&(p==null?void 0:p.directiveLabel)==="#isMain"&&(z.value=[]),!be){if(_e.value&&(p==null?void 0:p.directiveLabel)==="#isMain")if(m!=null&&m.includes("·")){let S=a,Ae=(ge=(Fe=(te=a==null?void 0:a[m])==null?void 0:te.split(" "))==null?void 0:Fe.filter(B=>B&&B!==""))==null?void 0:ge.map(B=>B==null?void 0:B.trim());(ve=m==null?void 0:m.split("·"))==null||ve.forEach((B,lt)=>{S[B]=Ae[lt]});let Ze=(ke=qe.value)==null?void 0:ke.find(B=>(B==null?void 0:B.prop)===m);S[Ze.prop]=[Ze.value],be=S}else{let S=(Ue=qe.value)==null?void 0:Ue.find(Ae=>(Ae==null?void 0:Ae.prop)===(p==null?void 0:p.prop));a[S.prop]=[S.value],be=a}else if((p==null?void 0:p.directiveLabel)==="#isMain"){let S={};(Ie=qe.value)==null||Ie.forEach(Ae=>{var Ze,B;(Ae==null?void 0:Ae.prop)===m?S[Ae.prop]=(Ze=Ae==null?void 0:Ae.selectValue)!=null&&Ze[0]?[(B=Ae==null?void 0:Ae.selectValue)==null?void 0:B[0]]:"":S[Ae.prop]=""}),be=S}}if(be){let S=de.cloneDeep(u);S=S==null?void 0:S.map(B=>{var wt,xt,_t,Bt,Tt,At,Ot,N,Z,ze,Dt,dt,st,kt,Rt,Mt,Xt,Yt,Gt,Q,O,Oe,pt,De,Ge,Ke,it,gt,Pt,at,Qt,ra,Ca,Ut,sa,nn,ln,on,rn,sn,un,cn,je,nt;if(((wt=B==null?void 0:B.prop)!=null&&wt.includes(".")&&(be!=null&&be[(Tt=(xt=B==null?void 0:B.prop)==null?void 0:xt.split("."))==null?void 0:Tt[((Bt=(_t=B==null?void 0:B.prop)==null?void 0:_t.split("."))==null?void 0:Bt.length)-1]])||be!=null&&be[B==null?void 0:B.prop]||be!=null&&be[(Z=(N=(Ot=(At=B==null?void 0:B.optionUrl)==null?void 0:At.groupSelect)==null?void 0:Ot[1])==null?void 0:N.replaceAll("[",""))==null?void 0:Z.replaceAll("]","")])&&((dt=(Dt=(ze=B==null?void 0:B.optionUrl)==null?void 0:ze.groupSelect)==null?void 0:Dt[1])!=null&&dt.includes("["))&&!(B!=null&&B.relatedValueId))return B.value=(be==null?void 0:be[B==null?void 0:B.prop])??(be==null?void 0:be[(Mt=(st=B==null?void 0:B.prop)==null?void 0:st.split("."))==null?void 0:Mt[((Rt=(kt=B==null?void 0:B.prop)==null?void 0:kt.split("."))==null?void 0:Rt.length)-1]])??(be==null?void 0:be[(Q=(Gt=(Yt=(Xt=B==null?void 0:B.optionUrl)==null?void 0:Xt.groupSelect)==null?void 0:Yt[1])==null?void 0:Gt.replaceAll("[",""))==null?void 0:Q.replaceAll("]","")]),B;let lt=be==null?void 0:be[B==null?void 0:B.prop];return(O=B==null?void 0:B.prop)!=null&&O.includes(".")&&!lt&&((pt=(Oe=p==null?void 0:p.prop)==null?void 0:Oe.split("."))==null?void 0:pt[0])===((Ge=(De=B==null?void 0:B.prop)==null?void 0:De.split("."))==null?void 0:Ge[0])&&(lt=(be==null?void 0:be[(Pt=(Ke=B==null?void 0:B.prop)==null?void 0:Ke.split("."))==null?void 0:Pt[((gt=(it=B==null?void 0:B.prop)==null?void 0:it.split("."))==null?void 0:gt.length)-1]])??(be==null?void 0:be[B==null?void 0:B.prop])),V&&(lt||lt==="")&&(B!=null&&B.relatedValueId)&&Vt.value==="新增"&&((B==null?void 0:B.prop)!==(p==null?void 0:p.prop)||m!=null&&m.includes((p==null?void 0:p.prop)+"·")||m!=null&&m.includes("·"+(B==null?void 0:B.prop)))?B.value=lt??(be==null?void 0:be[(Ca=(ra=(Qt=(at=B==null?void 0:B.optionUrl)==null?void 0:at.groupSelect)==null?void 0:Qt[1])==null?void 0:ra.replaceAll("[",""))==null?void 0:Ca.replaceAll("]","")]):(m!=null&&m.includes("·"+(B==null?void 0:B.prop))||m!=null&&m.includes("."))&&(B==null?void 0:B.prop)!==(p==null?void 0:p.prop)&&!Array.isArray((sa=(Ut=qe.value)==null?void 0:Ut.find(rt=>(rt==null?void 0:rt.prop)===(B==null?void 0:B.prop)))==null?void 0:sa.value)?B.value=lt??"":((nn=B==null?void 0:B.optionUrl)==null?void 0:nn.multiple)===!0&&!Array.isArray((on=(ln=qe.value)==null?void 0:ln.find(rt=>(rt==null?void 0:rt.prop)===(B==null?void 0:B.prop)))==null?void 0:on.value)?B.value=((sn=(rn=qe.value)==null?void 0:rn.find(rt=>(rt==null?void 0:rt.prop)===(B==null?void 0:B.prop)))==null?void 0:sn.value)===""?[]:[(cn=(un=qe.value)==null?void 0:un.find(rt=>(rt==null?void 0:rt.prop)===(B==null?void 0:B.prop)))==null?void 0:cn.value]:B.value=(nt=(je=qe.value)==null?void 0:je.find(rt=>(rt==null?void 0:rt.prop)===(B==null?void 0:B.prop)))==null?void 0:nt.value,B}),qe.value=de.cloneDeep(S);let Ae=de.cloneDeep(S);Ae=Ae==null?void 0:Ae.map(B=>{var lt,wt,xt,_t,Bt,Tt,At,Ot,N;return(wt=(lt=B==null?void 0:B.optionUrl)==null?void 0:lt.menuSelect)!=null&&wt.some(Z=>Z==null?void 0:Z.includes("["))&&(B.optionUrl.oldMenuSelect=(_t=(xt=de.cloneDeep(B))==null?void 0:xt.optionUrl)==null?void 0:_t.menuSelect,B.optionUrl.menuSelect=(Tt=(Bt=B==null?void 0:B.optionUrl)==null?void 0:Bt.menuSelect)==null?void 0:Tt.map(Z=>{var ze,Dt,dt,st;if(Z!=null&&Z.includes("[")){let kt=(Dt=(ze=Z==null?void 0:Z.replaceAll("[","").replaceAll("]",""))==null?void 0:ze.split(":"))==null?void 0:Dt[1];Z=(st=(dt=de.cloneDeep(S))==null?void 0:dt.find(Rt=>(Rt==null?void 0:Rt.label)===kt))==null?void 0:st.value}return Z})),((p==null?void 0:p.prop)===(B==null?void 0:B.prop)||m===(B==null?void 0:B.prop))&&Array.isArray(p.value)&&(At=p.value)!=null&&At.every(Z=>typeof Z=="string")&&(B.selectValue=((Ot=$==null?void 0:$.find(Z=>(Z==null?void 0:Z.key)===(B==null?void 0:B.prop)))==null?void 0:Ot.value)??((N=B.value)==null?void 0:N[0])),B}),qe.value=Ae;let Ze={};(X=qe.value)==null||X.forEach(B=>{Ze[B.prop]=B==null?void 0:B.value}),Ht.value=Ze}let et=z.value,Qe={};(xe=qe.value)==null||xe.forEach(S=>{var Ae,Ze,B,lt,wt,xt,_t,Bt,Tt,At,Ot;if(((S==null?void 0:S.directiveLabel)==="#isMain"||(Ae=S==null?void 0:S.optionUrl)!=null&&Ae.menuId)&&Array.isArray(S==null?void 0:S.value)){if(Qe[S.prop]||(Qe[S.prop]=(B=S.value)==null?void 0:B[((Ze=S.value)==null?void 0:Ze.length)-1]),(lt=S==null?void 0:S.prop)!=null&&lt.includes("·")){let N=(_t=(xt=(wt=S==null?void 0:S.prop)==null?void 0:wt.split("·"))==null?void 0:xt.filter(ze=>ze&&ze!==""))==null?void 0:_t.map(ze=>ze==null?void 0:ze.trim()),Z=(Ot=(At=(Tt=(Bt=S==null?void 0:S.selectValue)==null?void 0:Bt[0])==null?void 0:Tt.split(" "))==null?void 0:At.filter(ze=>ze&&ze!==""))==null?void 0:Ot.map(ze=>ze==null?void 0:ze.trim());N==null||N.forEach((ze,Dt)=>{Qe=Object.assign({},Qe,{[ze]:Z==null?void 0:Z[Dt]})})}}else Qe[S.prop]=(Qe==null?void 0:Qe[S==null?void 0:S.prop])??S.value});let vt=(W=qe.value)==null?void 0:W.find(S=>{var Ae;return(S==null?void 0:S.directiveLabel)==="#isMain"||((Ae=S==null?void 0:S.optionUrl)==null?void 0:Ae.menuId)});(p==null?void 0:p.directiveLabel)==="#isMain"&&(($e=p==null?void 0:p.value)==null?void 0:$e[((Be=p==null?void 0:p.value)==null?void 0:Be.length)-1])!==""?et.push({label:p==null?void 0:p.prop,value:(Ee=p==null?void 0:p.value)==null?void 0:Ee[((Pe=p==null?void 0:p.value)==null?void 0:Pe.length)-1],objectValue:Qe}):((oe=vt==null?void 0:vt.value)==null?void 0:oe.length)>0&&((Je=p==null?void 0:p.value)==null?void 0:Je[((Ye=p==null?void 0:p.value)==null?void 0:Ye.length)-1])!==""&&(et=et==null?void 0:et.map(S=>{var Ae;return(S==null?void 0:S.value)===((Ae=vt==null?void 0:vt.selectValue)==null?void 0:Ae[0])&&(S.objectValue=Qe),S})),z.value=et}Ja.value=!0,_e.value=!1},vs=a=>a?(a==null?void 0:a.toUpperCase())==="INPUT"?"TEXTAREA":a:"TEXTAREA",hs=a=>{var f,m;const n=(m=(f=na.value)==null?void 0:f.find(p=>(p==null?void 0:p.label)===(a==null?void 0:a.label)))==null?void 0:m.multiple,s=a==null?void 0:a.prop;if((a==null?void 0:a.formType)!="Select")return;le.value.forEach(p=>{const b=p==null?void 0:p[s];n&&no.isString(b)&&(p[s]=[b]),!n&&!no.isString(b)&&(p[s]="")})},Yl=(a,n)=>{var s;return n==null||n.forEach(u=>{a[u==null?void 0:u.prop]=u==null?void 0:u.value}),a.children&&((s=a.children)==null?void 0:s.length)>0&&(a.children=a.children.map(u=>Yl(u,n))),a},el=a=>{var s,u,d,f,m,p;tn("");const n=(s=qe.value)==null?void 0:s.reduce((b,k)=>(b[k.name]=k.value,b),{});if(((u=Object.keys(n))==null?void 0:u.length)>0){Ht.value=n,ea.value="",Xe.value=(d=le.value)==null?void 0:d.length,St.value=(f=Nt.value)==null?void 0:f.filter(k=>(k==null?void 0:k.label)!=="新增");const b=(p=(m=R.value)==null?void 0:m.filter(k=>(k==null?void 0:k.label)!=="操作"))==null?void 0:p.map(k=>{var $,V,q;const M=(V=($=na.value)==null?void 0:$.find(Y=>(Y==null?void 0:Y.label)===(k==null?void 0:k.label)))==null?void 0:V.multiple;return hs(k),{...k,contents:(k==null?void 0:k.options)??[],optionUrl:k!=null&&k.formMenuSelect&&((q=k==null?void 0:k.formMenuSelect)==null?void 0:q.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:M}:null}});T.value=b==null?void 0:b.map(k=>Yl(k,[{prop:"type",value:"edit"},{prop:"columnType",value:vs(k==null?void 0:k.formType)||(k==null?void 0:k.columnType)}])),a==="createClick"&&(Vt.value="新增",an(!0))}},Fa={START:"开始时间",END:"结束时间",HOURS:"工时"},ms=(a,n)=>Number(Re.dayjs(n).diff(Re.dayjs(a),"day",!0).toFixed(1)),Gl=a=>{var f;const n=r.itemData,s=(f=n==null?void 0:n.find(m=>(m==null?void 0:m.key)==="header"))==null?void 0:f.contents,u=new Map;return s==null||s.forEach((m,p)=>{const{label:b}=m;u.set(b,p)}),!u.has(Fa.START)||!u.has(Fa.END)||!u.has(Fa.HOURS)?a:a==null?void 0:a.map(m=>{const p=m==null?void 0:m[Fa.START],b=m==null?void 0:m[Fa.END],k=ms(p,b);return p&&b&&(m[Fa.HOURS]=`${k}天`),m})},Jl=(a,n,s=0)=>{if(s>((n==null?void 0:n.length)??""))return a;const u=n==null?void 0:n[s],d=new Map;for(const m of a){const p=m[u];d.has(p)||d.set(p,[]),d.get(p)&&d.get(p).push(m)}const f=[];for(const[m,p]of d){const[b,...k]=p,M={...b};s+1===((n==null?void 0:n.length)??"")?M.children=p==null?void 0:p.map($=>($.level=de.cloneDeep(s)+1,$)).filter(($,V)=>V!==0):k.length>0&&(M.children=Jl(k,n,s+1)),M.level=s,f.push(M)}return f},Xl=(a,n,s)=>{var d;if(!(n!=null&&n.contents)||((d=n==null?void 0:n.contents)==null?void 0:d.length)===0)return a;let u=[];return u=Jl(a,n==null?void 0:n.contents,0),u},Ql=async(a,n)=>{var ue,I,he,j,A,h,C,w,_,ie,H,Ne,y,te,Fe,ge,ve,ke,Ue,Ie,X,xe,W,Be,$e,Pe,Ee,oe,Ye,Je,P,be,et,Qe,vt,S,Ae,Ze,B,lt,wt,xt,_t,Bt,Tt,At,Ot;const s=a==null?void 0:a.filter(N=>(N==null?void 0:N.key)==="header");a==null||a.filter(N=>(N==null?void 0:N.key)==="tableIndexColumn")[0];const u=a==null?void 0:a.filter(N=>(N==null?void 0:N.key)==="childTree")[0];let d=!0;if((he=(I=(ue=a==null?void 0:a.find(N=>(N==null?void 0:N.key)==="filterAllType"))==null?void 0:ue.value)==null?void 0:I.find(N=>(N==null?void 0:N.value)==="onPamButtonContents"))!=null&&he.content){let N=(h=(A=(j=a==null?void 0:a.find(Z=>(Z==null?void 0:Z.key)==="filterAllType"))==null?void 0:j.value)==null?void 0:A.find(Z=>(Z==null?void 0:Z.value)==="onPamButtonContents"))==null?void 0:h.content;N=(C=N==null?void 0:N.split(":"))==null?void 0:C[1],N=(w=N.slice(1,(N==null?void 0:N.length)-1))==null?void 0:w.split(","),d=!!(N!=null&&N.find(Z=>Z==="操作"))}const f=a==null?void 0:a.find(N=>(N==null?void 0:N.key)==="page"),m=a==null?void 0:a.find(N=>(N==null?void 0:N.key)==="rowButton"),p=a==null?void 0:a.find(N=>(N==null?void 0:N.key)==="extraButton"),b=a==null?void 0:a.filter(N=>(N==null?void 0:N.key)==="tableContents"),k=a==null?void 0:a.filter(N=>(N==null?void 0:N.key)==="bottomButton"),M=a==null?void 0:a.filter(N=>(N==null?void 0:N.key)==="tableIndex");na.value=(ie=(_=a==null?void 0:a.filter(N=>(N==null?void 0:N.key)==="tableToForm"))==null?void 0:_[0])==null?void 0:ie.contents,pa.value=(f==null?void 0:f.contents)??!0;let $=[];Va.value===""?$=s==null?void 0:s[0]:$=(s==null?void 0:s.find(N=>(N==null?void 0:N.selectLabel)==="("+Va.value+")"))??(s==null?void 0:s.find(N=>!(N!=null&&N.selectLabel)));let V=[];Va.value===""?V=M==null?void 0:M[0]:V=(M==null?void 0:M.find(N=>(N==null?void 0:N.selectLabel)==="("+Va.value+")"))??(M==null?void 0:M.find(N=>!(N!=null&&N.selectLabel)));let q=[],Y=[];if(((H=$==null?void 0:$.contents)==null?void 0:H.length)>0){let N=[],Z=$==null?void 0:$.contents;if(Array.isArray(Z==null?void 0:Z[0])&&((Ne=Z==null?void 0:Z[0])!=null&&Ne.every(Q=>!(Q!=null&&Q.children)))&&(Z=Z==null?void 0:Z[0]),Z.some(Q=>Array.isArray(Q)&&(Q==null?void 0:Q.find(O=>O.children))))N=(y=Re.getGradeColumns(Z,d))==null?void 0:y[0],N!=null&&N.find(Q=>(Q==null?void 0:Q.label)==="操作")||N.push({label:"操作",prop:"operate",type:"operate"});else{let Q=Z.some(O=>Array.isArray(O))?Z==null?void 0:Z[0]:Z;Q!=null&&Q.find(O=>(O==null?void 0:O.label)==="操作")||Q.push({label:"操作",prop:"operate",type:"operate"}),Q==null||Q.forEach((O,Oe)=>{var pt,De,Ge,Ke,it,gt,Pt,at,Qt,ra,Ca,Ut,sa,nn,ln,on,rn,sn,un,cn;if((De=(pt=Ve.value)==null?void 0:pt.split("/"))==null||De.forEach(je=>{var nt,rt,eo;je!==""&&((eo=(rt=(nt=je==null?void 0:je.split(F+"updateLoading"))==null?void 0:nt[0])==null?void 0:rt.split(F+"loading"))==null||eo[0])}),O!=null&&O.methodContent){let je=(it=(Ke=(Ge=O==null?void 0:O.methodContent)==null?void 0:Ge.replace("@","%%#"))==null?void 0:Ke.split("%%#"))==null?void 0:it[1];if(je=je==null?void 0:je.slice(0,(je==null?void 0:je.length)-1),je=Re.contentTransArrayToAllNoExtra(je??"",","),(gt=je==null?void 0:je.find(nt=>nt==null?void 0:nt.includes("@Button")))!=null&&gt.includes("Prop")&&((Pt=je==null?void 0:je.find(nt=>nt==null?void 0:nt.includes("Type")))!=null&&Pt.includes("Manual"))){let nt=(Qt=(at=je==null?void 0:je.find(rt=>rt==null?void 0:rt.includes("@Button")))==null?void 0:at.split(":"))==null?void 0:Qt[1];nt=((Ut=(Ca=(ra=nt==null?void 0:nt.replaceAll("[",""))==null?void 0:ra.replaceAll("]",""))==null?void 0:Ca.split(","))==null?void 0:Ut[1])??"算法执行",q.push(nt)}else if((sa=je==null?void 0:je.find(nt=>nt==null?void 0:nt.includes("@Button")))!=null&&sa.includes("Row")&&((nn=je==null?void 0:je.find(nt=>nt==null?void 0:nt.includes("Type")))!=null&&nn.includes("Manual"))){let nt=(on=(ln=je==null?void 0:je.find(rt=>rt==null?void 0:rt.includes("@Button")))==null?void 0:ln.split(":"))==null?void 0:on[1];nt=((un=(sn=(rn=nt==null?void 0:nt.replaceAll("[",""))==null?void 0:rn.replaceAll("]",""))==null?void 0:sn.split(","))==null?void 0:un[1])??"算法执行",Y.push(nt)}}(cn=na.value)==null||cn.find(je=>(je==null?void 0:je.prop)===(O==null?void 0:O.prop)),N.push({label:(O==null?void 0:O.label)==="操作"?d?"操作":"":(O==null?void 0:O.label)??"",prop:(O==null?void 0:O.label)==="操作"?"operate":(O==null?void 0:O.prop)??"a"+Oe,width:O!=null&&O.width?parseInt(O.width):"",fixed:(O==null?void 0:O.fixed)??void 0,sortable:(O==null?void 0:O.sortable)??!0,filterable:(O==null?void 0:O.filterable)??!1,operable:(O==null?void 0:O.operable)??!1,showSummary:(O==null?void 0:O.showSummary)??!1,align:(O==null?void 0:O.align)??"left",showOverflowTooltip:(O==null?void 0:O.showOverflowTooltip)??!0,isNotDrag:(O==null?void 0:O.isNotDrag)??!1,isEditCol:(O==null?void 0:O.isEditCol)??!1,isOperate:(O==null?void 0:O.isOperate)??!1,id:(O==null?void 0:O.id)??Oe,type:(O==null?void 0:O.label)==="操作"?"operate":void 0,formType:(O==null?void 0:O.formType)??(O!=null&&O.groupSelect?"Select":""),disabled:O==null?void 0:O.disabled,options:(O==null?void 0:O.options)??[],value:(O==null?void 0:O.value)??"",isExistChild:(O==null?void 0:O.isExistChild)??!1,allSelectionContents:(O==null?void 0:O.allContents)??[],filterContent:O==null?void 0:O.filterContents,menus:O==null?void 0:O.menus,groups:O==null?void 0:O.groups,words:O==null?void 0:O.words})})}ee.value=(te=k==null?void 0:k[0])==null?void 0:te.contents;const ze=Re.getNewColumnChild(N),Dt=Q=>Array.isArray(Q)?Q.map(O=>(Array.isArray(O==null?void 0:O.children)&&O.children.length>0?(O.sortable=!1,Dt(O.children)):(O==null?void 0:O.prop)==="operate"||(O==null?void 0:O.label)==="操作"||(O==null?void 0:O.type)==="operate"||(O.sortable=!0),O)):Q;Dt(ze),await wr(ze),od(We.value,ze),T.value=ze,Ct.value=ze,l.value=(Fe=T.value)==null?void 0:Fe.map(Q=>Q==null?void 0:Q.label);let dt=(ve=(ge=Re.getAllLeafNodes(T.value))==null?void 0:ge.filter(Q=>(Q==null?void 0:Q.type)!=="operate"))==null?void 0:ve.map((Q,O)=>({prop:(Q==null?void 0:Q.prop)??"a"+O,column:Q.label}));la.value=dt;let st=[];Va.value===""?st=b==null?void 0:b[0]:st=(b==null?void 0:b.find(Q=>(Q==null?void 0:Q.selectLabel)==="("+Va.value+")"))??(b==null?void 0:b.find(Q=>!(Q!=null&&Q.selectLabel)));let kt=Array.isArray((ke=st==null?void 0:st.contents)==null?void 0:ke[0])&&((Ue=st==null?void 0:st.contents)!=null&&Ue[0].every(Q=>Array.isArray(Q)))?(Ie=st==null?void 0:st.contents)==null?void 0:Ie[0]:st==null?void 0:st.contents;V!=null&&V.contents&&((X=V==null?void 0:V.contents)==null?void 0:X.length)!==0&&(kt=(xe=de.cloneDeep(kt))==null?void 0:xe.map((Q,O)=>{if(!Array.isArray(Q)){let Oe={};for(let pt in Q)pt!=="id"&&pt!=="index"&&(Oe[pt]=Q[pt]);Q=Object.values(Oe)}return Q}));const Rt=!!((W=T.value)!=null&&W.find(Q=>Q.prop==="index"));kt=Ro(kt,V==null?void 0:V.contents,Rt);const Mt=[];kt==null||kt.forEach((Q,O)=>{var pt;let Oe={};if(Array.isArray(Q)){let De=[];Q==null||Q.filter(Ge=>!(Ge!=null&&Ge.id)).forEach((Ge,Ke)=>{var it,gt,Pt,at,Qt,ra;if((it=dt==null?void 0:dt[Ke])!=null&&it.prop&&!Array.isArray(Ge)){let Ca={};Ca[dt[Ke].column]=Ge,ot!=null&&ot.value&&((gt=ot==null?void 0:ot.value)==null?void 0:gt.length)>0&&((Pt=ot==null?void 0:ot.value)!=null&&Pt.find(Ut=>JSON.stringify(Ut==null?void 0:Ut[0])===JSON.stringify(Ca)))&&(De=(at=ot==null?void 0:ot.value)==null?void 0:at.find(Ut=>JSON.stringify(Ut==null?void 0:Ut[0])===JSON.stringify(Ca))),De&&De.length>0?Oe[dt[Ke].prop]=De!=null&&De.find(Ut=>{var sa;return((sa=Object.keys(Ut))==null?void 0:sa[0])===dt[Ke].column})?(Qt=De==null?void 0:De.find(Ut=>{var sa;return((sa=Object.keys(Ut))==null?void 0:sa[0])===dt[Ke].column}))==null?void 0:Qt[dt[Ke].column]:Ge:Oe[dt[Ke].prop]=Ge}else Array.isArray(Ge)&&((ra=dt[Ke])!=null&&ra.prop?Oe[dt[Ke].prop]=Ge:Oe.children=vl(Ge,dt))})}else Oe=Q;if(Array.isArray(Q)&&Q.some(De=>De==null?void 0:De.id)){const De=(pt=Q==null?void 0:Q.find(Ge=>Ge.id))==null?void 0:pt.id;Mt.push(Object.assign(Oe,{id:Ll(De)}))}else Oe.id?Mt.push(Oe):Mt.push(Object.assign(Oe,{id:O.toString()}))});try{const Q=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),O=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null"),Oe=Q==null?void 0:Q.tableId,pt=Q==null?void 0:Q.compIndex;if(Oe&&Array.isArray(O)&&O.length>0&&String(Oe)===String(r==null?void 0:r.parentTableId)&&String(pt)===String(r==null?void 0:r.index)){const De=new Set(Mt.map(Ke=>String(Ke==null?void 0:Ke.id))),Ge=O.filter(Ke=>!De.has(String(Ke)));if(Ge.length>0){const Ke=Q==null?void 0:Q.pageKey,it=Ke!=null&&Ke.startsWith("/")?Ke.substring(1):Ke;((n==null?void 0:n[Ke])||(n==null?void 0:n[it])||[]).filter(at=>{var Qt,ra;return((Qt=at==null?void 0:at.key)==null?void 0:Qt.type)==="data"&&String((ra=at==null?void 0:at.key)==null?void 0:ra.tableId)===String(Oe)&&Ge.includes(at==null?void 0:at.id)}).forEach(at=>{var Qt;De.has(String(at==null?void 0:at.id))||(Mt.push({id:at==null?void 0:at.id,...((Qt=at==null?void 0:at.value)==null?void 0:Qt.tableData)||{}}),De.add(String(at==null?void 0:at.id)))})}}}catch{}const Xt=Array.from(((Be=Lt.value)==null?void 0:Be.values())||[]).filter(Q=>(Q==null?void 0:Q._isOCRRow)&&(Q==null?void 0:Q._ocrTableId)===(r==null?void 0:r.index));le.value=Xl(Mt,u,T.value),jt.value=Mt,($e=jt.value)==null||$e.forEach(Q=>{var O;(O=Lt.value)==null||O.set(Q.id,Q)});const Yt=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),Gt=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null");if(Yt&&Array.isArray(Gt)&&Gt.length>0&&String(Yt==null?void 0:Yt.compIndex)===String(r==null?void 0:r.index)){const Q=new Set((jt.value||[]).map(O=>String(O==null?void 0:O.id)));Gt.filter(O=>!Q.has(String(O)))}if(Xt.length>0){const Q=new Set((le.value||[]).map(Oe=>Oe==null?void 0:Oe.id)),O=Xt.filter(Oe=>!Q.has(Oe.id));O.length>0&&(le.value=[...le.value||[],...O],jt.value=[...jt.value||[],...O],O.forEach(Oe=>{var pt;return(pt=Lt.value)==null?void 0:pt.set(Oe.id,Oe)}))}}else T.value=[],R.value=[],le.value=[],jt.value=[],Lt.value=new Map;if(Y=[...new Set(Y)],Y=Y==null?void 0:Y.map(N=>({label:N,type:"methodButton"})),((Pe=m==null?void 0:m.contents)==null?void 0:Pe.length)>0?fa.value=m==null?void 0:m.contents:fa.value=[],fa.value=[...fa.value,...Y],q=[...new Set(q)],q=q==null?void 0:q.map(N=>({label:N,type:"methodButton"})),((Ee=p==null?void 0:p.contents)==null?void 0:Ee.length)>0)if((Je=(Ye=(oe=a==null?void 0:a.find(N=>(N==null?void 0:N.key)==="filterAllType"))==null?void 0:oe.value)==null?void 0:Ye.find(N=>(N==null?void 0:N.value)==="onButtonContents"))!=null&&Je.content){let N=(et=(be=(P=a==null?void 0:a.find(Z=>(Z==null?void 0:Z.key)==="filterAllType"))==null?void 0:P.value)==null?void 0:be.find(Z=>(Z==null?void 0:Z.value)==="onButtonContents"))==null?void 0:et.content;if(N=(Qe=N==null?void 0:N.split(":"))==null?void 0:Qe[1],N=(vt=N.slice(1,(N==null?void 0:N.length)-1))==null?void 0:vt.split(","),St.value=(S=p==null?void 0:p.contents)==null?void 0:S.filter(Z=>N==null?void 0:N.find(ze=>ze===(Z==null?void 0:Z.label))),Nt.value=(Ae=p==null?void 0:p.contents)==null?void 0:Ae.filter(Z=>N==null?void 0:N.find(ze=>ze===(Z==null?void 0:Z.label))),(Ze=p==null?void 0:p.contents)!=null&&Ze.some(Z=>(Z==null?void 0:Z.label)==="OCR识别")&&!((B=St.value)!=null&&B.some(Z=>(Z==null?void 0:Z.label)==="OCR识别"))){const Z=(lt=p==null?void 0:p.contents)==null?void 0:lt.find(ze=>(ze==null?void 0:ze.label)==="OCR识别");St.value=[...St.value,Z],Nt.value=[...Nt.value,Z]}ne.value=!!(N!=null&&N.find(Z=>Z==="搜索")),K.value=!!(N!=null&&N.find(Z=>Z==="块状显示"))}else St.value=p==null?void 0:p.contents,Nt.value=p==null?void 0:p.contents;else St.value=[],Nt.value=[];St.value=[...St.value,...q],Nt.value=[...Nt.value,...q],typeof Ve.value=="string"&&Ve.value==="设备管理/试验设备"?((wt=St.value)!=null&&wt.some(N=>(N==null?void 0:N.label)==="OCR识别")||(St.value=[...St.value||[],{label:"OCR识别"}]),(xt=Nt.value)!=null&&xt.some(N=>(N==null?void 0:N.label)==="OCR识别")||(Nt.value=[...Nt.value||[],{label:"OCR识别"}])):(St.value=(St.value||[]).filter(N=>(N==null?void 0:N.label)!=="OCR识别"),Nt.value=(Nt.value||[]).filter(N=>(N==null?void 0:N.label)!=="OCR识别")),(_t=St.value)!=null&&_t.some(N=>(N==null?void 0:N.label)==="切换视图")||(St.value=[...St.value||[],{label:"切换视图"}]),(Bt=Nt.value)!=null&&Bt.some(N=>(N==null?void 0:N.label)==="切换视图")||(Nt.value=[...Nt.value||[],{label:"切换视图"}]),Xe.value=((Tt=le==null?void 0:le.value)==null?void 0:Tt.length)??0,Gl(le.value),Ua.value=le.value,Kt.value&&(T.value=(Ot=(At=R.value)==null?void 0:At.filter(N=>(N==null?void 0:N.label)!=="操作"))==null?void 0:Ot.map(N=>{var Z;return{...N,type:"edit",optionUrl:N!=null&&N.formMenuSelect&&((Z=N==null?void 0:N.formMenuSelect)==null?void 0:Z.length)>0?{groupSelect:N==null?void 0:N.groupSelect,menuSelect:N==null?void 0:N.formMenuSelect,selectRelateType:"",type:N==null?void 0:N.formType}:null}}),el())};e.watch(()=>[r.itemData,Va.value,ar.value,Wn.value,ot==null?void 0:ot.value],async()=>{var a,n,s,u,d,f;if((a=r==null?void 0:r.itemData)!=null&&a.find(m=>(m==null?void 0:m.key)==="columnPath")&&!((n=Ma.value)!=null&&n.find(m=>{var p,b;return(m==null?void 0:m.key)===((b=(p=r==null?void 0:r.itemData)==null?void 0:p.find(k=>(k==null?void 0:k.key)==="columnPath"))==null?void 0:b.contents)}))){let m=Ma.value,p={key:(u=(s=r==null?void 0:r.itemData)==null?void 0:s.find(b=>(b==null?void 0:b.key)==="columnPath"))==null?void 0:u.contents,value:(f=(d=r==null?void 0:r.itemData)==null?void 0:d.find(b=>(b==null?void 0:b.key)==="columnUsingPath"))==null?void 0:f.contents};m!=null&&m.find(b=>(b==null?void 0:b.key)===(p==null?void 0:p.key))?m=m==null?void 0:m.map(b=>((b==null?void 0:b.key)===(p==null?void 0:p.key)&&(b.value=p.value),b)):m.push(p),ft.setTableViewContents(m)}Ql(r.itemData,r.allMapContents)},{deep:!0,immediate:!0}),e.watch(()=>r==null?void 0:r.operatingForm,a=>{a!=null&&a.form&&(tn(a==null?void 0:a.form),Vt.value=a==null?void 0:a.dialogTitle,hn.value=!0,ta.value=!0)},{immediate:!0,deep:!0});const gs=()=>{var a;(a=re.value)!=null&&a.includes("read")&&(Kt.value=!Kt.value)},ys=()=>{Nn.value=!Nn.value};e.watch(()=>{var a;return(a=r==null?void 0:r.config)==null?void 0:a.viewport},a=>{var n;re.value=a,(a==null?void 0:a.length)===0?Kt.value=!1:(a!=null&&a.includes("read")||(Kt.value=!0),a!=null&&a.includes("edit")||(Kt.value=!1)),U.value=((n=r==null?void 0:r.config)==null?void 0:n.showIndex)||Kt.value},{immediate:!0}),e.watch(()=>Kt.value,a=>{var n;a?(el("viewChange"),ft.setCacheUpdatingData(null)):(St.value=Nt.value,T.value=Ct.value,wa.value&&(ft.setTableLoading(r==null?void 0:r.index),Te("change",wa.value))),U.value=a||((n=r==null?void 0:r.config)==null?void 0:n.showIndex)},{immediate:!0}),e.watch(()=>{var a;return(a=Al.value)==null?void 0:a.length},a=>{a===0&&(ye.currentPage=1)}),e.watch(()=>r==null?void 0:r.compNames,a=>{yt.contents=[{label:"列表名",prop:"groupName",name:"列表名",type:"select",value:"",id:0,contents:a||[],width:1}]},{immediate:!0}),e.ref(!1);const bs=(a,n)=>{var s;el("createClick"),n===ye.pageSize&&(ye.currentPage=Math.ceil(((s=le.value)==null?void 0:s.length)/ye.pageSize))},ks=(a,n,s)=>{var u,d;if(Kt.value){const f=a==null?void 0:a.id;f!=null&&(g.value.has(f)||g.value.set(f,de.cloneDeep(a)),v.value.add(f));const m=(n==null?void 0:n.property)??(n==null?void 0:n.prop),p=(u=le.value)==null?void 0:u.findIndex(b=>(b==null?void 0:b.id)===(a==null?void 0:a.id));p!==-1&&m&&(le.value[p]={...le.value[p],[m]:s}),Zn(s,a,n);return}Zn(s,a,n),Ht.value=de.cloneDeep(a),ea.value=a==null?void 0:a.id,Xe.value=(d=le.value)==null?void 0:d.length,Vt.value=a!=null&&a._isTemp?"新增":"编辑",an(!1)},qt=a=>{var b,k,M,$,V,q,Y,pe,ue,I;const{row:n,column:s,item:u,slotData:d}=a;let f=n!=null&&n[s==null?void 0:s.prop]||(n==null?void 0:n[s==null?void 0:s.prop])===0?((k=(b=n==null?void 0:n[s==null?void 0:s.prop])==null?void 0:b[0])==null?void 0:k.contents)??((n==null?void 0:n[s==null?void 0:s.prop])===0?"0":n==null?void 0:n[s==null?void 0:s.prop]):(($=(M=n==null?void 0:n[u==null?void 0:u.prop])==null?void 0:M[0])==null?void 0:$.contents)??(n==null?void 0:n[u==null?void 0:u.prop])??((q=(V=d==null?void 0:d[u==null?void 0:u.prop])==null?void 0:V[0])==null?void 0:q.contents)??(d==null?void 0:d[u==null?void 0:u.prop])??((ue=(pe=n==null?void 0:n[(Y=u==null?void 0:u.child)==null?void 0:Y.prop])==null?void 0:pe[0])==null?void 0:ue.contents)??(n==null?void 0:n[(I=u==null?void 0:u.child)==null?void 0:I.prop]),p=Array.isArray(f)&&!(f!=null&&f.every(he=>typeof he=="string"||typeof he=="number"))?"查看":f;return p=Array.isArray(p)?p.join(","):p,p},Cs=a=>{var k,M,$,V,q,Y,pe,ue,I,he;const{row:n,column:s,item:u,slotData:d}=a;let f=n!=null&&n[s==null?void 0:s.prop]?((M=(k=n==null?void 0:n[s==null?void 0:s.prop])==null?void 0:k[0])==null?void 0:M.contents)??(n==null?void 0:n[s==null?void 0:s.prop]):((V=($=n==null?void 0:n[u==null?void 0:u.prop])==null?void 0:$[0])==null?void 0:V.contents)??(n==null?void 0:n[u==null?void 0:u.prop])??((Y=(q=d==null?void 0:d[u==null?void 0:u.prop])==null?void 0:q[0])==null?void 0:Y.contents)??(d==null?void 0:d[u==null?void 0:u.prop])??((I=(ue=n==null?void 0:n[(pe=u==null?void 0:u.child)==null?void 0:pe.prop])==null?void 0:ue[0])==null?void 0:I.contents)??(n==null?void 0:n[(he=u==null?void 0:u.child)==null?void 0:he.prop]);const p=Array.isArray(f)&&!(f!=null&&f.every(j=>typeof j=="string"||typeof j=="number")),b=Array.isArray(f)&&(f==null?void 0:f.find(j=>j==null?void 0:j.url));return p&&b},Es=(a,n)=>a.find(s=>Object.values(s).some(u=>u===n));return e.watch(()=>Ka.value,async a=>{if(a){mt.setContentLoading(!0),await e.nextTick();const n=Es(le.value,a==null?void 0:a.data);if(!n)return mt.setContentLoading(!1);await Il(a==null?void 0:a.data,null,n,{data:a==null?void 0:a.data}),mt.setContentLoading(!1)}},{deep:!0,immediate:!0}),e.watch(()=>r==null?void 0:r.cacheNewData,a=>{var n;a&&(Array.isArray(a)?a.forEach(s=>{var u,d,f,m,p;if((s==null?void 0:s.compId)===(r==null?void 0:r.index)&&(s!=null&&s.resId)&&((u=s==null?void 0:s.data)!=null&&u.id)){const b=(d=s==null?void 0:s.data)==null?void 0:d.id,k=s==null?void 0:s.resId;if(le.value=(f=le.value)==null?void 0:f.map(M=>(M==null?void 0:M.id)===b?{...M,id:k}:M),(p=(m=Lt.value)==null?void 0:m.has)!=null&&p.call(m,b)){const M=Lt.value.get(b);Lt.value.delete(b),Lt.value.set(k,{...M,id:k})}Wo(r==null?void 0:r.index,b,k)}}):(a==null?void 0:a.compId)===(r==null?void 0:r.index)&&(le.value=(n=le.value)==null?void 0:n.map(s=>{var u;return(s==null?void 0:s.id)===((u=a==null?void 0:a.data)==null?void 0:u.id)?{...s,id:a==null?void 0:a.resId}:s})))},{immediate:!0,deep:!0}),(a,n)=>{var I,he,j,A;const s=e.resolveComponent("svg-icon"),u=e.resolveComponent("el-popover"),d=e.resolveComponent("el-switch"),f=e.resolveComponent("el-checkbox"),m=e.resolveComponent("el-radio"),p=e.resolveComponent("el-radio-group"),b=e.resolveComponent("el-checkbox-group"),k=e.resolveComponent("el-button"),M=e.resolveComponent("LookComponent"),$=e.resolveComponent("el-icon"),V=e.resolveComponent("el-progress"),q=e.resolveComponent("el-alert"),Y=e.resolveComponent("el-table-column"),pe=e.resolveComponent("el-table"),ue=e.resolveComponent("el-upload");return e.openBlock(),e.createElementBlock("div",pd,[Tl.value?(e.openBlock(),e.createBlock(Ft.ssTable,{id:"excel-table",pageObj:ye,showIndex:U.value,isTree:(I=t.compItem)==null?void 0:I.isTree,summaryInfo:ce,columns:T.value,defaultSort:bt,isCardViewport:Nn.value,checkedColumns:l.value,key:Kn.value+JSON.stringify(T.value),tableData:Al.value,isEditViewport:Kt.value,isShowPagination:pa.value,isShowEdit:!1,isShowDelete:!1,allowSelect:D.value,onDbClickRow:Lr,extraButton:St.value,rowButton:fa.value,cacheExtraButtons:Nt.value,isClearSelection:((he=ca.value)==null?void 0:he.length)===0,onDoCurrentChange:dr,onDoSizeChange:pr,onSortChange:fr,onContentClick:Il,onRowClick:Ir,onSelectChange:Er,onCellChange:ks,onChange:Zn,onPreview:Ml,onSubmitEditingTable:Cr,onHandleColEditChange:gr,onHandleColTypeChange:yr,onClickButton:Xn,onAddNewRow:br,bottomButton:ee.value},e.createSlots({headerButton:e.withCtx(h=>{var C,w;return[t.showHeader?(e.openBlock(),e.createBlock(Vc,{key:0,pageLayout:t.pageLayout,lockingPage:e.unref(fn)===e.unref(Ve),filterValues:Vl.value,selectNums:(C=ca.value)==null?void 0:C.length,dataNums:(w=le.value)==null?void 0:w.length,compName:t.compName,isDevMode:t.isDevMode,buttons:h.buttons,onButtonClick:n[1]||(n[1]=(_,ie,H)=>Xn(_,ie,{extra:H})),columns:T.value,onFilter:$r,onGetImportData:hr,level:t.level,filterShow:ne.value},null,8,["pageLayout","lockingPage","filterValues","selectNums","dataNums","compName","isDevMode","buttons","columns","level","filterShow"])):e.createCommentVNode("",!0)]}),viewport:e.withCtx(()=>{var h,C,w,_;return[((h=le.value)==null?void 0:h.length)>0&&t.allowOperate&&K.value?(e.openBlock(),e.createElementBlock("div",hd,[(C=re.value)!=null&&C.includes("read")&&((w=re.value)!=null&&w.includes("edit"))&&((_=fa.value)!=null&&_.some(ie=>(ie==null?void 0:ie.label)==="编辑"))&&!Nn.value&&e.unref(fn)!==e.unref(Ve)?(e.openBlock(),e.createElementBlock("span",{key:0,title:"编辑表格",onClick:gs},[e.createVNode(s,{name:"editTable",class:"view-icon"})])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]}),rowCreate:e.withCtx(({row:h,index:C})=>[e.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:w=>bs(h,C)},[e.createVNode(s,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,md)]),operateCol:e.withCtx(()=>[e.createVNode(u,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"hover",onShow:ps},{reference:e.withCtx(()=>[e.createElementVNode("span",gd,[e.createVNode(s,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:e.withCtx(()=>[e.createElementVNode("div",yd,[n[22]||(n[22]=e.createElementVNode("div",{class:"group-title"},"表格操作",-1)),e.createVNode(d,{"model-value":L.value,"active-text":"排序","inactive-text":"",style:{"margin-right":"8px"},onChange:n[2]||(n[2]=h=>xr(h))},null,8,["model-value"]),n[23]||(n[23]=e.createElementVNode("div",{class:"group-title"},"表格列操作",-1)),e.createVNode(b,{modelValue:l.value,"onUpdate:modelValue":n[3]||(n[3]=h=>l.value=h),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xa.value,h=>(e.openBlock(),e.createElementBlock("div",{style:{display:"flex","align-items":"center"},key:h.label},[e.createVNode(f,{value:h.label,style:{width:"100%",marginRight:0}},{default:e.withCtx(()=>[e.createElementVNode("span",{title:h.label,style:{display:"inline-block",width:"250px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},e.toDisplayString(h.label),9,bd)]),_:2},1032,["value"]),e.createVNode(u,{"popper-class":"col-operate-popover",title:"列操作",placement:"left",teleported:!1,trigger:"hover"},{reference:e.withCtx(()=>[e.createVNode(s,{name:"colOperate",style:{width:"15px",height:"15px",cursor:"pointer",color:"grey",position:"absolute",right:"40px"}})]),default:e.withCtx(()=>{var C;return[e.createElementVNode("div",kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((C=Object.keys(h))==null?void 0:C.filter(w=>{var _;return(_=J.value)==null?void 0:_.find(ie=>(ie==null?void 0:ie.value)===w)}),w=>{var _,ie;return e.openBlock(),e.createElementBlock("div",{key:w},[x[w]=="radio"?(e.openBlock(),e.createElementBlock("div",Cd,[n[21]||(n[21]=e.createElementVNode("div",null,"固定:",-1)),e.createVNode(p,{"model-value":h==null?void 0:h[w],onChange:H=>Dl(H,w,h)},{default:e.withCtx(()=>{var H,Ne;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((Ne=(H=J.value)==null?void 0:H.find(y=>(y==null?void 0:y.value)===w))==null?void 0:Ne.options,y=>(e.openBlock(),e.createBlock(m,{key:y==null?void 0:y.value,label:y==null?void 0:y.value,value:y==null?void 0:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y==null?void 0:y.label),1)]),_:2},1032,["label","value"]))),128))]}),_:2},1032,["model-value","onChange"])])):e.createCommentVNode("",!0),x[w]=="switch"?(e.openBlock(),e.createBlock(d,{key:1,"model-value":h==null?void 0:h[w],"active-text":(ie=(_=J.value)==null?void 0:_.find(H=>(H==null?void 0:H.value)===w))==null?void 0:ie.label,onChange:H=>Dl(H,w,h)},null,8,["model-value","active-text","onChange"])):e.createCommentVNode("",!0)])}),128))])]}),_:2},1024),e.createElementVNode("span",Ed,[e.createVNode(s,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px"}})])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),content:e.withCtx(h=>{var C,w,_,ie,H,Ne,y,te,Fe,ge,ve,ke,Ue,Ie,X,xe,W,Be,$e,Pe;return[((C=h==null?void 0:h.column)==null?void 0:C.label)==="证书附件"||((w=h==null?void 0:h.column)==null?void 0:w.prop)==="证书附件"?(e.openBlock(),e.createElementBlock("div",Sd,[e.createVNode(s,{name:"query",style:{width:"20px",height:"20px",color:"var(--ssComponent-theme-color)",cursor:"pointer"},onClick:e.withModifiers(Ee=>ls(h),["stop"]),title:"查看OCR图片"},null,8,["onClick"])])):Cs(h)?(e.openBlock(),e.createBlock(u,{key:1,"popper-class":"file-popover",placement:"right",trigger:"hover",effect:"light",width:"auto"},{reference:e.withCtx(()=>[e.createElementVNode("span",Nd,e.toDisplayString(qt(h)),1)]),default:e.withCtx(()=>{var Ee,oe;return[e.createElementVNode("div",wd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((oe=h==null?void 0:h.row)==null?void 0:oe[(Ee=h==null?void 0:h.column)==null?void 0:Ee.prop],Ye=>(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("div",{class:"prop-url",title:Qa(Ye),onClick:Je=>Tr(Ye)},e.toDisplayString(Qa(Ye)),9,_d),e.createElementVNode("div",{class:"prop-download",onClick:Je=>Ar(Ye)}," 下载 ",8,Bd)]))),256))])]}),_:2},1024)):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle({color:!Array.isArray(qt(h))&&((ie=(_=qt(h))==null?void 0:_.toString())!=null&&ie.includes(".txt")||(Ne=(H=qt(h))==null?void 0:H.toString())!=null&&Ne.includes(".cpt")||(te=(y=qt(h))==null?void 0:y.toString())!=null&&te.includes(".cyd"))?"var(--vertical-menuitem-active-bg)":"",textDecoration:!Array.isArray(qt(h))&&((ge=(Fe=qt(h))==null?void 0:Fe.toString())!=null&&ge.includes(".txt")||(ke=(ve=qt(h))==null?void 0:ve.toString())!=null&&ke.includes(".cpt")||(Ie=(Ue=qt(h))==null?void 0:Ue.toString())!=null&&Ie.includes(".cyd"))?"underline":"",cursor:!Array.isArray(qt(h))&&((xe=(X=qt(h))==null?void 0:X.toString())!=null&&xe.includes(".txt")||(Be=(W=qt(h))==null?void 0:W.toString())!=null&&Be.includes(".cpt")||(Pe=($e=qt(h))==null?void 0:$e.toString())!=null&&Pe.includes(".cyd"))?"pointer":"",marginLeft:(h==null?void 0:h.colIndex)===0?`${((h==null?void 0:h.level)??0)*20}px`:0}),onClick:Ee=>ur(qt(h))},e.toDisplayString(qt(h)===0?"0":qt(h)),13,Td))]}),_:2},[((j=fa.value)==null?void 0:j.length)>0?{name:"actions",fn:e.withCtx(({item:h,fIndex:C})=>[e.createVNode(u,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:e.withCtx(()=>[e.createVNode(s,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"},onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))})]),default:e.withCtx(()=>[e.createElementVNode("div",fd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Or(fa.value,h),(w,_)=>(e.openBlock(),e.createElementBlock("div",{class:"menu-config-item",key:_,onClick:e.withModifiers(ie=>Xn(w==null?void 0:w.label,h,{extra:w,index:C}),["stop"])},[e.createElementVNode("div",{style:e.normalizeStyle({color:w==null?void 0:w.textColor}),class:"extra-button-label"},e.toDisplayString(w==null?void 0:w.label),5)],8,vd))),128))])]),_:2},1024)]),key:"0"}:void 0]),1032,["pageObj","showIndex","isTree","summaryInfo","columns","defaultSort","isCardViewport","checkedColumns","tableData","isEditViewport","isShowPagination","allowSelect","extraButton","rowButton","cacheExtraButtons","isClearSelection","bottomButton"])):e.createCommentVNode("",!0),e.createCommentVNode("",!0),e.createVNode(Sa.ssDialog,{title:Vt.value,visible:ta.value,width:lr.value,onBeforeDestroy:_r,style:{height:"74%"}},{default:e.withCtx(()=>[e.createElementVNode("div",Ad,[e.createVNode(Ft.ssForm,{rowContents:qe.value,showOperator:!1,onChange:fs,isEnableWrap:!1,onFixChangeValue:Mr,onClickTrigger:Br,isEdit:me.value,onBlurChange:Sr,onCreate:Nr,onTagChange:ir},null,8,["rowContents","isEdit"])])]),footer:e.withCtx(()=>[hn.value?(e.openBlock(),e.createElementBlock("div",Od,[e.createVNode(k,{onClick:n[4]||(n[4]=h=>ta.value=!1),id:"themeBorderButton"},{default:e.withCtx(()=>n[26]||(n[26]=[e.createTextVNode(e.toDisplayString("取消"))])),_:1,__:[26]}),e.createVNode(k,{class:"ok-button",onClick:n[5]||(n[5]=h=>an(!0)),id:"themeButton"},{default:e.withCtx(()=>n[27]||(n[27]=[e.createTextVNode(e.toDisplayString("确认"))])),_:1,__:[27]})])):e.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),e.createVNode(Sa.ssDialog,{title:Vt.value,visible:vn.value,width:Pn.value,onBeforeDestroy:n[7]||(n[7]=h=>vn.value=!1)},{default:e.withCtx(()=>[e.createVNode(Fc)]),footer:e.withCtx(()=>[e.createElementVNode("div",Dd,[e.createVNode(k,{onClick:n[6]||(n[6]=h=>vn.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:e.withCtx(()=>n[28]||(n[28]=[e.createTextVNode(e.toDisplayString("取消"))])),_:1,__:[28]}),e.createVNode(k,{class:"ok-button",onClick:Pr,id:"themeButton"},{default:e.withCtx(()=>n[29]||(n[29]=[e.createTextVNode(e.toDisplayString("确认"))])),_:1,__:[29]})])]),_:1},8,["title","visible","width"]),$t.value?(e.openBlock(),e.createBlock(Ft.ssFilePreview,{key:2,fileDataList:Et.value,onDestroy:Vr},null,8,["fileDataList"])):e.createCommentVNode("",!0),ut.value?(e.openBlock(),e.createBlock(Sa.ssDialog,{key:3,visible:ut.value,onBeforeDestroy:cs,style:{height:"80vh",width:"80vw"},"body-class":"three-dialog-body","footer-class":"three-dialog-footer"},{default:e.withCtx(()=>[e.createVNode(ao.ThreeViewerHost,{files:Wa.value,threeData:se.value},null,8,["files","threeData"])]),_:1},8,["visible"])):e.createCommentVNode("",!0),e.createVNode(Sa.ssDialog,{visible:a.componentVisible,onBeforeDestroy:n[8]||(n[8]=h=>a.componentVisible=!1),width:Pn.value,style:{height:"70vh"}},{default:e.withCtx(()=>[e.createVNode(M,{dialogItem:or.value},null,8,["dialogItem"])]),_:1},8,["visible","width"]),e.createVNode(Sa.ssDialog,{title:"OCR扫描录入",visible:Rn.value,"close-on-click-modal":!1,onBeforeDestroy:Xr,width:"1000px",dialogHeight:700,minWidth:900,minHeight:600,class:"ocr-upload-dialog",resizable:!0},{default:e.withCtx(()=>[n[40]||(n[40]=e.createElementVNode("div",{class:"ocr-header-bg"},null,-1)),e.createElementVNode("div",Md,[e.createElementVNode("div",$d,[e.createElementVNode("div",{class:e.normalizeClass(["ocr-step-item",{active:It.value===1}])},n[30]||(n[30]=[e.createElementVNode("div",{class:"step-circle"},"1",-1),e.createElementVNode("div",{class:"step-label",style:{"font-weight":"800"}},"文件识别",-1)]),2),n[33]||(n[33]=e.createElementVNode("div",{class:"ocr-step-connector"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["ocr-step-item",{active:It.value===2}])},n[31]||(n[31]=[e.createElementVNode("div",{class:"step-circle"},"2",-1),e.createElementVNode("div",{class:"step-label",style:{"font-weight":"800"}},"文件确认",-1)]),2),n[34]||(n[34]=e.createElementVNode("div",{class:"ocr-step-connector"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["ocr-step-item",{active:It.value===3}])},n[32]||(n[32]=[e.createElementVNode("div",{class:"step-circle"},"3",-1),e.createElementVNode("div",{class:"step-label",style:{"font-weight":"800"}},"文件提交",-1)]),2)]),It.value===1?(e.openBlock(),e.createElementBlock("div",Ld,[e.createVNode(k,{onClick:Hr,class:"ocr-action-btn",disabled:ua.value,size:"default"},{default:e.withCtx(()=>n[35]||(n[35]=[e.createTextVNode("扫描文件")])),_:1,__:[35]},8,["disabled"]),e.createVNode(k,{onClick:ts,class:"ocr-action-btn",disabled:ua.value,size:"default"},{default:e.withCtx(()=>n[36]||(n[36]=[e.createTextVNode("上传文件")])),_:1,__:[36]},8,["disabled"])])):e.createCommentVNode("",!0),It.value===1?(e.openBlock(),e.createElementBlock("div",Vd,[e.createElementVNode("div",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,(h,C)=>{var w;return e.openBlock(),e.createElementBlock("div",{key:C,class:"ocr-file-item"},[e.createElementVNode("div",Pd,[h.raw&&((w=h.raw.type)!=null&&w.startsWith("image/"))?(e.openBlock(),e.createElementBlock("img",{key:0,src:Qr(h),alt:"预览",class:"thumbnail-image"},null,8,Rd)):(e.openBlock(),e.createElementBlock("div",Ud,[e.createVNode($,{size:40},{default:e.withCtx(()=>[e.createVNode(e.unref(E.document_default))]),_:1})])),e.createElementVNode("div",{class:e.normalizeClass(["file-progress-ring",{uploading:Wt(h)==="uploading",processing:Wt(h)==="processing",completed:Wt(h)==="completed"||Wt(h)==="uploaded"}])},[(e.openBlock(),e.createElementBlock("svg",Fd,[n[37]||(n[37]=e.createElementVNode("circle",{class:"progress-ring-bg",cx:"18",cy:"18",r:"16",fill:"none",stroke:"#e4e7ed","stroke-width":"2"},null,-1)),e.createElementVNode("circle",{class:e.normalizeClass(["progress-ring-fill",{completed:Wt(h)==="completed"||Wt(h)==="uploaded",uploading:Wt(h)==="uploading",processing:Wt(h)==="processing"}]),cx:"18",cy:"18",r:"16",fill:"none",stroke:Wt(h)==="completed"||Wt(h)==="uploaded"?"#67c23a":"#409eff","stroke-width":Wt(h)==="completed"||Wt(h)==="uploaded"?3:2,"stroke-dasharray":es(h),"stroke-dashoffset":"0","stroke-linecap":"round",transform:"rotate(-90 18 18)"},null,10,zd)])),Wt(h)==="completed"||Wt(h)==="uploaded"?(e.openBlock(),e.createElementBlock("div",jd,[e.createVNode($,{class:"check-icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.check_default))]),_:1})])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:"file-delete-btn",onClick:_=>os(C)},[e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.close_default))]),_:1})],8,Hd)]),e.createElementVNode("div",Kd,e.toDisplayString(h.name||"文件名123"),1)])}),128))]),ht.value.length>0?(e.openBlock(),e.createElementBlock("div",Wd,[e.createVNode(k,{onClick:Ul,class:"ocr-start-recognize-btn",disabled:ua.value||ht.value.length===0,size:"default"},{default:e.withCtx(()=>n[38]||(n[38]=[e.createTextVNode("开始识别")])),_:1,__:[38]},8,["disabled"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),It.value===1?(e.openBlock(),e.createElementBlock("div",qd,[e.createVNode(V,{percentage:ha.value,"stroke-width":8},null,8,["percentage"])])):e.createCommentVNode("",!0),It.value===2?(e.openBlock(),e.createElementBlock("div",Yd,[e.createElementVNode("div",Gd,[e.createVNode(q,{title:"请核对识别结果,在表头勾选字段用于匹配并替换现有数据。",type:"info",closable:!1,"show-icon":""})]),e.createElementVNode("div",Jd,[e.createVNode(pe,{data:ma.value,border:"",stripe:"","max-height":"400",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(Y,{type:"index",label:"序号",width:"60",fixed:""}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zn.value,h=>(e.openBlock(),e.createBlock(Y,{key:h.prop,prop:h.prop,"min-width":h.minWidth||230,"class-name":h.isAccuracy?"accuracy-column":""},{header:e.withCtx(()=>[e.createElementVNode("div",Xd,[h.isAccuracy?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(f,{key:0,"model-value":ga.value.includes(h.prop),onChange:C=>Yr(h.prop,C),onClick:n[9]||(n[9]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onChange"])),e.createElementVNode("span",null,e.toDisplayString(h.label),1)])]),default:e.withCtx(({row:C,$index:w})=>{var _,ie,H;return[h.isAccuracy?(e.openBlock(),e.createElementBlock("span",{key:0,class:"accuracy-value",style:e.normalizeStyle({color:Jr(C[h.prop]),fontWeight:500})},e.toDisplayString(Gr(C[h.prop])),5)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[$a.value!==w?(e.openBlock(),e.createElementBlock("span",Qd,e.toDisplayString(C[h.prop]),1)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Yo(h.prop)),{key:1,modelValue:C[h.prop],"onUpdate:modelValue":Ne=>C[h.prop]=Ne,size:"small",placeholder:"请输入"+h.label,content:((_=Cn(h.prop))==null?void 0:_.contents)??((ie=Cn(h.prop))==null?void 0:ie.options)??[],optionUrl:(H=Cn(h.prop))==null?void 0:H.optionUrl,onChange:Ne=>zl(w,h.prop,Ne),onFocus:Ne=>qa.value=h.prop,onBlur:n[10]||(n[10]=Ne=>qa.value="")},null,40,["modelValue","onUpdate:modelValue","placeholder","content","optionUrl","onChange","onFocus"]))],64))]}),_:2},1032,["prop","min-width","class-name"]))),128)),e.createVNode(Y,{label:"编辑",width:"80",fixed:"right"},{default:e.withCtx(({$index:h})=>[$a.value===h?(e.openBlock(),e.createBlock($,{key:0,class:"ocr-edit-icon editing",style:{"margin-left":"12px"},onClick:e.withModifiers(C=>jl(h),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(E.check_default))]),_:2},1032,["onClick"])):(e.openBlock(),e.createBlock(s,{key:1,name:"edit_101",class:"ocr-edit-icon",onClick:e.withModifiers(C=>jl(h),["stop"])},null,8,["onClick"]))]),_:1})]),_:1},8,["data"])])])):e.createCommentVNode("",!0),It.value===3?(e.openBlock(),e.createElementBlock("div",Zd,[e.createVNode($,{size:"32",class:"ocr-success-icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.check_default))]),_:1}),n[39]||(n[39]=e.createElementVNode("div",{class:"ocr-success-text"},"文件提交成功",-1))])):e.createCommentVNode("",!0)]),e.createVNode(ue,{ref:"ocrUploadRef","file-list":ht.value,"onUpdate:fileList":n[11]||(n[11]=h=>ht.value=h),multiple:"",action:"","auto-upload":!1,limit:20,accept:"image/*,application/pdf","on-change":Rl,"show-file-list":!1,class:"ocr-upload-input",style:{display:"none"}},null,8,["file-list"])]),footer:e.withCtx(()=>[It.value!==3?(e.openBlock(),e.createElementBlock("div",ep,[e.createVNode(k,{onClick:as,class:"ocr-start-recognize-btn",disabled:It.value===1||ua.value},{default:e.withCtx(()=>n[41]||(n[41]=[e.createTextVNode(" 上一步 ")])),_:1,__:[41]},8,["disabled"]),e.createVNode(k,{onClick:ns,class:"ocr-start-recognize-btn",disabled:ua.value},{default:e.withCtx(()=>n[42]||(n[42]=[e.createTextVNode(" 下一步 ")])),_:1,__:[42]},8,["disabled"])])):e.createCommentVNode("",!0)]),_:1},8,["visible"]),e.createVNode(nd,{visible:xn.value,onConfirm:Kr,onCancel:n[12]||(n[12]=h=>xn.value=!1)},null,8,["visible"]),e.createVNode(Hu,{visible:Un.value,"onUpdate:visible":n[13]||(n[13]=h=>Un.value=h),versions:Sl.value},null,8,["visible","versions"]),e.createVNode(Au,{visible:La.value,"onUpdate:visible":n[14]||(n[14]=h=>La.value=h),images:Ya.value,"default-image-name":jn.value,"field-meta":$a.value!==null?((A=ma.value[$a.value])==null?void 0:A.__ocrFieldMeta)||{}:{},"focused-field-name":qa.value,onClose:n[15]||(n[15]=h=>La.value=!1),class:"ocr-img-preview-dialog"},null,8,["visible","images","default-image-name","field-meta","focused-field-name"]),e.createVNode(tc,{visible:En.value,"onUpdate:visible":n[16]||(n[16]=h=>En.value=h),candidates:Sn.value,"name-prop":Go.value,"mfr-prop":Jo.value,columns:T.value,onSubmit:Qo},null,8,["visible","candidates","name-prop","mfr-prop","columns"]),e.createVNode(ic,{visible:Fn.value,"onUpdate:visible":n[17]||(n[17]=h=>Fn.value=h),ocrPreviewData:ma.value,"onUpdate:ocrPreviewData":n[18]||(n[18]=h=>ma.value=h),ocrSelectedFields:ga.value,"onUpdate:ocrSelectedFields":n[19]||(n[19]=h=>ga.value=h),ocrPreviewColumns:zn.value,onConfirm:Fl,onFieldChange:n[20]||(n[20]=({rowIndex:h,prop:C,value:w})=>zl(h,C,w))},null,8,["visible","ocrPreviewData","ocrSelectedFields","ocrPreviewColumns"]),e.createVNode(Sa.ssDialog,{title:yt.title,visible:yt.show,width:yt.width,onBeforeDestroy:Wr},{default:e.withCtx(()=>[e.createElementVNode("div",tp,[e.createVNode(Ft.ssForm,{rowContents:yt==null?void 0:yt.contents,formRules:yt==null?void 0:yt.formRules,showOperator:!1,buttonValue:yt.buttonValue,isEdit:me.value,isStartJustify:!1,onOnButtonClick:qr},null,8,["rowContents","formRules","buttonValue","isEdit"])])]),_:1},8,["title","visible","width"])])}}},lp=Da._export_sfc(np,[["__scopeId","data-v-aad03ce8"]]);exports.ElMessageBox=fl;exports.formGetOptions=$n;exports.getSelectRow=Ln;exports.ssTable=lp;exports.useFormComp=zo;exports.useFormToTableComp=Po;