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-BN26Feep.js";import{C as k}from"./index-CYoRlduV.js";import{j as v}from"./antd-vue-vendor-CahNzUUa.js";import{P as F}from"./index-CRgSyMPH.js";import{ai as g,_ as I}from"./index-Cy4uayzW.js";import{u as y,B as S}from"./useForm-DfoT2G6J.js";import"./componentMap-0iK4HQBq.js";import"./useFormItem-IOFWTdED.js";import"./index-zKZnG1QC.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useContentHeight-XU-h1taH.js";import"./useContentViewHeight-Qm4QNm5l.js";import"./usePageContext-CXQdt-5h.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};
