import{x as f}from"./index-c2dd6a24.js";import{M as d,I as c,F as b,B as V,e as g,b as y}from"./ui-ba7aaa7e.js";import{e as x,r as U,l as B,P as F,a3 as P,a4 as a,f as s,H as k}from"./vue-bf422dc1.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";const q={name:"UserPassword"},D=x({...q,setup(v){const m=U(null),e=B({password:"",new_password:"",new_password2:""}),p={password:[{required:!0,message:"请输入旧密码",type:"error"}],new_password:[{required:!0,message:"请输入新密码",type:"error"}],new_password2:[{required:!0,message:"请重复输入新密码",type:"error"}]},u=async()=>{const l=await m.value.validate();if(typeof l!="object"&&l){if(e.new_password!==e.new_password2){d.error("两次输入的密码不一致");return}const o=await f(e);o.code===1?d.success(o.msg):d.error(o.msg)}};return(l,o)=>{const n=c,t=b,_=V,w=g,i=y;return F(),P(i,{title:"重置密码",bordered:!1},{default:a(()=>[s(w,{ref_key:"form",ref:m,data:e,rules:p,"label-align":"left","label-width":160,onSubmit:u},{default:a(()=>[s(t,{label:"输入旧密码",name:"password"},{default:a(()=>[s(n,{modelValue:e.password,"onUpdate:modelValue":o[0]||(o[0]=r=>e.password=r),placeholder:"请输入旧密码"},null,8,["modelValue"])]),_:1}),s(t,{label:"输入新密码",name:"new_password"},{default:a(()=>[s(n,{modelValue:e.new_password,"onUpdate:modelValue":o[1]||(o[1]=r=>e.new_password=r),placeholder:"输入新密码,9个字符以上"},null,8,["modelValue"])]),_:1}),s(t,{label:"确认新密码",name:"new_password"},{default:a(()=>[s(n,{modelValue:e.new_password2,"onUpdate:modelValue":o[2]||(o[2]=r=>e.new_password2=r),placeholder:"请输入确认新密码"},null,8,["modelValue"])]),_:1}),s(t,null,{default:a(()=>[s(_,{theme:"primary",class:"form-submit-confirm",type:"submit"},{default:a(()=>[k(" 保存 ")]),_:1})]),_:1})]),_:1},8,["data"])]),_:1})}}});export{D as default};
