import{u as U,g,s as f,a as B,r as L}from"../js2/index-DTu-QzEG.js";import{b,j as S}from"./_js-fast-way-BT1PNT_n.js";import{i as z,n as A,b as d,aa as m,c as N,e as P,f as s,u as p,A as a,y as n,P as q}from"./__vendor-DQKyNF9L.js";import"./_pinia-D4felSvJ.js";import"./_nprogress-BwII5Wsx.js";import"./_vue-router-6J-a2VIf.js";import"./_hc-vue3-ui-Dz3VIK_0.js";const E=""+new URL("../png/bg1-CN0cYIvb.png",import.meta.url).href,T=""+new URL("../png/bg-Runxv98G.png",import.meta.url).href,x=""+new URL("../png/img-BRru6Xjh.png",import.meta.url).href,j={class:"hc-login-body hc-full"},D=["src","data-src"],I=["src","data-src"],K={class:"hc-login-main hc-h-full hc-flex-center w-[50%]"},$={class:"hc-login-main-content relative mt-30 w-[400px]"},G={class:"hc-login-form-card bg-white p-6"},W={__name:"index",setup(M){const v=U();z(async()=>{const c=b(g("login-username")||""),e=b(g("login-password")||""),t=b(g("login-checkbox")||"");o.value.username=c,o.value.password=e,r.value=t,await A(),v.clearStoreData(),h(),document.querySelectorAll('img[loading="lazy"]').forEach(l=>{l.src=l.dataset.src})});const w=d(null),r=d(!0),o=d({tenantId:"000000",username:"",password:"",type:"account"}),V={username:{required:!0,message:"请输入账号",trigger:"blur"},password:{required:!0,message:"请输入密码",trigger:"blur"}},k=c=>{c.key==="Enter"&&_()},u=d(!1),_=async()=>{if(!await S(w.value))return!1;u.value=!0;const{error:e,msg:t}=await B(o.value);if(e)return u.value=!1,window?.$message?.error(t),!1;u.value=!1,window?.$message?.success("登录成功"),h(),setTimeout(()=>{u.value=!1,L.push({name:v.home})},1500)},h=()=>{r.value&&(f("login-username",o.value.username),f("login-password",o.value.password)),f("login-checkbox",r.value)};return(c,e)=>{const t=m("el-input"),l=m("el-form-item"),y=m("el-checkbox"),R=m("el-button"),C=m("el-form");return N(),P("div",j,[s("img",{class:"hc-login-bg",src:p(E),"data-src":p(T),loading:"lazy",alt:"bg"},null,8,D),s("img",{class:"hc-login-img",src:p(x),"data-src":p(x),loading:"lazy",alt:"bg"},null,8,I),s("div",K,[s("div",$,[e[5]||(e[5]=s("div",{class:"app-title mb-6 text-center text-[28px] text-white font-bold"},[s("span",null,"欢迎使用"),s("span",{class:"name text-red-5"},"数据分析")],-1)),s("div",G,[e[4]||(e[4]=s("div",{class:"login-title mb-6 text-[28px] font-bold"},"登录",-1)),a(C,{ref_key:"formRef",ref:w,model:o.value,rules:V,"label-position":"left","label-width":"0px",size:"large"},{default:n(()=>[a(l,{prop:"username"},{default:n(()=>[a(t,{modelValue:o.value.username,"onUpdate:modelValue":e[0]||(e[0]=i=>o.value.username=i),clearable:"",placeholder:"请输入账号"},null,8,["modelValue"])]),_:1}),a(l,{class:"mt-8",prop:"password"},{default:n(()=>[a(t,{modelValue:o.value.password,"onUpdate:modelValue":e[1]||(e[1]=i=>o.value.password=i),clearable:"",placeholder:"请输入密码","show-password":"",type:"password",onKeyup:k},null,8,["modelValue"])]),_:1}),a(l,null,{default:n(()=>[a(y,{modelValue:r.value,"onUpdate:modelValue":e[2]||(e[2]=i=>r.value=i),label:"记住密码"},null,8,["modelValue"])]),_:1}),a(l,{class:"mb-0 mt-6"},{default:n(()=>[a(R,{class:"text-[16px] text-white",loading:u.value,block:"",color:"#20C88B",onClick:_},{default:n(()=>e[3]||(e[3]=[q("登 录")])),_:1},8,["loading"])]),_:1})]),_:1},8,["model"])])])])])}}};export{W as default};
