var C=(r,t,p)=>new Promise((s,m)=>{var e=o=>{try{i(p.next(o))}catch(a){m(a)}},n=o=>{try{i(p.throw(o))}catch(a){m(a)}},i=o=>o.done?s(o.value):Promise.resolve(o.value).then(e,n);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-BkgeZpOO.js";import{C as k}from"./index-BRTtls-l.js";import{j as v}from"./antd-vue-vendor-CDWW6V_M.js";import{P as F}from"./index-BxgvQLkr.js";import{ai as g,_ as I}from"./index-CYriLmQo.js";import{u as y,B as S}from"./useForm-8o5KRzWo.js";import"./componentMap-7D1QIeNI.js";import"./useFormItem-CWa0w7fA.js";import"./index-CF_FJn6P.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useTimeout-DC8132dd.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-CxQILSKV.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./download-CkbK5et1.js";import"./base64Conver-24EVOS6V.js";import"./index-QMJkXEyl.js";import"./index-Bb_NRLur.js";import"./useCountdown-C3-PRPLY.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-nVFm3ao2.js";import"./props-DoGpHXAD.js";import"./JSelectBiz-BW6f3e--.js";import"./JAddInput-CXT54-j9.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-BTSd5ebC.js";import"./index-BTAl55Kt.js";import"./bem-2ra1afoV.js";import"./props-BLY2qIO5.js";import"./useContextMenu-DYyhcDf7.js";import"./depart.api-C9T5xfw6.js";import"./JDictSelectTag-Jqy9TBcS.js";import"./JSelectDept-DorRVguN.js";import"./JPopup-KP1kIsae.js";import"./JEllipsis-287cEHxd.js";import"./JUpload-pyrTRFCz.js";import"./index-Bx9Mnn3N.js";import"./index-B1-pj6uh.js";import"./index-isxCPgHp.js";import"./JAreaLinkage-DFTeDmm8.js";import"./JCodeEditor-_KZ8XnNK.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-XK54XB3r.js";import"./index-DOuVMe-q.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useContentHeight-DtBiGC0g.js";import"./useContentViewHeight-D71xl1HH.js";import"./usePageContext-CCgh0KDo.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 m(){return C(this,null,function*(){try{const o=yield s()}catch(o){}})}const e=P(1);function n(){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:m,add:n,del:i}}});function q(r,t,p,s,m,e){const n=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(n,{key:0,onClick:r.add},{default:l(()=>t[0]||(t[0]=[_("+")])),_:1},8,["onClick"])):B("",!0),d>0?(c(),f(n,{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 Ao=I(h,[["render",q]]);export{Ao as default};
