import{d as B,V as C,W as A,r as f,X as L,b as K,o as $,aX as y,j9 as w,_ as D,c as r,e as N,f as R,g as t,n as S,t as F,h as n,i as u,a1 as V,m as U}from"./index.0308b213.js";const q=B({setup(){const{router:e,route:l}=C(),{storeManagementLogin:b}=A(),_=f(null),g=f(null),i=f(!1),c=f(!1),{config:d}=L(),a=K({account:"",password:""}),m={account:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D26\u53F7",trigger:["blur"]}],password:[{required:!0,message:"\u8BF7\u8F93\u5165\u5BC6\u7801",trigger:["blur"]}]},h=()=>{var o;if(!a.password)return(o=_.value)==null?void 0:o.focus();p()},p=()=>{var o;(o=g.value)==null||o.validate(v=>{!v||(c.value=!0,y.set(w,{remember:i.value,account:a.account}),b(a).then(()=>{const{query:{redirect:s}}=l,k=typeof s=="string"?s:"/storeManagement/home";e.replace(k)}).catch(s=>{console.log(s)}).finally(()=>{c.value=!1}))})};return $(()=>{const o=y.get(w);o.remember&&(i.value=o.remember,a.account=o.account)}),{config:d,passwordRefs:_,loginFormRefs:g,loginForm:a,loginLoading:c,rules:m,handleEnter:h,handleLogin:p,remAccount:i}}});const x={class:"login flex flex-col"},E={class:"flex-1 flex flex-center"},M={class:"login-card bg-white flex"},T={class:"login-form flex flex-col"},X={class:"f-s-24 f-w-500 text-center m-b-40"},j={class:"m-b-20"},z=U("\u767B\u5F55"),I={class:"login-footer"},O={class:"flex flex-center muted xs m-t-20"},W={class:"m-r-10"},G=["href"];function H(e,l,b,_,g,i){const c=r("avatar"),d=r("el-icon"),a=r("el-input"),m=r("el-form-item"),h=r("lock"),p=r("el-form"),o=r("el-checkbox"),v=r("el-button");return N(),R("div",x,[t("div",E,[t("div",M,[t("div",{class:"login-img",style:S({"background-image":`url(${e.config.login_image})`})},null,4),t("div",T,[t("div",X,F(e.config.web_name),1),n(p,{ref:"loginFormRefs",model:e.loginForm,"status-icon":"",rules:e.rules},{default:u(()=>[n(m,{prop:"account"},{default:u(()=>[n(a,{modelValue:e.loginForm.account,"onUpdate:modelValue":l[0]||(l[0]=s=>e.loginForm.account=s),placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7",onKeyup:V(e.handleEnter,["enter"])},{prepend:u(()=>[n(d,null,{default:u(()=>[n(c)]),_:1})]),_:1},8,["modelValue","onKeyup"])]),_:1}),n(m,{prop:"password"},{default:u(()=>[n(a,{ref:"passwordRefs",modelValue:e.loginForm.password,"onUpdate:modelValue":l[1]||(l[1]=s=>e.loginForm.password=s),"show-password":"",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",onKeyup:V(e.handleLogin,["enter"])},{prepend:u(()=>[n(d,null,{default:u(()=>[n(h)]),_:1})]),_:1},8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model","rules"]),t("div",j,[n(o,{modelValue:e.remAccount,"onUpdate:modelValue":l[2]||(l[2]=s=>e.remAccount=s),label:"\u8BB0\u4F4F\u8D26\u53F7"},null,8,["modelValue"])]),n(v,{type:"primary",loading:e.loginLoading,onClick:e.handleLogin},{default:u(()=>[z]),_:1},8,["loading","onClick"])])])]),t("div",I,[t("div",O,[t("span",W,F(e.config.copyright_info),1),t("a",{class:"link muted",href:e.config.icp_link,target:"_blank"},F(e.config.icp_number),9,G)])])])}const P=D(q,[["render",H],["__scopeId","data-v-c2833896"]]);export{P as default};
