index-f34e8151.js 1.9 KB

1
  1. import{g as v}from"./image-e1abec51.js";import{u as w}from"./index-f79a4cc5.js";import{d as h,f as u,c as e,k as l,D as s,I as n,B as x}from"./main-4801cc52.js";import{F as o,R as I,a as c}from"./Form-46ad1153.js";import"./useFlexGapSupport-310043de.js";import"./Col-7508b53a.js";import"./collapseMotion-14d9ada7.js";const y={wrapperCol:{span:24}},B={wrapperCol:{span:24}},N=h({setup(){const d=w(),i=u({loading:!1,loginType:"default"}),t=u({account:"",password:"",role:"admin"}),m=u({account:[{required:!0,message:"请输入正确的账号",trigger:"change"}],password:[{required:!0,message:"请输入正确的密码",trigger:"change"}],role:[{required:!0,message:"角色不能为空",trigger:"change"}]}),{validate:p,validateInfos:r}=o.useForm(t,m);async function g(){p().then(a=>{const f={password:a.password,role:a.role,loginName:a.account};d.passwordLogin(f)})}return()=>e("div",{class:F},[e("div",{class:"content"},[e("div",{class:"logo"},[e("img",{src:v("logo.png")},null)]),e("div",{class:"title"},[l("后台管理系统")]),e(o,s(y,{name:"basic"}),{default:()=>[e(o.Item,s({name:"account"},r.account),{default:()=>[e(n,{placeholder:"请输入账号",value:t.account,"onUpdate:value":a=>t.account=a,maxlength:30},null)]}),e(o.Item,s({name:"password"},r.password),{default:()=>[e(n.Password,{placeholder:"请输入密码",value:t.password,"onUpdate:value":a=>t.password=a,maxlength:18},null)]}),e(o.Item,s({name:"role"},r.role),{default:()=>[e(I,{class:"flex justify-center w-full ",value:t.role,"onUpdate:value":a=>t.role=a},{default:()=>[e("div",{class:"flex-1 text-center"},[e(c,{value:"teacher"},{default:()=>[l("教员")]})]),e("div",{class:"flex-1 text-center"},[e(c,{value:"admin"},{default:()=>[l("管理员")]})])]})]}),e(o.Item,s(B,{style:{marginBottom:0}}),{default:()=>[e(x,{htmlType:"submit",block:!0,class:"login_btn",size:"large",loading:i.loading,onClick:g},{default:()=>[l("登录")]})]})]})])])}}),F="p1fwmfaj";export{N as default};