import{x as E,c as p,r as a,k as D,al as u,y as N,H as h,I as r,A as g,Q as n,M as f,u as l}from"./vendor-6ae0c374-1783405707921v=1.0.0.js";import{u as w,_ as A}from"./index-71d7b18c-1783405707921v=1.0.0.js";import"./eleVendor-d42abce8-1783405707921v=1.0.0.js";const M={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"}]},O={class:"pt20 mt30"},R=E({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(_,{emit:F}){w();let i=_;const s=F,d=p({get(){return v(i.value)},set(o){s("update:value",o)}}),B=p({get(){return i.loading},set(o){s("update:loading",o)}}),c=a();a({xs:24,sm:22,md:20,lg:14,xl:13}),a({xs:24,sm:24,md:12,lg:12,xl:12}),a({xs:24,sm:22,md:18,lg:16,xl:8});const v=o=>o,x=()=>JSON.parse(JSON.stringify(d.value)),y=o=>{o.validate(async(e,m)=>{if(e){let t=x();s("submit",t)}else{const t=Object.keys(m)[0];o.scrollToField(t)}})},C=()=>{s("cancel")};return D(()=>{}),(o,e)=>{const m=u("PaRow"),t=u("el-button"),b=u("el-form-item"),k=u("el-form");return N(),h(k,{model:l(d),ref_key:"formRef",ref:c,rules:l(M),"label-width":"160px"},{default:r(()=>[e[3]||(e[3]=g("div",{class:"divider mb30"},"\u57FA\u7840\u4FE1\u606F",-1)),n(m),n(b,null,{default:r(()=>[g("div",O,[n(t,{onClick:C},{default:r(()=>e[1]||(e[1]=[f("\u8FD4\u56DE",-1)])),_:1,__:[1]}),n(t,{type:"primary",loading:l(B),onClick:e[0]||(e[0]=V=>y(l(c)))},{default:r(()=>e[2]||(e[2]=[f("\u4FDD\u5B58",-1)])),_:1,__:[2]},8,["loading"])])]),_:1})]),_:1,__:[3]},8,["model","rules"])}}}),I=A(R,[["__file","D:/desktop/huaZhong/huazhong-common/apps/vue-admin/src/views/baseManage/classManage/components/BaseForm.vue"]]);export{I as default};
