import{u as k}from"./index-c87bcfde-1782468512657v=1.0.0.js";import{x as N,c as p,r as s,k as D,al as a,y as A,H as w,I as r,A as f,Q as l,M as g,u as n}from"./vendor-27e23c1b-1782468512657v=1.0.0.js";import"./eleVendor-12a75a9a-1782468512657v=1.0.0.js";const O={className:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],collegeId:[{required:!0,message:"\u8BF7\u9009\u62E9\u9662\u7CFB\u540D\u79F0",trigger:"change"}],majorName:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E13\u4E1A\u540D\u79F0",trigger:"change"}],collegeName:[{required:!0,message:"\u8BF7\u9009\u62E9\u5B66\u9662\u540D\u79F0",trigger:"change"}]},R={class:"pt20 mt30"},S=N({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(_,{emit:F}){k();let d=_;const u=F,i=p({get(){return y(d.value)},set(t){u("update:value",t)}}),B=p({get(){return d.loading},set(t){u("update:loading",t)}}),c=s();s({xs:24,sm:22,md:20,lg:14,xl:13}),s({xs:24,sm:24,md:12,lg:12,xl:12}),s({xs:24,sm:22,md:18,lg:16,xl:8});const y=t=>t,x=()=>JSON.parse(JSON.stringify(i.value)),C=t=>{t.validate(async(e,m)=>{if(e){let o=x();u("submit",o)}else{const o=Object.keys(m)[0];t.scrollToField(o)}})},v=()=>{u("cancel")};return D(()=>{}),(t,e)=>{const m=a("PaRow"),o=a("el-button"),b=a("el-form-item"),E=a("el-form");return A(),w(E,{model:n(i),ref_key:"formRef",ref:c,rules:n(O),"label-width":"160px"},{default:r(()=>[e[3]||(e[3]=f("div",{class:"divider mb30"},"\u57FA\u7840\u4FE1\u606F",-1)),l(m),l(b,null,{default:r(()=>[f("div",R,[l(o,{onClick:v},{default:r(()=>e[1]||(e[1]=[g("\u8FD4\u56DE",-1)])),_:1,__:[1]}),l(o,{type:"primary",loading:n(B),onClick:e[0]||(e[0]=V=>C(n(c)))},{default:r(()=>e[2]||(e[2]=[g("\u4FDD\u5B58",-1)])),_:1,__:[2]},8,["loading"])])]),_:1})]),_:1,__:[3]},8,["model","rules"])}}});export{S as default};
