ss-component-new 1.3.76 → 1.3.77

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 (116) hide show
  1. package/dist/{MTLLoader-DYLUvPra.js → MTLLoader-DJIR3bGD.js} +1 -1
  2. package/dist/{MTLLoader-D1uo8mcW.cjs → MTLLoader-Dyl6PN5d.cjs} +1 -1
  3. package/dist/{OrbitControls-B4mz4dJ8.cjs → OrbitControls-CyFs1bm5.cjs} +1 -1
  4. package/dist/{OrbitControls-Cd9ZVfIV.js → OrbitControls-Dlw97WCj.js} +1 -1
  5. package/dist/{URDFLoader-BfRhERaC.js → URDFLoader-BRpoQyw2.js} +2 -2
  6. package/dist/{URDFLoader-BnH2w4x6.cjs → URDFLoader-DrNlUBtJ.cjs} +1 -1
  7. package/dist/{animationData-CO_7EKV4.js → animationData-C69CJGus.js} +2 -2
  8. package/dist/{animationData-CjVloDDN.cjs → animationData-Dm6x95MK.cjs} +1 -1
  9. package/dist/{array-Xb-5MHCa.js → array-CmRfs-24.js} +6 -6
  10. package/dist/{array-DtmeNOPn.cjs → array-lMkg06O4.cjs} +1 -1
  11. package/dist/{iconfont-CD3omIZU.js → iconfont-CUaAeb62.js} +2 -2
  12. package/dist/{iconfont-CkpU7gNh.cjs → iconfont-KwmsNAe-.cjs} +1 -1
  13. package/dist/{index-X_HnLtRC.js → index-6WE1wXNU.js} +1 -1
  14. package/dist/{index-DYqVJN3W.js → index-B5vwnwpW.js} +2 -2
  15. package/dist/{index-B_uWA5AJ.js → index-BEh5MTEf.js} +1 -1
  16. package/dist/{index-lz-ekKYh.js → index-BHrQS0PO.js} +1 -1
  17. package/dist/{index-j1S7YTh5.cjs → index-BL_f9rch.cjs} +1 -1
  18. package/dist/{index-C55GyDvp.js → index-BNtvoveb.js} +2 -2
  19. package/dist/{index-BLqnYCsi.js → index-BPmWhs0O.js} +2 -2
  20. package/dist/{index-pWdzgg-b.cjs → index-BQ5LLLCI.cjs} +1 -1
  21. package/dist/{index-BulgFj9c.cjs → index-BVPMO2zY.cjs} +1 -1
  22. package/dist/index-BX61i13K.cjs +11 -0
  23. package/dist/{index-BQEvzo4s.cjs → index-BeyHZLtG.cjs} +1 -1
  24. package/dist/{index-BFtGkyJf.js → index-BgV00fCC.js} +4963 -5011
  25. package/dist/{index-CFCn1Gpd.cjs → index-BjDreAqp.cjs} +1 -1
  26. package/dist/{index-nlfIt66y.cjs → index-BkmVU8a_.cjs} +1 -1
  27. package/dist/{index-BrLLsp39.js → index-BpPz543G.js} +2 -2
  28. package/dist/{index-0HSo1RHX.js → index-BsiDSvt3.js} +5 -5
  29. package/dist/{index-Cfzc5_ZK.js → index-BuZA4yzT.js} +4 -4
  30. package/dist/{index-CAD9KqHl.cjs → index-BvtucSN7.cjs} +1 -1
  31. package/dist/{index-BLeSUjbB.js → index-BwPcbO5s.js} +4 -4
  32. package/dist/{index-CVCJuzlD.cjs → index-C036vLtM.cjs} +1 -1
  33. package/dist/{index-DMfz6Qrm.js → index-C5PQL9cL.js} +2 -2
  34. package/dist/index-C5pQXH0_.cjs +11 -0
  35. package/dist/index-CPLj-52w.js +8139 -0
  36. package/dist/{index-C-iUVY59.js → index-CPg8HLR1.js} +22 -23
  37. package/dist/{index-BRyE_Lab.cjs → index-CRBCoILA.cjs} +1 -1
  38. package/dist/{index-DbFGGKSI.cjs → index-CUqebPpG.cjs} +1 -1
  39. package/dist/{index-CMdeEau9.js → index-CXaJ4hd1.js} +4 -4
  40. package/dist/{index-DJg5d7ei.cjs → index-CZfv7TSl.cjs} +1 -1
  41. package/dist/{index-u7JCx5KX.cjs → index-Cd0X7-qe.cjs} +1 -1
  42. package/dist/{index-B_kCqo4M.cjs → index-CjM4iX0P.cjs} +1 -1
  43. package/dist/{index-D03MbrNK.cjs → index-Ck3e5w1T.cjs} +1 -1
  44. package/dist/{index-C3gtImRs.js → index-CmS5GOiC.js} +2 -2
  45. package/dist/{index-B-A_4_n_.cjs → index-D0V8Wq5-.cjs} +1 -1
  46. package/dist/{index-Dysx8GkS.js → index-D0VCuSp4.js} +3 -3
  47. package/dist/{index-CI_UVQ4Z.js → index-D0aKEqnU.js} +4 -4
  48. package/dist/{index-jiFqoYN9.js → index-D1coeANk.js} +8 -8
  49. package/dist/{index-5dvr_F6Q.cjs → index-D7GkHVm4.cjs} +1 -1
  50. package/dist/{index-DhSdgyHz.cjs → index-D8DcUSsZ.cjs} +1 -1
  51. package/dist/{index-COyNONVE.js → index-D9hditHi.js} +11 -7
  52. package/dist/{index-DcqWejmU.cjs → index-DHdrBDP4.cjs} +1 -1
  53. package/dist/{index-B-nrai8J.cjs → index-DQUHH-Fm.cjs} +1 -1
  54. package/dist/{index-C5WqP8vL.cjs → index-DQWchc4Q.cjs} +1 -1
  55. package/dist/{index-IYg_iR8H.cjs → index-DRtwXN5G.cjs} +1 -1
  56. package/dist/{index-DxGZaHuy.js → index-DVdbO-ck.js} +6 -6
  57. package/dist/{index-DtJC43XK.cjs → index-DjJzpaj0.cjs} +1 -1
  58. package/dist/{index-CeXyg5Rl.cjs → index-Dlob1bxY.cjs} +1 -1
  59. package/dist/index-Dn8fWhFv.cjs +19 -0
  60. package/dist/{index-BkipVGFw.js → index-Dugr3nzy.js} +4 -4
  61. package/dist/{index-wv1wwLNX.cjs → index-Dx8_UO1H.cjs} +1 -1
  62. package/dist/{index-B5i-XCGU.js → index-Dyhg1YNv.js} +1 -1
  63. package/dist/{index-DPjDv9Ws.cjs → index-EzAyKU_n.cjs} +13 -13
  64. package/dist/{index-ChBgkXqb.js → index-G0nsjixB.js} +8 -8
  65. package/dist/{index-BYyFrGfX.js → index-JAXzKk2F.js} +1 -1
  66. package/dist/{index-jkHlUTog.js → index-K1n-pA4G.js} +2545 -2616
  67. package/dist/{index-vURW-4ky.js → index-PGQiH6e8.js} +12 -12
  68. package/dist/index-TvWbGp-2.cjs +1 -0
  69. package/dist/{index-sHmgudEg.js → index-XSETNP_T.js} +1 -1
  70. package/dist/{index-CW-lwsDk.cjs → index-Z0QzHXTu.cjs} +1 -1
  71. package/dist/{index--D0Thf0J.js → index-_YLcZ1t9.js} +1 -1
  72. package/dist/{index-BfOeLrc4.cjs → index-fwa9LBX5.cjs} +1 -1
  73. package/dist/{index-mdJtPr2-.js → index-q6nspJX5.js} +1 -1
  74. package/dist/index-sJ80M1T1.js +12857 -0
  75. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dj8zYuMh.cjs → index.vue_vue_type_style_index_0_scoped_75a8935f_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_75a8935f_lang-DljCMBcU.js} +2076 -2071
  77. package/dist/{index.vue_vue_type_style_index_1_lang-CCQPqKHr.js → index.vue_vue_type_style_index_1_lang-CmNA8ulW.js} +5 -5
  78. package/dist/{index.vue_vue_type_style_index_1_lang-DsZZR0tg.cjs → index.vue_vue_type_style_index_1_lang-qqb75Ddw.cjs} +1 -1
  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-DFF2Ml9R.cjs} +3 -3
  82. package/dist/{main-BLk4Mfi1.js → main-u2k3TQrH.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-v33sxEBl.js → threeModel-B04Pg2W0.js} +6 -6
  93. package/dist/{threeModel-C3N_ghfY.cjs → threeModel-Dk7qv8zl.cjs} +1 -1
  94. package/dist/{threePreview-Dif-1kRY.cjs → threePreview-BOYQbFek.cjs} +1 -1
  95. package/dist/{threePreview-DNw547cG.js → threePreview-DtTiTGwA.js} +5 -5
  96. package/dist/{threeSceneView-BkGy9bnz.js → threeSceneView-Cyz0VcYF.js} +11 -11
  97. package/dist/{threeSceneView-iXMcW_Z9.cjs → threeSceneView-zbf5qddT.cjs} +1 -1
  98. package/dist/{threeSceneViewForCPMPIP-Bjimwk9q.cjs → threeSceneViewForCPMPIP-k7hZw-es.cjs} +1 -1
  99. package/dist/{threeSceneViewForCPMPIP-qP-6IJzE.js → threeSceneViewForCPMPIP-t9KFm3E8.js} +9 -9
  100. package/dist/{threeTrackPathView-wK0hwn3B.js → threeTrackPathView-DKfc1ch-.js} +6 -6
  101. package/dist/{threeTrackPathView-Cqrx2pEK.cjs → threeTrackPathView-DcNa_KHp.cjs} +1 -1
  102. package/dist/{threeViewerHost-B2fHt8c2.js → threeViewerHost-BEk2aQE4.js} +3 -3
  103. package/dist/{threeViewerHost-RuZpxQGN.cjs → threeViewerHost-x6ut_8Rr.cjs} +1 -1
  104. package/dist/{urdfTree-i-8eGN0m.js → urdfTree-1CqRUMjW.js} +1 -1
  105. package/dist/{urdfTree-CnVw_qic.cjs → urdfTree-DB7SQ7Nk.cjs} +1 -1
  106. package/dist/{workpieceTreePanel-Cy1eCrLl.js → workpieceTreePanel-BV2LpHGy.js} +4 -4
  107. package/dist/{workpieceTreePanel-auNIy7t8.cjs → workpieceTreePanel-CdWOqLMh.cjs} +1 -1
  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-Dc6Q0f3F.cjs +0 -11
  116. package/dist/index-HCKkRTvn.cjs +0 -19
@@ -1,19 +0,0 @@
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 Xt=(t,o,l)=>Ns(t,typeof o!="symbol"?o+"":o,l);const e=require("vue"),E=require("./index-Dc6Q0f3F.cjs"),Le=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dj8zYuMh.cjs"),pe=require("./index-BfOeLrc4.cjs"),Rt=require("./index-DPjDv9Ws.cjs"),to=require("./index.vue_vue_type_style_index_1_lang-DsZZR0tg.cjs"),Ma=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Na=require("./index-CAD9KqHl.cjs"),ao=require("./threeViewerHost-RuZpxQGN.cjs"),al=require("./index-BGuyjj26.cjs");require("./index-5dvr_F6Q.cjs");const Bo=require("./index-C5WqP8vL.cjs"),no=require("./isString-DhPkQDQg.cjs");var lo=E.Symbol?E.Symbol.isConcatSpreadable:void 0;function ws(t){return E.isArray(t)||pe.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)?pe.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 Le.setToString(Le.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&&pe.isLength(c)&&pe.isIndex(g,c)&&(E.isArray(t)||pe.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 O=E.toKey(o[c]),L=l;if(O==="__proto__"||O==="constructor"||O==="prototype")return t;if(c!=g){var re=r[O];L=void 0,L===void 0&&(L=E.isObject(re)?re:pe.isIndex(o[c+1])?[]:{})}pe.assignValue(r,O,L),r=r[O]}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 $n="update:modelValue",oo="change",nl="input";let Bn;const Vs=t=>{var o;if(!E.isClient)return 0;if(Bn!==void 0)return Bn;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),Bn=i-v,Bn};let Qt;const Ps={height:"0",visibility:"hidden",overflow:E.isFirefox()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},Is=["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","word-break"],ro=t=>{const o=Number.parseFloat(t);return Number.isNaN(o)?t:o};function Rs(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:Is.map(g=>[g,o.getPropertyValue(g)]),paddingSize:i,borderSize:c,boxSizing:l}}function so(t,o=1,l){var i,c;Qt||(Qt=document.createElement("textarea"),((i=t.parentNode)!=null?i:document.body).appendChild(Qt));const{paddingSize:v,borderSize:g,boxSizing:r,contextStyle:O}=Rs(t);O.forEach(([Se,ne])=>Qt==null?void 0:Qt.style.setProperty(Se,ne)),Object.entries(Ps).forEach(([Se,ne])=>Qt==null?void 0:Qt.style.setProperty(Se,ne,"important")),Qt.value=t.value||t.placeholder||"";let L=Qt.scrollHeight;const re={};r==="border-box"?L=L+g:r==="content-box"&&(L=L-v),Qt.value="";const ge=Qt.scrollHeight-v;if(E.isNumber(o)){let Se=ge*o;r==="border-box"&&(Se=Se+v+g),L=Math.max(Se,L),re.minHeight=`${Se}px`}if(E.isNumber(l)){let Se=ge*l;r==="border-box"&&(Se=Se+v+g),L=Math.min(Se,L)}return re.height=`${L}px`,(c=Qt.parentNode)==null||c.removeChild(Qt),Qt=void 0,re}const Us=E.buildProps({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Fs=t=>Ls(Us,t),zs=E.buildProps({id:{type:String,default:void 0},size:E.useSizeProp,disabled:Boolean,modelValue:{type:E.definePropType([String,Number,Object]),default:""},modelModifiers:{type:E.definePropType(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:E.definePropType(String),default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:E.iconPropType,default:E.circle_close_default},showPassword:Boolean,showWordLimit:Boolean,wordLimitPosition:{type:String,values:["inside","outside"],default:"inside"},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},...Fs(["ariaLabel"]),inputmode:{type:E.definePropType(String),default:void 0},name:String}),js={[$n]: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},Hs=["class","style"],Ks=/^on[A-Z]/,Ws=(t={})=>{const{excludeListeners:o=!1,excludeKeys:l}=t,i=e.computed(()=>((l==null?void 0:l.value)||[]).concat(Hs)),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&&Ks.test(g))))}):(E.debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),e.computed(()=>({})))},ul={prefix:Math.floor(Math.random()*1e4),current:0},qs=Symbol("elIdInjection"),Ys=()=>e.getCurrentInstance()?e.inject(qs,ul):ul,cl=t=>{const o=Ys();!E.isClient&&o===ul&&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++}`)},ml=Symbol("formContextKey"),To=Symbol("formItemContextKey"),Ao=()=>{const t=e.inject(ml,void 0),o=e.inject(To,void 0);return{form:t,formItem:o}},Gs=(t,{formItemContext:o,disableIdGeneration:l,disableIdManagement:i})=>{l||(l=e.ref(!1)),i||(i=e.ref(!1));const c=e.getCurrentInstance(),v=()=>{let L=c==null?void 0:c.parent;for(;L;){if(L.type.name==="ElFormItem")return!1;if(L.type.name==="ElLabelWrap")return!0;L=L.parent}return!1},g=e.ref();let r;const O=e.computed(()=>{var L;return!!(!(t.label||t.ariaLabel)&&o&&o.inputIds&&((L=o.inputIds)==null?void 0:L.length)<=1)});return e.onMounted(()=>{r=e.watch([e.toRef(t,"id"),l],([L,re])=>{const ge=L??(re?void 0:cl().value);ge!==g.value&&(o!=null&&o.removeInputId&&!v()&&(g.value&&o.removeInputId(g.value),!(i!=null&&i.value)&&!re&&ge&&o.addInputId(ge)),g.value=ge)},{immediate:!0})}),e.onUnmounted(()=>{r&&r(),o!=null&&o.removeInputId&&g.value&&o.removeInputId(g.value)}),{isLabeledByFormItem:O,inputId:g}},Oo=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]})},Do=(t,o={})=>{const l=e.ref(void 0),i=o.prop?l:Oo("size"),c=o.global?l:E.useGlobalSize(),v=o.form?{size:void 0}:e.inject(ml,void 0),g=o.formItem?{size:void 0}:e.inject(To,void 0);return e.computed(()=>i.value||e.unref(t)||(g==null?void 0:g.size)||(v==null?void 0:v.size)||c.value||"")},gl=t=>{const o=Oo("disabled"),l=e.inject(ml,void 0);return e.computed(()=>o.value||e.unref(t)||(l==null?void 0:l.disabled)||!1)},Js='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',io=t=>typeof Element>"u"?!1:t instanceof Element,Xs=t=>getComputedStyle(t).position==="fixed"?!1:t.offsetParent!==null,uo=t=>Array.from(t.querySelectorAll(Js)).filter(o=>yl(o)&&Xs(o)),yl=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}},Qs=(t,o)=>{if(!t||!t.focus)return;let l=!1;io(t)&&!yl(t)&&!t.getAttribute("tabindex")&&(t.setAttribute("tabindex","-1"),l=!0),t.focus(o),io(t)&&l&&t.removeAttribute("tabindex")};function Zs(t,{disabled:o,beforeFocus:l,afterFocus:i,beforeBlur:c,afterBlur:v}={}){const g=e.getCurrentInstance(),{emit:r}=g,O=e.shallowRef(),L=e.ref(!1),re=ne=>{const w=E.isFunction$1(l)?l(ne):!1;e.unref(o)||L.value||w||(L.value=!0,r("focus",ne),i==null||i())},ge=ne=>{var w;const ae=E.isFunction$1(c)?c(ne):!1;e.unref(o)||ne.relatedTarget&&((w=O.value)!=null&&w.contains(ne.relatedTarget))||ae||(L.value=!1,r("blur",ne),v==null||v())},Se=ne=>{var w,ae;e.unref(o)||yl(ne.target)||(w=O.value)!=null&&w.contains(document.activeElement)&&O.value!==document.activeElement||(ae=t.value)==null||ae.focus()};return e.watch([O,()=>e.unref(o)],([ne,w])=>{ne&&(w?ne.removeAttribute("tabindex"):ne.setAttribute("tabindex","-1"))}),E.useEventListener(O,"focus",re,!0),E.useEventListener(O,"blur",ge,!0),E.useEventListener(O,"click",Se,!0),{isFocused:L,wrapperRef:O,handleFocus:re,handleBlur:ge}}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 O;o==null||o("compositionupdate",r);const L=(O=r.target)==null?void 0:O.value,re=L[L.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)),O=g.slice(Math.max(0,v));o={selectionStart:c,selectionEnd:v,value:g,beforeTxt:r,afterTxt:O}}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 O=c.length;if(c.endsWith(g))O=c.length-g.length;else if(c.startsWith(v))O=v.length;else{const L=v[r-1],re=c.indexOf(L,r-1);re!==-1&&(O=re+1)}t.value.setSelectionRange(O,O)}return[l,i]}const Mo="ElInput",ni=e.defineComponent({name:Mo,inheritAttrs:!1}),li=e.defineComponent({...ni,props:zs,emits:js,setup(t,{expose:o,emit:l}){const i=t,c=e.useAttrs(),v=Ws(),g=e.useSlots(),r=e.computed(()=>[i.type==="textarea"?ae.b():w.b(),w.m(Se.value),w.is("disabled",ne.value),w.is("exceed",Ve.value),{[w.b("group")]:g.prepend||g.append,[w.m("prefix")]:g.prefix||i.prefixIcon,[w.m("suffix")]:g.suffix||i.suffixIcon||i.clearable||i.showPassword,[w.bm("suffix","password-clear")]:Be.value&&ze.value,[w.b("hidden")]:i.type==="hidden"},c.class]),O=e.computed(()=>[w.e("wrapper"),w.is("focus",fe.value)]),{form:L,formItem:re}=Ao(),{inputId:ge}=Gs(i,{formItemContext:re}),Se=Do(),ne=gl(),w=E.useNamespace("input"),ae=E.useNamespace("textarea"),Ee=e.shallowRef(),G=e.shallowRef(),Y=e.ref(!1),U=e.ref(!1),$=e.ref(),j=e.shallowRef(i.inputStyle),F=e.computed(()=>Ee.value||G.value),{wrapperRef:Z,isFocused:fe,handleFocus:J,handleBlur:X}=Zs(F,{disabled:ne,afterBlur(){var W;i.validateEvent&&((W=re==null?void 0:re.validate)==null||W.call(re,"blur").catch(He=>E.debugWarn(He)))}}),et=e.computed(()=>{var W;return(W=L==null?void 0:L.statusIcon)!=null?W:!1}),Ke=e.computed(()=>(re==null?void 0:re.validateState)||""),kt=e.computed(()=>Ke.value&&E.ValidateComponentsMap[Ke.value]),R=e.computed(()=>U.value?E.view_default:E.hide_default),ft=e.computed(()=>[c.style]),Je=e.computed(()=>[i.inputStyle,j.value,{resize:i.resize}]),Q=e.computed(()=>Bo.isNil(i.modelValue)?"":String(i.modelValue)),Be=e.computed(()=>i.clearable&&!ne.value&&!i.readonly&&!!Q.value&&(fe.value||Y.value)),ze=e.computed(()=>i.showPassword&&!ne.value&&!!Q.value),be=e.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!ne.value&&!i.readonly&&!i.showPassword),we=e.computed(()=>Q.value.length),Ve=e.computed(()=>!!be.value&&we.value>Number(i.maxlength)),st=e.computed(()=>!!g.suffix||!!i.suffixIcon||Be.value||i.showPassword||be.value||!!Ke.value&&et.value),Et=e.computed(()=>!!Object.keys(i.modelModifiers).length),[Ft,mt]=ai(Ee);E.useResizeObserver(G,W=>{if(nt(),!be.value||i.resize!=="both")return;const He=W[0],{width:Dt}=He.contentRect;$.value={right:`calc(100% - ${Dt+15+6}px)`}});const Yt=()=>{const{type:W,autosize:He}=i;if(!(!E.isClient||W!=="textarea"||!G.value))if(He){const Dt=E.isObject$1(He)?He.minRows:void 0,oa=E.isObject$1(He)?He.maxRows:void 0,fa=so(G.value,Dt,oa);j.value={overflowY:"hidden",...fa},e.nextTick(()=>{G.value.offsetHeight,j.value=fa})}else j.value={minHeight:so(G.value).minHeight}},nt=(W=>{let He=!1;return()=>{var Dt;if(He||!i.autosize)return;((Dt=G.value)==null?void 0:Dt.offsetParent)===null||(setTimeout(W),He=!0)}})(Yt),aa=()=>{const W=F.value,He=i.formatter?i.formatter(Q.value):Q.value;!W||W.value===He||(W.value=He)},Wa=W=>{const{trim:He,number:Dt}=i.modelModifiers;return He&&(W=W.trim()),Dt&&(W=`${ro(W)}`),i.formatter&&i.parser&&(W=i.parser(W)),W},ct=async W=>{if(wa.value)return;const{lazy:He}=i.modelModifiers;let{value:Dt}=W.target;if(He){l(nl,Dt);return}if(Dt=Wa(Dt),String(Dt)===Q.value){i.formatter&&aa();return}Ft(),l($n,Dt),l(nl,Dt),await e.nextTick(),(i.formatter&&i.parser||!Et.value)&&aa(),mt()},it=async W=>{let{value:He}=W.target;He=Wa(He),i.modelModifiers.lazy&&l($n,He),l(oo,He),await e.nextTick(),aa()},{isComposing:wa,handleCompositionStart:xa,handleCompositionUpdate:Rn,handleCompositionEnd:pa}=ti({emit:l,afterComposition:ct}),hn=()=>{U.value=!U.value},se=()=>{var W;return(W=F.value)==null?void 0:W.focus()},Gt=()=>{var W;return(W=F.value)==null?void 0:W.blur()},Lt=W=>{Y.value=!1,l("mouseleave",W)},na=W=>{Y.value=!0,l("mouseenter",W)},$a=W=>{l("keydown",W)},_a=()=>{var W;(W=F.value)==null||W.select()},qa=()=>{l($n,""),l(oo,""),l("clear"),l(nl,"")};return e.watch(()=>i.modelValue,()=>{var W;e.nextTick(()=>Yt()),i.validateEvent&&((W=re==null?void 0:re.validate)==null||W.call(re,"change").catch(He=>E.debugWarn(He)))}),e.watch(Q,W=>{if(!F.value)return;const{trim:He,number:Dt}=i.modelModifiers,oa=F.value.value,fa=(Dt||i.type==="number")&&!/^0\d/.test(oa)?`${ro(oa)}`:oa;fa!==W&&(document.activeElement===F.value&&F.value.type!=="range"&&He&&fa.trim()===W||aa())}),e.watch(()=>i.type,async()=>{await e.nextTick(),aa(),Yt()}),e.onMounted(()=>{!i.formatter&&i.parser&&E.debugWarn(Mo,"If you set the parser, you also need to set the formatter."),aa(),e.nextTick(Yt)}),o({input:Ee,textarea:G,ref:F,textareaStyle:Je,autosize:e.toRef(i,"autosize"),isComposing:wa,focus:se,blur:Gt,select:_a,clear:qa,resizeTextarea:Yt}),(W,He)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(r),{[e.unref(w).bm("group","append")]:W.$slots.append,[e.unref(w).bm("group","prepend")]:W.$slots.prepend}]),style:e.normalizeStyle(e.unref(ft)),onMouseenter:na,onMouseleave:Lt},[e.createCommentVNode(" input "),W.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createCommentVNode(" prepend slot "),W.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(w).be("group","prepend"))},[e.renderSlot(W.$slots,"prepend")],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"wrapperRef",ref:Z,class:e.normalizeClass(e.unref(O))},[e.createCommentVNode(" prefix slot "),W.$slots.prefix||W.prefixIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(w).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(w).e("prefix-inner"))},[e.renderSlot(W.$slots,"prefix"),W.prefixIcon?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:0,class:e.normalizeClass(e.unref(w).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(W.prefixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(ge),ref_key:"input",ref:Ee,class:e.unref(w).e("inner")},e.unref(v),{name:W.name,minlength:W.minlength,maxlength:W.maxlength,type:W.showPassword?U.value?"text":"password":W.type,disabled:e.unref(ne),readonly:W.readonly,autocomplete:W.autocomplete,tabindex:W.tabindex,"aria-label":W.ariaLabel,placeholder:W.placeholder,style:W.inputStyle,form:W.form,autofocus:W.autofocus,role:W.containerRole,inputmode:W.inputmode,onCompositionstart:e.unref(xa),onCompositionupdate:e.unref(Rn),onCompositionend:e.unref(pa),onInput:ct,onChange:it,onKeydown:$a}),null,16,["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode","onCompositionstart","onCompositionupdate","onCompositionend"]),e.createCommentVNode(" suffix slot "),e.unref(st)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(w).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(w).e("suffix-inner"))},[!e.unref(Be)||!e.unref(ze)||!e.unref(be)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(W.$slots,"suffix"),W.suffixIcon?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:0,class:e.normalizeClass(e.unref(w).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(W.suffixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],64)):e.createCommentVNode("v-if",!0),e.unref(Be)?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:1,class:e.normalizeClass([e.unref(w).e("icon"),e.unref(w).e("clear")]),onMousedown:e.withModifiers(e.unref(E.NOOP),["prevent"]),onClick:qa},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(W.clearIcon)))]),_:1},8,["class","onMousedown"])):e.createCommentVNode("v-if",!0),e.unref(ze)?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:2,class:e.normalizeClass([e.unref(w).e("icon"),e.unref(w).e("password")]),onClick:hn,onMousedown:e.withModifiers(e.unref(E.NOOP),["prevent"]),onMouseup:e.withModifiers(e.unref(E.NOOP),["prevent"])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(R))))]),_:1},8,["class","onMousedown","onMouseup"])):e.createCommentVNode("v-if",!0),e.unref(be)?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass([e.unref(w).e("count"),e.unref(w).is("outside",W.wordLimitPosition==="outside")])},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(w).e("count-inner"))},e.toDisplayString(e.unref(we))+" / "+e.toDisplayString(W.maxlength),3)],2)):e.createCommentVNode("v-if",!0),e.unref(Ke)&&e.unref(kt)&&e.unref(et)?(e.openBlock(),e.createBlock(e.unref(E.ElIcon),{key:4,class:e.normalizeClass([e.unref(w).e("icon"),e.unref(w).e("validateIcon"),e.unref(w).is("loading",e.unref(Ke)==="validating")])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(kt))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0)],2),e.createCommentVNode(" append slot "),W.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(w).be("group","append"))},[e.renderSlot(W.$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(ge),ref_key:"textarea",ref:G,class:[e.unref(ae).e("inner"),e.unref(w).is("focus",e.unref(fe))]},e.unref(v),{minlength:W.minlength,maxlength:W.maxlength,tabindex:W.tabindex,disabled:e.unref(ne),readonly:W.readonly,autocomplete:W.autocomplete,style:e.unref(Je),"aria-label":W.ariaLabel,placeholder:W.placeholder,form:W.form,autofocus:W.autofocus,rows:W.rows,role:W.containerRole,onCompositionstart:e.unref(xa),onCompositionupdate:e.unref(Rn),onCompositionend:e.unref(pa),onInput:ct,onFocus:e.unref(J),onBlur:e.unref(X),onChange:it,onKeydown:$a}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),e.unref(be)?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle($.value),class:e.normalizeClass([e.unref(w).e("count"),e.unref(w).is("outside",W.wordLimitPosition==="outside")])},e.toDisplayString(e.unref(we))+" / "+e.toDisplayString(W.maxlength),7)):e.createCommentVNode("v-if",!0)],64))],38))}});var oi=E._export_sfc(li,[["__file","input.vue"]]);const ri=E.withInstall(oi),ll="focus-trap.focus-after-trapped",ol="focus-trap.focus-after-released",si="focus-trap.focusout-prevented",co={cancelable:!0,bubbles:!1},ii={cancelable:!0,bubbles:!1},po="focusAfterTrapped",fo="focusAfterReleased",ui=Symbol("elFocusTrap"),bl=e.ref(),In=e.ref(0),kl=e.ref(0);let Tn=0;const $o=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},vo=(t,o)=>{for(const l of t)if(!ci(l,o))return l},ci=(t,o)=>{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=$o(t),l=vo(o,t),i=vo(o.reverse(),t);return[l,i]},pi=t=>t instanceof HTMLInputElement&&"select"in t,Aa=(t,o)=>{if(t){const l=document.activeElement;Qs(t,{preventScroll:!0}),kl.value=window.performance.now(),t!==l&&pi(t)&&o&&t.select()}};function ho(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=ho(t,i),t.unshift(i)},remove:i=>{var c,v;t=ho(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(Aa(i,o),document.activeElement!==l)return},mo=fi(),hi=()=>In.value>kl.value,An=()=>{bl.value="pointer",In.value=window.performance.now()},go=()=>{bl.value="keyboard",In.value=window.performance.now()},mi=()=>(e.onMounted(()=>{Tn===0&&(document.addEventListener("mousedown",An),document.addEventListener("touchstart",An),document.addEventListener("keydown",go)),Tn++}),e.onBeforeUnmount(()=>{Tn--,Tn<=0&&(document.removeEventListener("mousedown",An),document.removeEventListener("touchstart",An),document.removeEventListener("keydown",go))}),{focusReason:bl,lastUserFocusTimestamp:In,lastAutomatedFocusTimestamp:kl}),On=t=>new CustomEvent(si,{...ii,detail:t});let Ha=[];const yo=t=>{E.getEventCode(t)===E.EVENT_CODE.esc&&Ha.forEach(l=>l(t))},gi=t=>{e.onMounted(()=>{Ha.length===0&&document.addEventListener("keydown",yo),E.isClient&&Ha.push(t)}),e.onBeforeUnmount(()=>{Ha=Ha.filter(o=>o!==t),Ha.length===0&&E.isClient&&document.removeEventListener("keydown",yo)})},yi=e.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[po,fo,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:o}){const l=e.ref();let i,c;const{focusReason:v}=mi();gi(w=>{t.trapped&&!g.paused&&o("release-requested",w)});const g={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},r=w=>{if(!t.loop&&!t.trapped||g.paused)return;const{altKey:ae,ctrlKey:Ee,metaKey:G,currentTarget:Y,shiftKey:U}=w,{loop:$}=t,F=E.getEventCode(w)===E.EVENT_CODE.tab&&!ae&&!Ee&&!G,Z=document.activeElement;if(F&&Z){const fe=Y,[J,X]=di(fe);if(J&&X){if(!U&&Z===X){const Ke=On({focusReason:v.value});o("focusout-prevented",Ke),Ke.defaultPrevented||(w.preventDefault(),$&&Aa(J,!0))}else if(U&&[J,fe].includes(Z)){const Ke=On({focusReason:v.value});o("focusout-prevented",Ke),Ke.defaultPrevented||(w.preventDefault(),$&&Aa(X,!0))}}else if(Z===fe){const Ke=On({focusReason:v.value});o("focusout-prevented",Ke),Ke.defaultPrevented||w.preventDefault()}}};e.provide(ui,{focusTrapRef:l,onKeydown:r}),e.watch(()=>t.focusTrapEl,w=>{w&&(l.value=w)},{immediate:!0}),e.watch([l],([w],[ae])=>{w&&(w.addEventListener("keydown",r),w.addEventListener("focusin",re),w.addEventListener("focusout",ge)),ae&&(ae.removeEventListener("keydown",r),ae.removeEventListener("focusin",re),ae.removeEventListener("focusout",ge))});const O=w=>{o(po,w)},L=w=>o(fo,w),re=w=>{const ae=e.unref(l);if(!ae)return;const Ee=w.target,G=w.relatedTarget,Y=Ee&&ae.contains(Ee);t.trapped||G&&ae.contains(G)||(i=G),Y&&o("focusin",w),!g.paused&&t.trapped&&(Y?c=Ee:Aa(c,!0))},ge=w=>{const ae=e.unref(l);if(!(g.paused||!ae))if(t.trapped){const Ee=w.relatedTarget;!Bo.isNil(Ee)&&!ae.contains(Ee)&&setTimeout(()=>{if(!g.paused&&t.trapped){const G=On({focusReason:v.value});o("focusout-prevented",G),G.defaultPrevented||Aa(c,!0)}},0)}else{const Ee=w.target;Ee&&ae.contains(Ee)||o("focusout",w)}};async function Se(){await e.nextTick();const w=e.unref(l);if(w){mo.push(g);const ae=w.contains(document.activeElement)?i:document.activeElement;if(i=ae,!w.contains(ae)){const G=new Event(ll,co);w.addEventListener(ll,O),w.dispatchEvent(G),G.defaultPrevented||e.nextTick(()=>{let Y=t.focusStartEl;E.isString(Y)||(Aa(Y),document.activeElement!==Y&&(Y="first")),Y==="first"&&vi($o(w),!0),(document.activeElement===ae||Y==="container")&&Aa(w)})}}}function ne(){const w=e.unref(l);if(w){w.removeEventListener(ll,O);const ae=new CustomEvent(ol,{...co,detail:{focusReason:v.value}});w.addEventListener(ol,L),w.dispatchEvent(ae),!ae.defaultPrevented&&(v.value=="keyboard"||!hi()||w.contains(document.activeElement))&&Aa(i??document.body),w.removeEventListener(ol,L),mo.remove(g),i=null,c=null}}return e.onMounted(()=>{t.trapped&&Se(),e.watch(()=>t.trapped,w=>{w?Se():ne()})}),e.onBeforeUnmount(()=>{t.trapped&&ne(),l.value&&(l.value.removeEventListener("keydown",r),l.value.removeEventListener("focusin",re),l.value.removeEventListener("focusout",ge),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 Lo=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(Lo,void 0),i=E.useGlobalConfig("button"),{form:c}=Ao(),v=Do(e.computed(()=>l==null?void 0:l.size)),g=gl(),r=e.ref(),O=e.useSlots(),L=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,Y,U;return(U=(Y=t.autoInsertSpace)!=null?Y:(G=i.value)==null?void 0:G.autoInsertSpace)!=null?U:!1}),ge=e.computed(()=>{var G,Y,U;return(U=(Y=t.plain)!=null?Y:(G=i.value)==null?void 0:G.plain)!=null?U:!1}),Se=e.computed(()=>{var G,Y,U;return(U=(Y=t.round)!=null?Y:(G=i.value)==null?void 0:G.round)!=null?U:!1}),ne=e.computed(()=>{var G,Y,U;return(U=(Y=t.text)!=null?Y:(G=i.value)==null?void 0:G.text)!=null?U:!1}),w=e.computed(()=>t.tag==="button"?{ariaDisabled:g.value||t.loading,disabled:g.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),ae=e.computed(()=>{var G;const Y=(G=O.default)==null?void 0:G.call(O);if(re.value&&(Y==null?void 0:Y.length)===1){const U=Y[0];if((U==null?void 0:U.type)===e.Text){const $=U.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test($.trim())}}return!1});return{_disabled:g,_size:v,_type:L,_ref:r,_props:w,_plain:ge,_round:Se,_text:ne,shouldAddSpace:ae,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"],dl=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:{type:Boolean,default:void 0},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 Ut(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 Dn(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 Vo(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Mn(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:Ut(t,255)*255,g:Ut(o,255)*255,b:Ut(l,255)*255}}function bo(t,o,l){t=Ut(t,255),o=Ut(o,255),l=Ut(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 O=i-c;switch(g=r>.5?O/(2-i-c):O/(i+c),i){case t:v=(o-l)/O+(o<l?6:0);break;case o:v=(l-t)/O+2;break;case l:v=(t-o)/O+4;break}v/=6}return{h:v,s:g,l:r}}function rl(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=Ut(t,360),o=Ut(o,100),l=Ut(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=rl(r,g,t+1/3),c=rl(r,g,t),v=rl(r,g,t-1/3)}return{r:i*255,g:c*255,b:v*255}}function ko(t,o,l){t=Ut(t,255),o=Ut(o,255),l=Ut(l,255);var i=Math.max(t,o,l),c=Math.min(t,o,l),v=0,g=i,r=i-c,O=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:O,v:g}}function Ai(t,o,l){t=Ut(t,360)*6,o=Ut(o,100),l=Ut(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),O=i%6,L=[l,g,v,v,r,l][O],re=[r,l,l,g,v,v][O],ge=[v,v,r,l,l,g][O];return{r:L*255,g:re*255,b:ge*255}}function Co(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 Eo(t){return ta(t)/255}function ta(t){return parseInt(t,16)}function Mi(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var pl={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=Pi(t)),typeof t=="object"&&(Sa(t.r)&&Sa(t.g)&&Sa(t.b)?(o=Bi(t.r,t.g,t.b),g=!0,r=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Sa(t.h)&&Sa(t.s)&&Sa(t.v)?(i=Mn(t.s),c=Mn(t.v),o=Ai(t.h,i,c),g=!0,r="hsv"):Sa(t.h)&&Sa(t.s)&&Sa(t.l)&&(i=Mn(t.s),v=Mn(t.l),o=Ti(t.h,i,v),g=!0,r="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(l=t.a)),l=Vo(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+%?",Da="(?:".concat(Vi,")|(?:").concat(Li,")"),sl="[\\s|\\(]+(".concat(Da,")[,|\\s]+(").concat(Da,")[,|\\s]+(").concat(Da,")\\s*\\)?"),il="[\\s|\\(]+(".concat(Da,")[,|\\s]+(").concat(Da,")[,|\\s]+(").concat(Da,")[,|\\s]+(").concat(Da,")\\s*\\)?"),ua={CSS_UNIT:new RegExp(Da),rgb:new RegExp("rgb"+sl),rgba:new RegExp("rgba"+il),hsl:new RegExp("hsl"+sl),hsla:new RegExp("hsla"+il),hsv:new RegExp("hsv"+sl),hsva:new RegExp("hsva"+il),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 Pi(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var o=!1;if(pl[t])t=pl[t],o=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var l=ua.rgb.exec(t);return l?{r:l[1],g:l[2],b:l[3]}:(l=ua.rgba.exec(t),l?{r:l[1],g:l[2],b:l[3],a:l[4]}:(l=ua.hsl.exec(t),l?{h:l[1],s:l[2],l:l[3]}:(l=ua.hsla.exec(t),l?{h:l[1],s:l[2],l:l[3],a:l[4]}:(l=ua.hsv.exec(t),l?{h:l[1],s:l[2],v:l[3]}:(l=ua.hsva.exec(t),l?{h:l[1],s:l[2],v:l[3],a:l[4]}:(l=ua.hex8.exec(t),l?{r:ta(l[1]),g:ta(l[2]),b:ta(l[3]),a:Eo(l[4]),format:o?"name":"hex8"}:(l=ua.hex6.exec(t),l?{r:ta(l[1]),g:ta(l[2]),b:ta(l[3]),format:o?"name":"hex"}:(l=ua.hex4.exec(t),l?{r:ta(l[1]+l[1]),g:ta(l[2]+l[2]),b:ta(l[3]+l[3]),a:Eo(l[4]+l[4]),format:o?"name":"hex8"}:(l=ua.hex3.exec(t),l?{r:ta(l[1]+l[1]),g:ta(l[2]+l[2]),b:ta(l[3]+l[3]),format:o?"name":"hex"}:!1)))))))))}function Sa(t){return!!ua.CSS_UNIT.exec(String(t))}var Ii=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=Vo(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=ko(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=ko(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=bo(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=bo(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),Co(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(Ut(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(Ut(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="#"+Co(this.r,this.g,this.b,!1),l=0,i=Object.entries(pl);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=Dn(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=Dn(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=Dn(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=Dn(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 Ta(t,o=20){return t.mix("#141414",o).toString()}function Ri(t){const o=gl(),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 Ii(c),r=t.dark?g.tint(20).toString():Ta(g,20);if(t.plain)i=l.cssVarBlock({"bg-color":t.dark?Ta(g,90):g.tint(90).toString(),"text-color":c,"border-color":t.dark?Ta(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?Ta(g,90):g.tint(90).toString(),i[l.cssVarBlockName("disabled-text-color")]=t.dark?Ta(g,50):g.tint(50).toString(),i[l.cssVarBlockName("disabled-border-color")]=t.dark?Ta(g,80):g.tint(80).toString());else{const O=t.dark?Ta(g,30):g.tint(30).toString(),L=g.isDark()?`var(${l.cssVarName("color-white")})`:`var(${l.cssVarName("color-black")})`;if(i=l.cssVarBlock({"bg-color":c,"text-color":L,"border-color":c,"hover-bg-color":O,"hover-text-color":L,"hover-border-color":O,"active-bg-color":r,"active-border-color":r}),o.value){const re=t.dark?Ta(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:dl,emits:wi,setup(t,{expose:o,emit:l}){const i=t,c=Ri(i),v=E.useNamespace("button"),{_ref:g,_size:r,_type:O,_disabled:L,_props:re,_plain:ge,_round:Se,_text:ne,shouldAddSpace:w,handleClick:ae}=Ei(i,l),Ee=e.computed(()=>[v.b(),v.m(O.value),v.m(r.value),v.is("disabled",L.value),v.is("loading",i.loading),v.is("plain",ge.value),v.is("round",Se.value),v.is("circle",i.circle),v.is("text",ne.value),v.is("link",i.link),v.is("has-bg",i.bg)]);return o({ref:g,size:r,type:O,disabled:L,shouldAddSpace:w}),(G,Y)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(G.tag),e.mergeProps({ref_key:"_ref",ref:g},e.unref(re),{class:e.unref(Ee),style:e.unref(c),onClick:e.unref(ae)}),{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(w)})},[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:dl.size,type:dl.type},Hi=e.defineComponent({name:"ElButtonGroup"}),Ki=e.defineComponent({...Hi,props:ji,setup(t){const o=t;e.provide(Lo,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 Po=E._export_sfc(Ki,[["__file","button-group.vue"]]);const Wi=E.withInstall(zi,{ButtonGroup:Po});E.withNoopInstall(Po);var Ln=(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))(Ln||{});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=O=>{l("click",O)},{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")],Ln.STYLE|Ln.CLASS|Ln.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=e.ref(!1),g=(Se,ne)=>{if(t.value){const{offsetX:w,offsetY:ae}=c,Ee=t.value.getBoundingClientRect(),G=Ee.left,Y=Ee.top,U=Ee.width,$=Ee.height,j=document.documentElement.clientWidth,F=document.documentElement.clientHeight,Z=-G+w,fe=-Y+ae,J=j-G-U+w,X=F-Y-($<F?$:0)+ae;i!=null&&i.value||(Se=Math.min(Math.max(Se,Z),J),ne=Math.min(Math.max(ne,fe),X)),c.offsetX=Se,c.offsetY=ne,t.value.style.transform=`translate(${E.addUnit(Se)}, ${E.addUnit(ne)})`}},r=Se=>{const ne=Se.clientX,w=Se.clientY,{offsetX:ae,offsetY:Ee}=c,G=U=>{v.value||(v.value=!0);const $=ae+U.clientX-ne,j=Ee+U.clientY-w;g($,j)},Y=()=>{v.value=!1,document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",Y)};document.addEventListener("mousemove",G),document.addEventListener("mouseup",Y)},O=()=>{o.value&&t.value&&(o.value.addEventListener("mousedown",r),window.addEventListener("resize",ge))},L=()=>{o.value&&t.value&&(o.value.removeEventListener("mousedown",r),window.removeEventListener("resize",ge))},re=()=>{c.offsetX=0,c.offsetY=0,t.value&&(t.value.style.transform="")},ge=()=>{const{offsetX:Se,offsetY:ne}=c;g(Se,ne)};return e.onMounted(()=>{e.watchEffect(()=>{l.value?O():L()})}),e.onBeforeUnmount(()=>{L()}),{isDragging:v,resetPosition:re,updatePosition:ge}},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"));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,O=>{if(!O){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 L=document.documentElement.clientHeight<document.body.scrollHeight,re=E.getStyle(document.body,"overflowY");c>0&&(L||re==="scroll")&&v&&(document.body.style.width=`calc(100% - ${c}px)`)}),e.onScopeDispose(()=>r())},eu=t=>["",...E.componentSizes].includes(t),fl="_trap-focus-children",Ra=[],So=t=>{if(Ra.length===0)return;const o=E.getEventCode(t),l=Ra[Ra.length-1][fl];if(l.length>0&&o===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];c&&i&&(t.preventDefault(),l[l.length-1].focus()),v&&!i&&(t.preventDefault(),l[0].focus())}},tu={beforeMount(t){t[fl]=uo(t),Ra.push(t),Ra.length<=1&&document.addEventListener("keydown",So)},updated(t){e.nextTick(()=>{t[fl]=uo(t)})},unmounted(){Ra.shift(),Ra.length===0&&document.removeEventListener("keydown",So)}},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: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,O=e.ref(!1),L=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 Q=L.type;return{[c.bm("icon",Q)]:Q&&E.TypeComponentsMap[Q]}}),ge=cl(),Se=cl(),ne=e.computed(()=>{const Q=L.type;return L.icon||Q&&E.TypeComponentsMap[Q]||""}),w=e.computed(()=>!!L.message),ae=e.ref(),Ee=e.ref(),G=e.ref(),Y=e.ref(),U=e.ref(),$=e.computed(()=>L.confirmButtonClass);e.watch(()=>L.inputValue,async Q=>{await e.nextTick(),t.boxType==="prompt"&&Q&&kt()},{immediate:!0}),e.watch(()=>O.value,Q=>{var Be,ze;Q&&(t.boxType!=="prompt"&&(L.autofocus?G.value=(ze=(Be=U.value)==null?void 0:Be.$el)!=null?ze:ae.value:G.value=ae.value),L.zIndex=r()),t.boxType==="prompt"&&(Q?e.nextTick().then(()=>{var be;Y.value&&Y.value.$el&&(L.autofocus?G.value=(be=R())!=null?be:ae.value:G.value=ae.value)}):(L.editorErrorMessage="",L.validateError=!1))});const j=e.computed(()=>t.draggable),F=e.computed(()=>t.overflow),{isDragging:Z}=Qi(ae,Ee,j,F);e.onMounted(async()=>{await e.nextTick(),t.closeOnHashChange&&window.addEventListener("hashchange",fe)}),e.onBeforeUnmount(()=>{t.closeOnHashChange&&window.removeEventListener("hashchange",fe)});function fe(){O.value&&(O.value=!1,e.nextTick(()=>{L.action&&o("action",L.action)}))}const J=()=>{t.closeOnClickModal&&Ke(L.distinguishCancelAndClose?"close":"cancel")},X=Io(J),et=Q=>{if(L.inputType!=="textarea")return Q.preventDefault(),Ke("confirm")},Ke=Q=>{var Be;t.boxType==="prompt"&&Q==="confirm"&&!kt()||(L.action=Q,L.beforeClose?(Be=L.beforeClose)==null||Be.call(L,Q,L,fe):fe())},kt=()=>{if(t.boxType==="prompt"){const Q=L.inputPattern;if(Q&&!Q.test(L.inputValue||""))return L.editorErrorMessage=L.inputErrorMessage||g("el.messagebox.error"),L.validateError=!0,!1;const Be=L.inputValidator;if(E.isFunction$1(Be)){const ze=Be(L.inputValue);if(ze===!1)return L.editorErrorMessage=L.inputErrorMessage||g("el.messagebox.error"),L.validateError=!0,!1;if(E.isString(ze))return L.editorErrorMessage=ze,L.validateError=!0,!1}}return L.editorErrorMessage="",L.validateError=!1,!0},R=()=>{var Q,Be;const ze=(Q=Y.value)==null?void 0:Q.$refs;return(Be=ze==null?void 0:ze.input)!=null?Be:ze==null?void 0:ze.textarea},ft=()=>{Ke("close")},Je=()=>{t.closeOnPressEscape&&ft()};return t.lockScroll&&Zi(O,{ns:c}),{...e.toRefs(L),ns:c,overlayEvent:X,visible:O,hasMessage:w,typeClass:re,contentId:ge,inputId:Se,btnSize:v,iconComponent:ne,confirmButtonClasses:$,rootRef:ae,focusStartRef:G,headerRef:Ee,inputRef:Y,isDragging:Z,confirmRef:U,doClose:fe,handleClose:ft,onCloseRequested:Je,handleWrapperClick:J,handleInputEnter:et,handleAction:Ke,t:g}}});function nu(t,o,l,i,c,v){const g=e.resolveComponent("el-icon"),r=e.resolveComponent("el-input"),O=e.resolveComponent("el-button"),L=e.resolveComponent("el-focus-trap"),re=e.resolveComponent("el-overlay");return e.openBlock(),e.createBlock(e.Transition,{name:"fade-in-linear",onAfterLeave:ge=>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(L,{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.is("dragging",t.isDragging),{[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:ge=>t.handleAction(t.distinguishCancelAndClose?"close":"cancel"),onKeydown:e.withKeys(e.withModifiers(ge=>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,textContent:e.toDisplayString(t.message)},null,8,["for","textContent"]))])],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":ge=>t.inputValue=ge,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(O,{key:0,loading:t.cancelButtonLoading,"loading-icon":t.cancelButtonLoadingIcon,class:e.normalizeClass([t.cancelButtonClass]),round:t.roundButton,size:t.btnSize,onClick:ge=>t.handleAction("cancel"),onKeydown:e.withKeys(e.withModifiers(ge=>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(O,{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:ge=>t.handleAction("confirm"),onKeydown:e.withKeys(e.withModifiers(ge=>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 vn=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),vn.delete(c)},t.onAction=v=>{const g=vn.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 Ka(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??Ka._context);vn.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=>{Ka[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,Ka(Object.assign({title:v,message:o,type:"",...cu[t]},i,{boxType:t}),c)}}Ka.close=()=>{vn.forEach((t,o)=>{o.doClose()}),vn.clear()};Ka._context=null;const Oa=Ka;Oa.install=t=>{Oa._context=t._context,t.config.globalProperties.$msgbox=Oa,t.config.globalProperties.$messageBox=Oa,t.config.globalProperties.$alert=Oa.alert,t.config.globalProperties.$confirm=Oa.confirm,t.config.globalProperties.$prompt=Oa.prompt};const vl=Oa,Vn=t=>t.match(/\((.*)\)/)[1],No={__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]=O=>i.value=O),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,O=t.getBoundingClientRect(),L=o.getBoundingClientRect(),re=o.naturalWidth,ge=o.naturalHeight,Se=L.width/re,ne=L.height/ge,w=Math.min(Se,ne),ae=re*w,Ee=ge*w,G=(O.width-ae)/2,Y=(O.height-Ee)/2,U=l.map(([j,F])=>{const Z=G+j*ae,fe=Y+F*Ee;return{x:Z,y:fe}});c.clearRect(0,0,t.width,t.height),c.beginPath(),c.moveTo(U[0].x,U[0].y);for(let j=1;j<U.length;j++)c.lineTo(U[j].x,U[j].y);c.closePath();const $=v.replace(/[\d.]+\)$/,`${r})`);c.fillStyle=$,c.fill(),c.strokeStyle=v.replace(/[\d.]+\)$/,"1)"),c.lineWidth=g,c.stroke()}function ja(t){if(!t)return;const o=t.getContext("2d");o&&o.clearRect(0,0,t.width,t.height)}function wo(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:be=>i("update:visible",be)});let v=!1,g="",r=0,O=0,L=0,re=0,ge=0,Se=0,ne=null;const w=be=>{var Ve,st;const we=(st=(Ve=be==null?void 0:be.target)==null?void 0:Ve.closest)==null?void 0:st.call(Ve,".el-dialog");return we||document.querySelector(".ocr-img-preview-dialog.el-dialog")},ae=be=>{if(!be||be==="none")return{tx:0,ty:0};let we=be.match(/matrix\(([^)]+)\)/);if(we){const Ve=we[1].split(",").map(st=>Number(st.trim()));return{tx:(Ve==null?void 0:Ve[4])||0,ty:(Ve==null?void 0:Ve[5])||0}}if(we=be.match(/matrix3d\(([^)]+)\)/),we){const Ve=we[1].split(",").map(st=>Number(st.trim()));return{tx:(Ve==null?void 0:Ve[12])||0,ty:(Ve==null?void 0:Ve[13])||0}}return we=be.match(/translate\(\s*([-\d.]+)px\s*,\s*([-\d.]+)px\s*\)/),we?{tx:Number(we[1])||0,ty:Number(we[2])||0}:{tx:0,ty:0}},Ee=(be,we,Ve)=>{be.style.transform=`translate(${we}px, ${Ve}px)`},G=(be,we)=>{const Ve=w(be);if(!Ve)return;v=!0,ne=Ve,g=we,r=be.clientX,O=be.clientY;const st=Ve.getBoundingClientRect();L=st.width,re=st.height;const Et=window.getComputedStyle(Ve),{tx:Ft,ty:mt}=ae(Et.transform);ge=Ft,Se=mt,document.addEventListener("mousemove",Y),document.addEventListener("mouseup",U)},Y=be=>{if(!v||!ne)return;const we=be.clientX-r,Ve=be.clientY-O,st=360,Et=420;let Ft=L,mt=re,Yt=ge,vt=Se;if(g.includes("right")&&(Ft=Math.max(st,L+we)),g.includes("bottom")&&(mt=Math.max(Et,re+Ve)),g.includes("left")){const nt=L-we;nt<st?(Ft=st,Yt=ge+(L-st)):(Ft=nt,Yt=ge+we)}if(g.includes("top")){const nt=re-Ve;nt<Et?(mt=Et,vt=Se+(re-Et)):(mt=nt,vt=Se+Ve)}ne.style.width=`${Ft}px`,ne.style.height=`${mt}px`,Ee(ne,Yt,vt)},U=()=>{v=!1,g="",ne=null,document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",U)},$=e.ref([]),j=e.ref(!1);e.watch(()=>l.images,async be=>{if(!Array.isArray(be)||be.length===0){$.value=[];return}j.value=!0;const we=[];for(const Ve of be)if(Ve.url&&!Ve.url.startsWith("blob:")&&!Ve.url.startsWith("http"))try{const st=await Le.downloadFile(Ve.url),Et=URL.createObjectURL(st);we.push({...Ve,blobUrl:Et})}catch(st){console.error(`Failed to load image for preview: ${Ve.url}`,st),we.push({...Ve,blobUrl:""})}else we.push({...Ve,blobUrl:Ve.url});$.value=we,j.value=!1},{deep:!0,immediate:!0});const F=e.ref(0),Z=e.ref(null),fe=e.ref(null),J=e.computed(()=>$.value[F.value]||null),X=()=>{if(!$.value.length){F.value=0;return}if(l.defaultImageName){const be=$.value.findIndex(we=>(we==null?void 0:we.name)===l.defaultImageName);F.value=be>=0?be:0}else F.value=0},et=be=>{if(!$.value.length)return;const we=Math.max(0,Math.min(be,$.value.length-1));F.value=we},Ke=()=>et(F.value-1),kt=()=>et(F.value+1),R=be=>{if(!be)return;const we=$.value.findIndex(Ve=>(Ve==null?void 0:Ve.name)===be);we>=0&&(F.value=we)},ft=()=>{if(!fe.value)return;const be=fe.value.parentElement;if(!be)return;const we=be.getBoundingClientRect();fe.value.width=we.width,fe.value.height=we.height},Je=()=>{var st,Et;if(!fe.value||!Z.value||!l.focusedFieldName){fe.value&&ja(fe.value);return}const be=(st=Z.value.$el)==null?void 0:st.querySelector("img");if(!be)return;if(!be.complete||be.naturalWidth===0){be.onload=()=>{e.nextTick(()=>{Je()})};return}const we=((Et=J.value)==null?void 0:Et.name)||"",Ve=wo(l.fieldMeta,l.focusedFieldName);if(!Ve){ja(fe.value);return}if(Ve.imageName!==we){ja(fe.value);return}ft(),pu(fe.value,be,Ve.bboxNorm)},Q=()=>{e.nextTick(()=>{ft(),Je()})};e.watch(()=>l.focusedFieldName,()=>{if(!c.value)return;const be=wo(l.fieldMeta,l.focusedFieldName);be!=null&&be.imageName&&R(be.imageName),e.nextTick(()=>{Je()})}),e.watch(()=>{var be;return(be=J.value)==null?void 0:be.name},()=>{c.value&&e.nextTick(()=>{fe.value&&ja(fe.value),Je()})}),e.watch(()=>l.visible,be=>{be?(X(),e.nextTick(()=>{ft(),Je()})):fe.value&&ja(fe.value)}),e.watch(()=>l.defaultImageName,()=>{c.value&&X()});let Be=null;e.onMounted(()=>{var be;typeof ResizeObserver<"u"&&(Be=new ResizeObserver(()=>{ft(),e.nextTick(()=>{Je()})}),(be=fe.value)!=null&&be.parentElement&&Be.observe(fe.value.parentElement))}),e.onUnmounted(()=>{Be&&(Be.disconnect(),Be=null),document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",U)});const ze=()=>{fe.value&&ja(fe.value),i("update:visible",!1),i("close")};return(be,we)=>{const Ve=e.resolveComponent("el-button"),st=e.resolveComponent("el-image"),Et=e.resolveComponent("Loading"),Ft=e.resolveComponent("el-icon"),mt=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(mt,{modelValue:c.value,"onUpdate:modelValue":we[8]||(we[8]=Yt=>c.value=Yt),title:"文件预览",class:"ocr-img-preview-dialog",width:"460px",modal:!1,"modal-penetrable":!0,draggable:!0,overflow:!0,"append-to-body":"",onClose:ze},{default:e.withCtx(()=>{var Yt,vt;return[e.createElementVNode("div",{class:"resizable-handle top",onMousedown:we[0]||(we[0]=e.withModifiers(nt=>G(nt,"top"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle right",onMousedown:we[1]||(we[1]=e.withModifiers(nt=>G(nt,"right"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle bottom",onMousedown:we[2]||(we[2]=e.withModifiers(nt=>G(nt,"bottom"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle left",onMousedown:we[3]||(we[3]=e.withModifiers(nt=>G(nt,"left"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle top-left",onMousedown:we[4]||(we[4]=e.withModifiers(nt=>G(nt,"top-left"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle top-right",onMousedown:we[5]||(we[5]=e.withModifiers(nt=>G(nt,"top-right"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle bottom-left",onMousedown:we[6]||(we[6]=e.withModifiers(nt=>G(nt,"bottom-left"),["stop"]))},null,32),e.createElementVNode("div",{class:"resizable-handle bottom-right",onMousedown:we[7]||(we[7]=e.withModifiers(nt=>G(nt,"bottom-right"),["stop"]))},null,32),J.value?(e.openBlock(),e.createElementBlock("div",fu,[e.createElementVNode("div",vu,[e.createElementVNode("div",hu,[e.createElementVNode("span",mu,e.toDisplayString(J.value.name?J.value.name+(J.value.url&&J.value.url.lastIndexOf(".")!==-1?J.value.url.substring(J.value.url.lastIndexOf(".")):""):""),1)]),$.value.length>1?(e.openBlock(),e.createElementBlock("div",gu,[e.createVNode(Ve,{size:"small",disabled:F.value===0,onClick:Ke},{default:e.withCtx(()=>we[9]||(we[9]=[e.createTextVNode("上一张")])),_:1,__:[9]},8,["disabled"]),e.createElementVNode("span",yu,e.toDisplayString(F.value+1)+" / "+e.toDisplayString($.value.length),1),e.createVNode(Ve,{size:"small",disabled:F.value===$.value.length-1,onClick:kt},{default:e.withCtx(()=>we[10]||(we[10]=[e.createTextVNode("下一张")])),_:1,__:[10]},8,["disabled"])])):e.createCommentVNode("",!0)]),$.value.length>1?(e.openBlock(),e.createElementBlock("div",bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(nt,aa)=>(e.openBlock(),e.createElementBlock("div",{key:(nt.name||"")+"-"+aa,class:e.normalizeClass(["img-thumb-item",{active:aa===F.value}]),onClick:Wa=>et(aa)},[nt!=null&&nt.blobUrl?(e.openBlock(),e.createBlock(st,{key:0,src:nt.blobUrl,fit:"cover",class:"thumb-image","preview-src-list":[nt.blobUrl],"initial-index":0},null,8,["src","preview-src-list"])):(e.openBlock(),e.createElementBlock("div",Cu,"加载失败")),e.createElementVNode("div",Eu,e.toDisplayString(nt.name||"-"),1)],10,ku))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Su,[j.value?(e.openBlock(),e.createElementBlock("div",Nu,[e.createVNode(Ft,{class:"is-loading"},{default:e.withCtx(()=>[e.createVNode(Et)]),_:1}),we[11]||(we[11]=e.createElementVNode("span",null,"图片加载中...",-1))])):(Yt=J.value)!=null&&Yt.blobUrl?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(st,{ref_key:"imageRef",ref:Z,src:J.value.blobUrl,fit:"contain",class:"preview-image","preview-src-list":[J.value.blobUrl],onLoad:Q},null,8,["src","preview-src-list"]),e.createElementVNode("canvas",{ref_key:"canvasRef",ref:fe,class:"highlight-canvas"},null,512)],64)):(e.openBlock(),e.createElementBlock("div",wu,[(vt=J.value)!=null&&vt.url?(e.openBlock(),e.createElementBlock("span",xu,"图片加载失败")):(e.openBlock(),e.createElementBlock("span",_u,"暂无图片"))]))])])):(e.openBlock(),e.createElementBlock("div",Bu,"暂无图片"))]}),_:1},8,["modelValue"])}}}),Au=Ma._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"],Pu={key:1,class:"thumb-loading"},Iu={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(w=>String(w.versionId)===String(c.value))),r=e.ref({}),O=e.ref(""),L=e.ref("证书附件.pdf"),re=()=>{try{Object.values(r.value||{}).forEach(w=>{w&&URL.revokeObjectURL(w)}),O.value&&URL.revokeObjectURL(O.value)}catch{}r.value={},O.value=""},ge=async w=>{if(!w||w.fileType==="pdf")return;const ae=Array.isArray(w.images)?w.images:[];for(const Ee of ae){const G=Ee==null?void 0:Ee.url;if(!(!G||r.value[G]))try{const Y=await Le.downloadAvatarApi({url:G}),U=URL.createObjectURL(Y.data);r.value={...r.value,[G]:U}}catch{}}},Se=async w=>{if(!w||w.fileType!=="pdf"){O.value="";return}const ae=w.sourceUrl||"";if(!ae){O.value="";return}if(O.value){try{URL.revokeObjectURL(O.value)}catch{}O.value=""}try{const Ee=await Le.downloadAvatarApi({url:ae}),G=URL.createObjectURL(Ee.data);O.value=G;const Y=w.certNo?String(w.certNo):"";L.value=Y?`${Y}.pdf`:"证书附件.pdf"}catch{O.value=""}};e.watch(()=>l.visible,async w=>{var Ee;if(!w){re();return}const ae=(Ee=l.versions)==null?void 0:Ee[0];c.value=(ae==null?void 0:ae.versionId)||"",await ge(ae),await Se(ae)},{immediate:!0}),e.watch(()=>c.value,async()=>{var ae,Ee;const w=g.value;if(!w){v.value="",O.value="";return}if(w.fileType==="pdf"){v.value="",await Se(w);return}O.value="",v.value=((Ee=(ae=w.images)==null?void 0:ae[0])==null?void 0:Ee.url)||"",await ge(w)},{immediate:!0});const ne=()=>{i("update:visible",!1),re()};return e.onBeforeUnmount(()=>{re()}),(w,ae)=>{const Ee=e.resolveComponent("el-empty"),G=e.resolveComponent("el-tab-pane"),Y=e.resolveComponent("el-tabs"),U=e.resolveComponent("el-button"),$=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock($,{"model-value":w.visible,title:"证书附件预览",width:"1100px","close-on-click-modal":!1,onClose:ne},{footer:e.withCtx(()=>[e.createVNode(U,{id:"themeBorderButton",onClick:ne},{default:e.withCtx(()=>ae[1]||(ae[1]=[e.createTextVNode("关闭")])),_:1,__:[1]})]),default:e.withCtx(()=>[w.versions&&w.versions.length>0?(e.openBlock(),e.createBlock(Y,{key:0,modelValue:c.value,"onUpdate:modelValue":ae[0]||(ae[0]=j=>c.value=j),type:"card",class:"cert-version-tabs"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.versions,j=>(e.openBlock(),e.createBlock(G,{key:j.versionId,name:j.versionId,label:j.label},{default:e.withCtx(()=>[e.createElementVNode("div",Ou,[j.fileType==="pdf"?(e.openBlock(),e.createElementBlock("div",Du,[O.value?(e.openBlock(),e.createBlock(Rt.SsFilePreview,{key:1,fileName:L.value,blobUrl:O.value},null,8,["fileName","blobUrl"])):(e.openBlock(),e.createBlock(Ee,{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(j.images||[],F=>(e.openBlock(),e.createElementBlock("div",{key:F.url,class:e.normalizeClass(["thumb",{active:F.url===v.value}]),onClick:Z=>v.value=F.url},[e.createElementVNode("div",Lu,[r.value[F.url]?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.value[F.url]},null,8,Vu)):(e.openBlock(),e.createElementBlock("div",Pu,"加载中"))]),e.createElementVNode("div",Iu,e.toDisplayString(F.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(Ee,{key:0,description:"暂无图片"}))])],64))])]),_:2},1032,["name","label"]))),128))]),_:1},8,["modelValue"])):(e.openBlock(),e.createBlock(Ee,{key:1,description:"暂无可预览的证书附件"}))]),_:1},8,["model-value"])}}}),Hu=Ma._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=(Y=[])=>{const U=[],$=j=>{(j||[]).forEach(F=>{if(!F)return;const Z=F.children||F.childrens||F.columns;Array.isArray(Z)&&Z.length>0?$(Z):U.push(F)})};return $(Y),U},i=t,c=o,v=e.ref([]),g=e.ref(0),r=e.ref("");e.watch(()=>i.candidates,Y=>{var U,$;v.value=(Y||[]).map(j=>({...j,selectedTargetId:(j==null?void 0:j.selectedTargetId)||"",__decision:j==null?void 0:j.__decision})),g.value=0,r.value=(($=(U=v.value)==null?void 0:U[0])==null?void 0:$.selectedTargetId)||""},{immediate:!0,deep:!0}),e.watch(()=>i.visible,Y=>{var U,$;Y&&(g.value=0,r.value=(($=(U=v.value)==null?void 0:U[0])==null?void 0:$.selectedTargetId)||"")});const O=e.computed(()=>{var U;const Y=Number(g.value||0);return((U=v.value||[])==null?void 0:U[Y])||null}),L=e.computed(()=>(l(i.columns||[])||[]).filter($=>$&&$.prop).filter($=>$.type!=="operate"&&$.label!=="操作"&&$.prop!=="operate")),re=Y=>{if(!Y)return;const U=(v.value||[]).findIndex($=>($==null?void 0:$.idx)===(Y==null?void 0:Y.idx));U>-1&&(g.value=U,r.value=(Y==null?void 0:Y.selectedTargetId)||"")},ge=Y=>{if(!Y){r.value="";return}r.value=String((Y==null?void 0:Y.id)??"")},Se=(Y,U="")=>{const $=Number(g.value||0),j=v.value||[],F=j[$];F&&(F.__decision=Y,F.selectedTargetId=U,r.value=U,v.value=[...j])},ne=()=>Se("skip",""),w=()=>Se("add",""),ae=()=>{if(!r.value){E.ElMessage.warning("请先选择要替换的目标记录");return}Se("replace",r.value)},Ee=()=>{c("update:visible",!1)},G=()=>{const Y=v.value||[];if(Y.find($=>($==null?void 0:$.__decision)==="replace"&&!($!=null&&$.selectedTargetId))){E.ElMessage.warning("存在“替换”但未选择目标记录的条目,请处理后再提交");return}c("submit",Y),c("update:visible",!1)};return(Y,U)=>{const $=e.resolveComponent("el-table-column"),j=e.resolveComponent("el-table"),F=e.resolveComponent("el-button"),Z=e.resolveComponent("el-alert");return e.openBlock(),e.createBlock(Na.ssDialog,{title:"OCR候选匹配",visible:t.visible,"close-on-click-modal":!1,width:"90%",style:{maxWidth:"1200px"},onBeforeDestroy:Ee},{default:e.withCtx(()=>{var fe,J;return[e.createElementVNode("div",Ku,[e.createElementVNode("div",Wu,[U[0]||(U[0]=e.createElementVNode("div",{class:"ocr-candidate-title"},"待处理OCR行(可跳过)",-1)),e.createVNode(j,{data:v.value,border:"",stripe:"","max-height":"420",style:{width:"100%"},"highlight-current-row":"",onCurrentChange:re},{default:e.withCtx(()=>[e.createVNode($,{type:"index",label:"序号",width:"60"}),e.createVNode($,{label:"编号","min-width":"140"},{default:e.withCtx(({row:X})=>[e.createTextVNode(e.toDisplayString((X==null?void 0:X.ocrNo)||"-"),1)]),_:1}),e.createVNode($,{label:"候选数",width:"90"},{default:e.withCtx(({row:X})=>[e.createTextVNode(e.toDisplayString(((X==null?void 0:X.candidates)||[]).length),1)]),_:1}),e.createVNode($,{label:"处理状态",width:"120"},{default:e.withCtx(({row:X})=>[(X==null?void 0:X.__decision)==="replace"?(e.openBlock(),e.createElementBlock("span",qu,"替换")):(X==null?void 0:X.__decision)==="add"?(e.openBlock(),e.createElementBlock("span",Yu,"新增")):(X==null?void 0:X.__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,[U[4]||(U[4]=e.createElementVNode("div",{class:"ocr-candidate-title"},"当前行候选记录(同编号)",-1)),e.createElementVNode("div",Qu,[e.createVNode(F,{id:"themeBorderButton",onClick:ne},{default:e.withCtx(()=>U[1]||(U[1]=[e.createTextVNode("跳过本行")])),_:1,__:[1]}),e.createVNode(F,{id:"themeBorderButton",onClick:w},{default:e.withCtx(()=>U[2]||(U[2]=[e.createTextVNode("新增本行")])),_:1,__:[2]}),e.createVNode(F,{class:"ok-button",id:"themeButton",onClick:ae,disabled:!r.value},{default:e.withCtx(()=>U[3]||(U[3]=[e.createTextVNode("替换选中记录")])),_:1,__:[3]},8,["disabled"])]),(((fe=O.value)==null?void 0:fe.candidates)||[]).length===0?(e.openBlock(),e.createBlock(Z,{key:0,title:"该编号暂无候选记录,可选择“新增本行”或“跳过本行”。",type:"info",closable:!1,"show-icon":"",style:{margin:"8px 0"}})):e.createCommentVNode("",!0),e.createVNode(j,{data:((J=O.value)==null?void 0:J.candidates)||[],border:"",stripe:"","max-height":"360",style:{width:"100%"},onCurrentChange:ge,"highlight-current-row":""},{default:e.withCtx(()=>[e.createVNode($,{type:"index",label:"序号",width:"60"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,X=>(e.openBlock(),e.createBlock($,{key:X.prop,label:X.label,prop:X.prop,"min-width":X.minWidth||160},null,8,["label","prop","min-width"]))),128))]),_:1},8,["data"])])):e.createCommentVNode("",!0)])]}),footer:e.withCtx(()=>[e.createElementVNode("div",Zu,[e.createVNode(F,{id:"themeBorderButton",onClick:Ee},{default:e.withCtx(()=>U[5]||(U[5]=[e.createTextVNode("取消")])),_:1,__:[5]}),e.createVNode(F,{class:"ok-button",id:"themeButton",onClick:G},{default:e.withCtx(()=>U[6]||(U[6]=[e.createTextVNode("提交已处理")])),_:1,__:[6]})])]),_:1},8,["visible"])}}},tc=Ma._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,ne=>{ne&&(c.value=JSON.parse(JSON.stringify(l.ocrPreviewData)),v.value=JSON.parse(JSON.stringify(l.ocrPreviewColumns)),g.value=[...l.ocrSelectedFields])});const r=(ne,w)=>{const ae=[...g.value];if(w)ae.includes(ne)||ae.push(ne);else{const Ee=ae.indexOf(ne);Ee>-1&&ae.splice(Ee,1)}g.value=ae,i("update:ocrSelectedFields",ae)},O=(ne,w,ae)=>{i("fieldChange",{rowIndex:ne,prop:w,value:ae})},L=()=>{i("update:ocrPreviewData",c.value),i("confirm",c.value),i("update:visible",!1)},re=()=>{i("update:visible",!1)},ge=ne=>typeof ne!="number"?"-":`${(ne*100).toFixed(1)}%`,Se=ne=>typeof ne!="number"?"#606266":ne>=.9?"#67c23a":ne>=.7?"#e6a23c":"#f56c6c";return(ne,w)=>{const ae=e.resolveComponent("el-alert"),Ee=e.resolveComponent("el-table-column"),G=e.resolveComponent("el-checkbox"),Y=e.resolveComponent("el-input"),U=e.resolveComponent("el-table"),$=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(Na.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(ae,{title:"请核对识别结果。系统将按 编号+名称+制造厂 规则匹配并替换;未唯一命中但有编号的,将进入候选选择;无编号则直接新增。",type:"info",closable:!1,"show-icon":""})]),e.createElementVNode("div",lc,[e.createVNode(U,{data:c.value,border:"",stripe:"","max-height":"400",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(Ee,{type:"index",label:"序号",width:"60",fixed:""}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,j=>(e.openBlock(),e.createBlock(Ee,{key:j.prop,prop:j.prop,"min-width":j.minWidth||230,"class-name":j.isAccuracy?"accuracy-column":""},{header:e.withCtx(()=>[e.createElementVNode("div",oc,[j.isAccuracy?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G,{key:0,"model-value":g.value.includes(j.prop),onChange:F=>r(j.prop,F),onClick:w[0]||(w[0]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onChange"])),e.createElementVNode("span",null,e.toDisplayString(j.label),1)])]),default:e.withCtx(({row:F,$index:Z})=>[j.isAccuracy?(e.openBlock(),e.createElementBlock("span",{key:0,class:"accuracy-value",style:e.normalizeStyle({color:Se(F[j.prop]),fontWeight:500})},e.toDisplayString(ge(F[j.prop])),5)):(e.openBlock(),e.createBlock(Y,{key:1,modelValue:F[j.prop],"onUpdate:modelValue":fe=>F[j.prop]=fe,size:"small",placeholder:"请输入"+j.label,onChange:fe=>O(Z,j.prop,fe)},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($,{onClick:re,id:"themeBorderButton"},{default:e.withCtx(()=>w[1]||(w[1]=[e.createTextVNode("取消")])),_:1,__:[1]}),e.createVNode($,{class:"ok-button",onClick:L,id:"themeButton"},{default:e.withCtx(()=>w[2]||(w[2]=[e.createTextVNode("确认")])),_:1,__:[2]})])]),_:1},8,["visible"])}}},ic=Ma._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:"确认"}]),O=[{label:"新增",icon:"new"},{label:"导入",icon:"import_101"},{label:"导出",icon:"export_101"},{label:"OCR识别",icon:"OCR识别"},{label:"切换视图",icon:"cardViewport_101"}],L=U=>{const $=U.raw;if(!$)return;const j=new FileReader;j.onload=F=>{try{const Z=new Uint8Array(F.target.result),fe=Le.readSync(Z,{type:"array"}),J=fe.SheetNames[0],X=fe.Sheets[J],Ke=Le.utils.decode_range(X["!ref"]).e.c+1,kt=new Array(Ke).fill(""),R=[];for(const Je in X){if(Je[0]==="!")continue;const{r:Q,c:Be}=Le.utils.decode_cell(Je);let ze=X[Je].v;if(X[Je].t==="n"&&ze>0&&ze<1e6&&(ze=new Date((ze-25569)*86400*1e3).toISOString().split("T")[0]),(ze==null||ze==="")&&(ze=""),Q===0)kt[Be]=ze;else{if(!R[Q-1]){R[Q-1]={};for(let be=0;be<Ke;be++)R[Q-1][`col_${be}`]=""}R[Q-1][`col_${Be}`]=ze}}for(let Je=0;Je<Ke;Je++)kt[Je]===void 0&&(kt[Je]="");const ft=R==null?void 0:R[0];if(!(ft!=null&&ft.hasOwnProperty("col_0")))return E.ElMessage.error("导入的数据列不匹配,请检查是否错位");l("getImportData",kt,R)}catch(Z){throw E.ElMessage.error(Z.message),new Error(Z.message)}},j.readAsArrayBuffer($)},re=U=>{var j;const $=(j=g.value)==null?void 0:j.reduce((F,Z,fe)=>(fe===0?F[Z.label]=U:F[Z.label]=Z==null?void 0:Z.value,F),{});l("filter",$,U,!0)},ge=(U,$={})=>{l("buttonClick",U,"",$)},Se=U=>{var $,j;g.value=(j=($=Le.getColumnChild(pe.cloneDeep(U)))==null?void 0:$.filter(F=>(F==null?void 0:F.label)!==""&&(F==null?void 0:F.label)!=="操作"))==null?void 0:j.map(F=>({label:(F==null?void 0:F.label)??"",value:"",name:(F==null?void 0:F.label)??"",isFormColHidden:F==null?void 0:F.isTableColHidden,width:2}))},ne=e.ref(!1),w=U=>{var $;if((U==null?void 0:U.buttonName)==="确认"&&(l("filter",U==null?void 0:U.content),ne.value=(U==null?void 0:U.content)&&Object.values(U==null?void 0:U.content).length>0),(U==null?void 0:U.buttonName)==="清空"){const j=pe.cloneDeep(U==null?void 0:U.content);for(const F in j)j[F]="";g.value=($=g.value)==null?void 0:$.map(F=>({...F,value:""})),l("filter",j),ne.value=!1}v.value=!1},ae=()=>{v.value=!v.value},Ee=()=>{var $,j;g.value=($=g.value)==null?void 0:$.map(F=>({...F,value:""}));const U=(j=g.value)==null?void 0:j.reduce((F,Z)=>(F[Z.label]=Z.value,F),{});l("filter",U)},G=e.ref(null);let Y;return Y=U=>{var Z;if(!v.value)return;const $=(Z=G==null?void 0:G.value)==null?void 0:Z.$el,j=$==null?void 0:$.contains(U.target);let F=!1;document.querySelectorAll(".el-popover, .el-popper").forEach(fe=>{fe.contains(U.target)&&(F=!0)}),!j&&!F&&(v.value=!1)},e.onMounted(()=>{document.addEventListener("click",Y),Se(i.columns)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",Y)}),e.watch(()=>i.columns,()=>{Se(i.columns)},{deep:!0,immediate:!0}),(U,$)=>{var X,et,Ke,kt;const j=e.resolveComponent("el-icon"),F=e.resolveComponent("svg-icon"),Z=e.resolveComponent("el-input"),fe=e.resolveComponent("el-upload"),J=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(No,{trigger:"manual",ref_key:"popOverRef",ref:G,title:"",width:800,placement:"bottom-start",isVisible:v.value,"onUpdate:isVisible":$[1]||($[1]=R=>v.value=R)},{reference:e.withCtx(()=>{var R,ft,Je,Q;return[e.createVNode(Z,{modelValue:c.value,"onUpdate:modelValue":$[0]||($[0]=Be=>c.value=Be),style:{"min-width":"80px"},placeholder:ne.value?(Je=(ft=(R=t.filterValues)==null?void 0:R.filter(Be=>Be))==null?void 0:ft.slice(0,3))==null?void 0:Je.join("/"):"搜索","prefix-icon":e.unref(E.search_default),clearable:"",onInput:re,disabled:((Q=g.value)==null?void 0:Q.length)===0},{suffix:e.withCtx(()=>{var Be,ze;return[!c.value&&((ze=(Be=t.filterValues)==null?void 0:Be.filter(be=>be))!=null&&ze.join("/"))?(e.openBlock(),e.createBlock(j,{key:0,style:{cursor:"pointer"},onClick:Ee},{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(ae,["stop"])},[e.createVNode(F,{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(Rt.ssForm,{rowContents:g.value,buttonValue:r.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:r.value,isStartJustify:!1,onOnButtonClick:w},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])])):e.createCommentVNode("",!0),t.buttons&&((X=t.buttons)==null?void 0:X.length)>0?(e.openBlock(),e.createElementBlock("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((et=t.buttons)==null?void 0:et.filter(R=>t.isDevMode||(R==null?void 0:R.label)!=="修改模板"),(R,ft)=>{var Je;return e.openBlock(),e.createElementBlock("div",{class:"extra-contents",key:ft},[(R==null?void 0:R.type)==="upload"?(e.openBlock(),e.createBlock(fe,{key:0,class:"upload-button-wrap","on-change":L,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1,disabled:!!t.lockingPage},{default:e.withCtx(()=>{var Q;return[e.createElementVNode("div",{class:e.normalizeClass(["table-op-action",{"is-disabled":!!t.lockingPage}]),onClick:Be=>ge(R==null?void 0:R.label)},[e.createVNode(F,{class:"table-op-icon",name:(Q=O==null?void 0:O.find(Be=>(Be==null?void 0:Be.label)===(R==null?void 0:R.label)))==null?void 0:Q.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(Rt._sfc_main,{key:1},{dropTitle:e.withCtx(()=>{var Q;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(F,{class:"table-op-icon",name:(Q=O==null?void 0:O.find(Be=>(Be==null?void 0:Be.label)===(R==null?void 0:R.label)))==null?void 0:Q.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,Q=>{var Be,ze;return e.openBlock(),e.createElementBlock("div",{key:Q==null?void 0:Q.label,class:e.normalizeClass(["table-op-drop-item",{"is-disabled":!!t.lockingPage}]),onClick:be=>!t.lockingPage&&ge(Q==null?void 0:Q.label)},[e.createTextVNode(e.toDisplayString(Q==null?void 0:Q.label),1),(Be=Q==null?void 0:Q.label)!=null&&Be.includes("选中")?(e.openBlock(),e.createElementBlock("span",bc,"("+e.toDisplayString(t.selectNums)+")",1)):e.createCommentVNode("",!0),(ze=Q==null?void 0:Q.label)!=null&&ze.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:Q=>!t.lockingPage&&ge(R==null?void 0:R.label,R)},[e.createVNode(F,{class:"table-op-icon",name:(Je=O==null?void 0:O.find(Q=>(Q==null?void 0:Q.label)===(R==null?void 0:R.label)))==null?void 0:Je.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(No,{trigger:"manual",ref_key:"popOverRef",ref:G,title:"",width:800,placement:"bottom-start",isVisible:v.value,"onUpdate:isVisible":$[3]||($[3]=R=>v.value=R)},{reference:e.withCtx(()=>{var R,ft,Je,Q;return[e.createVNode(Z,{modelValue:c.value,"onUpdate:modelValue":$[2]||($[2]=Be=>c.value=Be),style:{"min-width":"80px"},placeholder:ne.value?(Je=(ft=(R=t.filterValues)==null?void 0:R.filter(Be=>Be))==null?void 0:ft.slice(0,3))==null?void 0:Je.join("/"):"搜索","prefix-icon":e.unref(E.search_default),clearable:"",onInput:re,disabled:((Q=g.value)==null?void 0:Q.length)===0},{suffix:e.withCtx(()=>{var Be,ze;return[!c.value&&((ze=(Be=t.filterValues)==null?void 0:Be.filter(be=>be))!=null&&ze.join("/"))?(e.openBlock(),e.createBlock(j,{key:0,style:{cursor:"pointer"},onClick:Ee},{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(ae,["stop"])},[e.createVNode(F,{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(Rt.ssForm,{rowContents:g.value,buttonValue:r.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:r.value,isStartJustify:!1,onOnButtonClick:w},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),t.buttons&&((Ke=t.buttons)==null?void 0:Ke.length)>0?(e.openBlock(),e.createElementBlock("div",_c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((kt=t.buttons)==null?void 0:kt.filter(R=>t.isDevMode||(R==null?void 0:R.label)!=="修改模板"),(R,ft)=>{var Je;return e.openBlock(),e.createElementBlock("div",{class:"extra-contents",key:ft},[(R==null?void 0:R.type)==="upload"?(e.openBlock(),e.createBlock(fe,{key:0,class:"upload-button-wrap","on-change":L,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1},{default:e.withCtx(()=>{var Q;return[e.createElementVNode("div",Bc,[e.createVNode(F,{class:"table-op-icon",name:(Q=O==null?void 0:O.find(Be=>(Be==null?void 0:Be.label)===(R==null?void 0:R.label)))==null?void 0:Q.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(Rt._sfc_main,{key:1},{dropTitle:e.withCtx(()=>[(R==null?void 0:R.type)==="popover"?(e.openBlock(),e.createBlock(J,{key:0,style:{background:"transparent",color:"#000000"}},{icon:e.withCtx(()=>{var Q;return[e.createVNode(F,{class:"table-op-icon",name:(Q=O==null?void 0:O.find(Be=>(Be==null?void 0:Be.label)===(R==null?void 0:R.label)))==null?void 0:Q.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,Q=>(e.openBlock(),e.createBlock(J,{key:Q==null?void 0:Q.label,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:Be=>ge(Q==null?void 0:Q.label)},{default:e.withCtx(()=>{var Be,ze;return[e.createTextVNode(e.toDisplayString(Q==null?void 0:Q.label),1),(Be=Q==null?void 0:Q.label)!=null&&Be.includes("选中")?(e.openBlock(),e.createElementBlock("span",Oc,"("+e.toDisplayString(t.selectNums)+")",1)):e.createCommentVNode("",!0),(ze=Q==null?void 0:Q.label)!=null&&ze.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:Q=>!t.lockingPage&&ge(R==null?void 0:R.label,R)},[e.createVNode(F,{class:"table-op-icon",name:(Je=O==null?void 0:O.find(Q=>(Q==null?void 0:Q.label)===(R==null?void 0:R.label)))==null?void 0:Je.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=Ma._export_sfc(Lc,[["__scopeId","data-v-9d73f66c"]]),Ro=pe.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(t){this.selectArray=t},setSelectString(t){this.selectString=t}}}),Pc={class:"calculator-content"},Ic={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",Pc,[e.createElementVNode("div",Ic,[e.createVNode(Rt.ssForm,{rowContents:o.value,isRowFlex:!0},null,8,["rowContents"])]),e.createElementVNode("div",Rc,[e.createVNode(Rt.ssForm,{rowContents:l.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),Fc=Ma._export_sfc(Uc,[["__scopeId","data-v-73db0fe7"]]),hl=(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,O)=>{var L;(L=i==null?void 0:i[O])!=null&&L.prop?g[i[O].prop]=r:Array.isArray(r)&&(g.children=hl(r,i))}),Object.assign(g,{id:v})}else return c})),l},Uo=(t,o,l)=>{let i=t,c=o;return i=i==null?void 0:i.map((v,g)=>{var r,O;return!Array.isArray(v)||!((r=c==null?void 0:c[g])!=null&&r.label)&&!l||(v.unshift(((O=c==null?void 0:c[g])==null?void 0:O.label)??""),v.some(L=>Array.isArray(L))&&(v=v==null?void 0:v.map(L=>{var re;return Array.isArray(L)&&(L=Uo(L,(re=c==null?void 0:c[g])==null?void 0:re.children,l)),L}))),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=Fo(v,c,l)),v)),i},Fo=(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=Fo(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=zo(v,c,l)),v)),i},zo=(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=zo(g,c,l)),g)),i};class Wc{constructor(o={}){Xt(this,"url");Xt(this,"heartbeatInterval");Xt(this,"socket",null);Xt(this,"isConnected",!1);Xt(this,"heartTimer",null);Xt(this,"canvas",null);Xt(this,"ctx",null);Xt(this,"mainCamCutMode",0);Xt(this,"pMainShowStartX",0);Xt(this,"pMainShowStartY",0);Xt(this,"onLog");Xt(this,"onDevCount");Xt(this,"onCameraStatus");Xt(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,O;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 L=l[3],re=l.length-4,ge=new Uint8Array(re);for(let w=0;w<re;w++)ge[w]=l[4+w];const ne=decodeURIComponent(this.byteToString(ge)).split("|");(c=this.onDevCount)==null||c.call(this,L,ne);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],ge=l[6]*65536+l[7]*256+l[8];let Se="";if(re>0){const ae=new Uint8Array(re);for(let Ee=0;Ee<re;Ee++)ae[Ee]=l[9+Ee];Se=decodeURIComponent(this.byteToString(ae))}const ne=new Uint8Array(ge);for(let ae=0;ae<ge;ae++)ne[ae]=l[9+re+ae];const w=this.uint8ArrayToString(ne);(r=this.onPhoto)==null||r.call(this,{flag:0,imgPath:Se,base64:w})}l[3]===2&&((O=this.onPhoto)==null||O.call(this,{flag:2,imgPath:"",base64:""}));return}if(i===204){if(!this.canvas||!this.ctx)return;const L=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 ge=this.ctx.createImageData(L,re);let Se=11;for(let ne=0;ne<ge.data.length;ne+=4)ge.data[ne+0]=l[Se],ge.data[ne+1]=l[Se+1],ge.data[ne+2]=l[Se+2],ge.data[ne+3]=255,Se+=3;this.ctx.putImageData(ge,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(""),O=new Wc({url:"ws://127.0.0.1:22225"});function L($,j){var et;const F=$.split(","),Z=((et=F[0].match(/:(.*?);/))==null?void 0:et[1])??"image/jpeg",fe=atob(F[1]);let J=fe.length;const X=new Uint8Array(J);for(;J--;)X[J]=fe.charCodeAt(J);return new File([X],j,{type:Z})}function re(){O.onLog=$=>{console.log("[GPY]",$)},O.onDevCount=($,j)=>{if(r.value+=`设备数量=${$},设备=${j.join(",")}
8
- `,$>0){r.value+=`检测到设备,正在打开摄像头...
9
- `;try{O.openCamera(0,1280,720)}catch(F){r.value+=`打开摄像头失败:${(F==null?void 0:F.message)??F}
10
- `}}else r.value+=`未检测到高拍仪设备!
11
- `},O.onCameraStatus=$=>{$==="opened"?(v.value=!0,r.value+=`摄像头已打开
12
- `):(v.value=!1,r.value+=`摄像头已关闭
13
- `)},O.onPhoto=$=>{$.flag===0&&$.base64?(g.value=`data:image/jpeg;base64,${$.base64}`,r.value+=`拍照完成,已接收图片
14
- `):r.value+=`拍照失败 flag=${$.flag}
15
- `}}const ge=async()=>{if(await e.nextTick(),!c.value)return;Se(),re();const $=c.value.getBoundingClientRect();O.init(c.value,Math.floor($.width),Math.floor($.height)),r.value+=`正在连接设备服务...
16
- `,await O.connect(),r.value+=`正在获取设备数量...
17
- `,O.getDevCount()},Se=()=>{try{O.destroy()}catch($){console.error($)}v.value=!1,g.value="",r.value=""};e.watch(()=>l.visible,$=>{$?ge():Se()});const ne=()=>{try{O.bestSize()}catch($){console.error($)}},w=()=>{try{O.rotateLeft()}catch($){console.error($)}},ae=()=>{try{O.rotateRight()}catch($){console.error($)}},Ee=()=>{try{O.focus()}catch($){console.error($)}},G=()=>{r.value+=`正在拍照...
18
- `;try{O.photo()}catch($){r.value+=`拍照调用失败:${($==null?void 0:$.message)??$}
19
- `}},Y=()=>{if(g.value){const $=L(g.value,"gpy-capture.jpg");i("confirm",$)}else i("confirm",null)},U=()=>{Se(),i("cancel")};return($,j)=>{const F=e.resolveComponent("el-input"),Z=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(Na.ssDialog,{title:"扫描录入",visible:l.visible,onBeforeDestroy:U,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,[j[0]||(j[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,[j[1]||(j[1]=e.createElementVNode("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"操作记录",-1)),e.createVNode(F,{type:"textarea",value:r.value,readonly:"",rows:10,placeholder:"设备操作记录...",style:{flex:"1"}},null,8,["value"])])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",td,[e.createVNode(Z,{onClick:ne,disabled:!v.value,id:"themeBorderButton"},{default:e.withCtx(()=>j[2]||(j[2]=[e.createTextVNode("适屏")])),_:1,__:[2]},8,["disabled"]),e.createVNode(Z,{onClick:w,disabled:!v.value,id:"themeBorderButton"},{default:e.withCtx(()=>j[3]||(j[3]=[e.createTextVNode("左旋")])),_:1,__:[3]},8,["disabled"]),e.createVNode(Z,{onClick:ae,disabled:!v.value,id:"themeBorderButton"},{default:e.withCtx(()=>j[4]||(j[4]=[e.createTextVNode("右旋")])),_:1,__:[4]},8,["disabled"]),e.createVNode(Z,{onClick:Ee,disabled:!v.value,id:"themeBorderButton"},{default:e.withCtx(()=>j[5]||(j[5]=[e.createTextVNode("对焦")])),_:1,__:[5]},8,["disabled"]),e.createVNode(Z,{onClick:G,disabled:!v.value,id:"themeButton"},{default:e.withCtx(()=>j[6]||(j[6]=[e.createTextVNode("拍照")])),_:1,__:[6]},8,["disabled"]),j[9]||(j[9]=e.createElementVNode("div",{style:{flex:"1"}},null,-1)),e.createVNode(Z,{onClick:Y,disabled:!g.value,id:"themeButton"},{default:e.withCtx(()=>j[7]||(j[7]=[e.createTextVNode("确认")])),_:1,__:[7]},8,["disabled"]),e.createVNode(Z,{onClick:U,id:"themeBorderButton"},{default:e.withCtx(()=>j[8]||(j[8]=[e.createTextVNode("取消")])),_:1,__:[8]})])]),_:1},8,["visible"])}}}),nd=Ma._export_sfc(ad,[["__scopeId","data-v-cfe79109"]]),jo=pe.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(t){this.objUrl=t},setBlobUrls(t){this.blobUrls=t}}}),Pn=async(t,o)=>{var g,r,O,L,re,ge,Se,ne,w,ae,Ee,G,Y,U,$,j,F;let l=(r=(g=pe.cloneDeep(t))==null?void 0:g.optionUrl)==null?void 0:r.menuSelect,i=[];l==null||l.forEach(Z=>{});let c="",v=await Le.menuToParent(l);if(v==null||v.forEach(Z=>{var fe,J,X,et;(Z==null?void 0:Z.name)===(((et=(X=(J=(fe=pe.cloneDeep(t))==null?void 0:fe.optionUrl)==null?void 0:J.groupSelect)==null?void 0:X[0])==null?void 0:et.replaceAll("'",""))??"")&&(c=Z==null?void 0:Z.id)}),o){c=o;const Z=await E.getInsofDataApi({id:c}),fe=(ge=(re=(L=(O=Z==null?void 0:Z.data)==null?void 0:O.result)==null?void 0:L[0])==null?void 0:re.key)==null?void 0:ge.pageKey;v=await Le.getItemData(fe,sessionStorage.getItem("systemKey"),"")}if(c!==""){let Z;o?Z=(Se=v==null?void 0:v.find(X=>(X==null?void 0:X.id)===o))==null?void 0:Se.compData:Z=(ne=v==null?void 0:v.find(X=>{var et,Ke,kt,R;return(X==null?void 0:X.name)===(((Ke=(et=t==null?void 0:t.groupSelect)==null?void 0:et.split(":"))==null?void 0:Ke[0])||((R=(kt=t==null?void 0:t.optionUrl)==null?void 0:kt.groupSelect)==null?void 0:R[0]))}))==null?void 0:ne.compData;let fe=(ae=(w=Z==null?void 0:Z.find(X=>(X==null?void 0:X.key)==="header"))==null?void 0:w.contents)==null?void 0:ae.map(X=>X==null?void 0:X.label);(G=(Ee=Z==null?void 0:Z.find(X=>(X==null?void 0:X.key)==="header"))==null?void 0:Ee.contents)!=null&&G.every(X=>Array.isArray(X))&&(fe=($=Le.getColumnChild((U=(Y=Z==null?void 0:Z.find(X=>(X==null?void 0:X.key)==="header"))==null?void 0:Y.contents)==null?void 0:U[0]))==null?void 0:$.map(X=>X==null?void 0:X.prop));let J=(F=(j=Z==null?void 0:Z.find(X=>(X==null?void 0:X.key)==="tableContents"))==null?void 0:j.contents)==null?void 0:F.map(X=>{if(Array.isArray(X))X=X==null?void 0:X.filter(et=>!(et!=null&&et.id));else{let et={};for(let Ke in X)Ke!=="id"&&(et[Ke]=X==null?void 0:X[Ke]);X=et}return X});J==null||J.forEach(X=>{Array.isArray(X)?i.push(Le.getValueToObjectValue(X,fe)):i.push(X)})}return i},ld="col-operate",Cl=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=Cl(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,O;if(!t)return;const o=Cl(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?(O=(r=c==null?void 0:c[0])==null?void 0:r.value)==null?void 0:O.columns:[]},cd=async(t,o)=>{if(!t||!o)return;const l=Cl(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}}),xo=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"},Pd={class:"ocr-file-grid"},Id={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"},_o="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 eo;const l=e.ref([]),i=jo(pe.pinia),c=e.ref(null),v=e.ref(new Set),g=e.ref(new Map),r=t,O=e.ref((r==null?void 0:r.allowSelect)??!0),L=e.ref(((eo=r==null?void 0:r.config)==null?void 0:eo.showIndex)??!0),re=e.ref(),ge=e.ref(!0),Se=e.ref(!1),ne={sortable:"switch",filterable:"switch",showSummary:"switch",operable:"switch",fixed:"radio"},w=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"}]}]),ae=Le.useOriginalState(pe.pinia);let Ee="$R";const{originalPath:G}=pe.storeToRefs(ae),Y=G.value,U=e.computed(()=>{var n;const a=(n=Le.getAllLeafNodes(J.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=J.value)==null?void 0:n.every(s=>s==null?void 0:s.filterable)}),e.computed(()=>{var n;return(n=J.value)==null?void 0:n.every(s=>s==null?void 0:s.operable)});const $=e.ref(!0),j=e.ref([]),F=e.reactive({column:{},status:!1,text:"合计"}),Z=e.reactive({currentPage:1,pageSize:10,total:0,pageSizes:[5,10,20,50,100]}),fe=o,J=e.ref([]),X=e.ref([]),et=e.ref([]),Ke=e.reactive({prop:"",order:null}),kt=e.ref([]),R=e.ref(!1),ft=e.ref(!1),Je=e.ref(null),{isUseBackdrop:Q,initTrackFileType:Be,getFileExtension:ze,setData:be,getFileInfo:we,getFilesInfo:Ve}=ao.useThreeSystem(),st=e.ref([]),Et=e.ref(!1),Ft=e.ref(),mt=pe.useMenuState(),{importLoading:Yt,activeMenuPath:vt,contentLoading:nt,linkMenuInfo:aa}=pe.storeToRefs(mt),Wa=Le.useTableComp(pe.pinia),ct=pe.useModelComp(pe.pinia),{extraContents:it,cacheUpdatingData:wa,tableViewContents:xa,tableLoading:Rn,pageMapState:pa,lockingPage:hn}=pe.storeToRefs(ct),se=e.ref([]),Gt=e.ref([]),Lt=e.ref(new Map);e.ref(!1);const na=e.ref("");e.ref();const $a=e.ref(!0),_a=e.ref(0),qa=e.ref(!0),W=e.ref(""),He=e.ref(!1);e.ref([]);const Dt=e.ref({label:"查看三维模型"}),oa=e.ref(!1),fa=e.ref(),la=e.ref([]),va=e.ref([]),mn=e.ref(!1),Ya=e.ref([]),xt=e.ref([]),_t=e.ref([]),qe=e.ref([]),ha=e.ref([]),Ho=()=>{try{const a=localStorage.getItem(_o),n=a?JSON.parse(a):[];ha.value=Array.isArray(n)?n:[]}catch{ha.value=[]}},Ko=()=>{try{localStorage.setItem(_o,JSON.stringify(ha.value||[]))}catch{}},El=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=(ha.value||[]).findIndex(k=>String((k==null?void 0:k.name)||"").trim().toLowerCase()===d);f>-1&&ha.value.splice(f,1),ha.value.unshift(u),ha.value.length>20&&(ha.value=ha.value.slice(0,20)),Ko()};Ho();const gn=(a,n)=>`${ap}:${String(a??"")}:${String(n??"")}`,yn=(a,n)=>{try{const s=sessionStorage.getItem(gn(a,n)),u=s?JSON.parse(s):[];return Array.isArray(u)?u:[]}catch{return[]}},Sl=(a,n,s)=>{try{sessionStorage.setItem(gn(a,n),JSON.stringify(Array.isArray(s)?s:[]))}catch{}},bn=(a,n,s)=>{if(!n)return;const u=yn(a,n),d=[s,...u||[]].filter(Boolean).slice(0,5);return Sl(a,n,d),d},Wo=(a,n,s)=>{if(!n||!s)return;const u=gn(a,n),d=gn(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=yn(a,s),b=[...m,...p||[]].filter(Boolean).sort((k,D)=>Number((D==null?void 0:D.ts)||0)-Number((k==null?void 0:k.ts)||0)).slice(0,5);sessionStorage.setItem(d,JSON.stringify(b)),sessionStorage.removeItem(u)}catch{}},Un=e.ref(!1),ca=e.ref(!1),gt=e.ref([]),qo=e.ref(null);e.ref(!1),e.ref([]),e.ref(""),e.ref("");const Fn=e.ref(!1),Nl=e.ref([]),Vt=e.ref(1),kn=e.ref(new Map),Cn=e.ref(new Map),ma=e.ref(0),zn=e.ref(!1),ga=e.ref([]),jn=e.ref([]),En=a=>{var n;try{const s=(n=Le.getAllLeafNodes(J.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=En(a),s=(n==null?void 0:n.formType)||(n==null?void 0:n.columnType)||"Input";return Rt.getComponent(s)||Rt.getComponent("Input")},wl=e.ref([]),xl=e.ref(null),ya=e.ref([]),La=e.ref(null),Ga=e.ref(""),Va=e.ref(!1),Ja=e.ref([]),Hn=e.ref(""),Sn=e.ref(!1),Nn=e.ref([]),Ua=e.ref([]),ba=e.ref([]),Kn=e.ref(null),_l=e.ref([]),Bl=e.ref("");e.computed(()=>{var a;try{const n=(a=Le.getAllLeafNodes(J.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=Le.getAllLeafNodes(J.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=Le.getAllLeafNodes(J.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""}}),Tl=()=>{Sn.value=!1,Nn.value=[],Ua.value=[],ba.value=[],Kn.value=null,_l.value=[],Bl.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=Gt.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),bn(r==null?void 0:r.index,n.id,a==null?void 0:a.versionItem),Ua.value=[...Ua.value||[],JSON.parse(JSON.stringify(n))]},Qo=a=>{const n=Array.isArray(a)?a:Nn.value||[];if(n.length===0){Tl();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"){bn(r==null?void 0:r.index,(p=f==null?void 0:f.ocrRow)==null?void 0:p.id,f==null?void 0:f.versionItem),ba.value=[...ba.value||[],f.ocrRow];return}if(m==="replace"){const b=f==null?void 0:f.selectedTargetId,k=(se.value||[]).find(D=>String(D==null?void 0:D.id)===String(b));if(!k)return;Xo(f,k)}}}),(Ua.value||[]).length>0&&(se.value=[...se.value||[]]),(ba.value||[]).length>0&&(se.value=[...se.value||[],...ba.value||[]],Gt.value=[...Gt.value||[],...ba.value||[]],(ba.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)})),Fa.value=se.value;const u=Ua.value||[],d=ba.value||[];if(u.length>0&&fe("change",{buttonName:"编辑",singleContent:u,content:se.value,index:r==null?void 0:r.index,parentTableId:r==null?void 0:r.parentTableId,column:J.value}),d.length>0){const f=Kn.value;fe("change",{buttonName:"OCR批量新增",content:se.value,index:r==null?void 0:r.index,parentTableId:r==null?void 0:r.parentTableId,column:J.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("已提交候选处理结果"),Tl()},Xa=to.createOCRService(),Zo=e.computed(()=>Xa.getConfig()),ra=e.ref(),zt=e.ref(),er=Ro(pe.pinia),Fa=e.ref(),Wn=e.ref(0),tr=Le.useUnit(pe.pinia),{selectIndex:ar,selectMenu:qn,selectTitle:op}=pe.storeToRefs(tr),{selectString:Pa}=pe.storeToRefs(er),nr=pe.useLoginState(pe.pinia),{loginUserInfo:ka}=pe.storeToRefs(nr),lr=e.ref(720),jt=e.ref(!1),wn=e.ref(!1),da=e.ref([]),sa=e.ref(),Qa=e.ref(!0),Al=e.ref(!0),or=e.ref([]),rr=e.inject("contentRef");e.provide("contentRef",rr),e.watch(()=>{var a;return(a=se.value)==null?void 0:a.length},a=>{Z.total=a}),e.watch(()=>xa.value,async()=>{var n,s,u,d,f,m,p,b,k,D,M,V,q,le,ce,de,P;if(((n=xa.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=(D=r==null?void 0:r.itemData)==null?void 0:D.find(he=>(he==null?void 0:he.key)==="pageColumn"))==null?void 0:M.contents)==null?void 0:V.split("["))==null?void 0:q[0])+((ce=(le=xa.value)==null?void 0:le.find(he=>(he==null?void 0:he.key)===a))==null?void 0:ce.value),(P=(de=r==null?void 0:r.itemData)==null?void 0:de.find(he=>(he==null?void 0:he.key)==="pageGroup"))==null||P.contents,Zl(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:vt.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 D=Object.keys(k),M={};return D.forEach((V,q)=>{M[a[q]]=k[V]}),M}),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?(ct.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,D,M;let n=et.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,le;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(ce=>typeof ce=="string")&&(V.selectValue=(le=n==null?void 0:n.find(ce=>(ce==null?void 0:ce.key)===(V==null?void 0:V.prop)))==null?void 0:le.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 Pn(d==null?void 0:d.optionUrl,u),q,le=j.value,ce=(M=(D=(k=qe.value)==null?void 0:k.find(de=>{var P;return(P=d==null?void 0:d.optionUrl)==null?void 0:P.menuId}))==null?void 0:D.selectValue)==null?void 0:M[0];if(V==null||V.forEach(de=>{var P,he,z,T,h,C,x,_,ue,H;if(u){let xe=(he=(P=qe.value)==null?void 0:P.find(oe=>{var Re,me;return((Re=d==null?void 0:d.optionUrl)==null?void 0:Re.menuId)===((me=oe==null?void 0:oe.optionUrl)==null?void 0:me.menuId)}))==null?void 0:he.prop,y=(T=(z=s==null?void 0:s.find(oe=>(oe==null?void 0:oe.prop)===xe))==null?void 0:z.selectValue)==null?void 0:T[0];xe!=null&&xe.includes("·")&&(xe=(h=xe==null?void 0:xe.split("·"))==null?void 0:h[0],y=(ue=(_=(x=a==null?void 0:a.value)==null?void 0:x[((C=a==null?void 0:a.value)==null?void 0:C.length)-1])==null?void 0:_.split(" "))==null?void 0:ue[0]),le!=null&&le.find(oe=>(oe==null?void 0:oe.value)===ce)?q=(H=le==null?void 0:le.find(oe=>(oe==null?void 0:oe.value)===ce))==null?void 0:H.objectValue:de[xe]===y&&(q=de)}}),q){let de=s;de=de==null?void 0:de.map(P=>{var he,z,T,h,C,x;return u&&(q!=null&&q[P==null?void 0:P.prop])&&W.value==="新增"&&(P==null?void 0:P.prop)!==(d==null?void 0:d.prop)?P.value=(q==null?void 0:q[P==null?void 0:P.prop])||(q==null?void 0:q[(h=(T=(z=(he=P==null?void 0:P.optionUrl)==null?void 0:he.groupSelect)==null?void 0:z[1])==null?void 0:T.replaceAll("[",""))==null?void 0:h.replaceAll("]","")]):P.value=(x=(C=qe.value)==null?void 0:C.find(_=>(_==null?void 0:_.prop)===(P==null?void 0:P.prop)))==null?void 0:x.value,P}),qe.value=de}}et.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);Ft.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}],Et.value=!0}};e.onBeforeUnmount(()=>{Al.value=!1;let a=Wn.value;Wn.value=a+1});const xn=e.reactive({prop:"",order:null}),cr=e.computed(()=>{const a=(se.value??[]).slice(),n=xn.prop||Ke.prop,s=xn.order||Ke.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 D=f(b),M=f(k);if(D.ok&&M.ok)return u?D.value-M.value:M.value-D.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 x=C.match(/^(-)?(\d+):(\d{1,2}):(\d{1,2})$/);if(!x)return{ok:!1,value:NaN};const _=x[1]?-1:1,ue=Number(x[2]),H=Number(x[3]),xe=Number(x[4]);return[ue,H,xe].some(y=>Number.isNaN(y))?{ok:!1,value:NaN}:H>=60||xe>=60?{ok:!1,value:NaN}:{ok:!0,value:_*(ue*3600+H*60+xe)}},q=V(b),le=V(k);if(q.ok&&le.ok)return u?q.value-le.value:le.value-q.value;const ce=new Date(b).getTime(),de=new Date(k).getTime(),P=!Number.isNaN(ce),he=!Number.isNaN(de);if(P&&he)return u?ce-de:de-ce;const z=String(b),T=String(k);return u?z.localeCompare(T):T.localeCompare(z)})}),Ol=e.computed(()=>{var s;const a=(Z.currentPage-1)*Z.pageSize,n=a+Z.pageSize;return fe("getSliceContLength",Z),(s=cr.value)==null?void 0:s.slice(a,n)}),dr=a=>{Z.currentPage=a,fe("getSliceContLength",Z)},pr=a=>{var u;Z.pageSize=a;const n=((u=se.value)==null?void 0:u.length)??0,s=a>0?Math.ceil(n/a):1;Z.currentPage>s&&(Z.currentPage=s||1,E.ElMessage.warning("当前页超出范围,已自动跳转到最后一页")),fe("getSliceContLength",Z)},fr=({prop:a,order:n})=>{xn.prop=a,xn.order=n,Z.currentPage=1},vr=(a,n)=>{var m,p;const s=(p=(m=J.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;ct.setRefreshCurStructure(!1),((s=J.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 D=a[k],M=[];for(const[V,q]of Object.entries(D))M.push(q),f.length<m(D)&&f.push(V);d.push(M)}d.unshift(f);const p=Le.utils.aoa_to_sheet(d),b=Le.utils.book_new();Le.utils.book_append_sheet(b,p,u),Le.writeFileSync(b,`${n}.xlsx`),da.value=[]},Dl=async(a,n,s,u=!1,d)=>{var f,m,p,b,k,D,M,V;try{ct.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 le=(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?le={...le,compData:(M=le==null?void 0:le.compData)==null?void 0:M.map(de=>{var P;return(de==null?void 0:de.key)==="header"?{...de,contents:(P=de==null?void 0:de.contents)==null?void 0:P.map(he=>({...he,[a]:s}))}:de})}:le={...le,compData:(D=le==null?void 0:le.compData)==null?void 0:D.map(de=>{var P,he;return(de==null?void 0:de.key)==="header"?{...de,contents:(P=de==null?void 0:de.contents)==null?void 0:P.map(z=>{if(Array.isArray(z))z=z==null?void 0:z.map(T=>(T==null?void 0:T.prop)===(n==null?void 0:n.prop)?{...T,[a]:s}:T);else if((z==null?void 0:z.prop)===(n==null?void 0:n.prop))return{...z,[a]:s};return z})}:(de==null?void 0:de.key)==="tableToForm"&&d?{...de,contents:(he=de==null?void 0:de.contents)==null?void 0:he.map(z=>(z==null?void 0:z.prop)===(n==null?void 0:n.prop)?{...z,[d]:s}:z)}:de})};const ce=await E.updateInsofDataApi({id:r==null?void 0:r.index,value:{pageData:le}});((V=ce==null?void 0:ce.data)==null?void 0:V.code)===200?(E.ElMessage.success("编辑成功"),ct.setRefreshCurStructure(!0)):E.ElMessage.error("编辑响应失败")}}catch(q){E.ElMessage.error(q)}},gr=async(a,n)=>{await Dl("label",n,a)},yr=async(a,n)=>{await Dl("columnType",n,a,!1,"type")},br=async({newRow:a,targetIndex:n})=>{var d;const u=(Z.currentPage-1)*Z.pageSize+(n??0);a._isTemp=!0,se.value.splice(u,0,a),await e.nextTick(),g.value.has(a.id)||g.value.set(a.id,pe.cloneDeep(a)),se.value=(d=se.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),jt.value=!0},kr=async()=>{var u,d,f,m,p;console.log(r.itemData,"props.itemData");const a=Array.from(v.value||[]);if(a.length===0)return;const n=[],s=[];if(a.forEach(b=>{var M;const k=(M=se.value)==null?void 0:M.find(V=>(V==null?void 0:V.id)===b);if(!k)return;if(k!=null&&k._isTemp){const V=se.value.findIndex(ce=>(ce==null?void 0:ce.id)===b),le={id:(V>=0?V+1:se.value.length+1).toString()};for(let ce in k)ce!=="index"&&ce!=="_isTemp"&&ce!=="tableEditType"&&ce!=="id"&&(le[ce]=k[ce]);n.push(le);return}const D={};for(let V in k)V!=="id"&&V!=="index"&&(D[V]=k[V]);s.push({id:k.id,value:{tableData:D}})}),ct.setTableLoading(r==null?void 0:r.index),s.length>0){const b=s.map(D=>{const M={id:D.id,...D.value.tableData};return delete M._isOCRRow,delete M._ocrTableId,delete M._isTemp,delete M.tableEditType,delete M.index,M}),k=[{tableName:(u=r==null?void 0:r.related)==null?void 0:u.find(D=>D==null?void 0:D.includes("content")),tableContents:b}];try{await al.pageBatchUpdateApi({platId:parseInt((d=ka.value)==null?void 0:d.plat_id),changeContents:k})}catch(D){E.ElMessage.error(((m=(f=D==null?void 0:D.response)==null?void 0:f.data)==null?void 0:m.message)||(D==null?void 0:D.message)||"保存失败"),ct.setTableLoading(!1);return}}if(n.length>0){const b={fixContent:n,buttonName:"新增",relatedContents:r==null?void 0:r.related};fe("change",b)}E.ElMessage.success("保存成功"),v.value.clear(),g.value.clear(),se.value=(p=se.value)==null?void 0:p.map(b=>({...b,tableEditType:"text"})),jt.value=!1,ct.setRefreshCurStructure(!0)},Yn=e.ref(!1),Cr=async()=>{if(wa.value){jt.value=!1;return}if(!Yn.value){Yn.value=!0;try{Array.from(v.value||[]).length>0?await kr():jt.value=!1}finally{Promise.resolve().then(()=>{Yn.value=!1})}}},Er=a=>{da.value=a},Sr=(a,n)=>{sa.value===n?Qa.value=!1:Qa.value=!0,sa.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})},Za=e.computed(()=>{var s,u,d;const a=(s=J.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=J.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}))}),Ml=async(a,n,s)=>{const u=pe.cloneDeep(J.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=Gn(d);await xo(r.index,f),J.value=d,X.value=f},Gn=a=>{var d;const n=a||[];return((d=Le.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=Gn(a)),X.value=n},xr=async(a,n)=>{const s=pe.cloneDeep(J.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=Gn(d);await xo(r.index,f),J.value=d,X.value=f},_r=()=>{He.value=!1},Br=a=>{fe("clickTrigger",a)},$l=async a=>{var f,m,p,b,k,D,M,V,q,le,ce,de,P,he,z;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(Q(n)){const h={files:[we(n)],data:{}};be(h);return}Ya.value=[{url:n,extension:ze(n)}],ft.value=!0,Je.value={data:pe.cloneDeep(s)},R.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 T=(D=n==null?void 0:n.toString())==null?void 0:D.split(","),h=Ve(T),C=h==null?void 0:h[0];if(Q(C==null?void 0:C.extension)){be({files:h,data:{}});return}Ya.value=h,ft.value=!1,R.value=!0;return}if((M=n==null?void 0:n.toString())!=null&&M.includes(".stl")||(V=n==null?void 0:n.toString())!=null&&V.includes(".STL")||(q=n==null?void 0:n.toString())!=null&&q.includes(".obj")||(le=n==null?void 0:n.toString())!=null&&le.includes(".mtl")||u!=null&&u.includes(".stl")||u!=null&&u.includes(".STL")||u!=null&&u.includes(".obj")||u!=null&&u.includes(".mtl")){let T,h=[],C={};if(Array.isArray(n)?T=n:T=n==null?void 0:n.split(","),T==null||T.forEach(x=>{x.includes(".mtl")?h.push(x):C.blob=C.blob?C.blob+","+x:x}),(h==null?void 0:h.length)>0&&(C.mtlBlobs=h),u&&(C.suffix=u),(de=(ce=Object.values(C))==null?void 0:ce[0])!=null&&de.includes("http:"))d.push(C);else{const x=new Blob([C.blob],{type:"application/octet-stream;charset=UTF-8"});let _=URL.createObjectURL(x),ue="";(P=n==null?void 0:n.split("/"))==null||P.forEach((H,xe)=>{var y;xe===((y=n==null?void 0:n.split("/"))==null?void 0:y.length)-1&&(ue=H)}),(he=C.blob)!=null&&he.includes(".stl")&&(ue=(ue==null?void 0:ue.replaceAll(">",""))+".urdf"),Ft.value=[{name:ue,blobUrl:_}],Et.value=!0}}else{const T=await E.axios.get(n,{responseType:"blob",headers:{"Content-Type":"application/json"}}),h=new Blob([T.data],{type:"application/octet-stream;charset=UTF-8"});let C=URL.createObjectURL(h),x="";if((z=n==null?void 0:n.split("/"))==null||z.forEach((_,ue)=>{var H;ue===((H=n==null?void 0:n.split("/"))==null?void 0:H.length)-1&&(x=_)}),Q(x)){const _=Be(x),ue=we(n);be({files:[ue],data:{trackFileType:_}});return}Ft.value=[{name:x,blobUrl:C}],Et.value=!0}(d==null?void 0:d.length)>0&&i.setBlobUrls(d)},en=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},Ll=a=>{if(!a)return"未知文件";try{const u=en(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}`},Vl=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=Rt.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"});try{const f=await Le.downloadAvatarApi(a);n=URL.createObjectURL(f.data),s=Ll(a)}finally{d.close()}}else if(a!=null&&a.downloadUrl){const d=await Jn(),f=Rt.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 Le.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=en(a)):n=a==null?void 0:a.url}if(Q(n)){const d={row:`${n}`,suffix:ze(s)};$l(d);return}const u={name:s,blobUrl:n};Ft.value=[u],Et.value=!0},Ar=async a=>{let n=null,s=null;if(a!=null&&a.id){const f=await Le.downloadAvatarApi(a);n=URL.createObjectURL(f.data),s=Ll(a)}else if(a!=null&&a.downloadUrl){const f=await Jn(),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 Le.downloadAvatarApi({url:a==null?void 0:a.url});n=URL.createObjectURL(f.data),s=en(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,Dt.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=()=>{Se.value=!0},Pl=e.ref([]),$r=async(a,n,s=!1)=>{var u;if(a){if(ct.setTableLoading(!0),Pl.value=Object.values(a),a&&((u=Object.values(a))!=null&&u.every(d=>!d)))return se.value=Gt.value;if(s){se.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}se.value=Dr(Lt.value,a),ct.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,pe.cloneDeep(a)),se.value=(s=se.value)==null?void 0:s.map(u=>({...u,tableEditType:(u==null?void 0:u.id)===n?"edit":"text"})),v.value.add(n),jt.value=!0)},Il=async(a,n,s,u)=>{u!=null&&u.isExistChild&&fe("clickMainKey",a)},Vr=()=>{Et.value=!1},Pr=a=>{fe("rowClick",a)};e.watch(()=>r.changedContent,()=>{var s,u;if(!r.changedContent)return;let a=(s=se.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));se.value=a,fe("contentChange",{contents:n,index:r.index}),fe("change",{content:a,index:r==null?void 0:r.index,buttonName:"",id:r==null?void 0:r.index})},{deep:!0,immediate:!0});const Ir=()=>{},Rr=async()=>{const a=vt.value,n=sessionStorage.getItem("systemKey"),s=await Le.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},Jn=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=pe.cloneDeep(a))==null||u.forEach((d,f)=>{var m,p,b,k,D,M,V,q,le,ce,de,P,he,z;if((d==null?void 0:d.comp)==="Table"){(p=(m=d==null?void 0:d.compData)==null?void 0:m.find(x=>(x==null?void 0:x.key)==="header"))==null||p.contents;let T=(D=(k=(b=d==null?void 0:d.compData)==null?void 0:b.find(x=>(x==null?void 0:x.key)==="tableContents"))==null?void 0:k.contents)==null?void 0:D.map(x=>x.slice(1));(ce=(le=(q=(V=(M=d==null?void 0:d.compData)==null?void 0:M.find(x=>(x==null?void 0:x.key)==="header"))==null?void 0:V.contents)==null?void 0:q[0])==null?void 0:le[0])==null||ce.label;let h=(P=(de=d==null?void 0:d.compData)==null?void 0:de.find(x=>(x==null?void 0:x.key)==="header"))==null?void 0:P.contents,C=[];T==null||T.forEach(x=>{let _=[];x==null||x.forEach((ue,H)=>{var y;let xe={};((y=h[H])==null?void 0:y.label)!=="操作"&&(xe[h[H].label]=ue,_.push(xe))}),C.push(_)}),n[d.name]=C}else{const T=(z=(he=d.compData)==null?void 0:he.find(h=>(h==null?void 0:h.key)==="formContent"))==null?void 0:z.contents;T==null||T.forEach(h=>{var C,x;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/"+((x=_==null?void 0:_[0])==null?void 0:x.url):_=_.toString(),h={key:(h==null?void 0:h.prop)??(h==null?void 0:h.label),value:_},s.push(h)}})}}),n.form=Le.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,x,_,ue,H,xe,y,oe,Re,me,ve,ke,Ie,Me,ee,_e;mt.setImportLoading(!0),ct.setFreshContent(!1);let u=await Rr().catch(K=>(mt.setImportLoading(!1),Promise.reject(K)));u=u==null?void 0:u.filter(K=>{var Te;return((Te=K==null?void 0:K.find(De=>De==null?void 0:De.id))==null?void 0:Te.id)===(n==null?void 0:n.id)});let d=Le.getEqualChild([(h=J.value)==null?void 0:h.filter(K=>(K==null?void 0:K.label)!=="操作")]);const f=(x=(C=Le.tableToForm(u,d))==null?void 0:C[0])==null?void 0:x.find(K=>{const Te=K==null?void 0:K.key;return Te==="Interface"||Te==="方法体"}),m=f==null?void 0:f.value;if(!m){console.log("未搜索到isMain, 缺少算法执行接口"),mt.setImportLoading(!1);return}const p=J.value?Le.getEqualChild([J.value]):[],b=p.find(K=>{const Te=K==null?void 0:K.prop;return Te==="Input1"||Te==="输入数据.输入1"||Te==="样本输入数据"}),k=b==null?void 0:b.prop;let D=n==null?void 0:n[k];const M=await Jn().catch(K=>(mt.setImportLoading(!1),Promise.reject(K)));let V=!0,q="";(_=J.value)==null||_.forEach(K=>{(K==null?void 0:K.prop)===k&&(V=!!(K!=null&&K.childPath),q=K==null?void 0:K.childPath)});let le="";if(V){let K=(H=(ue=J.value)==null?void 0:ue.find(ie=>(ie==null?void 0:ie.isMainKey)===!0))==null?void 0:H.prop;le=n==null?void 0:n[K];let Te=q==null?void 0:q.split(Y),De=[];Te==null||Te.forEach((ie,Ye)=>{(Te==null?void 0:Te.length)-1===Ye&&De.push(le),De.push(ie)}),De=De==null?void 0:De[0];let $e=await Le.getItemData(De,sessionStorage.getItem("systemKey"),""),Ne=$e==null?void 0:$e.filter(ie=>(ie==null?void 0:ie.name)===k);Ne=Ne==null?void 0:Ne.map(ie=>{var Ye;return ie.compData=(Ye=ie==null?void 0:ie.compData)==null?void 0:Ye.map(Xe=>{var I;return(Xe==null?void 0:Xe.key)==="tableContents"&&(Xe.contents=(I=Xe==null?void 0:Xe.contents)==null?void 0:I.filter(ye=>(ye==null?void 0:ye[1])===(n==null?void 0:n[k]))),Xe}),ie}),(!Ne||(Ne==null?void 0:Ne.length)===0)&&(Ne=$e,Ne=Ne==null?void 0:Ne.map(ie=>{var Ye;return ie.compData=(Ye=ie==null?void 0:ie.compData)==null?void 0:Ye.map(Xe=>{var I;return(Xe==null?void 0:Xe.key)==="tableContents"&&(Xe.contents=(I=Xe==null?void 0:Xe.contents)==null?void 0:I.filter(ye=>{var tt,Qe;return(ye==null?void 0:ye[1])===(n==null?void 0:n[(Qe=(tt=J==null?void 0:J.value)==null?void 0:tt[0])==null?void 0:Qe.prop])})),Xe}),ie})),D=Fr(Ne)}const ce=await Ur(m,{token:M,inputData:D}).catch(K=>(mt.setImportLoading(!1),Promise.reject(K))),de=(xe=ce==null?void 0:ce.data)==null?void 0:xe.data,P=p.find(K=>(K==null?void 0:K.prop)==="Output1"),he=P==null?void 0:P.prop;let z=[],T=[];if(de&&((y=Object.values(de))==null?void 0:y.length)>0){let K=[];const Te=new FormData,De=(oe=zr(de))==null?void 0:oe.map(async Ne=>{var ie,Ye;if(!Array.isArray(Ne)&&(Ne!=null&&Ne.includes("http"))){let Xe=await E.axios.get(Ne,{responseType:"blob"}),I=(Ye=Ne==null?void 0:Ne.split("/"))==null?void 0:Ye[((ie=Ne==null?void 0:Ne.split("/"))==null?void 0:ie.length)-1];Te.append("files",Xe.data,I)}else K.push(Ne)});if(await Promise.all(De),!Le.isFormDataEmpty(Te)){let Ne=await Le.uploadAmountApi(Te),ie=(me=(Re=Ne==null?void 0:Ne.data)==null?void 0:Re.result)==null?void 0:me.map(Ye=>{var Xe,I,ye,tt,Qe,ht;return{name:(ht=(Qe=(tt=(Xe=Ye==null?void 0:Ye.url)==null?void 0:Xe.split("/"))==null?void 0:tt[((ye=(I=Ye==null?void 0:Ye.url)==null?void 0:I.split("/"))==null?void 0:ye.length)-1])==null?void 0:Qe.split("."))==null?void 0:ht[0],url:Ye==null?void 0:Ye.url}});K=[...K,...ie]}let $e={};for(let Ne in n)Ne!=="id"&&($e[Ne]=n[Ne]);$e[he]=K,T.push({id:n==null?void 0:n.id,value:{tableData:$e}})}if((T==null?void 0:T.length)>0){const K=T.map(De=>{const $e={id:De.id,...De.value.tableData};return delete $e._isOCRRow,delete $e._ocrTableId,delete $e._isTemp,delete $e.tableEditType,delete $e.index,$e}),Te=[{tableName:(ve=r==null?void 0:r.related)==null?void 0:ve.find(De=>De==null?void 0:De.includes("content")),tableContents:K}];await al.pageBatchUpdateApi({platId:parseInt((ke=ka.value)==null?void 0:ke.plat_id),changeContents:Te})}if((z==null?void 0:z.length)>0)try{await al.pageBatchAddApi({platId:parseInt((Ie=ka.value)==null?void 0:Ie.plat_id),changeContents:[{tableName:(Me=r==null?void 0:r.related)==null?void 0:Me.find(K=>K==null?void 0:K.includes("content")),tableContents:z.map(K=>{var De,$e,Ne;const Te={id:((De=K==null?void 0:K.key)==null?void 0:De.id)??(($e=K==null?void 0:K.key)==null?void 0:$e.rowId)??(K==null?void 0:K.id),...((Ne=K==null?void 0:K.value)==null?void 0:Ne.tableData)||{}};return delete Te._isOCRRow,delete Te._ocrTableId,delete Te._isTemp,delete Te.tableEditType,delete Te.index,Te})}]})}catch(K){E.ElMessage.error(((_e=(ee=K==null?void 0:K.response)==null?void 0:ee.data)==null?void 0:_e.message)||(K==null?void 0:K.message)||"保存失败"),ct.setTableLoading(!1);return}ln(!0),mt.setImportLoading(!1),ct.setFreshContent(!0)},Rl=(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=Rl(s.children,n)),s}),a),_n=e.ref(!1),Hr=()=>{_n.value=!0},Kr=async a=>{var n,s,u,d;if(_n.value=!1,a){const f={name:a.name||"capture.jpg",url:URL.createObjectURL(a),raw:a,uid:Date.now()+Math.random()};gt.value.push(f),Ca(f,"uploading"),Ba(f,0);try{const m=new FormData;m.append("file",a,f.name);const p=await Rt.uploadFileApi(m);f.uploadResult=((n=p==null?void 0:p.data)==null?void 0:n.result)||{name:f.name,url:"",fileName:f.name},El({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}),Ca(f,"uploaded"),Ba(f,100)}catch(m){console.error("文件上传失败:",m),E.ElMessage.error(`文件 ${f.name} 上传失败,请重试`),Ca(f,"pending"),Ba(f,0);const p=gt.value.findIndex(b=>b.uid===f.uid);p>-1&&gt.value.splice(p,1)}}},St=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=()=>{St.show=!1},qr=a=>{var n,s;if((a==null?void 0:a.buttonName)==="取消")return St.show=!1;St.to=a==null?void 0:a.content,!(!(r!=null&&r.index)||!((n=St.to)!=null&&n.groupName))&&(r==null?void 0:r.index)!==((s=St.to)==null?void 0:s.groupName)&&(fe("change",{buttonName:"迁移",value:{from:St.from,to:St.to,data:St.selectRow}}),St.show=!1)},Ul=async a=>{var n,s,u,d;if(a){if(!Xa.validateFileSize(a.raw)){E.ElMessage.warning(`文件大小不能超过 ${Zo.value.maxSize}MB`);const f=gt.value.findIndex(m=>m.uid===a.uid);f>-1&&gt.value.splice(f,1),Xn();return}if(!Xa.validateFileType(a.raw)){E.ElMessage.warning("请上传图片文件");const f=gt.value.findIndex(m=>m.uid===a.uid);f>-1&&gt.value.splice(f,1),Xn();return}Ca(a,"uploading"),Ba(a,0);try{const f=new FormData;f.append("file",a.raw,a.name);const m=await Rt.uploadFileApi(f);a.uploadResult=((n=m==null?void 0:m.data)==null?void 0:n.result)||{name:a.name,url:"",fileName:a.name},El({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}),Ca(a,"uploaded"),Ba(a,100)}catch(f){console.error("文件上传失败:",f),E.ElMessage.error(`文件 ${a.name} 上传失败,请重试`),Ca(a,"pending"),Ba(a,0);const m=gt.value.findIndex(p=>p.uid===a.uid);m>-1&&gt.value.splice(m,1)}finally{Xn()}}},Xn=()=>{e.nextTick(()=>{const a=document.querySelector('.ocr-upload-input input[type="file"]');a&&(a.value="")})},Fl=async()=>{var s,u;if(sessionStorage.setItem("ocr_root_table_id",String((r==null?void 0:r.index)??"")),gt.value.length===0){E.ElMessage.warning("请先选择要上传的图片");return}if(gt.value.filter(d=>{const f=Ht(d);return f!=="uploaded"&&f!=="completed"}).length>0){E.ElMessage.warning("请等待所有文件上传完成后再开始识别");return}ca.value=!0,ma.value=0;let n=null;try{gt.value.forEach(P=>{Ca(P,"processing")});const d=Math.floor(Math.random()*10)+90;n=setInterval(()=>{ma.value<d?ma.value+=1:clearInterval(n)},50);const f=gt.value.map(P=>{var he,z,T;return{name:((he=P.uploadResult)==null?void 0:he.name)||P.name,url:((z=P.uploadResult)==null?void 0:z.url)||"",fileName:((T=P.uploadResult)==null?void 0:T.fileName)||P.name}}),m=Xa.extractTableHeaders(J.value),p=f.map(P=>({name:(P==null?void 0:P.fileName)||(P==null?void 0:P.name),url:(P==null?void 0:P.url)||""})),b=await Xa.recognize(p,m);console.log(b,"ocrResult"),clearInterval(n),ma.value=d;const k=Array.isArray(b==null?void 0:b.result)?b.result:[];if(k.length===0){E.ElMessage.warning("OCR识别未返回有效数据"),ca.value=!1;return}const D=new Set,M=[];k.forEach((P,he)=>{const z=P!=null&&P.数据&&typeof(P==null?void 0:P.数据)=="object"?P.数据:{},T=Array.isArray(P==null?void 0:P.图片信息)?P.图片信息:[],h=new Map;T.forEach(x=>{x!=null&&x.name&&h.set(x.name,x.url||"")});const C={_index:he,_certType:(P==null?void 0:P.证书类型)||"",_certNo:(P==null?void 0:P.证书编号)||"",_ocrImages:T,__ocrFieldMeta:{}};Object.entries(z).forEach(([x,_])=>{let ue="",H=0,xe=[],y="";_&&typeof _=="object"&&!Array.isArray(_)?(ue=(_==null?void 0:_.value)??"",H=(_==null?void 0:_.score)??0,xe=Array.isArray(_==null?void 0:_.bboxNorm)?_==null?void 0:_.bboxNorm:[],y=(_==null?void 0:_.imageName)||""):Array.isArray(_)&&_.length>=2?(ue=_[0]??"",H=_[1]??0):(ue=_??"",H=0),C[x]=ue,C[`${x}_accuracy`]=H,D.add(x),C.__ocrFieldMeta[x]={value:ue,score:H,bboxNorm:xe,imageName:y,imageUrl:y&&h.get(y)||"",images:T}}),M.push(C)});const V=[],q=new Set;M.forEach(P=>{P&&D.forEach(he=>{const z=P[`${he}_accuracy`];(typeof z=="number"?z>0:z!=null&&String(z).trim()!==""&&String(z)!=="0")&&q.add(he)})}),D.forEach(P=>{V.push({prop:P,label:P,editable:!0,minWidth:230}),q.has(P)&&V.push({prop:`${P}_accuracy`,label:"准确率",editable:!1,minWidth:100,isAccuracy:!0})}),gt.value.forEach(P=>{Ca(P,"completed")}),ma.value=100,jn.value=V,ga.value=M,wl.value=f,xl.value=b;const le=["系统编号","设备名称","制造厂"],ce=V.filter(P=>P&&!P.isAccuracy&&typeof P.prop=="string").map(P=>P.prop),de=["系统编号","设备名称","制造厂"];ya.value=ce.filter(P=>de.includes(P)),console.log("[OCR] 默认勾选字段 props:",ya.value),Vt.value=2,ca.value=!1,zn.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识别失败,请重试"),ca.value=!1,ma.value=0,gt.value.forEach(f=>{Ca(f,"pending"),Ba(f,0)})}},tn=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},zl=()=>{var P,he;const a=wl.value,n=xl.value,s=ga.value;if(!s||s.length===0){E.ElMessage.warning("暂无数据可添加");return}const u=(P=Le.getAllLeafNodes(J.value)||[])==null?void 0:P.filter(z=>(z==null?void 0:z.type)!=="operate"&&(z==null?void 0:z.label)!=="操作"&&(z==null?void 0:z.prop)!=="operate"),d=new Map,f=new Map,m=(he=u==null?void 0:u.find(z=>(z==null?void 0:z.label)==="证书附件"))==null?void 0:he.prop;u==null||u.forEach(z=>{z!=null&&z.label&&(z!=null&&z.prop)&&(d.set(z.label,z.prop),f.set(z.prop,z.label))});const p=Date.now(),b=z=>String(p*1e3+z);let k=0,D=0;const M=[],V=[],q=d.get("编号"),le=d.get("名称"),ce=d.get("制造厂"),de=[];if(s.forEach((z,T)=>{var Ie,Me;const h={id:b(T),_isOCRRow:!0,_ocrTableId:r==null?void 0:r.index};for(const[ee,_e]of d.entries())Object.prototype.hasOwnProperty.call(z,ee)&&(h[_e]=z[ee]);if(m){const ee=Array.isArray((Me=(Ie=n==null?void 0:n.result)==null?void 0:Ie[T])==null?void 0:Me.图片信息)?n.result[T].图片信息:[];h[m]=ee.map(_e=>({url:(_e==null?void 0:_e.url)||"",name:(_e==null?void 0:_e.name)||"",fileName:(_e==null?void 0:_e.name)||""})).filter(_e=>_e.url)}const C=(Array.isArray(n==null?void 0:n.result)?n.result[T]:null)||null,x=(Array.isArray(a)?a[T]:null)||null,_=(x==null?void 0:x.url)||"",ue=(x==null?void 0:x.fileName)||(x==null?void 0:x.name)||"",H=String(ue).toLowerCase().endsWith(".pdf")||String(_).toLowerCase().endsWith(".pdf"),xe={ts:Date.now(),versionId:String(Date.now())+"_"+String(T),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(ee=>({name:(ee==null?void 0:ee.name)||"",url:(ee==null?void 0:ee.url)||""})).filter(ee=>ee.url):[]},y=ee=>{var K,Te,De,$e;for(const[Ne,ie]of d.entries())Object.prototype.hasOwnProperty.call(h,ie)&&ie!=="_isOCRRow"&&ie!=="_ocrTableId"&&ie!=="id"&&(ee[ie]=h[ie]);if(m){const Ne=Array.isArray((Te=(K=n==null?void 0:n.result)==null?void 0:K[T])==null?void 0:Te.图片信息)?n.result[T].图片信息:[];ee[m]=Ne.map(ie=>({url:(ie==null?void 0:ie.url)||"",name:(ie==null?void 0:ie.name)||"",fileName:(ie==null?void 0:ie.name)||""})).filter(ie=>ie.url)}const _e=Gt.value.find(Ne=>Ne.id===ee.id);if(_e){for(const[Ne,ie]of d.entries())Object.prototype.hasOwnProperty.call(h,ie)&&ie!=="_isOCRRow"&&ie!=="_ocrTableId"&&ie!=="id"&&(_e[ie]=h[ie]);if(m){const Ne=Array.isArray(($e=(De=n==null?void 0:n.result)==null?void 0:De[T])==null?void 0:$e.图片信息)?n.result[T].图片信息:[];_e[m]=Ne.map(ie=>({url:(ie==null?void 0:ie.url)||"",name:(ie==null?void 0:ie.name)||"",fileName:(ie==null?void 0:ie.name)||""})).filter(ie=>ie.url)}}Lt.value&&Lt.value.set(ee.id,ee),bn(r==null?void 0:r.index,ee.id,xe),V.push(JSON.parse(JSON.stringify(ee))),k++},oe=ee=>tn(ee?h==null?void 0:h[ee]:""),Re=oe(q),me=oe(le),ve=oe(ce);if(!!(q&&le&&ce&&Re&&me&&ve)){const ee=(se.value||[]).find(_e=>{const K=tn(q?_e==null?void 0:_e[q]:""),Te=tn(le?_e==null?void 0:_e[le]:""),De=tn(ce?_e==null?void 0:_e[ce]:"");return K&&Te&&De&&K===Re&&Te===me&&De===ve});if(ee){y(ee);return}}if(Re&&q){const ee=(se.value||[]).filter(_e=>{const K=tn(q?_e==null?void 0:_e[q]:"");return K&&K===Re});de.push({idx:T,ocrRow:h,versionItem:xe,ocrNo:Re,candidates:ee});return}bn(r==null?void 0:r.index,h.id,xe),M.push(h),D++}),V.length>0&&(se.value=[...se.value||[]]),M.length>0&&(se.value=[...se.value||[],...M],Gt.value=[...Gt.value||[],...M],M.forEach(z=>{var T,h;return(h=(T=Lt.value)==null?void 0:T.set)==null?void 0:h.call(T,z.id,z)})),Fa.value=se.value,(de||[]).length>0){Nn.value=(de||[]).map(z=>({...z,selectedTargetId:""})),Sn.value=!0,Ua.value=V,ba.value=M,Kn.value=n,_l.value=a,Bl.value=m||"",k>0&&E.ElMessage.success(`已唯一匹配并准备覆盖 ${k} 条数据(请在候选弹窗确认后提交)`);return}k>0&&E.ElMessage.success(`成功匹配替换 ${k} 条数据`),V.length>0&&fe("change",{buttonName:"编辑",singleContent:V,content:se.value,index:r==null?void 0:r.index,parentTableId:r==null?void 0:r.parentTableId,column:J.value}),M.length>0&&fe("change",{buttonName:"OCR批量新增",content:se.value,index:r==null?void 0:r.index,parentTableId:r==null?void 0:r.parentTableId,column:J.value,ocrRows:M,relatedContents:r==null?void 0:r.related,uploadedFiles:(Array.isArray(n==null?void 0:n.result)?n.result:[]).map(z=>(Array.isArray(z==null?void 0:z.图片信息)?z.图片信息:[]).map(T=>({url:(T==null?void 0:T.url)||"",name:(T==null?void 0:T.name)||"",fileName:(T==null?void 0:T.name)||""})).filter(T=>T.url)),ocrResult:n,matchedCount:k,newCount:D})},jl=(a,n,s)=>{ga.value[a]&&(ga.value[a][n]=s)},Yr=(a,n)=>{if(n)ya.value.includes(a)||ya.value.push(a);else{const s=ya.value.indexOf(a);s>-1&&ya.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"},Hl=a=>{var s,u,d,f;if(La.value===a){La.value=null,Va.value=!1,Ga.value="";return}La.value=a,Ga.value="";const n=(s=ga.value)==null?void 0:s[a];if(n&&Array.isArray(n._ocrImages)&&n._ocrImages.length>0){Ja.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);Hn.value=(p==null?void 0:p.imageName)||((f=(d=Ja.value)==null?void 0:d[0])==null?void 0:f.name)||"",Va.value=Ja.value.length>0}else Ja.value=[],Va.value=!1,Hn.value=""},Xr=()=>{Un.value=!1,gt.value=[],qo.value=null,Vt.value=1,kn.value.clear(),Cn.value.clear(),ma.value=0,Va.value=!1},Qr=a=>a.raw?URL.createObjectURL(a.raw):a.url?a.url:"",Ht=a=>{const n=a.uid||a.name;return kn.value.get(n)||"pending"},Zr=a=>{const n=a.uid||a.name;return Cn.value.get(n)||0},Ba=(a,n)=>{const s=a.uid||a.name;Cn.value.set(s,Math.min(100,Math.max(0,n)))},es=a=>{const n=Ht(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}`},Ca=(a,n)=>{const s=a.uid||a.name;kn.value.set(s,n),(n==="completed"||n==="uploaded")&&Ba(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()};gt.value.push(f),await Ul(f)}s.target.value="",document.body.removeChild(n)},document.body.appendChild(n),n.click()}})},as=()=>{Vt.value>1&&Vt.value--},ns=()=>{Vt.value===1?gt.value.length>0&&!ca.value&&Fl():Vt.value===2&&(zl(),Vt.value=3)},ls=async a=>{const{row:n}=a||{},s=n==null?void 0:n.id;if(!s){E.ElMessage.warning("暂无可预览数据");return}let u=yn(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=yn(f,s);Array.isArray(m)&&m.length>0&&(Sl(r==null?void 0:r.index,s,m),u=m)}}if(!u||u.length===0){E.ElMessage.warning("暂无可预览数据");return}Nl.value=u,Fn.value=!0},os=a=>{gt.value=gt.value.filter((n,s)=>s!==a)},Qn=async(a,n,s)=>{var u,d,f,m,p,b,k,D,M,V,q,le,ce,de,P,he,z;if(na.value="",mn.value=!0,$a.value=!0,fe("onButtonClick",a,n),j.value=[],a==="删除")vl.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var T,h;(T=se.value)!=null&&T.find(C=>(C==null?void 0:C.id)===(n==null?void 0:n.id))?se.value=(h=pe.cloneDeep(se.value))==null?void 0:h.filter(C=>(C==null?void 0:C.id)!==(n==null?void 0:n.id)):se.value=Rl(pe.cloneDeep(se.value),n),zc(Fa.value,qn.value,n==null?void 0:n.id),ct.setTableLoading(r==null?void 0:r.index),fe("change",{content:se.value,fixContent:[n],index:r==null?void 0:r.index,type:"delete",buttonName:a,column:J.value,relatedContents:r==null?void 0:r.related})});else if(a==="批量删除"){if(((u=da.value)==null?void 0:u.length)===0)return E.ElMessage.warning("请先勾选操作的数据");vl.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var h,C;const T=(h=da.value)==null?void 0:h.map(x=>x.id);se.value=(C=pe.cloneDeep(se.value))==null?void 0:C.filter(x=>!(T!=null&&T.includes(x.id))),ct.setTableLoading(r==null?void 0:r.index),fe("change",{content:se.value,singleContent:null,selectItems:da.value,index:r==null?void 0:r.index,type:"batchDelete",buttonName:a,column:J.value})})}else if(a==="复制新增"){W.value="新增";const T=pe.cloneDeep(n),h=(d=J.value)==null?void 0:d.find(_=>_==null?void 0:_.isMainKey),C=h||((f=J.value)==null?void 0:f[0]),x=(m=_t.value)==null?void 0:m.find(_=>(_==null?void 0:_.label)==="新建");await Kl(!0,x,{data:T,firstCol:C})}else if(a==="新增")W.value="新增",nn(""),He.value=!0;else if(a==="编辑")W.value="编辑",nn(n),He.value=!0;else if(a==="查看")W.value="查看",nn(n),mn.value=!1,$a.value=!1,He.value=!0;else if(a==="查看三维模型"){const T={};for(let C in n)C!=="id"&&(T[C]=n[C]);let h=(p=Object.values(T))==null?void 0:p[1];Wa.setTableShowThree(h)}else if(a==="切换视图")ys();else if(((b=s==null?void 0:s.extra)==null?void 0:b.type)==="modelExample")W.value=a,oa.value=!0;else if(a==="新建"){let T=pa.value,h=[];for(let H in T)H!=null&&H.includes(`loading${((k=ka.value)==null?void 0:k.account)||((D=ka.value)==null?void 0:D.账号)}`)&&(h=[...h,...H]);let C=[];for(let H in T)H!=null&&H.includes(`updateLoading${((M=ka.value)==null?void 0:M.account)||((V=ka.value)==null?void 0:V.账号)}`)&&(C=[...C,...H]);let x=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);x=[...pe.cloneDeep(x),..._],(x==null?void 0:x.length)>0&&(x!=null&&x.every(H=>H!==null&&H))&&await E.batchDeleteInsofDataApi({ids:x});const ue=(q=_t.value)==null?void 0:q.find(H=>(H==null?void 0:H.label)==="新建");await Kl(!1,ue)}else if(a==="修改模板"){let T=pe.cloneDeep(vt).value;ct.setRouteToChildPath(T),mt.setActiveMenuPath(T+Y)}else if(a==="执行")jr(a,n);else if(a!=null&&a.includes("导出")){if(a==="导出选中"&&((le=da.value)==null?void 0:le.length)===0)return E.ElMessage.warning(`请先勾选${a}的数据`);if(a==="导出全部"&&((ce=se.value)==null?void 0:ce.length)===0)return E.ElMessage.warning("暂无数据导出");const T=(P=(de=J.value)==null?void 0:de.map(C=>C==null?void 0:C.label))==null?void 0:P.filter(C=>C!=="操作"),h=a==="导出全部"?pe.cloneDeep(se.value):pe.cloneDeep(da.value);h==null||h.forEach(C=>{C==null||delete C.id}),mr(h,r==null?void 0:r.compName,T,r==null?void 0:r.compName)}else if(a==="OCR识别")Un.value=!0,gt.value=[],Vt.value=1,kn.value.clear(),Cn.value.clear(),ma.value=0;else if(a==="迁移")St.selectRow=n,St.show=!0;else if(((he=s==null?void 0:s.extra)==null?void 0:he.type)==="methodButton"){let T=n;n===""&&(T=pe.cloneDeep(se.value));let h=await to.loadingValueContent(T,J==null?void 0:J.value,a,r==null?void 0:r.index);s!=null&&s.index?se.value=(z=se.value)==null?void 0:z.map((C,x)=>(x===(s==null?void 0:s.index)&&(C=h==null?void 0:h[0]),C)):se.value=h}},rs=async(a,n)=>{var s,u,d,f,m,p,b,k,D,M,V,q,le,ce,de,P,he,z,T,h;try{let C,x;const _=(s=pa.value[vt.value+Y])==null?void 0:s.filter(ve=>{var ke;return((ke=ve==null?void 0:ve.key)==null?void 0:ke.type)==="structureMethod"}),ue=(u=pa.value[vt.value+Y])==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,Ie;return((Ie=(ke=ve==null?void 0:ve.value)==null?void 0:ke.pageData)==null?void 0:Ie.method)==="保存"});if(!H)return;const xe=(p=(m=pa.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,Ie,Me,ee;return((Ie=(ke=ve==null?void 0:ve.value)==null?void 0:ke.tableData)==null?void 0:Ie.算法名称)===((ee=(Me=H==null?void 0:H.value)==null?void 0:Me.pageData)==null?void 0:ee.method)});if(!xe)return;const y={buttonName:(k=(b=H==null?void 0:H.value)==null?void 0:b.pageData)==null?void 0:k.method,api:(M=(D=xe==null?void 0:xe.value)==null?void 0:D.tableData)==null?void 0:M.算法体,content:ue==null?void 0:ue.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:(ce=(le=H==null?void 0:H.value)==null?void 0:le.pageData)==null?void 0:ce.path};if(!a)return;const oe={...a,compData:(de=a==null?void 0:a.compData)==null?void 0:de.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(Ie=>(Ie==null?void 0:Ie.prop)===n?{...Ie,value:""}:Ie)}:ve})},Re={key:{pageKey:vt.value+Y,parentTable:"",systemKey:sessionStorage.getItem("systemKey"),type:"structure"},value:{pageData:oe}},me=await E.axios.post(y.api,Re,{headers:{"Content-Type":"application/json"}});return((P=me==null?void 0:me.data)==null?void 0:P.code)===200&&(C=(z=(he=me==null?void 0:me.data)==null?void 0:he.result)==null?void 0:z.latestReportCode,x=(h=(T=me==null?void 0:me.data)==null?void 0:T.result)==null?void 0:h.status),{newMainKeyValue:C,newStatus:x}}catch(C){throw E.ElMessage.error(C),new Error(C)}},ss=(a,n,s,u)=>{var d;fe("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}:an.value&&(p==null?void 0:p.prop)===an.prop?{...p,value:an.value}:p)}:f}),index:a==null?void 0:a.id},u)},an=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=pe.cloneDeep(vt).value+Y+u;if(p){an.value="",f=(b=pa.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 D=f==null?void 0:f.find(V=>{var q,le,ce;return((ce=(le=(q=V==null?void 0:V.value)==null?void 0:q.pageData)==null?void 0:le.comp)==null?void 0:ce.toUpperCase())==="FORM"});m={...(k=D==null?void 0:D.value)==null?void 0:k.pageData,id:D==null?void 0:D.id};const M=await rs(m,n==null?void 0:n.prop);if(an.value=M==null?void 0:M.newStatus,M!=null&&M.newMainKeyValue)return M==null?void 0:M.newMainKeyValue}if(se.value.some(D=>(D==null?void 0:D[n==null?void 0:n.prop])===u)){const D=u;for(;se.value.some(M=>(M==null?void 0:M[n==null?void 0:n.prop])===`${D}(${d})`);)d++;u=`${D}(${d})`}return u},Kl=async(a,n,s)=>{var m,p,b,k,D,M,V;let u,d;const f=await us(s==null?void 0:s.data,s==null?void 0:s.firstCol);if(a?(u=pe.cloneDeep(vt).value+Y+((k=s==null?void 0:s.data)==null?void 0:k[(b=s==null?void 0:s.firstCol)==null?void 0:b.prop]),d=pe.cloneDeep(vt).value+Y+f):(u=pe.cloneDeep(vt).value+Y,d=pe.cloneDeep(u)+`loading${((m=ka.value)==null?void 0:m.account)||((p=ka.value)==null?void 0:p.账号)}`),n){const q=(M=(D=pa.value[d])==null?void 0:D.filter(le=>{var ce;return((ce=le==null?void 0:le.key)==null?void 0:ce.parentTable)===""}))==null?void 0:M.map(le=>{var ce;return{id:le==null?void 0:le.id,...(ce=le==null?void 0:le.value)==null?void 0:ce.pageData}});if((q==null?void 0:q.length)>0)if(a){const le=q==null?void 0:q.find(ce=>{var de;return((de=ce==null?void 0:ce.comp)==null?void 0:de.toUpperCase())==="FORM"});le&&ss(le,(V=s==null?void 0:s.firstCol)==null?void 0:V.label,f,vt.value)}else ct.setRouteToChildPath(pe.cloneDeep(vt).value),mt.setActiveMenuPath(d);else await Le.loadingConstruct(u,d,null,null,a?is.value:null),a||(ct.setRouteToChildPath(pe.cloneDeep(vt).value),mt.setActiveMenuPath(d))}else a?(na.value="",zt.value=s==null?void 0:s.data,ln(!0,s==null?void 0:s.firstCol,f)):(ct.setRouteToChildPath(pe.cloneDeep(vt).value),mt.setActiveMenuPath(d))},cs=()=>{R.value=!1,Ya.value=[],ft.value=!1},nn=a=>{var m,p,b,k,D,M,V,q,le,ce,de,P,he,z,T,h,C,x,_,ue,H,xe;const n=[];let s=[];for(let y in a)Array.isArray(a==null?void 0:a[y])&&s.push(y);kt.value=pe.cloneDeep(J.value),(p=Le.getColumnChild((m=pe.cloneDeep(J.value))==null?void 0:m.filter(y=>(y==null?void 0:y.label)!=="操作")))==null||p.forEach((y,oe)=>{var Re,me,ve;s.find(ke=>ke===(y==null?void 0:y.prop))||(y!=null&&y.formType&&((Re=y==null?void 0:y.formType)==null?void 0:Re.toUpperCase())==="SELECT"||y!=null&&y.menuId?n.push({label:(me=y==null?void 0:y.prop)!=null&&me.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"+oe,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)??oe,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"+oe,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)??oe,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||(na.value=(a==null?void 0:a.id)??"");let u=Le.getColumnChild((b=pe.cloneDeep(J.value))==null?void 0:b.filter(y=>(y==null?void 0:y.label)!=="操作"));la.value&&((k=la.value)==null?void 0:k.length)>0&&(la.value=(D=pe.cloneDeep(la).value)==null?void 0:D.map(y=>{var Re;let oe=(y==null?void 0:y.prop)||((Re=u==null?void 0:u.find(me=>(me==null?void 0:me.label)===(y==null?void 0:y.label)))==null?void 0:Re.prop);return oe&&(y.value=a[oe]),y})),qe.value=la.value&&((M=la.value)==null?void 0:M.length)>0?Le.getTableFormToForm(la.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(oe=>oe==null?void 0:oe.value)).flat()),(d==null?void 0:d.length)>0){let y=(le=d==null?void 0:d.filter(me=>{var ve;return(ve=me==null?void 0:me.content)==null?void 0:ve.includes("@Type")}))==null?void 0:le[((q=d==null?void 0:d.filter(me=>{var ve;return(ve=me==null?void 0:me.content)==null?void 0:ve.includes("@Type")}))==null?void 0:q.length)-1];if(y!=null&&y.content){let me=(P=(de=(ce=y==null?void 0:y.content)==null?void 0:ce.replace(":",Ee))==null?void 0:de.split(Ee))==null?void 0:P[1];if(((he=me==null?void 0:me.trim())==null?void 0:he.toUpperCase())==="MANUAL"){let ve=(x=(C=(z=r.itemData)==null?void 0:z.filter(ke=>(ke==null?void 0:ke.key)==="contentTableId"))==null?void 0:C[((h=(T=r.itemData)==null?void 0:T.filter(ke=>(ke==null?void 0:ke.key)==="contentTableId"))==null?void 0:h.length)-1])==null?void 0:x.contents;qe.value=(_=qe.value)==null?void 0:_.map((ke,Ie)=>{var Me,ee;return(Me=ke==null?void 0:ke.optionUrl)!=null&&Me.menuId&&(ke.type="Select",(ee=ke==null?void 0:ke.optionUrl)!=null&&ee.menuId&&(ke.optionUrl.menuId=ke.optionUrl.menuId??ve,ke.optionUrl.menuFilter=d,W.value==="新增"&&(ke.optionUrl.multiple=!0,ke.optionUrl.multipleLimit=5))),ke})}}let oe=(ue=qe.value)==null?void 0:ue.filter(me=>{var ve,ke;return((ve=me==null?void 0:me.optionUrl)==null?void 0:ve.menuId)&&((ke=me==null?void 0:me.optionUrl)==null?void 0:ke.menuId)!==""}),Re;if(oe==null||oe.forEach(me=>{var ke,Ie;if(Re!==void 0)return;let ve=(ke=me==null?void 0:me.optionUrl)==null?void 0:ke.menuId;((Ie=oe==null?void 0:oe.filter(Me=>{var ee;return((ee=Me==null?void 0:Me.optionUrl)==null?void 0:ee.menuId)===ve}))==null?void 0:Ie.length)>1&&(Re=ve)}),oe=oe==null?void 0:oe.filter(me=>{var ve;return((ve=me==null?void 0:me.optionUrl)==null?void 0:ve.menuId)===Re}),(oe==null?void 0:oe.length)>1){let me=oe==null?void 0:oe.map(Me=>Me==null?void 0:Me.prop),ve=oe==null?void 0:oe.map(Me=>Me==null?void 0:Me.label),ke=oe==null?void 0:oe.map(Me=>Me==null?void 0:Me.value),Ie=(H=pe.cloneDeep(oe))==null?void 0:H[0];Ie.label=ve==null?void 0:ve.join("·"),Ie.value=ke==null?void 0:ke.join(" "),Ie.value.trim()===""&&(Ie.value=""),Ie.prop=me==null?void 0:me.join("·"),Ie.usingType="parent",qe.value.unshift(Ie),qe.value=(xe=qe.value)==null?void 0:xe.map(Me=>(me!=null&&me.find(ee=>ee===(Me==null?void 0:Me.prop))&&(Me.isFormColHidden=!0),Me))}}},ds=()=>{var n;const a=(n=c.value)==null?void 0:n.$el;a&&Le.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=Za.value.splice(u,1)[0];Za.value.splice(d,0,f),J.value=(m=J.value)==null?void 0:m.slice().sort((p,b)=>{if(p.label==="操作")return 1;if(b.label==="操作")return-1;const k=Za.value.findIndex(M=>M.label===p.label),D=Za.value.findIndex(M=>M.label===b.label);return k-D})}})};e.onMounted(()=>{fa.value=window.innerWidth-240*2});const ps=()=>{e.nextTick(()=>{ds()})},Zn=(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)===na.value){let p={};for(let b in d){let k=(f=n==null?void 0:n.find(D=>(D==null?void 0:D.prop)===b))==null?void 0:f.label;k?p[b]=(m=zt.value)==null?void 0:m[k]:p[b]=d[b]}d=Object.assign(p,zt.value),s=d}else{let p=Zn(d,n);d=p==null?void 0:p.contents,s=p==null?void 0:p.currentSelectContents}return d}),{contents:a,currentSelectContents:s}},Wl=(a,n)=>{let s,u;return a!=null&&a.find(d=>(d==null?void 0:d.id)===na.value)?s=a==null?void 0:a.map(d=>{var f,m;if((d==null?void 0:d.id)===na.value){let p={};for(let b in d){let k=(f=n==null?void 0:n.find(D=>(D==null?void 0:D.prop)===b))==null?void 0:f.label;k?p[b]=(m=zt.value)==null?void 0:m[k]:p[b]=d[b]}d=Object.assign(p,zt.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)===na.value){let k={};for(let D in d){let M=(f=n==null?void 0:n.find(V=>(V==null?void 0:V.prop)===D))==null?void 0:f.label;M?k[D]=(m=zt.value)==null?void 0:m[M]:k[D]=d[D]}d=Object.assign(k,zt.value),u=d}else d=(p=Zn(d,n))==null?void 0:p.contents,u=(b=Zn(d,n))==null?void 0:b.currentSelectContents;return d}),{newContents:s,currentSelectContents:u}},ql=(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(ql)),a},Yl=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(...Yl(u))})),(n==null?void 0:n.length)>0?n==null?void 0:n.map(u=>{const d={...u};return delete d.children,d}):[]},ln=(a=!0,n,s)=>{var k,D,M,V,q,le,ce,de,P,he,z,T,h,C,x,_,ue,H,xe,y,oe,Re,me,ve,ke,Ie,Me;let u=Le.getColumnChild((k=pe.cloneDeep(J.value))==null?void 0:k.filter(ee=>(ee==null?void 0:ee.label)!=="操作")),d,f=pe.cloneDeep(se.value);if(!zt.value){He.value=!1;return}if(na.value===""){_a.value++;let ee;n&&s?ee={id:_a.value.toString(),[n==null?void 0:n.prop]:s,children:zt.value.children}:ee={id:_a.value.toString()},ee!=null&&ee.children&&(ee={...ee,children:(D=ee.children)==null?void 0:D.map(_e=>ql(_e,n,s))}),f.push(Object.assign(zt.value,ee)),d=Object.assign(zt.value,ee)}else f=(M=Wl(f,u))==null?void 0:M.newContents,d=(V=Wl(f,u))==null?void 0:V.currentSelectContents;const m=(q=r.itemData)==null?void 0:q.filter(ee=>(ee==null?void 0:ee.key)==="childTree")[0];if(((le=m==null?void 0:m.contents)==null?void 0:le.length)>0){W.value="编辑";const ee=[];f==null||f.forEach((_e,K)=>{var De;let Te={};if(Array.isArray(_e)){let $e=[];_e==null||_e.filter(Ne=>!(Ne!=null&&Ne.id)).forEach((Ne,ie)=>{var Ye,Xe,I,ye,tt,Qe,ht;if((Xe=(Ye=ra.value)==null?void 0:Ye[ie])!=null&&Xe.prop&&!Array.isArray(Ne)){let S={};S[ra.value[ie].column]=Ne,it!=null&&it.value&&((I=it==null?void 0:it.value)==null?void 0:I.length)>0&&((ye=it==null?void 0:it.value)!=null&&ye.find(Ae=>JSON.stringify(Ae==null?void 0:Ae[0])===JSON.stringify(S)))&&($e=(tt=it==null?void 0:it.value)==null?void 0:tt.find(Ae=>JSON.stringify(Ae==null?void 0:Ae[0])===JSON.stringify(S))),$e&&$e.length>0?Te[ra.value[ie].prop]=$e!=null&&$e.find(Ae=>{var Ze;return((Ze=Object.keys(Ae))==null?void 0:Ze[0])===ra.value[ie].column})?(Qe=$e==null?void 0:$e.find(Ae=>{var Ze;return((Ze=Object.keys(Ae))==null?void 0:Ze[0])===ra.value[ie].column}))==null?void 0:Qe[ra.value[ie].column]:Ne:Te[ra.value[ie].prop]=Ne}else Array.isArray(Ne)&&((ht=ra.value[ie])!=null&&ht.prop?Te[ra.value[ie].prop]=Ne:Te.children=hl(Ne,ra.value))})}else Te=_e;if(Array.isArray(_e)&&_e.some($e=>$e==null?void 0:$e.id)){const $e=(De=_e==null?void 0:_e.find(Ne=>Ne.id))==null?void 0:De.id;ee.push(Object.assign(Te,{id:Vl($e)}))}else Te.id?ee.push(Te):ee.push(Object.assign(Te,{id:K.toString()}))}),se.value=Ql(ee,m,J.value)}else se.value=f;Jl(se.value),Fa.value=se.value;const p=Hc(Fa.value,qn.value,f);let b=[];if(wa.value?(b=(ce=pe.cloneDeep(wa).value.singleContent)==null?void 0:ce.filter(ee=>(ee==null?void 0:ee.id)!==(d==null?void 0:d.id)),b.push(d)):b=[d],jt.value){const ee={content:p,singleContent:((de=m==null?void 0:m.contents)==null?void 0:de.length)>0?b==null?void 0:b.flatMap(Yl):b,index:r==null?void 0:r.index,buttonName:"编辑",column:J.value,parentTableId:r==null?void 0:r.parentTableId};ct.setCacheUpdatingData(ee)}if(a){(T=(z=(he=(P=r.itemData)==null?void 0:P.find(K=>(K==null?void 0:K.key)==="filterAllType"))==null?void 0:he.value)==null?void 0:z.find(K=>(K==null?void 0:K.value)==="onConditionContents"))==null||T.content;let ee=(h=r.itemData)==null?void 0:h.filter(K=>(K==null?void 0:K.key)==="filterAllType");ee=Array.from(new Map(ee.filter(Boolean).map((K,Te)=>[K.value,{...K,_idx:Te}])).values()).sort((K,Te)=>K._idx-Te._idx).map(({_idx:K,...Te})=>Te),ee=(C=ee==null?void 0:ee[(ee==null?void 0:ee.length)-1])==null?void 0:C.value;const _e={fixContent:[d],buttonName:W.value,relatedContents:r==null?void 0:r.related};ct.setTableLoading(r==null?void 0:r.index),He.value=!1,zt.value=void 0,fe("change",_e)}if((ue=(_=(x=qe.value)==null?void 0:x[0])==null?void 0:_.optionUrl)!=null&&ue.menuId){He.value=!1;let ee=(H=r.itemData)==null?void 0:H.filter(_e=>(_e==null?void 0:_e.key)==="filterAllType");if((ee==null?void 0:ee.length)>0){let _e=ee==null?void 0:ee.map(De=>De==null?void 0:De.value),K=(oe=(y=(xe=_e.flat().find(De=>{var $e;return($e=De==null?void 0:De.content)==null?void 0:$e.includes("@Num")}))==null?void 0:xe.content)==null?void 0:y.split(":"))==null?void 0:oe[1];((ve=(me=(Re=_e.flat().find(De=>{var $e;return($e=De==null?void 0:De.content)==null?void 0:$e.includes("@Type:")}))==null?void 0:Re.content)==null?void 0:me.split(":"))==null?void 0:ve[1])!=="Manual"&&(K=parseInt(K),se.value=(Me=se.value)==null?void 0:Me.slice(((ke=se.value)==null?void 0:ke.length)-K,(Ie=se.value)==null?void 0:Ie.length))}}};e.onUnmounted(()=>{J.value=[],se.value=[],kt.value=[],st.value=[],la.value=[],va.value=[],Ya.value=[],xt.value=[],qe.value=[],da.value=[],c.value=null});const el=async(a,n,s)=>{var k,D,M,V,q,le,ce,de,P,he,z;sa.value=s==null?void 0:s.prop;const u=pe.cloneDeep(r.itemData),d=u==null?void 0:u.map(T=>{var h;return(T==null?void 0:T.key)==="header"&&((h=T.contents)==null||h.map((C,x)=>{var _,ue,H,xe,y,oe,Re,me,ve,ke,Ie,Me,ee,_e,K,Te,De,$e,Ne;return C.type=C!=null&&C.type?C.type:(xe=(H=(ue=(_=C==null?void 0:C.key)==null?void 0:_.split("$"))==null?void 0:ue[1])==null?void 0:H.split("("))!=null&&xe[0]?(oe=(y=Le.FormType)==null?void 0:y.find(ie=>{var Ye,Xe,I,ye;return(ie==null?void 0:ie.key)===((ye=(I=(Xe=(Ye=C==null?void 0:C.key)==null?void 0:Ye.split("$"))==null?void 0:Xe[1])==null?void 0:I.split("("))==null?void 0:ye[0])}))==null?void 0:oe.value:"Input",C.options=C!=null&&C.options?C.options:((ve=(me=(Re=C==null?void 0:C.key)==null?void 0:Re.split("$"))==null?void 0:me[1])==null?void 0:ve.length)>0?(ee=(Me=Vn((Ie=(ke=C==null?void 0:C.key)==null?void 0:ke.split("$"))==null?void 0:Ie[1]))==null?void 0:Me.split(","))==null?void 0:ee.map(ie=>({label:ie,value:ie})):[],(_e=C==null?void 0:C.key)!=null&&_e.includes("$")&&(C.key=(Te=(K=C==null?void 0:C.key)==null?void 0:K.split("$"))==null?void 0:Te[0]),C.value=(De=Object.values(n))==null?void 0:De[x],C.optionUrl=C!=null&&C.formMenuSelect&&(($e=C==null?void 0:C.formMenuSelect)==null?void 0:$e.length)>0?{groupSelect:(Ne=C==null?void 0:C.groupSelect)==null?void 0:Ne.split(/[::]/).map(ie=>ie.trim()),menuSelect:C==null?void 0:C.formMenuSelect,selectRelateType:"",type:(C==null?void 0:C.formType)??(C!=null&&C.groupSelect?"Select":"")}:null,C})),T});let f=pe.cloneDeep(qe.value),m=(D=(k=pe.cloneDeep(d))==null?void 0:k.find(T=>(T==null?void 0:T.key)==="header"))==null?void 0:D.contents;f=f==null?void 0:f.map(T=>{var h;return T.value=(h=m==null?void 0:m.find((C,x)=>x===(T==null?void 0:T.id)))==null?void 0:h.value,T});let p="",b=(q=(V=(M=pe.cloneDeep(d))==null?void 0:M.find(T=>(T==null?void 0:T.key)==="header"))==null?void 0:V.contents)==null?void 0:q.find((T,h)=>{var C,x,_;return(T==null?void 0:T.label)===sa.value||(h==null?void 0:h.toString())===((_=(x=(C=sa.value)==null?void 0:C.split("a"))==null?void 0:x[1])==null?void 0:_.toString())});if((de=(ce=(le=pe.cloneDeep(d))==null?void 0:le.find(T=>(T==null?void 0:T.key)==="header"))==null?void 0:ce.contents)==null||de.forEach(T=>{var h,C,x,_,ue;p===""&&((x=(C=(h=T==null?void 0:T.optionUrl)==null?void 0:h.groupSelect)==null?void 0:C[1])!=null&&x.includes("["))&&(p=(ue=(_=T==null?void 0:T.optionUrl)==null?void 0:_.groupSelect)==null?void 0:ue[1])}),(P=b==null?void 0:b.optionUrl)!=null&&P.menuSelect){let T=await Pn(b),h;if(T==null||T.forEach(C=>{var x,_,ue,H,xe,y,oe,Re,me,ve;p===((_=(x=b==null?void 0:b.optionUrl)==null?void 0:x.groupSelect)==null?void 0:_[1])&&((xe=(H=(ue=b==null?void 0:b.optionUrl)==null?void 0:ue.groupSelect)==null?void 0:H[1])!=null&&xe.includes("["))&&((ve=pe.cloneDeep(C))==null?void 0:ve[(me=(Re=(oe=(y=b==null?void 0:b.optionUrl)==null?void 0:y.groupSelect)==null?void 0:oe[1])==null?void 0:Re.replaceAll("[",""))==null?void 0:me.replaceAll("]","")])===(b==null?void 0:b.value)&&(h=C)}),h){let C=pe.cloneDeep(f);C=C==null?void 0:C.map(_=>{var ue,H,xe,y,oe,Re,me,ve,ke,Ie,Me;return(h!=null&&h[_==null?void 0:_.label]||h!=null&&h[(y=(xe=(H=(ue=_==null?void 0:_.optionUrl)==null?void 0:ue.groupSelect)==null?void 0:H[1])==null?void 0:xe.replaceAll("[",""))==null?void 0:y.replaceAll("]","")])&&((me=(Re=(oe=_==null?void 0:_.optionUrl)==null?void 0:oe.groupSelect)==null?void 0:Re[1])!=null&&me.includes("["))&&(_.value=(h==null?void 0:h[_==null?void 0:_.label])||(h==null?void 0:h[(Me=(Ie=(ke=(ve=_==null?void 0:_.optionUrl)==null?void 0:ve.groupSelect)==null?void 0:ke[1])==null?void 0:Ie.replaceAll("[",""))==null?void 0:Me.replaceAll("]","")])),_}),se.value=(he=pe.cloneDeep(se.value))==null?void 0:he.map(_=>{if((_==null?void 0:_.id)===(n==null?void 0:n.id)){const ue={};return C==null||C.forEach(H=>{ue[H.name]=H.value}),ue.id=_==null?void 0:_.id,ue}return _});let x=pe.cloneDeep(C);x=x==null?void 0:x.map(_=>{var ue,H,xe,y;return(H=(ue=_==null?void 0:_.optionUrl)==null?void 0:ue.menuSelect)!=null&&H.some(oe=>oe==null?void 0:oe.includes)&&(_.optionUrl.menuSelect=(y=(xe=_==null?void 0:_.optionUrl)==null?void 0:xe.menuSelect)==null?void 0:y.map(oe=>{var Re,me,ve,ke;if(oe!=null&&oe.includes("[")){let Ie=(me=(Re=oe==null?void 0:oe.replaceAll("[","").replaceAll("]",""))==null?void 0:Re.split(":"))==null?void 0:me[1];oe=(ke=(ve=pe.cloneDeep(C))==null?void 0:ve.find(Me=>(Me==null?void 0:Me.label)===Ie))==null?void 0:ke.value}return oe})),_}),se.value=(z=pe.cloneDeep(se.value))==null?void 0:z.map(_=>{if((_==null?void 0:_.id)===(n==null?void 0:n.id)){const ue={};return x==null||x.forEach(H=>{ue[H.name]=H.value}),ue.id=_==null?void 0:_.id,ue}return _})}}},fs=async a=>{var q,le,ce,de,P,he,z,T,h,C,x,_,ue,H,xe,y,oe,Re,me,ve,ke,Ie,Me,ee,_e,K,Te,De,$e,Ne,ie,Ye,Xe;if(!a)return;zt.value=a;const n=pe.cloneDeep(r.itemData);let s=n==null?void 0:n.map(I=>{var ye,tt,Qe,ht;return(I==null?void 0:I.key)==="header"&&(Array.isArray((ye=I.contents)==null?void 0:ye[0])?I.contents=(Qe=Le.getColumnChild((tt=I.contents)==null?void 0:tt[0]))==null?void 0:Qe.map((S,Ae)=>{var Ze,B,ut,yt,Bt,Tt,At,Ot,N,Ce,lt,Ge,Fe,ot,Nt,Wt,wt,Pt,qt,Jt,te,A,je,dt;return S.type=S!=null&&S.type?S.type:(yt=(ut=(B=(Ze=S==null?void 0:S.key)==null?void 0:Ze.split("$"))==null?void 0:B[1])==null?void 0:ut.split("("))!=null&&yt[0]?(Tt=(Bt=Le.FormType)==null?void 0:Bt.find(Pe=>{var rt,Oe,bt,Mt;return(Pe==null?void 0:Pe.key)===((Mt=(bt=(Oe=(rt=S==null?void 0:S.key)==null?void 0:rt.split("$"))==null?void 0:Oe[1])==null?void 0:bt.split("("))==null?void 0:Mt[0])}))==null?void 0:Tt.value:"Input",S.options=S!=null&&S.options?S.options:((N=(Ot=(At=S==null?void 0:S.key)==null?void 0:At.split("$"))==null?void 0:Ot[1])==null?void 0:N.length)>0?(Fe=(Ge=Vn((lt=(Ce=S==null?void 0:S.key)==null?void 0:Ce.split("$"))==null?void 0:lt[1]))==null?void 0:Ge.split(","))==null?void 0:Fe.map(Pe=>({label:Pe,value:Pe})):[],(ot=S==null?void 0:S.key)!=null&&ot.includes("$")&&(S.key=(Wt=(Nt=S==null?void 0:S.key)==null?void 0:Nt.split("$"))==null?void 0:Wt[0]),((qt=(Pt=(wt=qe.value)==null?void 0:wt.find(Pe=>(Pe==null?void 0:Pe.prop)===(S==null?void 0:S.prop)))==null?void 0:Pt.optionUrl)==null?void 0:qt.multiple)===!0&&!Array.isArray((Jt=Object.values(a))==null?void 0:Jt[Ae])?S.value=[(te=Object.values(a))==null?void 0:te[Ae]]:S.value=(A=Object.values(a))==null?void 0:A[Ae],S.optionUrl=S!=null&&S.formMenuSelect&&((je=S==null?void 0:S.formMenuSelect)==null?void 0:je.length)>0?{groupSelect:(dt=S==null?void 0:S.groupSelect)==null?void 0:dt.split(/[::]/).map(Pe=>Pe.trim()),menuSelect:S==null?void 0:S.formMenuSelect,selectRelateType:"",type:(S==null?void 0:S.formType)??(S!=null&&S.groupSelect?"Select":"")}:null,S}):I.contents=(ht=I.contents)==null?void 0:ht.map((S,Ae)=>{var Ze,B,ut,yt,Bt,Tt,At,Ot,N,Ce,lt,Ge,Fe,ot,Nt,Wt,wt,Pt,qt,Jt,te,A,je,dt;return S.type=S!=null&&S.type?S.type:(yt=(ut=(B=(Ze=S==null?void 0:S.key)==null?void 0:Ze.split("$"))==null?void 0:B[1])==null?void 0:ut.split("("))!=null&&yt[0]?(Tt=(Bt=Le.FormType)==null?void 0:Bt.find(Pe=>{var rt,Oe,bt,Mt;return(Pe==null?void 0:Pe.key)===((Mt=(bt=(Oe=(rt=S==null?void 0:S.key)==null?void 0:rt.split("$"))==null?void 0:Oe[1])==null?void 0:bt.split("("))==null?void 0:Mt[0])}))==null?void 0:Tt.value:"Input",S.options=S!=null&&S.options?S.options:((N=(Ot=(At=S==null?void 0:S.key)==null?void 0:At.split("$"))==null?void 0:Ot[1])==null?void 0:N.length)>0?(Fe=(Ge=Vn((lt=(Ce=S==null?void 0:S.key)==null?void 0:Ce.split("$"))==null?void 0:lt[1]))==null?void 0:Ge.split(","))==null?void 0:Fe.map(Pe=>({label:Pe,value:Pe})):[],(ot=S==null?void 0:S.key)!=null&&ot.includes("$")&&(S.key=(Wt=(Nt=S==null?void 0:S.key)==null?void 0:Nt.split("$"))==null?void 0:Wt[0]),((qt=(Pt=(wt=qe.value)==null?void 0:wt.find(Pe=>(Pe==null?void 0:Pe.prop)===(S==null?void 0:S.prop)))==null?void 0:Pt.optionUrl)==null?void 0:qt.multiple)===!0&&!Array.isArray((Jt=Object.values(a))==null?void 0:Jt[Ae])?S.value=[(te=Object.values(a))==null?void 0:te[Ae]]:S.value=(A=Object.values(a))==null?void 0:A[Ae],S.optionUrl=S!=null&&S.formMenuSelect&&((je=S==null?void 0:S.formMenuSelect)==null?void 0:je.length)>0?{groupSelect:(dt=S==null?void 0:S.groupSelect)==null?void 0:dt.split(/[::]/).map(Pe=>Pe.trim()),menuSelect:S==null?void 0:S.formMenuSelect,selectRelateType:"",type:(S==null?void 0:S.formType)??(S!=null&&S.groupSelect?"Select":"")}:null,S})),I}),u=qe.value,d=(le=(q=pe.cloneDeep(s))==null?void 0:q.find(I=>(I==null?void 0:I.key)==="header"))==null?void 0:le.contents;if(d=d==null?void 0:d.filter(I=>(I==null?void 0:I.label)!=="操作"),d.push({label:"操作",type:"operate"}),u=u==null?void 0:u.map(I=>{var ye;return I.value=I.value??((ye=d==null?void 0:d.find((tt,Qe)=>(tt==null?void 0:tt.prop)===(I==null?void 0:I.name)))==null?void 0:ye.value),I}),!Qa.value)return;let f="",m=pe.cloneDeep(sa.value);(ce=sa.value)!=null&&ce.includes("·")&&(sa.value=(P=(de=sa.value)==null?void 0:de.split("·"))==null?void 0:P[0]);let p=(T=(z=(he=pe.cloneDeep(s))==null?void 0:he.find(I=>(I==null?void 0:I.key)==="header"))==null?void 0:z.contents)==null?void 0:T.find((I,ye)=>{var tt,Qe,ht;return(I==null?void 0:I.prop)===sa.value||(ye==null?void 0:ye.toString())===((ht=(Qe=(tt=sa.value)==null?void 0:tt.split("a"))==null?void 0:Qe[1])==null?void 0:ht.toString())}),b=(h=p==null?void 0:p.optionUrl)==null?void 0:h.menuSelect,k=!0;(_=(x=(C=pe.cloneDeep(s))==null?void 0:C.find(I=>(I==null?void 0:I.key)==="header"))==null?void 0:x.contents)==null||_.forEach(I=>{var tt,Qe,ht,S,Ae,Ze,B;let ye=(Qe=(tt=I==null?void 0:I.optionUrl)==null?void 0:tt.groupSelect)==null?void 0:Qe[1];!ye&&!Array.isArray((ht=I==null?void 0:I.optionUrl)==null?void 0:ht.groupSelect)&&(ye=(Ze=(Ae=(S=I==null?void 0:I.optionUrl)==null?void 0:S.groupSelect)==null?void 0:Ae.split(":"))==null?void 0:Ze[1]),k&&(ye!=null&&ye.includes("["))&&(f=ye,JSON.stringify(b)===JSON.stringify((B=I==null?void 0:I.optionUrl)==null?void 0:B.menuSelect)&&(k=!1))});let D=pe.cloneDeep(u),M=et.value;M!=null&&M.find(I=>(p==null?void 0:p.prop)===(I==null?void 0:I.key))&&(M=M==null?void 0:M.filter(I=>(p==null?void 0:p.prop)!==(I==null?void 0:I.key))),M!=null&&M.find(I=>m===(I==null?void 0:I.key))&&(M=M==null?void 0:M.filter(I=>m!==(I==null?void 0:I.key))),D=D==null?void 0:D.map(I=>{var ye,tt,Qe,ht,S,Ae,Ze,B,ut;return(I==null?void 0:I.type)==="Select"&&(((tt=(ye=I==null?void 0:I.optionUrl)==null?void 0:ye.allSelectionContents)==null?void 0:tt.length)>0&&(I.optionUrl.contactValue=a),((p==null?void 0:p.prop)===(I==null?void 0:I.prop)||m===(I==null?void 0:I.prop))&&p&&(Array.isArray(p.value)&&((Qe=p.value)==null?void 0:Qe.length)>0&&((ht=p.value)!=null&&ht.every(yt=>typeof yt=="string"))?(M.push({key:I==null?void 0:I.prop,value:[(Ae=p.value)==null?void 0:Ae[((S=p.value)==null?void 0:S.length)-1]]}),I.selectValue=(Ze=M==null?void 0:M.find(yt=>(yt==null?void 0:yt.key)===(I==null?void 0:I.prop)))==null?void 0:Ze.value):Array.isArray(p.value)&&((B=p.value)==null?void 0:B.length)===0?(M=[],I.selectValue=[],a[I==null?void 0:I.prop]=""):Array.isArray(I.value)&&M.push({key:I==null?void 0:I.prop,value:[(ut=I.value)==null?void 0:ut[(I==null?void 0:I.length)-1]]}))),I.value=a==null?void 0:a[I==null?void 0:I.prop],I}),et.value=M,qe.value=pe.cloneDeep(D);let V=(p==null?void 0:p.menuId)??((xe=(H=(ue=qe.value)==null?void 0:ue.find(I=>{var ye;return(ye=I==null?void 0:I.optionUrl)==null?void 0:ye.menuId}))==null?void 0:H.optionUrl)==null?void 0:xe.menuId);if((y=p==null?void 0:p.optionUrl)!=null&&y.menuSelect&&Qa.value||V){let I=await Pn(p,V),ye;if(I==null||I.forEach(S=>{var Ae,Ze,B,ut,yt,Bt,Tt,At,Ot,N,Ce,lt,Ge,Fe,ot,Nt,Wt,wt,Pt,qt,Jt,te,A,je,dt,Pe,rt;if(!V&&f===((Ze=(Ae=p==null?void 0:p.optionUrl)==null?void 0:Ae.groupSelect)==null?void 0:Ze[1])&&((yt=(ut=(B=p==null?void 0:p.optionUrl)==null?void 0:B.groupSelect)==null?void 0:ut[1])!=null&&yt.includes("["))&&((N=pe.cloneDeep(S))==null?void 0:N[(Ot=(At=(Tt=(Bt=p==null?void 0:p.optionUrl)==null?void 0:Bt.groupSelect)==null?void 0:Tt[1])==null?void 0:At.replaceAll("[",""))==null?void 0:Ot.replaceAll("]","")])===(p==null?void 0:p.value)&&(ye=S),V){let Oe=(lt=(Ce=qe.value)==null?void 0:Ce.find(pt=>{var Ue;return(p==null?void 0:p.menuId)===((Ue=pt==null?void 0:pt.optionUrl)==null?void 0:Ue.menuId)}))==null?void 0:lt.prop,bt=a[Oe];if(Oe!=null&&Oe.includes("·"))if(!Array.isArray(a[Oe]))bt=(Fe=(Ge=a[Oe])==null?void 0:Ge.split(" "))==null?void 0:Fe[0],Oe=(ot=Oe==null?void 0:Oe.split("·"))==null?void 0:ot[0];else{Oe=(Nt=Oe==null?void 0:Oe.split("·"))==null?void 0:Nt[0];let pt=(wt=(Wt=D==null?void 0:D.find(Ue=>(Ue==null?void 0:Ue.prop)===Oe))==null?void 0:Wt.selectValue)==null?void 0:wt[0];bt=(Pt=pt==null?void 0:pt.split(" "))==null?void 0:Pt[0]}let Mt=(Jt=(qt=D==null?void 0:D.find(pt=>{var Ue;return(pt==null?void 0:pt.prop)===Oe||((Ue=pt==null?void 0:pt.prop)==null?void 0:Ue.includes("."+Oe))}))==null?void 0:qt.selectValue)==null?void 0:Jt[0];if(Oe!=null&&Oe.includes(".")&&!S[Oe]&&(Oe=(A=Oe==null?void 0:Oe.split("."))==null?void 0:A[((te=Oe==null?void 0:Oe.split("."))==null?void 0:te.length)-1]),Array.isArray(bt)&&!Mt&&(Mt=bt==null?void 0:bt[0]),S[Oe]===(Array.isArray(bt)?Mt:bt)&&(p==null?void 0:p.directiveLabel)==="#isMain"){if(m!=null&&m.includes("·")){let pt=m==null?void 0:m.split("·"),Ue=(rt=(Pe=(dt=Array.isArray(a==null?void 0:a[m])?(je=a==null?void 0:a[m])==null?void 0:je[0]:a==null?void 0:a[m])==null?void 0:dt.split(" "))==null?void 0:Pe.filter(Ct=>Ct&&Ct!==""))==null?void 0:rt.map(Ct=>Ct==null?void 0:Ct.trim());pt==null||pt.forEach((Ct,Zt)=>{S[Ct]=Ue==null?void 0:Ue[Zt]})}ye=S}}}),Se.value&&(p==null?void 0:p.directiveLabel)==="#isMain"&&(j.value=[]),!ye){if(Se.value&&(p==null?void 0:p.directiveLabel)==="#isMain")if(m!=null&&m.includes("·")){let S=a,Ae=(me=(Re=(oe=a==null?void 0:a[m])==null?void 0:oe.split(" "))==null?void 0:Re.filter(B=>B&&B!==""))==null?void 0:me.map(B=>B==null?void 0:B.trim());(ve=m==null?void 0:m.split("·"))==null||ve.forEach((B,ut)=>{S[B]=Ae[ut]});let Ze=(ke=qe.value)==null?void 0:ke.find(B=>(B==null?void 0:B.prop)===m);S[Ze.prop]=[Ze.value],ye=S}else{let S=(Ie=qe.value)==null?void 0:Ie.find(Ae=>(Ae==null?void 0:Ae.prop)===(p==null?void 0:p.prop));a[S.prop]=[S.value],ye=a}else if((p==null?void 0:p.directiveLabel)==="#isMain"){let S={};(Me=qe.value)==null||Me.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]=""}),ye=S}}if(ye){let S=pe.cloneDeep(u);S=S==null?void 0:S.map(B=>{var yt,Bt,Tt,At,Ot,N,Ce,lt,Ge,Fe,ot,Nt,Wt,wt,Pt,qt,Jt,te,A,je,dt,Pe,rt,Oe,bt,Mt,pt,Ue,Ct,Zt,Ea,It,ia,on,rn,sn,un,cn,dn,pn,We,at,ea,fn;if(((yt=B==null?void 0:B.prop)!=null&&yt.includes(".")&&(ye!=null&&ye[(Ot=(Bt=B==null?void 0:B.prop)==null?void 0:Bt.split("."))==null?void 0:Ot[((At=(Tt=B==null?void 0:B.prop)==null?void 0:Tt.split("."))==null?void 0:At.length)-1]])||ye!=null&&ye[B==null?void 0:B.prop]||ye!=null&&ye[(Ge=(lt=(Ce=(N=B==null?void 0:B.optionUrl)==null?void 0:N.groupSelect)==null?void 0:Ce[1])==null?void 0:lt.replaceAll("[",""))==null?void 0:Ge.replaceAll("]","")])&&((Nt=(ot=(Fe=B==null?void 0:B.optionUrl)==null?void 0:Fe.groupSelect)==null?void 0:ot[1])!=null&&Nt.includes("["))&&!(B!=null&&B.relatedValueId))return B.value=(ye==null?void 0:ye[B==null?void 0:B.prop])??(ye==null?void 0:ye[(qt=(Wt=B==null?void 0:B.prop)==null?void 0:Wt.split("."))==null?void 0:qt[((Pt=(wt=B==null?void 0:B.prop)==null?void 0:wt.split("."))==null?void 0:Pt.length)-1]])??(ye==null?void 0:ye[(je=(A=(te=(Jt=B==null?void 0:B.optionUrl)==null?void 0:Jt.groupSelect)==null?void 0:te[1])==null?void 0:A.replaceAll("[",""))==null?void 0:je.replaceAll("]","")]),B;let ut=ye==null?void 0:ye[B==null?void 0:B.prop];return(dt=B==null?void 0:B.prop)!=null&&dt.includes(".")&&!ut&&((rt=(Pe=p==null?void 0:p.prop)==null?void 0:Pe.split("."))==null?void 0:rt[0])===((bt=(Oe=B==null?void 0:B.prop)==null?void 0:Oe.split("."))==null?void 0:bt[0])&&(ut=(ye==null?void 0:ye[(Ct=(Mt=B==null?void 0:B.prop)==null?void 0:Mt.split("."))==null?void 0:Ct[((Ue=(pt=B==null?void 0:B.prop)==null?void 0:pt.split("."))==null?void 0:Ue.length)-1]])??(ye==null?void 0:ye[B==null?void 0:B.prop])),V&&(ut||ut==="")&&(B!=null&&B.relatedValueId)&&W.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=ut??(ye==null?void 0:ye[(ia=(It=(Ea=(Zt=B==null?void 0:B.optionUrl)==null?void 0:Zt.groupSelect)==null?void 0:Ea[1])==null?void 0:It.replaceAll("[",""))==null?void 0:ia.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((rn=(on=qe.value)==null?void 0:on.find($t=>($t==null?void 0:$t.prop)===(B==null?void 0:B.prop)))==null?void 0:rn.value)?B.value=ut??"":((sn=B==null?void 0:B.optionUrl)==null?void 0:sn.multiple)===!0&&!Array.isArray((cn=(un=qe.value)==null?void 0:un.find($t=>($t==null?void 0:$t.prop)===(B==null?void 0:B.prop)))==null?void 0:cn.value)?B.value=((pn=(dn=qe.value)==null?void 0:dn.find($t=>($t==null?void 0:$t.prop)===(B==null?void 0:B.prop)))==null?void 0:pn.value)===""?[]:[(at=(We=qe.value)==null?void 0:We.find($t=>($t==null?void 0:$t.prop)===(B==null?void 0:B.prop)))==null?void 0:at.value]:B.value=(fn=(ea=qe.value)==null?void 0:ea.find($t=>($t==null?void 0:$t.prop)===(B==null?void 0:B.prop)))==null?void 0:fn.value,B}),qe.value=pe.cloneDeep(S);let Ae=pe.cloneDeep(S);Ae=Ae==null?void 0:Ae.map(B=>{var ut,yt,Bt,Tt,At,Ot,N,Ce,lt;return(yt=(ut=B==null?void 0:B.optionUrl)==null?void 0:ut.menuSelect)!=null&&yt.some(Ge=>Ge==null?void 0:Ge.includes("["))&&(B.optionUrl.oldMenuSelect=(Tt=(Bt=pe.cloneDeep(B))==null?void 0:Bt.optionUrl)==null?void 0:Tt.menuSelect,B.optionUrl.menuSelect=(Ot=(At=B==null?void 0:B.optionUrl)==null?void 0:At.menuSelect)==null?void 0:Ot.map(Ge=>{var Fe,ot,Nt,Wt;if(Ge!=null&&Ge.includes("[")){let wt=(ot=(Fe=Ge==null?void 0:Ge.replaceAll("[","").replaceAll("]",""))==null?void 0:Fe.split(":"))==null?void 0:ot[1];Ge=(Wt=(Nt=pe.cloneDeep(S))==null?void 0:Nt.find(Pt=>(Pt==null?void 0:Pt.label)===wt))==null?void 0:Wt.value}return Ge})),((p==null?void 0:p.prop)===(B==null?void 0:B.prop)||m===(B==null?void 0:B.prop))&&Array.isArray(p.value)&&(N=p.value)!=null&&N.every(Ge=>typeof Ge=="string")&&(B.selectValue=((Ce=M==null?void 0:M.find(Ge=>(Ge==null?void 0:Ge.key)===(B==null?void 0:B.prop)))==null?void 0:Ce.value)??((lt=B.value)==null?void 0:lt[0])),B}),qe.value=Ae;let Ze={};(ee=qe.value)==null||ee.forEach(B=>{Ze[B.prop]=B==null?void 0:B.value}),zt.value=Ze}let tt=j.value,Qe={};(_e=qe.value)==null||_e.forEach(S=>{var Ae,Ze,B,ut,yt,Bt,Tt,At,Ot,N,Ce;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]),(ut=S==null?void 0:S.prop)!=null&&ut.includes("·")){let lt=(Tt=(Bt=(yt=S==null?void 0:S.prop)==null?void 0:yt.split("·"))==null?void 0:Bt.filter(Fe=>Fe&&Fe!==""))==null?void 0:Tt.map(Fe=>Fe==null?void 0:Fe.trim()),Ge=(Ce=(N=(Ot=(At=S==null?void 0:S.selectValue)==null?void 0:At[0])==null?void 0:Ot.split(" "))==null?void 0:N.filter(Fe=>Fe&&Fe!==""))==null?void 0:Ce.map(Fe=>Fe==null?void 0:Fe.trim());lt==null||lt.forEach((Fe,ot)=>{Qe=Object.assign({},Qe,{[Fe]:Ge==null?void 0:Ge[ot]})})}}else Qe[S.prop]=(Qe==null?void 0:Qe[S==null?void 0:S.prop])??S.value});let ht=(K=qe.value)==null?void 0:K.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"&&((De=p==null?void 0:p.value)==null?void 0:De[((Te=p==null?void 0:p.value)==null?void 0:Te.length)-1])!==""?tt.push({label:p==null?void 0:p.prop,value:(Ne=p==null?void 0:p.value)==null?void 0:Ne[(($e=p==null?void 0:p.value)==null?void 0:$e.length)-1],objectValue:Qe}):((ie=ht==null?void 0:ht.value)==null?void 0:ie.length)>0&&((Xe=p==null?void 0:p.value)==null?void 0:Xe[((Ye=p==null?void 0:p.value)==null?void 0:Ye.length)-1])!==""&&(tt=tt==null?void 0:tt.map(S=>{var Ae;return(S==null?void 0:S.value)===((Ae=ht==null?void 0:ht.selectValue)==null?void 0:Ae[0])&&(S.objectValue=Qe),S})),j.value=tt}Qa.value=!0,Se.value=!1},vs=a=>a?(a==null?void 0:a.toUpperCase())==="INPUT"?"TEXTAREA":a:"TEXTAREA",hs=a=>{var f,m;const n=(m=(f=la.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;se.value.forEach(p=>{const b=p==null?void 0:p[s];n&&no.isString(b)&&(p[s]=[b]),!n&&!no.isString(b)&&(p[s]="")})},Gl=(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=>Gl(u,n))),a},tl=a=>{var s,u,d,f,m,p;nn("");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){zt.value=n,na.value="",_a.value=(d=se.value)==null?void 0:d.length,xt.value=(f=_t.value)==null?void 0:f.filter(k=>(k==null?void 0:k.label)!=="新增");const b=(p=(m=kt.value)==null?void 0:m.filter(k=>(k==null?void 0:k.label)!=="操作"))==null?void 0:p.map(k=>{var M,V,q;const D=(V=(M=la.value)==null?void 0:M.find(le=>(le==null?void 0:le.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:D}:null}});J.value=b==null?void 0:b.map(k=>Gl(k,[{prop:"type",value:"edit"},{prop:"columnType",value:vs(k==null?void 0:k.formType)||(k==null?void 0:k.columnType)}])),a==="createClick"&&(W.value="新增",ln(!0))}},za={START:"开始时间",END:"结束时间",HOURS:"工时"},ms=(a,n)=>Number(Le.dayjs(n).diff(Le.dayjs(a),"day",!0).toFixed(1)),Jl=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(za.START)||!u.has(za.END)||!u.has(za.HOURS)?a:a==null?void 0:a.map(m=>{const p=m==null?void 0:m[za.START],b=m==null?void 0:m[za.END],k=ms(p,b);return p&&b&&(m[za.HOURS]=`${k}天`),m})},Xl=(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,D={...b};s+1===((n==null?void 0:n.length)??"")?D.children=p==null?void 0:p.map(M=>(M.level=pe.cloneDeep(s)+1,M)).filter((M,V)=>V!==0):k.length>0&&(D.children=Xl(k,n,s+1)),D.level=s,f.push(D)}return f},Ql=(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=Xl(a,n==null?void 0:n.contents,0),u},Zl=async(a,n)=>{var ce,de,P,he,z,T,h,C,x,_,ue,H,xe,y,oe,Re,me,ve,ke,Ie,Me,ee,_e,K,Te,De,$e,Ne,ie,Ye,Xe,I,ye,tt,Qe,ht,S,Ae,Ze,B,ut,yt,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((P=(de=(ce=a==null?void 0:a.find(N=>(N==null?void 0:N.key)==="filterAllType"))==null?void 0:ce.value)==null?void 0:de.find(N=>(N==null?void 0:N.value)==="onPamButtonContents"))!=null&&P.content){let N=(T=(z=(he=a==null?void 0:a.find(Ce=>(Ce==null?void 0:Ce.key)==="filterAllType"))==null?void 0:he.value)==null?void 0:z.find(Ce=>(Ce==null?void 0:Ce.value)==="onPamButtonContents"))==null?void 0:T.content;N=(h=N==null?void 0:N.split(":"))==null?void 0:h[1],N=(C=N.slice(1,(N==null?void 0:N.length)-1))==null?void 0:C.split(","),d=!!(N!=null&&N.find(Ce=>Ce==="操作"))}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)==="tableIndex");la.value=(_=(x=a==null?void 0:a.filter(N=>(N==null?void 0:N.key)==="tableToForm"))==null?void 0:x[0])==null?void 0:_.contents,qa.value=(f==null?void 0:f.contents)??!0;let D=[];Pa.value===""?D=s==null?void 0:s[0]:D=(s==null?void 0:s.find(N=>(N==null?void 0:N.selectLabel)==="("+Pa.value+")"))??(s==null?void 0:s.find(N=>!(N!=null&&N.selectLabel)));let M=[];Pa.value===""?M=k==null?void 0:k[0]:M=(k==null?void 0:k.find(N=>(N==null?void 0:N.selectLabel)==="("+Pa.value+")"))??(k==null?void 0:k.find(N=>!(N!=null&&N.selectLabel)));let V=[],q=[];if(((ue=D==null?void 0:D.contents)==null?void 0:ue.length)>0){let N=[],Ce=D==null?void 0:D.contents;if(Array.isArray(Ce==null?void 0:Ce[0])&&((H=Ce==null?void 0:Ce[0])!=null&&H.every(te=>!(te!=null&&te.children)))&&(Ce=Ce==null?void 0:Ce[0]),Ce.some(te=>Array.isArray(te)&&(te==null?void 0:te.find(A=>A.children))))N=(xe=Le.getGradeColumns(Ce,d))==null?void 0:xe[0],N!=null&&N.find(te=>(te==null?void 0:te.label)==="操作")||N.push({label:"操作",prop:"operate",type:"operate"});else{let te=Ce.some(A=>Array.isArray(A))?Ce==null?void 0:Ce[0]:Ce;te!=null&&te.find(A=>(A==null?void 0:A.label)==="操作")||te.push({label:"操作",prop:"operate",type:"operate"}),te==null||te.forEach((A,je)=>{var dt,Pe,rt,Oe,bt,Mt,pt,Ue,Ct,Zt,Ea,It,ia,on,rn,sn,un,cn,dn,pn;if((Pe=(dt=vt.value)==null?void 0:dt.split("/"))==null||Pe.forEach(We=>{var at,ea,fn;We!==""&&((fn=(ea=(at=We==null?void 0:We.split(Y+"updateLoading"))==null?void 0:at[0])==null?void 0:ea.split(Y+"loading"))==null||fn[0])}),A!=null&&A.methodContent){let We=(bt=(Oe=(rt=A==null?void 0:A.methodContent)==null?void 0:rt.replace("@","%%#"))==null?void 0:Oe.split("%%#"))==null?void 0:bt[1];if(We=We==null?void 0:We.slice(0,(We==null?void 0:We.length)-1),We=Le.contentTransArrayToAllNoExtra(We??"",","),(Mt=We==null?void 0:We.find(at=>at==null?void 0:at.includes("@Button")))!=null&&Mt.includes("Prop")&&((pt=We==null?void 0:We.find(at=>at==null?void 0:at.includes("Type")))!=null&&pt.includes("Manual"))){let at=(Ct=(Ue=We==null?void 0:We.find(ea=>ea==null?void 0:ea.includes("@Button")))==null?void 0:Ue.split(":"))==null?void 0:Ct[1];at=((It=(Ea=(Zt=at==null?void 0:at.replaceAll("[",""))==null?void 0:Zt.replaceAll("]",""))==null?void 0:Ea.split(","))==null?void 0:It[1])??"算法执行",V.push(at)}else if((ia=We==null?void 0:We.find(at=>at==null?void 0:at.includes("@Button")))!=null&&ia.includes("Row")&&((on=We==null?void 0:We.find(at=>at==null?void 0:at.includes("Type")))!=null&&on.includes("Manual"))){let at=(sn=(rn=We==null?void 0:We.find(ea=>ea==null?void 0:ea.includes("@Button")))==null?void 0:rn.split(":"))==null?void 0:sn[1];at=((dn=(cn=(un=at==null?void 0:at.replaceAll("[",""))==null?void 0:un.replaceAll("]",""))==null?void 0:cn.split(","))==null?void 0:dn[1])??"算法执行",q.push(at)}}(pn=la.value)==null||pn.find(We=>(We==null?void 0:We.prop)===(A==null?void 0:A.prop)),N.push({label:(A==null?void 0:A.label)==="操作"?d?"操作":"":(A==null?void 0:A.label)??"",prop:(A==null?void 0:A.label)==="操作"?"operate":(A==null?void 0:A.prop)??"a"+je,width:A!=null&&A.width?parseInt(A.width):"",fixed:(A==null?void 0:A.fixed)??void 0,sortable:(A==null?void 0:A.sortable)??!0,filterable:(A==null?void 0:A.filterable)??!1,operable:(A==null?void 0:A.operable)??!1,showSummary:(A==null?void 0:A.showSummary)??!1,align:(A==null?void 0:A.align)??"left",showOverflowTooltip:(A==null?void 0:A.showOverflowTooltip)??!0,isNotDrag:(A==null?void 0:A.isNotDrag)??!1,isEditCol:(A==null?void 0:A.isEditCol)??!1,isOperate:(A==null?void 0:A.isOperate)??!1,id:(A==null?void 0:A.id)??je,type:(A==null?void 0:A.label)==="操作"?"operate":void 0,formType:(A==null?void 0:A.formType)??(A!=null&&A.groupSelect?"Select":""),disabled:A==null?void 0:A.disabled,options:(A==null?void 0:A.options)??[],value:(A==null?void 0:A.value)??"",isExistChild:(A==null?void 0:A.isExistChild)??!1,allSelectionContents:(A==null?void 0:A.allContents)??[],filterContent:A==null?void 0:A.filterContents,menus:A==null?void 0:A.menus,groups:A==null?void 0:A.groups,words:A==null?void 0:A.words})})}const lt=Le.getNewColumnChild(N),Ge=te=>Array.isArray(te)?te.map(A=>(Array.isArray(A==null?void 0:A.children)&&A.children.length>0?(A.sortable=!1,Ge(A.children)):(A==null?void 0:A.prop)==="operate"||(A==null?void 0:A.label)==="操作"||(A==null?void 0:A.type)==="operate"||(A.sortable=!0),A)):te;Ge(lt),await wr(lt),od(X.value,lt),J.value=lt,st.value=lt,l.value=(y=J.value)==null?void 0:y.map(te=>te==null?void 0:te.label);let Fe=(Re=(oe=Le.getAllLeafNodes(J.value))==null?void 0:oe.filter(te=>(te==null?void 0:te.type)!=="operate"))==null?void 0:Re.map((te,A)=>({prop:(te==null?void 0:te.prop)??"a"+A,column:te.label}));ra.value=Fe;let ot=[];Pa.value===""?ot=b==null?void 0:b[0]:ot=(b==null?void 0:b.find(te=>(te==null?void 0:te.selectLabel)==="("+Pa.value+")"))??(b==null?void 0:b.find(te=>!(te!=null&&te.selectLabel)));let Nt=Array.isArray((me=ot==null?void 0:ot.contents)==null?void 0:me[0])&&((ve=ot==null?void 0:ot.contents)!=null&&ve[0].every(te=>Array.isArray(te)))?(ke=ot==null?void 0:ot.contents)==null?void 0:ke[0]:ot==null?void 0:ot.contents;M!=null&&M.contents&&((Ie=M==null?void 0:M.contents)==null?void 0:Ie.length)!==0&&(Nt=(Me=pe.cloneDeep(Nt))==null?void 0:Me.map((te,A)=>{if(!Array.isArray(te)){let je={};for(let dt in te)dt!=="id"&&dt!=="index"&&(je[dt]=te[dt]);te=Object.values(je)}return te}));const Wt=!!((ee=J.value)!=null&&ee.find(te=>te.prop==="index"));Nt=Uo(Nt,M==null?void 0:M.contents,Wt);const wt=[];Nt==null||Nt.forEach((te,A)=>{var dt;let je={};if(Array.isArray(te)){let Pe=[];te==null||te.filter(rt=>!(rt!=null&&rt.id)).forEach((rt,Oe)=>{var bt,Mt,pt,Ue,Ct,Zt;if((bt=Fe==null?void 0:Fe[Oe])!=null&&bt.prop&&!Array.isArray(rt)){let Ea={};Ea[Fe[Oe].column]=rt,it!=null&&it.value&&((Mt=it==null?void 0:it.value)==null?void 0:Mt.length)>0&&((pt=it==null?void 0:it.value)!=null&&pt.find(It=>JSON.stringify(It==null?void 0:It[0])===JSON.stringify(Ea)))&&(Pe=(Ue=it==null?void 0:it.value)==null?void 0:Ue.find(It=>JSON.stringify(It==null?void 0:It[0])===JSON.stringify(Ea))),Pe&&Pe.length>0?je[Fe[Oe].prop]=Pe!=null&&Pe.find(It=>{var ia;return((ia=Object.keys(It))==null?void 0:ia[0])===Fe[Oe].column})?(Ct=Pe==null?void 0:Pe.find(It=>{var ia;return((ia=Object.keys(It))==null?void 0:ia[0])===Fe[Oe].column}))==null?void 0:Ct[Fe[Oe].column]:rt:je[Fe[Oe].prop]=rt}else Array.isArray(rt)&&((Zt=Fe[Oe])!=null&&Zt.prop?je[Fe[Oe].prop]=rt:je.children=hl(rt,Fe))})}else je=te;if(Array.isArray(te)&&te.some(Pe=>Pe==null?void 0:Pe.id)){const Pe=(dt=te==null?void 0:te.find(rt=>rt.id))==null?void 0:dt.id;wt.push(Object.assign(je,{id:Vl(Pe)}))}else je.id?wt.push(je):wt.push(Object.assign(je,{id:A.toString()}))});try{const te=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),A=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null"),je=te==null?void 0:te.tableId,dt=te==null?void 0:te.compIndex;if(je&&Array.isArray(A)&&A.length>0&&String(je)===String(r==null?void 0:r.parentTableId)&&String(dt)===String(r==null?void 0:r.index)){const Pe=new Set(wt.map(Oe=>String(Oe==null?void 0:Oe.id))),rt=A.filter(Oe=>!Pe.has(String(Oe)));if(rt.length>0){const Oe=te==null?void 0:te.pageKey,bt=Oe!=null&&Oe.startsWith("/")?Oe.substring(1):Oe;((n==null?void 0:n[Oe])||(n==null?void 0:n[bt])||[]).filter(Ue=>{var Ct,Zt;return((Ct=Ue==null?void 0:Ue.key)==null?void 0:Ct.type)==="data"&&String((Zt=Ue==null?void 0:Ue.key)==null?void 0:Zt.tableId)===String(je)&&rt.includes(Ue==null?void 0:Ue.id)}).forEach(Ue=>{var Ct;Pe.has(String(Ue==null?void 0:Ue.id))||(wt.push({id:Ue==null?void 0:Ue.id,...((Ct=Ue==null?void 0:Ue.value)==null?void 0:Ct.tableData)||{}}),Pe.add(String(Ue==null?void 0:Ue.id)))})}}}catch{}const Pt=Array.from(((_e=Lt.value)==null?void 0:_e.values())||[]).filter(te=>(te==null?void 0:te._isOCRRow)&&(te==null?void 0:te._ocrTableId)===(r==null?void 0:r.index));se.value=Ql(wt,u,J.value),Gt.value=wt,(K=Gt.value)==null||K.forEach(te=>{var A;(A=Lt.value)==null||A.set(te.id,te)});const qt=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),Jt=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null");if(qt&&Array.isArray(Jt)&&Jt.length>0&&String(qt==null?void 0:qt.compIndex)===String(r==null?void 0:r.index)){const te=new Set((Gt.value||[]).map(A=>String(A==null?void 0:A.id)));Jt.filter(A=>!te.has(String(A)))}if(Pt.length>0){const te=new Set((se.value||[]).map(je=>je==null?void 0:je.id)),A=Pt.filter(je=>!te.has(je.id));A.length>0&&(se.value=[...se.value||[],...A],Gt.value=[...Gt.value||[],...A],A.forEach(je=>{var dt;return(dt=Lt.value)==null?void 0:dt.set(je.id,je)}))}}else J.value=[],kt.value=[],se.value=[],Gt.value=[],Lt.value=new Map;if(q=[...new Set(q)],q=q==null?void 0:q.map(N=>({label:N,type:"methodButton"})),((Te=m==null?void 0:m.contents)==null?void 0:Te.length)>0?va.value=m==null?void 0:m.contents:va.value=[],va.value=[...va.value,...q],V=[...new Set(V)],V=V==null?void 0:V.map(N=>({label:N,type:"methodButton"})),((De=p==null?void 0:p.contents)==null?void 0:De.length)>0)if((ie=(Ne=($e=a==null?void 0:a.find(N=>(N==null?void 0:N.key)==="filterAllType"))==null?void 0:$e.value)==null?void 0:Ne.find(N=>(N==null?void 0:N.value)==="onButtonContents"))!=null&&ie.content){let N=(I=(Xe=(Ye=a==null?void 0:a.find(Ce=>(Ce==null?void 0:Ce.key)==="filterAllType"))==null?void 0:Ye.value)==null?void 0:Xe.find(Ce=>(Ce==null?void 0:Ce.value)==="onButtonContents"))==null?void 0:I.content;if(N=(ye=N==null?void 0:N.split(":"))==null?void 0:ye[1],N=(tt=N.slice(1,(N==null?void 0:N.length)-1))==null?void 0:tt.split(","),xt.value=(Qe=p==null?void 0:p.contents)==null?void 0:Qe.filter(Ce=>N==null?void 0:N.find(lt=>lt===(Ce==null?void 0:Ce.label))),_t.value=(ht=p==null?void 0:p.contents)==null?void 0:ht.filter(Ce=>N==null?void 0:N.find(lt=>lt===(Ce==null?void 0:Ce.label))),(S=p==null?void 0:p.contents)!=null&&S.some(Ce=>(Ce==null?void 0:Ce.label)==="OCR识别")&&!((Ae=xt.value)!=null&&Ae.some(Ce=>(Ce==null?void 0:Ce.label)==="OCR识别"))){const Ce=(Ze=p==null?void 0:p.contents)==null?void 0:Ze.find(lt=>(lt==null?void 0:lt.label)==="OCR识别");xt.value=[...xt.value,Ce],_t.value=[..._t.value,Ce]}ge.value=!!(N!=null&&N.find(Ce=>Ce==="搜索")),$.value=!!(N!=null&&N.find(Ce=>Ce==="块状显示"))}else xt.value=p==null?void 0:p.contents,_t.value=p==null?void 0:p.contents;else xt.value=[],_t.value=[];xt.value=[...xt.value,...V],_t.value=[..._t.value,...V],typeof vt.value=="string"&&vt.value==="设备管理/试验设备"?((B=xt.value)!=null&&B.some(N=>(N==null?void 0:N.label)==="OCR识别")||(xt.value=[...xt.value||[],{label:"OCR识别"}]),(ut=_t.value)!=null&&ut.some(N=>(N==null?void 0:N.label)==="OCR识别")||(_t.value=[..._t.value||[],{label:"OCR识别"}])):(xt.value=(xt.value||[]).filter(N=>(N==null?void 0:N.label)!=="OCR识别"),_t.value=(_t.value||[]).filter(N=>(N==null?void 0:N.label)!=="OCR识别")),(yt=xt.value)!=null&&yt.some(N=>(N==null?void 0:N.label)==="切换视图")||(xt.value=[...xt.value||[],{label:"切换视图"}]),(Bt=_t.value)!=null&&Bt.some(N=>(N==null?void 0:N.label)==="切换视图")||(_t.value=[..._t.value||[],{label:"切换视图"}]),_a.value=((Tt=se==null?void 0:se.value)==null?void 0:Tt.length)??0,Jl(se.value),Fa.value=se.value,jt.value&&(J.value=(Ot=(At=kt.value)==null?void 0:At.filter(N=>(N==null?void 0:N.label)!=="操作"))==null?void 0:Ot.map(N=>{var Ce;return{...N,type:"edit",optionUrl:N!=null&&N.formMenuSelect&&((Ce=N==null?void 0:N.formMenuSelect)==null?void 0:Ce.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}}),tl())};e.watch(()=>[r.itemData,Pa.value,ar.value,qn.value,it==null?void 0:it.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=xa.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=xa.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),ct.setTableViewContents(m)}Zl(r.itemData,r.allMapContents)},{deep:!0,immediate:!0}),e.watch(()=>r==null?void 0:r.operatingForm,a=>{a!=null&&a.form&&(nn(a==null?void 0:a.form),W.value=a==null?void 0:a.dialogTitle,mn.value=!0,He.value=!0)},{immediate:!0,deep:!0});const gs=()=>{var a;(a=re.value)!=null&&a.includes("read")&&(jt.value=!jt.value)},ys=()=>{wn.value=!wn.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?jt.value=!1:(a!=null&&a.includes("read")||(jt.value=!0),a!=null&&a.includes("edit")||(jt.value=!1)),L.value=((n=r==null?void 0:r.config)==null?void 0:n.showIndex)||jt.value},{immediate:!0}),e.watch(()=>jt.value,a=>{var n;a?(tl("viewChange"),ct.setCacheUpdatingData(null)):(xt.value=_t.value,J.value=st.value,wa.value&&(ct.setTableLoading(r==null?void 0:r.index),fe("change",wa.value))),L.value=a||((n=r==null?void 0:r.config)==null?void 0:n.showIndex)},{immediate:!0}),e.watch(()=>{var a;return(a=Ol.value)==null?void 0:a.length},a=>{a===0&&(Z.currentPage=1)}),e.watch(()=>r==null?void 0:r.compNames,a=>{St.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;tl("createClick"),n===Z.pageSize&&(Z.currentPage=Math.ceil(((s=se.value)==null?void 0:s.length)/Z.pageSize))},ks=(a,n,s)=>{var u,d;if(jt.value){const f=a==null?void 0:a.id;f!=null&&(g.value.has(f)||g.value.set(f,pe.cloneDeep(a)),v.value.add(f));const m=(n==null?void 0:n.property)??(n==null?void 0:n.prop),p=(u=se.value)==null?void 0:u.findIndex(b=>(b==null?void 0:b.id)===(a==null?void 0:a.id));p!==-1&&m&&(se.value[p]={...se.value[p],[m]:s}),el(s,a,n);return}el(s,a,n),zt.value=pe.cloneDeep(a),na.value=a==null?void 0:a.id,_a.value=(d=se.value)==null?void 0:d.length,W.value=a!=null&&a._isTemp?"新增":"编辑",ln(!1)},Kt=a=>{var b,k,D,M,V,q,le,ce,de,P;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=(D=n==null?void 0:n[u==null?void 0:u.prop])==null?void 0:D[0])==null?void 0:M.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])??((de=(ce=n==null?void 0:n[(le=u==null?void 0:u.child)==null?void 0:le.prop])==null?void 0:ce[0])==null?void 0:de.contents)??(n==null?void 0:n[(P=u==null?void 0:u.child)==null?void 0:P.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,D,M,V,q,le,ce,de,P,he;const{row:n,column:s,item:u,slotData:d}=a;let f=n!=null&&n[s==null?void 0:s.prop]?((D=(k=n==null?void 0:n[s==null?void 0:s.prop])==null?void 0:k[0])==null?void 0:D.contents)??(n==null?void 0:n[s==null?void 0:s.prop]):((V=(M=n==null?void 0:n[u==null?void 0:u.prop])==null?void 0:M[0])==null?void 0:V.contents)??(n==null?void 0:n[u==null?void 0:u.prop])??((le=(q=d==null?void 0:d[u==null?void 0:u.prop])==null?void 0:q[0])==null?void 0:le.contents)??(d==null?void 0:d[u==null?void 0:u.prop])??((P=(de=n==null?void 0:n[(ce=u==null?void 0:u.child)==null?void 0:ce.prop])==null?void 0:de[0])==null?void 0:P.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(z=>typeof z=="string"||typeof z=="number")),b=Array.isArray(f)&&(f==null?void 0:f.find(z=>z==null?void 0:z.url));return p&&b},Es=(a,n)=>a.find(s=>Object.values(s).some(u=>u===n));return e.watch(()=>aa.value,async a=>{if(a){mt.setContentLoading(!0),await e.nextTick();const n=Es(se.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(se.value=(f=se.value)==null?void 0:f.map(D=>(D==null?void 0:D.id)===b?{...D,id:k}:D),(p=(m=Lt.value)==null?void 0:m.has)!=null&&p.call(m,b)){const D=Lt.value.get(b);Lt.value.delete(b),Lt.value.set(k,{...D,id:k})}Wo(r==null?void 0:r.index,b,k)}}):(a==null?void 0:a.compId)===(r==null?void 0:r.index)&&(se.value=(n=se.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 P,he,z,T;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"),D=e.resolveComponent("LookComponent"),M=e.resolveComponent("el-icon"),V=e.resolveComponent("el-progress"),q=e.resolveComponent("el-alert"),le=e.resolveComponent("el-table-column"),ce=e.resolveComponent("el-table"),de=e.resolveComponent("el-upload");return e.openBlock(),e.createElementBlock("div",pd,[Al.value?(e.openBlock(),e.createBlock(Rt.ssTable,{id:"excel-table",pageObj:Z,showIndex:L.value,isTree:(P=t.compItem)==null?void 0:P.isTree,summaryInfo:F,columns:J.value,defaultSort:Ke,isCardViewport:wn.value,checkedColumns:l.value,key:Wn.value+JSON.stringify(J.value),tableData:Ol.value,isEditViewport:jt.value,isShowPagination:qa.value,isShowEdit:!1,isShowDelete:!1,allowSelect:O.value,onDbClickRow:Lr,extraButton:xt.value,rowButton:va.value,cacheExtraButtons:_t.value,isClearSelection:((he=da.value)==null?void 0:he.length)===0,onDoCurrentChange:dr,onDoSizeChange:pr,onSortChange:fr,onContentClick:Il,onRowClick:Pr,onSelectChange:Er,onCellChange:ks,onChange:el,onPreview:$l,onSubmitEditingTable:Cr,onHandleColEditChange:gr,onHandleColTypeChange:yr,onClickButton:Qn,onAddNewRow:br},e.createSlots({headerButton:e.withCtx(h=>{var C,x;return[t.showHeader?(e.openBlock(),e.createBlock(Vc,{key:0,pageLayout:t.pageLayout,lockingPage:e.unref(hn)===e.unref(vt),filterValues:Pl.value,selectNums:(C=da.value)==null?void 0:C.length,dataNums:(x=se.value)==null?void 0:x.length,compName:t.compName,isDevMode:t.isDevMode,buttons:h.buttons,onButtonClick:n[1]||(n[1]=(_,ue,H)=>Qn(_,ue,{extra:H})),columns:J.value,onFilter:$r,onGetImportData:hr,level:t.level,filterShow:ge.value},null,8,["pageLayout","lockingPage","filterValues","selectNums","dataNums","compName","isDevMode","buttons","columns","level","filterShow"])):e.createCommentVNode("",!0)]}),viewport:e.withCtx(()=>{var h,C,x,_;return[((h=se.value)==null?void 0:h.length)>0&&t.allowOperate&&$.value?(e.openBlock(),e.createElementBlock("div",hd,[(C=re.value)!=null&&C.includes("read")&&((x=re.value)!=null&&x.includes("edit"))&&((_=va.value)!=null&&_.some(ue=>(ue==null?void 0:ue.label)==="编辑"))&&!wn.value&&e.unref(hn)!==e.unref(vt)?(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:x=>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":U.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(Za.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(x=>{var _;return(_=w.value)==null?void 0:_.find(ue=>(ue==null?void 0:ue.value)===x)}),x=>{var _,ue;return e.openBlock(),e.createElementBlock("div",{key:x},[ne[x]=="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[x],onChange:H=>Ml(H,x,h)},{default:e.withCtx(()=>{var H,xe;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((xe=(H=w.value)==null?void 0:H.find(y=>(y==null?void 0:y.value)===x))==null?void 0:xe.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),ne[x]=="switch"?(e.openBlock(),e.createBlock(d,{key:1,"model-value":h==null?void 0:h[x],"active-text":(ue=(_=w.value)==null?void 0:_.find(H=>(H==null?void 0:H.value)===x))==null?void 0:ue.label,onChange:H=>Ml(H,x,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,x,_,ue,H,xe,y,oe,Re,me,ve,ke,Ie,Me,ee,_e,K,Te,De,$e;return[((C=h==null?void 0:h.column)==null?void 0:C.label)==="证书附件"||((x=h==null?void 0:h.column)==null?void 0:x.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(Ne=>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(Kt(h)),1)]),default:e.withCtx(()=>{var Ne,ie;return[e.createElementVNode("div",wd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ie=h==null?void 0:h.row)==null?void 0:ie[(Ne=h==null?void 0:h.column)==null?void 0:Ne.prop],Ye=>(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("div",{class:"prop-url",title:en(Ye),onClick:Xe=>Tr(Ye)},e.toDisplayString(en(Ye)),9,_d),e.createElementVNode("div",{class:"prop-download",onClick:Xe=>Ar(Ye)}," 下载 ",8,Bd)]))),256))])]}),_:2},1024)):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle({color:!Array.isArray(Kt(h))&&((ue=(_=Kt(h))==null?void 0:_.toString())!=null&&ue.includes(".txt")||(xe=(H=Kt(h))==null?void 0:H.toString())!=null&&xe.includes(".cpt")||(oe=(y=Kt(h))==null?void 0:y.toString())!=null&&oe.includes(".cyd"))?"var(--vertical-menuitem-active-bg)":"",textDecoration:!Array.isArray(Kt(h))&&((me=(Re=Kt(h))==null?void 0:Re.toString())!=null&&me.includes(".txt")||(ke=(ve=Kt(h))==null?void 0:ve.toString())!=null&&ke.includes(".cpt")||(Me=(Ie=Kt(h))==null?void 0:Ie.toString())!=null&&Me.includes(".cyd"))?"underline":"",cursor:!Array.isArray(Kt(h))&&((_e=(ee=Kt(h))==null?void 0:ee.toString())!=null&&_e.includes(".txt")||(Te=(K=Kt(h))==null?void 0:K.toString())!=null&&Te.includes(".cpt")||($e=(De=Kt(h))==null?void 0:De.toString())!=null&&$e.includes(".cyd"))?"pointer":"",marginLeft:(h==null?void 0:h.colIndex)===0?`${((h==null?void 0:h.level)??0)*20}px`:0}),onClick:Ne=>ur(Kt(h))},e.toDisplayString(Kt(h)===0?"0":Kt(h)),13,Td))]}),_:2},[((z=va.value)==null?void 0:z.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(va.value,h),(x,_)=>(e.openBlock(),e.createElementBlock("div",{class:"menu-config-item",key:_,onClick:e.withModifiers(ue=>Qn(x==null?void 0:x.label,h,{extra:x,index:C}),["stop"])},[e.createElementVNode("div",{style:e.normalizeStyle({color:x==null?void 0:x.textColor}),class:"extra-button-label"},e.toDisplayString(x==null?void 0:x.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"])):e.createCommentVNode("",!0),e.createCommentVNode("",!0),e.createVNode(Na.ssDialog,{title:W.value,visible:He.value,width:lr.value,onBeforeDestroy:_r,style:{height:"74%"}},{default:e.withCtx(()=>[e.createElementVNode("div",Ad,[e.createVNode(Rt.ssForm,{rowContents:qe.value,showOperator:!1,onChange:fs,isEnableWrap:!1,onFixChangeValue:Mr,onClickTrigger:Br,isEdit:$a.value,onBlurChange:Sr,onCreate:Nr,onTagChange:ir},null,8,["rowContents","isEdit"])])]),footer:e.withCtx(()=>[mn.value?(e.openBlock(),e.createElementBlock("div",Od,[e.createVNode(k,{onClick:n[4]||(n[4]=h=>He.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=>ln(!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(Na.ssDialog,{title:W.value,visible:oa.value,width:fa.value,onBeforeDestroy:n[7]||(n[7]=h=>oa.value=!1)},{default:e.withCtx(()=>[e.createVNode(Fc)]),footer:e.withCtx(()=>[e.createElementVNode("div",Dd,[e.createVNode(k,{onClick:n[6]||(n[6]=h=>oa.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:Ir,id:"themeButton"},{default:e.withCtx(()=>n[29]||(n[29]=[e.createTextVNode(e.toDisplayString("确认"))])),_:1,__:[29]})])]),_:1},8,["title","visible","width"]),Et.value?(e.openBlock(),e.createBlock(Rt.ssFilePreview,{key:2,fileDataList:Ft.value,onDestroy:Vr},null,8,["fileDataList"])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createBlock(Na.ssDialog,{key:3,visible:R.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:Ya.value,threeData:Je.value},null,8,["files","threeData"])]),_:1},8,["visible"])):e.createCommentVNode("",!0),e.createVNode(Na.ssDialog,{visible:a.componentVisible,onBeforeDestroy:n[8]||(n[8]=h=>a.componentVisible=!1),width:fa.value,style:{height:"70vh"}},{default:e.withCtx(()=>[e.createVNode(D,{dialogItem:or.value},null,8,["dialogItem"])]),_:1},8,["visible","width"]),e.createVNode(Na.ssDialog,{title:"OCR扫描录入",visible:Un.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:Vt.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:Vt.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:Vt.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)]),Vt.value===1?(e.openBlock(),e.createElementBlock("div",Ld,[e.createVNode(k,{onClick:Hr,class:"ocr-action-btn",disabled:ca.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:ca.value,size:"default"},{default:e.withCtx(()=>n[36]||(n[36]=[e.createTextVNode("上传文件")])),_:1,__:[36]},8,["disabled"])])):e.createCommentVNode("",!0),Vt.value===1?(e.openBlock(),e.createElementBlock("div",Vd,[e.createElementVNode("div",Pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(h,C)=>{var x;return e.openBlock(),e.createElementBlock("div",{key:C,class:"ocr-file-item"},[e.createElementVNode("div",Id,[h.raw&&((x=h.raw.type)!=null&&x.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(M,{size:40},{default:e.withCtx(()=>[e.createVNode(e.unref(E.document_default))]),_:1})])),e.createElementVNode("div",{class:e.normalizeClass(["file-progress-ring",{uploading:Ht(h)==="uploading",processing:Ht(h)==="processing",completed:Ht(h)==="completed"||Ht(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:Ht(h)==="completed"||Ht(h)==="uploaded",uploading:Ht(h)==="uploading",processing:Ht(h)==="processing"}]),cx:"18",cy:"18",r:"16",fill:"none",stroke:Ht(h)==="completed"||Ht(h)==="uploaded"?"#67c23a":"#409eff","stroke-width":Ht(h)==="completed"||Ht(h)==="uploaded"?3:2,"stroke-dasharray":es(h),"stroke-dashoffset":"0","stroke-linecap":"round",transform:"rotate(-90 18 18)"},null,10,zd)])),Ht(h)==="completed"||Ht(h)==="uploaded"?(e.openBlock(),e.createElementBlock("div",jd,[e.createVNode(M,{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(M,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))]),gt.value.length>0?(e.openBlock(),e.createElementBlock("div",Wd,[e.createVNode(k,{onClick:Fl,class:"ocr-start-recognize-btn",disabled:ca.value||gt.value.length===0,size:"default"},{default:e.withCtx(()=>n[38]||(n[38]=[e.createTextVNode("开始识别")])),_:1,__:[38]},8,["disabled"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Vt.value===1?(e.openBlock(),e.createElementBlock("div",qd,[e.createVNode(V,{percentage:ma.value,"stroke-width":8},null,8,["percentage"])])):e.createCommentVNode("",!0),Vt.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(ce,{data:ga.value,border:"",stripe:"","max-height":"400",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(le,{type:"index",label:"序号",width:"60",fixed:""}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jn.value,h=>(e.openBlock(),e.createBlock(le,{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":ya.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:x})=>{var _,ue,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},[La.value!==x?(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":xe=>C[h.prop]=xe,size:"small",placeholder:"请输入"+h.label,content:((_=En(h.prop))==null?void 0:_.contents)??((ue=En(h.prop))==null?void 0:ue.options)??[],optionUrl:(H=En(h.prop))==null?void 0:H.optionUrl,onChange:xe=>jl(x,h.prop,xe),onFocus:xe=>Ga.value=h.prop,onBlur:n[10]||(n[10]=xe=>Ga.value="")},null,40,["modelValue","onUpdate:modelValue","placeholder","content","optionUrl","onChange","onFocus"]))],64))]}),_:2},1032,["prop","min-width","class-name"]))),128)),e.createVNode(le,{label:"编辑",width:"80",fixed:"right"},{default:e.withCtx(({$index:h})=>[La.value===h?(e.openBlock(),e.createBlock(M,{key:0,class:"ocr-edit-icon editing",style:{"margin-left":"12px"},onClick:e.withModifiers(C=>Hl(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=>Hl(h),["stop"])},null,8,["onClick"]))]),_:1})]),_:1},8,["data"])])])):e.createCommentVNode("",!0),Vt.value===3?(e.openBlock(),e.createElementBlock("div",Zd,[e.createVNode(M,{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(de,{ref:"ocrUploadRef","file-list":gt.value,"onUpdate:fileList":n[11]||(n[11]=h=>gt.value=h),multiple:"",action:"","auto-upload":!1,limit:20,accept:"image/*,application/pdf","on-change":Ul,"show-file-list":!1,class:"ocr-upload-input",style:{display:"none"}},null,8,["file-list"])]),footer:e.withCtx(()=>[Vt.value!==3?(e.openBlock(),e.createElementBlock("div",ep,[e.createVNode(k,{onClick:as,class:"ocr-start-recognize-btn",disabled:Vt.value===1||ca.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:ca.value},{default:e.withCtx(()=>n[42]||(n[42]=[e.createTextVNode(" 下一步 ")])),_:1,__:[42]},8,["disabled"])])):e.createCommentVNode("",!0)]),_:1},8,["visible"]),e.createVNode(nd,{visible:_n.value,onConfirm:Kr,onCancel:n[12]||(n[12]=h=>_n.value=!1)},null,8,["visible"]),e.createVNode(Hu,{visible:Fn.value,"onUpdate:visible":n[13]||(n[13]=h=>Fn.value=h),versions:Nl.value},null,8,["visible","versions"]),e.createVNode(Au,{visible:Va.value,"onUpdate:visible":n[14]||(n[14]=h=>Va.value=h),images:Ja.value,"default-image-name":Hn.value,"field-meta":La.value!==null?((T=ga.value[La.value])==null?void 0:T.__ocrFieldMeta)||{}:{},"focused-field-name":Ga.value,onClose:n[15]||(n[15]=h=>Va.value=!1),class:"ocr-img-preview-dialog"},null,8,["visible","images","default-image-name","field-meta","focused-field-name"]),e.createVNode(tc,{visible:Sn.value,"onUpdate:visible":n[16]||(n[16]=h=>Sn.value=h),candidates:Nn.value,"name-prop":Go.value,"mfr-prop":Jo.value,columns:J.value,onSubmit:Qo},null,8,["visible","candidates","name-prop","mfr-prop","columns"]),e.createVNode(ic,{visible:zn.value,"onUpdate:visible":n[17]||(n[17]=h=>zn.value=h),ocrPreviewData:ga.value,"onUpdate:ocrPreviewData":n[18]||(n[18]=h=>ga.value=h),ocrSelectedFields:ya.value,"onUpdate:ocrSelectedFields":n[19]||(n[19]=h=>ya.value=h),ocrPreviewColumns:jn.value,onConfirm:zl,onFieldChange:n[20]||(n[20]=({rowIndex:h,prop:C,value:x})=>jl(h,C,x))},null,8,["visible","ocrPreviewData","ocrSelectedFields","ocrPreviewColumns"]),e.createVNode(Na.ssDialog,{title:St.title,visible:St.show,width:St.width,onBeforeDestroy:Wr},{default:e.withCtx(()=>[e.createElementVNode("div",tp,[e.createVNode(Rt.ssForm,{rowContents:St==null?void 0:St.contents,formRules:St==null?void 0:St.formRules,showOperator:!1,buttonValue:St.buttonValue,isEdit:$a.value,isStartJustify:!1,onOnButtonClick:qr},null,8,["rowContents","formRules","buttonValue","isEdit"])])]),_:1},8,["title","visible","width"])])}}},lp=Ma._export_sfc(np,[["__scopeId","data-v-0f83b254"]]);exports.ElMessageBox=vl;exports.formGetOptions=Vn;exports.getSelectRow=Pn;exports.ssTable=lp;exports.useFormComp=jo;exports.useFormToTableComp=Ro;