import{d as w,B as y,C as v,u as F,h as i,Y as $,r as n,o as k,f as q,w as a,b as e,a as C,t as f,k as R,s as B,l as E,a2 as N,a5 as U,E as D}from"./index.e3896b23.js";import{a as K}from"./validate.14f7b19b.js";import{c as S}from"./tabs.5c15e0e9.js";const T=w({name:"ProfilePassword"}),j=w({...T,setup(A){const c=y(),_=v(),{t:u}=F(),p=i(null),o=$({password:"",newPassword:"",confirmPassword:""}),P=i({password:[{required:!0,message:u("required"),trigger:"blur"}],newPassword:[{required:!0,validator:K,trigger:"blur"}],confirmPassword:[{required:!0,message:u("required"),trigger:"blur"}]}),m=()=>{p.value.validate(r=>{if(!r)return!1;U(o).then(()=>{D.success("\u4FEE\u6539\u6210\u529F"),S(c,_)})})};return(r,s)=>{const t=n("el-form-item"),d=n("el-input"),b=n("el-button"),V=n("el-form"),g=n("el-card");return k(),q(g,null,{default:a(()=>[e(V,{ref_key:"dataFormRef",ref:p,model:o,rules:P.value,"label-width":"200px",onKeyup:s[3]||(s[3]=N(l=>m(),["enter"]))},{default:a(()=>[e(t,{label:r.$t("profile.username")},{default:a(()=>[C("span",null,f(R(B).userStore.user.username),1)]),_:1},8,["label"]),e(t,{prop:"password",label:r.$t("profile.oldPassword")},{default:a(()=>[e(d,{modelValue:o.password,"onUpdate:modelValue":s[0]||(s[0]=l=>o.password=l),type:"password"},null,8,["modelValue"])]),_:1},8,["label"]),e(t,{prop:"newPassword",label:r.$t("profile.newPassword")},{default:a(()=>[e(d,{modelValue:o.newPassword,"onUpdate:modelValue":s[1]||(s[1]=l=>o.newPassword=l),type:"password"},null,8,["modelValue"])]),_:1},8,["label"]),e(t,{prop:"confirmPassword",label:r.$t("profile.confirmPassword")},{default:a(()=>[e(d,{modelValue:o.confirmPassword,"onUpdate:modelValue":s[2]||(s[2]=l=>o.confirmPassword=l),type:"password"},null,8,["modelValue"])]),_:1},8,["label"]),e(t,null,{default:a(()=>[e(b,{type:"primary",onClick:m},{default:a(()=>[E(f(r.$t("confirm")),1)]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})}}});export{j as default};
