import{C as e,D as s,y as r,G as a}from"./element-plus-DSMJnpwa.js";import"./index-mv7arXuk.js";/* empty css                     */import{b as o}from"./index-C9waQ9oZ.js";import{B as l,g as d,H as t,I as u,O as w,M as m,u as n,Y as p,d as i}from"./vue-vendor-DZekML78.js";const g=l({__name:"resetPwd",setup(l){const{proxy:g}=d(),P=i(),f=i({oldPassword:"",newPassword:"",confirmPassword:""}),c=i({oldPassword:[{required:!0,message:"旧密码不能为空",trigger:"blur"}],newPassword:[{required:!0,message:"新密码不能为空",trigger:"blur"},{min:6,max:20,message:"长度在 6 到 20 个字符",trigger:"blur"},{pattern:/^[^<>"'|\\]+$/,message:"不能包含非法字符：< > \" ' \\ |",trigger:"blur"}],confirmPassword:[{required:!0,message:"确认密码不能为空",trigger:"blur"},{required:!0,validator:(e,s,r)=>{f.value.newPassword!==s?r(new Error("两次输入的密码不一致")):r()},trigger:"blur"}]}),b=()=>{P.value?.validate(async e=>{e&&(await o(f.value.oldPassword,f.value.newPassword),g?.$modal.msgSuccess("修改成功"))})},_=()=>{g?.$tab.closePage()};return(o,l)=>{const d=s,i=e,g=r,y=a;return t(),u(y,{ref_key:"pwdRef",ref:P,model:n(f),rules:n(c),"label-width":"80px"},{default:w(()=>[m(i,{label:"旧密码",prop:"oldPassword"},{default:w(()=>[m(d,{modelValue:n(f).oldPassword,"onUpdate:modelValue":l[0]||(l[0]=e=>n(f).oldPassword=e),placeholder:"请输入旧密码",type:"password","show-password":""},null,8,["modelValue"])]),_:1}),m(i,{label:"新密码",prop:"newPassword"},{default:w(()=>[m(d,{modelValue:n(f).newPassword,"onUpdate:modelValue":l[1]||(l[1]=e=>n(f).newPassword=e),placeholder:"请输入新密码",type:"password","show-password":""},null,8,["modelValue"])]),_:1}),m(i,{label:"确认密码",prop:"confirmPassword"},{default:w(()=>[m(d,{modelValue:n(f).confirmPassword,"onUpdate:modelValue":l[2]||(l[2]=e=>n(f).confirmPassword=e),placeholder:"请确认新密码",type:"password","show-password":""},null,8,["modelValue"])]),_:1}),m(i,null,{default:w(()=>[m(g,{type:"primary",onClick:b},{default:w(()=>[...l[3]||(l[3]=[p("保存",-1)])]),_:1}),m(g,{type:"danger",onClick:_},{default:w(()=>[...l[4]||(l[4]=[p("关闭",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});export{g as _};
