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-CDWW6V_M.js";import{C as N}from"./index-BZ9ST2iq.js";import O from"./LoginFormTitle-Bwlk5a95.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-B_2CoVdl.js";import"./useCountdown-ImUE7YaG.js";import"./index-D2AmS0aU.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useFormItemSingle-DM34aWgK.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};
