import{_ as b}from"./Form-DWU3hFR9.js";import{_ as y}from"./XButton-C1WkVWZR.js";import{d as _,J as R,ad as I,a as o,A as V,r as x,P as C,ae as F,o as L,g as U,B as n,k as t,C as d,a7 as B}from"./index-CHTXMeh8.js";import{u as q}from"./useForm-CEk1zgLl.js";import{u as E}from"./useValidator-kEqoZj3j.js";import{u as S,L as j,_ as z}from"./LoginFormTitle.vue_vue_type_script_setup_true_lang-BYAXnov1.js";import"./Form.vue_vue_type_style_index_0_scoped_09f6ff61_lang-B0myO5Ey.js";import"./el-virtual-list-DyZstV52.js";import"./el-tree-select-DhIHMmfG.js";import"./InputPassword-BKyYinTx.js";const A={class:"w-[100%] flex"},G={class:"w-[100%]"},J={class:"mt-15px w-[100%]"},T=_({name:"RegisterForm",__name:"RegisterForm",setup(D){const{t:e}=R(),{required:a}=E(),{register:c,elFormRef:m}=q(),{handleBackLogin:u,getLoginState:g}=S(),h=I(()=>o(g)===j.REGISTER),w=V([{field:"title",colProps:{span:24}},{field:"username",label:e("login.username"),value:"",component:"Input",colProps:{span:24},componentProps:{placeholder:e("login.usernamePlaceholder")}},{field:"password",label:e("login.password"),value:"",component:"InputPassword",colProps:{span:24},componentProps:{style:{width:"100%"},strength:!0,placeholder:e("login.passwordPlaceholder")}},{field:"check_password",label:e("login.checkPassword"),value:"",component:"InputPassword",colProps:{span:24},componentProps:{style:{width:"100%"},strength:!0,placeholder:e("login.passwordPlaceholder")}},{field:"code",label:e("login.code"),colProps:{span:24}},{field:"register",colProps:{span:24}}]),f={username:[a()],password:[a()],check_password:[a()],code:[a()]},i=x(!1);return(H,l)=>{const P=B,p=y,k=b;return C((L(),U(k,{rules:f,schema:o(w),class:"dark:(border-1 border-[var(--el-border-color)] border-solid)","hide-required-asterisk":"","label-position":"top",size:"large",onRegister:o(c)},{title:n(()=>[t(z,{style:{width:"100%"}})]),code:n(r=>[d("div",A,[t(P,{modelValue:r.code,"onUpdate:modelValue":s=>r.code=s,placeholder:o(e)("login.codePlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"])])]),register:n(()=>[d("div",G,[t(p,{loading:o(i),title:o(e)("login.register"),class:"w-[100%]",type:"primary",onClick:l[0]||(l[0]=r=>(async()=>{const s=o(m);s==null||s.validate(async v=>{if(v)try{i.value=!0}finally{i.value=!1}})})())},null,8,["loading","title"])]),d("div",J,[t(p,{title:o(e)("login.hasUser"),class:"w-[100%]",onClick:l[1]||(l[1]=r=>o(u)())},null,8,["title"])])]),_:1},8,["schema","onRegister"])),[[F,o(h)]])}}});export{T as default};
|