import{d as f,k as v,v as r,c as e,l as s,x as o,I as d,B as w}from"./index-432e0d5a.js";import{F as l,R as n}from"./Form-3e7c293d.js";import"./useFlexGapSupport-1b1e93ca.js";const h={wrapperCol:{span:24}},x={wrapperCol:{span:24}},b=f({setup(){const i=v(),m=r({loading:!1,loginType:"default"}),a=r({loginName:"",password:"",role:"student"}),p=r({loginName:[{required:!0,message:"请输入正确的账号",trigger:"change"}],password:[{required:!0,message:"请输入正确的密码",trigger:"change"}],role:[{required:!0,message:"登录角色不能为空",trigger:"change"}]}),{validate:c,validateInfos:u}=l.useForm(a,p);async function g(){c().then(t=>{i.passwordLogin(t)})}return()=>e("div",{class:y},[e("div",{class:"content"},[e("div",{class:"title"},[s("用户登录")]),e("div",{class:"py-30px px-20px"},[e(l,o(h,{name:"basic"}),{default:()=>[e(l.Item,o({name:"loginName"},u.loginName),{default:()=>[e(d,{placeholder:"请输入账号",value:a.loginName,"onUpdate:value":t=>a.loginName=t,maxlength:30},null)]}),e(l.Item,o({name:"password"},u.password),{default:()=>[e(d.Password,{placeholder:"请输入密码",value:a.password,"onUpdate:value":t=>a.password=t,maxlength:18},null)]}),e(l.Item,o({name:"role"},u.role),{default:()=>[e(n.Group,{class:"flex justify-between w-full login_role",value:a.role,"onUpdate:value":t=>a.role=t},{default:()=>[e(n,{value:"student"},{default:()=>[s("学生")]}),e(n,{value:"teacher"},{default:()=>[s("老师")]}),e(n,{value:"admin"},{default:()=>[s("管理员")]})]})]}),e(l.Item,o(x,{style:{marginBottom:0}}),{default:()=>[e(w,{htmlType:"submit",type:"primary",block:!0,class:"login_btn",size:"large",loading:m.loading,onClick:g},{default:()=>[s("登录")]})]})]})])])])}}),y="p1fwmfaj";export{b as default};
