var _=(y,i,s)=>new Promise((d,m)=>{var f=o=>{try{u(s.next(o))}catch(r){m(r)}},c=o=>{try{u(s.throw(o))}catch(r){m(r)}},u=o=>o.done?d(o.value):Promise.resolve(o.value).then(f,c);u((s=s.apply(y,i)).next())});import{d as I,f as k,r as w,e as L,u as e,a2 as R,a3 as D,k as t,af as l,J as M,G as S,a5 as v,F as V,V as z}from"./vue-vendor-CxLCUzY4.js";import{a5 as x,j as T,B as C}from"./antd-vue-vendor-CahNzUUa.js";import{C as N}from"./index-D0jTtUNS.js";import O from"./LoginFormTitle-KDWDPvSe.js";import{bB as U,bC as $,ab as A,bH as G,K as j,aZ as H,bD as J,bE as K,u as P}from"./index-CLZzJyTP.js";import"./useCountdown-BpP55PQ2.js";import"./index-XZKTTfG1.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-DvqyyN77.js";import"./useWindowSizeFn-D9PllI8g.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useFormItemSingle-BEyrYQqf.js";const de=I({__name:"MobileForm",setup(y){const i=x.Item,{t:s}=j(),{handleBackLogin:d,getLoginState:m}=U(),{getFormRules:f}=$(),{notification:c,createErrorModal:u}=P(),o=A(),r=k(),g=k(!1),n=w({mobile:"",sms:""}),{validForm:F}=K(r),h=L(()=>e(m)===G.MOBILE);function B(){return _(this,null,function*(){const p=yield F();if(p)try{g.value=!0;const a=yield o.phoneLogin(M({mobile:p.mobile,captcha:p.sms,mode:"none"}));a&&c.success({message:s("sys.login.loginSuccessTitle"),description:`${s("sys.login.loginSuccessDesc")}: ${a.realname}`,duration:3})}catch(a){c.error({message:s("sys.api.errorTip"),description:a.message||s("sys.api.networkExceptionMsg"),duration:3})}finally{g.value=!1}})}function E(){return H({mobile:n.mobile,smsmode:J.FORGET_PASSWORD})}return(p,a)=>h.value?(R(),D(V,{key:0},[t(O,{class:"enter-x"}),t(e(x),{class:"p-4 enter-x",model:n,rules:e(f),ref_key:"formRef",ref:r},{default:l(()=>[t(e(i),{name:"mobile",class:"enter-x"},{default:l(()=>[t(e(T),{size:"large",value:n.mobile,"onUpdate:value":a[0]||(a[0]=b=>n.mobile=b),placeholder:e(s)("sys.login.mobile"),class:"fix-auto-fill"},null,8,["value","placeholder"])]),_:1}),t(e(i),{name:"sms",class:"enter-x"},{default:l(()=>[t(e(N),{size:"large",class:"fix-auto-fill",value:n.sms,"onUpdate:value":a[1]||(a[1]=b=>n.sms=b),placeholder:e(s)("sys.login.smsCode"),sendCodeApi:E},null,8,["value","placeholder"])]),_:1}),t(e(i),{class:"enter-x"},{default:l(()=>[t(e(C),{type:"primary",size:"large",block:"",onClick:B,loading:g.value},{default:l(()=>[S(v(e(s)("sys.login.loginButton")),1)]),_:1},8,["loading"]),t(e(C),{size:"large",block:"",class:"mt-4",onClick:e(d)},{default:l(()=>[S(v(e(s)("sys.login.backSignIn")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model","rules"])],64)):z("",!0)}});export{de as default};
