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-ARbUvvsq.js";import{C as k}from"./index-Dz2zbQB_.js";import{j as v}from"./antd-vue-vendor-CDWW6V_M.js";import{P as F}from"./index-DaObvZxT.js";import{ai as g,_ as I}from"./index-B_2CoVdl.js";import{u as y,B as S}from"./useForm-CcjrODHR.js";import"./componentMap-CzCGDP7x.js";import"./useFormItem-CWa0w7fA.js";import"./index-D2AmS0aU.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JAddInput-YFlAniYT.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-CkL00Q0a.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./depart.api-0qTriT9h.js";import"./JDictSelectTag-CxpDdimB.js";import"./JSelectDept-wKz_Qtmc.js";import"./JPopup-BJBYqoWe.js";import"./JEllipsis-Cn7GCKHR.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./JAreaLinkage-CSgDAlrn.js";import"./JCodeEditor-esTLnfS3.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-DclSHT47.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useContentHeight-BWLGvKEC.js";import"./useContentViewHeight-DlpfApuB.js";import"./usePageContext-HMYqek-Q.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};
