"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("element-plus"),m=require("../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.4.21/node_modules/@element-plus/icons-vue/dist/index.js"),y=require("../symbol.js"),_=require("../types.js"),h=require("../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/cloneDeep.js"),$=e.defineComponent({name:"WetProFormList",__name:"list",props:_.wetProFormListProps,setup(i){const t=e.inject(y.SymbolState),s=i,l=e.shallowRef(0),o=e.ref([]),u=()=>{o.value.push(`${l.value}`),l.value++},d=(r,n)=>{if(s.prop){const a=Array.isArray(s.prop)?[...s.prop]:[s.prop],v=t==null?void 0:t.getFieldsValue([...a,`${n}`]),f=h.default(v);t==null||t.setFieldsValue([...a,`${l.value}`],f),o.value.splice(r+1,0,`${l.value}`),l.value++}},p=r=>{o.value.splice(r,1),o.value.length===0&&(l.value=0)};return(r,n)=>(e.openBlock(),e.createBlock(e.unref(c.ElCol),null,{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.renderSlot(r.$slots,"default",{keys:o.value,deleteItem:p,addItem:u,copyAdd:d})]),e.createElementVNode("div",null,[e.createVNode(e.unref(c.ElButton),{style:{width:"100%"},icon:e.unref(m.Plus),onClick:u},{default:e.withCtx(()=>[e.createTextVNode("添加一行数据")]),_:1},8,["icon"])])]),_:3}))}});exports.default=$;
