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