import{u as T}from"./index-996f931c-1782111760424v=1.0.0.js";import{m as U,f as F,a as m,e as j,ai as n,p,M as v,O as o,t as C,U as a,ac as y,ad as E,u as l,q as J,F as L,a8 as M,S as f,T as z}from"./vendor-7f807b9d-1782111760424v=1.0.0.js";const $={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u4E1A\u52A1\u7C7B\u578B",trigger:"blur"},{max:255,message:"\u6700\u591A 255 \u4E2A\u5B57\u7B26",trigger:"blur"}],isEnable:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:"change"}]},G={class:"pt20 mt30"},K=U({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(x,{emit:V}){T();let c=x;const d=V,r=F({get(){return D(c.value)},set(t){d("update:value",t)}}),k=F({get(){return c.loading},set(t){d("update:loading",t)}}),_=m();m({xs:24,sm:22,md:20,lg:14,xl:13});const g=m({xs:24,sm:24,md:12,lg:12,xl:12});m({xs:24,sm:22,md:18,lg:16,xl:8});const A=m([]),D=t=>t,O=()=>JSON.parse(JSON.stringify(r.value)),P=t=>{t.validate(async(e,i)=>{if(e){let s=O();d("submit",s)}else{const s=Object.keys(i)[0];t.scrollToField(s)}})},w=()=>{d("cancel")};return j(()=>{}),(t,e)=>{const i=n("el-input"),s=n("el-form-item"),b=n("PaCol"),N=n("el-radio"),R=n("el-radio-group"),S=n("PaRow"),B=n("el-button"),q=n("el-form");return p(),v(q,{model:l(r),ref_key:"formRef",ref:_,rules:l($),"label-width":"160px"},{default:o(()=>[e[5]||(e[5]=C("div",{class:"divider mb30"},"\u57FA\u7840\u4FE1\u606F",-1)),a(S,null,{default:o(()=>[a(b,y(E(l(g))),{default:o(()=>[a(s,{label:"\u4E1A\u52A1\u7C7B\u578B",prop:"name"},{default:o(()=>[a(i,{modelValue:l(r).name,"onUpdate:modelValue":e[0]||(e[0]=u=>l(r).name=u),placeholder:"\u8BF7\u8F93\u5165\u4E1A\u52A1\u7C7B\u578B"},null,8,["modelValue"])]),_:1})]),_:1},16),a(b,y(E(l(g))),{default:o(()=>[a(s,{label:"\u72B6\u6001",prop:"isEnable"},{default:o(()=>[a(R,{modelValue:l(r).isEnable,"onUpdate:modelValue":e[1]||(e[1]=u=>l(r).isEnable=u)},{default:o(()=>[(p(!0),J(L,null,M(l(A),u=>(p(),v(N,{key:u.value,label:u.label,value:u.value},{default:o(()=>[f(z(u.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16)]),_:1}),a(s,null,{default:o(()=>[C("div",G,[a(B,{onClick:w},{default:o(()=>e[3]||(e[3]=[f("\u8FD4\u56DE")])),_:1}),a(B,{type:"primary",loading:l(k),onClick:e[2]||(e[2]=u=>P(l(_)))},{default:o(()=>e[4]||(e[4]=[f("\u4FDD\u5B58")])),_:1},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});export{K as _};
