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