resetPassword.17053ee9.js 3.4 KB

1
  1. import{_ as N,d as S,v as U,w as f,ad as C,b6 as q,b7 as I,b8 as R,z as j,r as n,al as k,H as G,o as H,G as O,C as l,l as s,M as g,au as D,y as $}from"./index.1d5f2f42.js";import{c as J}from"./index.00fd5a1f.js";const K=S({__name:"resetPassword",props:{itemId:{type:String,default:""},showModel:{type:Boolean,default:!1}},emits:["cancel","refresh"],setup(A,{emit:B}){const _=A,{logout:y}=U(),h=f("default"),p=f(),t=f(!1),m=f(""),r=C({id:"",password:"",confirmPassword:""}),x=C({password:[{required:!0,validator:(o,e,u)=>{e===""?u(new Error("\u65B0\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A\uFF01")):q(e)?e.length<6||e.length>16?u(new Error("\u65B0\u5BC6\u7801\u4E3A6-16\u4F4D\u6570\u5B57\u5B57\u6BCD\u7EC4\u5408\uFF01")):I(e)?u(new Error("\u65B0\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7EAF\u6570\u5B57\uFF01")):R(e)?u(new Error("\u65B0\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7EAF\u5B57\u6BCD\uFF01")):u():u(new Error("\u65B0\u5BC6\u7801\u4E3A6-16\u4F4D\u6570\u5B57\u5B57\u6BCD\u7EC4\u5408\uFF01"))},trigger:"blur"}],confirmPassword:[{required:!0,validator:(o,e,u)=>{e===""?u(new Error("\u786E\u8BA4\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A\uFF01")):r.password!==e?u(new Error("\u786E\u8BA4\u5BC6\u7801\u4E0E\u65B0\u5BC6\u7801\u4E0D\u4E00\u81F4\uFF01")):u()},trigger:"blur"}]}),V=async o=>{!o||await o.validate(async(e,u)=>{if(e){if(i.value===!0)return;i.value=!0;let c=Object.assign({},r);c.id=m.value;const{code:a,message:w}=await J(c);i.value=!1,a===0?(D.success("\u5BC6\u7801\u4FEE\u6539\u6210\u529F\uFF01"),t.value=!1,B("refresh")):a>100&&a<140?(t.value=!1,y()):D.error(w)}})},P=async o=>{!o||(o.clearValidate(),o.resetFields(),await $(async()=>{r.id=m.value,r.password="",r.confirmPassword=""}))},F=()=>{t.value=!1,B("cancel")},i=f(!0),v=f("");async function b(){i.value=!0,v.value="\u4FEE\u6539\u5BC6\u7801",await P(p.value),i.value=!1}return j(()=>_.showModel,()=>{const{showModel:o,itemId:e}=_;t.value=o,t.value&&(m.value=e,b())}),(o,e)=>{const u=n("el-input"),c=n("el-form-item"),a=n("el-col"),w=n("el-row"),E=n("el-button"),M=n("el-form"),z=n("el-dialog"),T=k("loading");return G((H(),O(z,{"close-on-press-escape":!1,"close-on-click-modal":!1,modelValue:t.value,"onUpdate:modelValue":e[3]||(e[3]=d=>t.value=d),"append-to-body":"",width:"900px",title:v.value,onClose:F},{default:l(()=>[s(M,{ref_key:"ruleFormRef",ref:p,model:r,rules:x,"label-width":"90px",style:{"margin-top":"-10px"},class:"demo-ruleForm",size:h.value,"status-icon":""},{default:l(()=>[s(w,null,{default:l(()=>[s(a,{span:8},{default:l(()=>[s(c,{label:"\u65B0\u5BC6\u7801",prop:"password"},{default:l(()=>[s(u,{modelValue:r.password,"onUpdate:modelValue":e[0]||(e[0]=d=>r.password=d),placeholder:"\u65B0\u5BC6\u7801"},null,8,["modelValue"])]),_:1})]),_:1}),s(a,{span:8},{default:l(()=>[s(c,{label:"\u786E\u8BA4\u5BC6\u7801",prop:"confirmPassword"},{default:l(()=>[s(u,{modelValue:r.confirmPassword,"onUpdate:modelValue":e[1]||(e[1]=d=>r.confirmPassword=d),maxlength:11,placeholder:"\u786E\u8BA4\u5BC6\u7801"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),s(a,{span:24,class:"clear"},{default:l(()=>[s(E,{type:"primary",class:"fr",style:{margin:"0 0 0 16px"},onClick:e[2]||(e[2]=d=>V(p.value))},{default:l(()=>[g("\u4FDD\u5B58")]),_:1}),s(E,{class:"fr",style:{margin:"0 0 0 16px"},onClick:F},{default:l(()=>[g("\u5173\u95ED")]),_:1})]),_:1})]),_:1},8,["model","rules","size"])]),_:1},8,["modelValue","title"])),[[T,i.value]])}}});var X=N(K,[["__file","D:/work/rep-v3/report-v3/src/views/interest/companyAccount-origin/resetPassword.vue"]]);export{X as default};