var C=(r,t,p)=>new Promise((s,n)=>{var e=o=>{try{i(p.next(o))}catch(a){n(a)}},m=o=>{try{i(p.throw(o))}catch(a){n(a)}},i=o=>o.done?s(o.value):Promise.resolve(o.value).then(e,m);i((p=p.apply(r,t)).next())});import{d as $,f as P,U as u,a2 as c,ad as f,af as l,k as b,G as _,V as B}from"./vue-vendor-CxLCUzY4.js";import"./index-ByX9XNkE.js";import{C as k}from"./index-DS3utcig.js";import{j as v}from"./antd-vue-vendor-CahNzUUa.js";import{P as F}from"./index-D55rh6hR.js";import{ai as g,_ as I}from"./index-CLZzJyTP.js";import{u as y,B as S}from"./useForm-Dx3lJ3DG.js";import"./componentMap-DpsJvoqz.js";import"./useFormItem-IOFWTdED.js";import"./index-XZKTTfG1.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-DvqyyN77.js";import"./useWindowSizeFn-D9PllI8g.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./depart.api-DHG2p2Yd.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useContentHeight-DLfJuPsF.js";import"./useContentViewHeight-BIb_dTbE.js";import"./usePageContext-FyDvfV_K.js";import"./injectionKey-DPVn4AgL.js";const h=$({components:{BasicForm:S,CollapseContainer:k,PageWrapper:F,[v.name]:v,Button:g},setup(){const[r,{appendSchemaByField:t,removeSchemaByFiled:p,validate:s}]=y({schemas:[{field:"field0a",component:"Input",label:"字段0",colProps:{span:8},required:!0},{field:"field0b",component:"Input",label:"字段0",colProps:{span:8},required:!0},{field:"0",component:"Input",label:" ",colProps:{span:8},slot:"add"}],labelWidth:100,actionColOptions:{span:24}});function n(){return C(this,null,function*(){try{const o=yield s()}catch(o){}})}const e=P(1);function m(){t({field:`field${e.value}a`,component:"Input",label:"字段"+e.value,colProps:{span:8},required:!0},""),t({field:`field${e.value}b`,component:"Input",label:"字段"+e.value,colProps:{span:8},required:!0},""),t({field:`${e.value}`,component:"Input",label:" ",colProps:{span:8},slot:"add"},""),e.value++}function i(o){p([`field${o}a`,`field${o}b`,`${o}`]),e.value--}return{register:r,handleSubmit:n,add:m,del:i}}});function q(r,t,p,s,n,e){const m=u("Button"),i=u("BasicForm"),o=u("CollapseContainer"),a=u("PageWrapper");return c(),f(a,{title:"表单增删示例"},{default:l(()=>[b(o,{title:"表单增删"},{default:l(()=>[b(i,{onRegister:r.register,onSubmit:r.handleSubmit},{add:l(({field:d})=>[Number(d)===0?(c(),f(m,{key:0,onClick:r.add},{default:l(()=>t[0]||(t[0]=[_("+")])),_:1},8,["onClick"])):B("",!0),d>0?(c(),f(m,{key:1,onClick:N=>r.del(d)},{default:l(()=>t[1]||(t[1]=[_("-")])),_:2},1032,["onClick"])):B("",!0)]),_:1},8,["onRegister","onSubmit"])]),_:1})]),_:1})}const Eo=I(h,[["render",q]]);export{Eo as default};
