var g=(e,o,t)=>new Promise((c,r)=>{var i=s=>{try{a(t.next(s))}catch(m){r(m)}},p=s=>{try{a(t.throw(s))}catch(m){r(m)}},a=s=>s.done?c(s.value):Promise.resolve(s.value).then(i,p);a((t=t.apply(e,o)).next())});import{d as F,f as P,r as k,J as y,U as d,a2 as B,ad as C,af as u,k as n,G as v}from"./vue-vendor-CxLCUzY4.js";import{j as I,a5 as b,B as h}from"./antd-vue-vendor-CahNzUUa.js";import{S as D}from"./index-D6H6KsT6.js";import{bC as S,bE as j,bG as E,u as M,K as R,_ as z}from"./index-Cy4uayzW.js";import"./vxe-table-vendor-Cdi8WfTx.js";const N=F({name:"step2",components:{Button:h,Form:b,FormItem:b.Item,InputPassword:I.Password,Input:I,StrengthMeter:D},props:{accountInfo:{type:Object,default:()=>({})}},emits:["prevStep","nextStep"],setup(e,{emit:o}){const{t}=R(),{createErrorModal:c}=M(),{accountInfo:r}=e,i=P(),p=k({username:r.obj.username||"",password:"",confirmPassword:""}),{getFormRules:a}=S(p),{validForm:s}=j(i);function m(){o("prevStep",r.obj)}function w(){return g(this,null,function*(){const f=yield s();if(!f)return;const l=yield E(y({username:f.username,password:f.password,smscode:r.obj.smscode,phone:r.obj.phone}));l.success?o("nextStep",r.obj):c({title:t("sys.api.errorTip"),content:l.message||t("sys.api.networkExceptionMsg")})})}return{t,formRef:i,formData:p,getFormRules:a,handleNext:w,handlePrev:m}}});function _(e,o,t,c,r,i){const p=d("Input"),a=d("FormItem"),s=d("StrengthMeter"),m=d("InputPassword"),w=d("Button"),f=d("Form");return B(),C(f,{class:"p-4 enter-x",model:e.formData,rules:e.getFormRules,ref:"formRef"},{default:u(()=>[n(a,{name:"username",class:"enter-x"},{default:u(()=>[n(p,{size:"large",value:e.formData.username,"onUpdate:value":o[0]||(o[0]=l=>e.formData.username=l),placeholder:e.t("sys.login.userName"),disabled:""},null,8,["value","placeholder"])]),_:1}),n(a,{name:"password",class:"enter-x"},{default:u(()=>[n(s,{size:"large",value:e.formData.password,"onUpdate:value":o[1]||(o[1]=l=>e.formData.password=l),placeholder:e.t("sys.login.password")},null,8,["value","placeholder"])]),_:1}),n(a,{name:"confirmPassword",class:"enter-x"},{default:u(()=>[n(m,{size:"large",visibilityToggle:"",value:e.formData.confirmPassword,"onUpdate:value":o[2]||(o[2]=l=>e.formData.confirmPassword=l),placeholder:e.t("sys.login.confirmPassword")},null,8,["value","placeholder"])]),_:1}),n(a,{class:"enter-x"},{default:u(()=>[n(w,{type:"primary",size:"large",block:"",onClick:e.handlePrev},{default:u(()=>o[3]||(o[3]=[v(" 上一步 ")])),_:1},8,["onClick"]),n(w,{size:"large",block:"",class:"mt-4",onClick:e.handleNext},{default:u(()=>o[4]||(o[4]=[v(" 下一步 ")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model","rules"])}const A=z(N,[["render",_]]);export{A as default};
