import{d as C,u as S,a as F,b as L,r as c,c as U,e as r,f as x,o as v,g as o,h as t,C as B,i as I,j as D,t as d,w as l,k as w,l as R,_ as q}from"./index-5k_MqT6o.js";const E="/assets/login-Z_ybrVFF.png",M={class:"login-page"},j={class:"login-change-lang"},P={class:"login-form-container"},T={class:"scroll-container"},Z={class:"login-card-wrapper"},z={class:"login-card"},A={class:"welcome-section"},G={class:"welcome-title"},H={class:"welcome-desc"},J={class:"form-actions"},K=C({__name:"index",setup(O){const{t:p}=S(),h=F();L();const m=c(!1),_=c(null),i=c(!1),b=c(!0),e=U({username:"",password:"",remember:!0}),V={username:[{required:!0,message:p("请输入账号"),trigger:"blur"}],password:[{required:!0,message:p("请输入密码"),trigger:"blur"}]},g=localStorage.getItem("userName");g&&(e.username=g);const y=async()=>{const s=_.value;if(s)try{i.value=!0,await s.validate(),await h.login(e.username,e.password),e.remember&&localStorage.setItem("userName",e.username)}catch{i.value=!1}finally{i.value=!1}};return(s,a)=>{const f=r("el-input"),u=r("el-form-item"),k=r("el-checkbox"),$=r("el-button"),N=r("el-form");return v(),x("div",M,[o("div",j,[t(B,{class:"ml14"})]),a[3]||(a[3]=o("div",{class:"login-image-container"},[o("div",{class:"center-image-placeholder"},[o("img",{src:E,alt:"",style:{width:"100%"}})])],-1)),o("div",P,[o("div",T,[o("div",Z,[o("div",z,[o("div",A,[o("h1",G,d(m.value?s.$t("创建新账号")+" 🚀":s.$t("欢迎回来")+" 👋"),1),o("p",H,d(m.value?s.$t("请填写以下信息创建您的账号，开启项目管理之旅"):s.$t("请输入您的帐户信息以开始管理您的项目")),1)]),m.value?D("",!0):(v(),I(N,{key:0,ref_key:"loginForm",ref:_,model:e,rules:V,class:"login-form",onSubmit:R(y,["prevent"])},{default:l(()=>[t(u,{prop:"username"},{default:l(()=>[t(f,{modelValue:e.username,"onUpdate:modelValue":a[0]||(a[0]=n=>e.username=n),placeholder:s.$t("请输入账号"),"prefix-icon":"User",class:"login-input"},null,8,["modelValue","placeholder"])]),_:1}),t(u,{prop:"password"},{default:l(()=>[t(f,{modelValue:e.password,"onUpdate:modelValue":a[1]||(a[1]=n=>e.password=n),type:"password",placeholder:s.$t("请输入密码"),"prefix-icon":"Lock",class:"login-input","show-password":b.value},null,8,["modelValue","placeholder","show-password"])]),_:1}),o("div",J,[t(k,{modelValue:e.remember,"onUpdate:modelValue":a[2]||(a[2]=n=>e.remember=n),class:"remember-checkbox"},{default:l(()=>[w(d(s.$t("记住账号")),1)]),_:1},8,["modelValue"])]),t(u,null,{default:l(()=>[t($,{type:"primary","native-type":"submit",class:"login-button",loading:i.value},{default:l(()=>[w(d(s.$t("登录")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["model"]))])])])])])}}}),W=q(K,[["__scopeId","data-v-4a3ac369"]]);export{W as default};
