var p=(i,r,s)=>new Promise((c,a)=>{var n=e=>{try{m(s.next(e))}catch(o){a(o)}},t=e=>{try{m(s.throw(e))}catch(o){a(o)}},m=e=>e.done?c(e.value):Promise.resolve(e.value).then(n,t);m((s=s.apply(i,r)).next())});import{bh as _,b8 as h,bi as b,c0 as P}from"./bootstrap-Bqxdt4iG.js";import{a1 as d,P as g,E as f,ap as S,aj as w,p as u,a9 as l,ak as x,ax as V,L as k,ai as v}from"../jse/index-index-BUJ_4tQs.js";const y=d({__name:"password-setting",props:{formSchema:{default:()=>[]}},emits:["submit"],setup(i,{expose:r,emit:s}){const c=i,a=s,[n,t]=_(g({commonConfig:{componentProps:{class:"w-full"}},layout:"horizontal",schema:f(()=>c.formSchema),showDefaultActions:!1}));function m(){return p(this,null,function*(){const{valid:e}=yield t.validate(),o=yield t.getValues();e&&a("submit",o)})}return r({getFormApi:()=>t}),(e,o)=>(w(),S("div",null,[u(l(n)),u(l(h),{type:"submit",class:"mt-4",onClick:m},{default:x(()=>[...o[0]||(o[0]=[V(" 更新密码 ",-1)])]),_:1})]))}}),A=d({__name:"password-setting",setup(i){const r=k(),s=f(()=>[{fieldName:"oldPassword",label:"旧密码",component:"VbenInputPassword",componentProps:{placeholder:"请输入旧密码"}},{fieldName:"newPassword",label:"新密码",component:"VbenInputPassword",componentProps:{passwordStrength:!0,placeholder:"请输入新密码"}},{fieldName:"confirmPassword",label:"确认密码",component:"VbenInputPassword",componentProps:{passwordStrength:!0,placeholder:"请再次输入新密码"},dependencies:{rules(a){const{newPassword:n}=a;return b({required_error:"请再次输入新密码"}).min(1,{message:"请再次输入新密码"}).refine(t=>t===n,{message:"两次输入的密码不一致"})},triggerFields:["newPassword"]}}]);function c(){P.success("密码修改成功")}return(a,n)=>(w(),v(l(y),{ref_key:"profilePasswordSettingRef",ref:r,class:"w-1/3","form-schema":s.value,onSubmit:c},null,8,["form-schema"]))}});export{A as _};
