var b=(x,i,u)=>new Promise((o,d)=>{var g=l=>{try{f(u.next(l))}catch(m){d(m)}},p=l=>{try{f(u.throw(l))}catch(m){d(m)}},f=l=>l.done?o(l.value):Promise.resolve(l.value).then(g,p);f((u=u.apply(x,i)).next())});import{d as F,f as k,r as _,e as B,u as e,a2 as P,a3 as M,k as a,af as n,G as y,a5 as w,J as T,F as U,V as N}from"./vue-vendor-CxLCUzY4.js";import V from"./LoginFormTitle-BPlUFYPW.js";import{a5 as C,j as v,z as L,B as h}from"./antd-vue-vendor-CahNzUUa.js";import{S as D}from"./index-D6H6KsT6.js";import{C as G}from"./index-CLxBW_h0.js";import{bB as j,bC as A,bH as H,K as J,aZ as K,bD as Z,bE as $,bN as q,u as O}from"./index-Cy4uayzW.js";import"./useCountdown-2P9HvnfJ.js";import"./index-zKZnG1QC.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useFormItemSingle-BEyrYQqf.js";const ye=F({__name:"RegisterForm",setup(x){const i=C.Item,u=v.Password,{t:o}=J(),{handleBackLogin:d,getLoginState:g}=j(),{notification:p,createErrorModal:f}=O(),l=k(),m=k(!1),t=_({account:"",password:"",confirmPassword:"",mobile:"",sms:"",policy:!1}),{getFormRules:E}=A(t),{validForm:R}=$(l),S=B(()=>e(g)===H.REGISTER);function I(){return b(this,null,function*(){const c=yield R();if(c)try{m.value=!0;const s=yield q(T({username:c.account,password:c.password,phone:c.mobile,smscode:c.sms}));s&&s.data.success?(p.success({description:s.data.message||o("sys.api.registerMsg"),duration:3}),d()):p.warning({message:o("sys.api.errorTip"),description:s.data.message||o("sys.api.networkExceptionMsg"),duration:3})}catch(s){p.error({message:o("sys.api.errorTip"),description:s.message||o("sys.api.networkExceptionMsg"),duration:3})}finally{m.value=!1}})}function z(){return K({mobile:t.mobile,smsmode:Z.REGISTER})}return(c,s)=>S.value?(P(),M(U,{key:0},[a(V,{class:"enter-x"}),a(e(C),{class:"p-4 enter-x",model:t,rules:e(E),ref_key:"formRef",ref:l},{default:n(()=>[a(e(i),{name:"account",class:"enter-x"},{default:n(()=>[a(e(v),{class:"fix-auto-fill",size:"large",value:t.account,"onUpdate:value":s[0]||(s[0]=r=>t.account=r),placeholder:e(o)("sys.login.userName")},null,8,["value","placeholder"])]),_:1}),a(e(i),{name:"mobile",class:"enter-x"},{default:n(()=>[a(e(v),{size:"large",value:t.mobile,"onUpdate:value":s[1]||(s[1]=r=>t.mobile=r),placeholder:e(o)("sys.login.mobile"),class:"fix-auto-fill"},null,8,["value","placeholder"])]),_:1}),a(e(i),{name:"sms",class:"enter-x"},{default:n(()=>[a(e(G),{size:"large",class:"fix-auto-fill",value:t.sms,"onUpdate:value":s[2]||(s[2]=r=>t.sms=r),placeholder:e(o)("sys.login.smsCode"),sendCodeApi:z},null,8,["value","placeholder"])]),_:1}),a(e(i),{name:"password",class:"enter-x"},{default:n(()=>[a(e(D),{size:"large",value:t.password,"onUpdate:value":s[3]||(s[3]=r=>t.password=r),placeholder:e(o)("sys.login.password")},null,8,["value","placeholder"])]),_:1}),a(e(i),{name:"confirmPassword",class:"enter-x"},{default:n(()=>[a(e(u),{size:"large",visibilityToggle:"",value:t.confirmPassword,"onUpdate:value":s[4]||(s[4]=r=>t.confirmPassword=r),placeholder:e(o)("sys.login.confirmPassword")},null,8,["value","placeholder"])]),_:1}),a(e(i),{class:"enter-x",name:"policy"},{default:n(()=>[a(e(L),{checked:t.policy,"onUpdate:checked":s[5]||(s[5]=r=>t.policy=r),size:"small"},{default:n(()=>[y(w(e(o)("sys.login.policy")),1)]),_:1},8,["checked"])]),_:1}),a(e(h),{type:"primary",class:"enter-x",size:"large",block:"",onClick:I,loading:m.value},{default:n(()=>[y(w(e(o)("sys.login.registerButton")),1)]),_:1},8,["loading"]),a(e(h),{size:"large",block:"",class:"mt-4 enter-x",onClick:e(d)},{default:n(()=>[y(w(e(o)("sys.login.backSignIn")),1)]),_:1},8,["onClick"])]),_:1},8,["model","rules"])],64)):N("",!0)}});export{ye as default};
