var b=(a,n,r)=>new Promise((i,_)=>{var c=s=>{try{u(r.next(s))}catch(o){_(o)}},m=s=>{try{u(r.throw(s))}catch(o){_(o)}},u=s=>s.done?i(s.value):Promise.resolve(s.value).then(c,m);u((r=r.apply(a,n)).next())});import{aP as B,a as k,cB as E,r as v,ai as $,aQ as f,bK as A,w as P,o as g,aR as y,p,i as T,j as F,h as D,aW as K,aU as w,F as V,dD as R,q as h,x as S}from"./index.0d073eaa.js";import{T as C}from"./index.78efd931.js";import{P as W}from"./index.566277e5.js";import{B as j}from"./BasicForm.d11b68fd.js";import{u as M}from"./useForm.868c8e81.js";import"./useRefs.e81831e2.js";import"./PlusOutlined.64d8e001.js";import"./index.e9a84cba.js";import"./index.0972fd96.js";import"./useSize.bb4e5ce5.js";import"./eagerComputed.156e81ff.js";import"./useWindowSizeFn.ef20ece8.js";import"./useContentViewHeight.01b9d1c6.js";import"./ArrowLeftOutlined.90d2e05e.js";import"./index.8680e4c4.js";import"./transButton.8c1b1a4f.js";/* empty css              *//* empty css              */import"./index.0fb15725.js";import"./index.965098be.js";import"./Checkbox.476f6e92.js";import"./index.1491cab6.js";import"./index.e317a008.js";import"./index.7075e2b7.js";import"./index.04f7e044.js";import"./index.e8daa066.js";import"./get.49a42f2e.js";import"./index.e8b360cf.js";import"./index.2b5ea4f6.js";import"./_baseIteratee.3919e7cf.js";import"./DeleteOutlined.247d1f35.js";import"./index.a8c197b8.js";import"./Form.48352728.js";import"./Col.a2eadc78.js";import"./useFlexGapSupport.474c31b7.js";import"./index.81899e8a.js";import"./index.c05f9254.js";import"./FullscreenOutlined.401a7bcd.js";import"./index.ffb8ac7d.js";import"./index.dd1f987c.js";import"./uuid.2b29000c.js";import"./download.bb4c9304.js";import"./base64Conver.08b9f4ec.js";import"./index.31930d74.js";import"./index.1d29734e.js";import"./uniqBy.ac0f9c38.js";const N=k({name:"TabsFormDemo",components:{Tabs:C,TabPane:C.TabPane,PageWrapper:W,CollapseContainer:E,BasicForm:j},setup(){const{createMessage:a}=S(),n=v("tabs2"),r=v(!1),i=[],_={showActionButtonGroup:!1,labelWidth:100},c={};for(let o=1;o<=5;++o){const e=`tabs${o}`,l=[],d={};for(let t=1;t<=8;++t)l.push({field:`${e}.field${t}`,label:`${e}-field${t}`,component:"Input",colProps:{span:24}}),d[`field${t}`]=`field: ${e}.field${t}, default value`;c[e]=d,i.push({key:e,tab:e,forceRender:!0,Form:M(Object.assign({schemas:l},_))})}function m(){return b(this,null,function*(){for(const o of i){const{resetFields:e}=o.Form[1];yield e()}})}function u(){return b(this,null,function*(){let o="";r.value=!0;try{const e={};for(const l of i){o=l.key;const{validate:d,getFieldsValue:t}=l.Form[1];yield d(),R(e,t())}console.log("submit values: ",e),a.success("\u63D0\u4EA4\u6210\u529F\uFF01\u8BF7\u6253\u5F00\u63A7\u5236\u53F0\u67E5\u770B")}catch(e){n.value=o,console.log(e)}finally{r.value=!1}})}function s(){return b(this,null,function*(){console.log("\u9ED8\u8BA4\u503C\u4E3A: ",c);for(const o of i){const{setFieldsValue:e}=o.Form[1];yield e(c)}})}return{omit:$,loading:r,activeKey:n,tabsFormSchema:i,handleReset:m,handleSubmit:u,handleSetValues:s}}}),U={class:"mb-4"},q=h(" \u91CD\u7F6E\u8868\u5355 "),G=h(" \u8BBE\u7F6E\u9ED8\u8BA4\u503C "),I=h(" \u63D0\u4EA4\u8868\u5355 ");function L(a,n,r,i,_,c){const m=f("a-button"),u=f("BasicForm"),s=f("TabPane"),o=f("Tabs"),e=f("CollapseContainer"),l=f("PageWrapper"),d=A("loading");return P((g(),y(l,{title:"\u6807\u7B7E\u9875+\u591A\u7EA7field\u8868\u5355"},{default:p(()=>[T("div",U,[F(m,{onClick:a.handleReset,class:"mr-2"},{default:p(()=>[q]),_:1},8,["onClick"]),F(m,{onClick:a.handleSetValues,class:"mr-2"},{default:p(()=>[G]),_:1},8,["onClick"]),F(m,{onClick:a.handleSubmit,class:"mr-2",type:"primary"},{default:p(()=>[I]),_:1},8,["onClick"])]),F(e,{title:"\u6807\u7B7E\u9875+\u591A\u7EA7field\u8868\u5355"},{default:p(()=>[F(o,{activeKey:a.activeKey,"onUpdate:activeKey":n[0]||(n[0]=t=>a.activeKey=t)},{default:p(()=>[(g(!0),D(V,null,K(a.tabsFormSchema,t=>(g(),y(s,w({key:t.key},a.omit(t,["Form","key"])),{default:p(()=>[F(u,{onRegister:t.Form[0]},null,8,["onRegister"])]),_:2},1040))),128))]),_:1},8,["activeKey"])]),_:1})]),_:1})),[[d,a.loading]])}var Me=B(N,[["render",L]]);export{Me as default};
