import{y as N,r as R,c as f,al as a,z as w,I as z,J as o,R as t,u,O as m,B as J,k as O}from"./vendor-866bb149-1782572373740v=1.0.0.js";const U={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u7C7B\u578B\u540D\u79F0",trigger:"change"},{max:15,message:"\u540D\u79F0\u4E0D\u80FD\u8D85\u8FC715\u4E2A\u5B57",trigger:"blur"}],isEnable:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:"change"}]},q={class:"content"},I=N({__name:"BaseFormDialog",props:{visible:{type:Boolean,default:!1},title:{default:""},value:{default:()=>({})},loading:{type:Boolean},needImg:{type:Boolean,default:!1}},emits:["update:visible","update:value","submit","update:loading"],setup(c,{emit:y}){const i=c,n=y,_=R(null),s=f({get:()=>F(i.value),set:l=>{n("update:value",l)}}),p=f({get:()=>i.visible,set:l=>{n("update:visible",l)}}),C=f({get:()=>i.loading,set:l=>{n("update:loading",l)}}),F=l=>l,V=()=>JSON.parse(JSON.stringify(s.value)),g=()=>{n("update:visible",!1)},D=async l=>{l.validate(async(e,B)=>{if(e){let d=V();n("update:value",d),n("submit",d)}})};return(l,e)=>{const B=a("el-input"),d=a("el-form-item"),b=a("el-radio"),E=a("el-radio-group"),k=a("el-form"),v=a("el-button"),x=a("el-dialog");return w(),z(x,{modelValue:u(p),"onUpdate:modelValue":e[3]||(e[3]=r=>O(p)?p.value=r:null),width:"600px",title:i.title,"before-close":g},{footer:o(()=>[t(v,{type:"primary",loading:u(C),onClick:e[2]||(e[2]=r=>D(u(_)))},{default:o(()=>e[6]||(e[6]=[m("\u786E\u8BA4",-1)])),_:1,__:[6]},8,["loading"]),t(v,{onClick:g},{default:o(()=>e[7]||(e[7]=[m("\u53D6\u6D88",-1)])),_:1,__:[7]})]),default:o(()=>[J("div",q,[t(k,{ref_key:"formRef",ref:_,model:u(s),"label-width":"auto",rules:u(U)},{default:o(()=>[t(d,{label:"\u7C7B\u578B\u540D\u79F0:",prop:"name"},{default:o(()=>[t(B,{modelValue:u(s).name,"onUpdate:modelValue":e[0]||(e[0]=r=>u(s).name=r),placeholder:"\u8BF7\u8F93\u5165\u7C7B\u578B\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(d,{label:"\u72B6\u6001:",prop:"isEnable"},{default:o(()=>[t(E,{modelValue:u(s).isEnable,"onUpdate:modelValue":e[1]||(e[1]=r=>u(s).isEnable=r)},{default:o(()=>[t(b,{value:1,size:"large"},{default:o(()=>e[4]||(e[4]=[m("\u6709\u6548",-1)])),_:1,__:[4]}),t(b,{value:0,size:"large"},{default:o(()=>e[5]||(e[5]=[m("\u65E0\u6548",-1)])),_:1,__:[5]})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue","title"])}}});export{I as default};
