var d=(w,n,r)=>new Promise((p,o)=>{var f=e=>{try{i(r.next(e))}catch(t){o(t)}},a=e=>{try{i(r.throw(e))}catch(t){o(t)}},i=e=>e.done?p(e.value):Promise.resolve(e.value).then(f,a);i((r=r.apply(w,n)).next())});import{d as v,f as u,a2 as I,ad as N,af as k,k as x,u as m,ag as C}from"./vue-vendor-CxLCUzY4.js";import{rules as F}from"./validator-CyHCj96y.js";import{bI as L,K as S,a8 as q,u as E,h as O}from"./index-Cy4uayzW.js";import{B as V}from"./index-zKZnG1QC.js";import{u as $,B as j}from"./useForm-DfoT2G6J.js";import"./user.api-CoaMxYm2.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./componentMap-0iK4HQBq.js";import"./useFormItem-IOFWTdED.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";const Se=v({__name:"UpdatePassword",emits:["register"],setup(w,{expose:n,emit:r}){const p=L(),{t:o}=S(),f=r,a=E(),i=u(),e=u(""),t=u(o("layout.changePassword.changePassword")),[h,{resetFields:P,validate:y,clearValidate:M}]=$({schemas:[{label:o("layout.changePassword.oldPassword"),field:"oldpassword",component:"InputPassword",required:!0},{label:o("layout.changePassword.newPassword"),field:"password",component:"StrengthMeter",componentProps:{placeholder:o("layout.changePassword.pleaseEnterNewPassword")},rules:[{required:!0,message:o("layout.changePassword.pleaseEnterNewPassword")}]},{label:o("layout.changePassword.confirmNewPassword"),field:"confirmpassword",component:"InputPassword",dynamicRules:({values:s})=>F.confirmPassword(s,!0)}],showActionButtonGroup:!1,wrapperCol:null,labelWidth:p.getLocale=="zh_CN"?100:160}),[_,{setModalProps:l,closeModal:b}]=q();function B(){return d(this,null,function*(){try{const s=yield y();l({confirmLoading:!0});let g=Object.assign({username:m(e)},s);O.put({url:"/sys/user/updatePassword",params:g},{isTransformResponse:!1}).then(c=>{c.success?(a.createMessage.success(c.message),b()):a.createMessage.warning(c.message)})}finally{l({confirmLoading:!1})}})}function R(s){return d(this,null,function*(){if(s)e.value=s,yield l({visible:!0}),yield P(),yield M();else{a.createMessage.warning("当前系统无登录用户!");return}})}return n({title:t,show:R}),(s,g)=>(I(),N(m(V),C(s.$attrs,{onRegister:m(_),title:t.value,onOk:B,width:"600px"}),{default:k(()=>[x(j,{onRegister:m(h)},null,8,["onRegister"])]),_:1},16,["onRegister","title"]))}});export{Se as default};
