var y=(e,n,t)=>new Promise((o,u)=>{var a=i=>{try{l(t.next(i))}catch(r){u(r)}},s=i=>{try{l(t.throw(i))}catch(r){u(r)}},l=i=>i.done?o(i.value):Promise.resolve(i.value).then(a,s);l((t=t.apply(e,n)).next())});import{c as v}from"./index-CYriLmQo.js";import"./vue-vendor-CxLCUzY4.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";const c=Symbol();function w(e,n,t,o,u){return y(this,null,function*(){if(!(e&&typeof e=="function"))throw`validate 参数需要的是一个方法，而传入的却是${typeof e}`;let a={},s=yield new Promise((i,r)=>{e().then(()=>{for(let f in n)n[f]instanceof Array&&v(o,f)==="string"&&(n[f]=n[f].join(","));i(n)}).catch(()=>{r({error:c,index:0})})});Object.assign(a,{formValue:s});let l=yield T(t,u);return a=Object.assign(a,{tablesValue:l}),a})}function T(e,n=!0){if(!(e instanceof Array))throw`'validateTables'函数的'cases'参数需要的是一个数组，而传入的却是${typeof e}`;return new Promise((t,o)=>{let u=[],a=0;(!e||e.length===0)&&t(u),function s(){let l=e[a];l.value.validateTable().then(i=>{if(!i)u[a]={tableData:l.value.getTableData()},++a===e.length?t(u):s();else{let r,f=p(l.value,"ATabPane");if(f&&(r=f.$.vnode.key,n)){let b=p(f,"Tabs");b&&b.setActiveKey&&b.setActiveKey(r)}o({error:c,index:a,paneKey:r,errMap:i,subIndex:a})}})}()})}function p(e,n){let t=e.$parent;if(t&&t.$options){if(t.$options.name===n)return t;{let o=p(t,n);if(o)return o}}return null}export{c as VALIDATE_FAILED,p as getVmParentByName,w as validateFormModelAndTables,T as validateTables};
