import{u as N}from"./index-c87bcfde-1782468512657v=1.0.0.js";import{x as k,c as p,r as u,k as E,al as r,y as w,H as D,I as a,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={teacherName:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],teacherNo:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],courseName:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],courseTime:[],courseAddress:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],specialProjectName:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}]},R={class:"pt20 mt30"},S=k({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(_,{emit:B}){N();let i=_;const s=B,d=p({get(){return b(i.value)},set(o){s("update:value",o)}}),x=p({get(){return i.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 b=o=>o,y=()=>JSON.parse(JSON.stringify(d.value)),A=o=>{o.validate(async(e,m)=>{if(e){let t=y();s("submit",t)}else{const t=Object.keys(m)[0];o.scrollToField(t)}})},v=()=>{s("cancel")};return E(()=>{}),(o,e)=>{const m=r("PaRow"),t=r("el-button"),C=r("el-form-item"),F=r("el-form");return w(),D(F,{model:n(d),ref_key:"formRef",ref:c,rules:n(O),"label-width":"160px"},{default:a(()=>[e[3]||(e[3]=f("div",{class:"divider mb30"},"\u57FA\u7840\u4FE1\u606F",-1)),l(m),l(C,null,{default:a(()=>[f("div",R,[l(t,{onClick:v},{default:a(()=>e[1]||(e[1]=[g("\u8FD4\u56DE",-1)])),_:1,__:[1]}),l(t,{type:"primary",loading:n(x),onClick:e[0]||(e[0]=V=>A(n(c)))},{default:a(()=>e[2]||(e[2]=[g("\u4FDD\u5B58",-1)])),_:1,__:[2]},8,["loading"])])]),_:1})]),_:1,__:[3]},8,["model","rules"])}}});export{S as default};
