1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d229a09"],{ddf9:function(e,a,r){"use strict";r.r(a);var s=function(){var e=this,a=e._self._c;return a("a-modal",{staticStyle:{top:"20px"},attrs:{title:"重新设定密码",width:800,visible:e.visible,confirmLoading:e.confirmLoading,cancelText:"关闭"},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[a("a-spin",{attrs:{spinning:e.confirmLoading}},[a("a-form",{attrs:{form:e.form}},[a("a-form-item",{attrs:{label:"用户账号",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["username",{}],expression:"[ 'username', {}]"}],attrs:{placeholder:"请输入用户账号",readOnly:!0}})],1),a("a-form-item",{attrs:{label:"登陆密码",labelCol:e.labelCol,wrapperCol:e.wrapperCol,hasFeedback:""}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",e.validatorRules.password],expression:"[ 'password', validatorRules.password]"}],attrs:{type:"password",placeholder:"请输入登陆密码"}})],1),a("a-form-item",{attrs:{label:"确认密码",labelCol:e.labelCol,wrapperCol:e.wrapperCol,hasFeedback:""}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["confirmpassword",e.validatorRules.confirmpassword],expression:"[ 'confirmpassword', validatorRules.confirmpassword]"}],attrs:{type:"password",placeholder:"请重新输入登陆密码"},on:{blur:e.handleConfirmBlur}})],1)],1)],1)],1)},o=[],i=r("4ec3"),t={name:"PasswordModal",data:function(){return{visible:!1,confirmLoading:!1,confirmDirty:!1,validatorRules:{password:{rules:[{required:!0,pattern:/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,message:"密码由8位数字、大小写字母和特殊符号组成!"},{validator:this.validateToNextPassword}]},confirmpassword:{rules:[{required:!0,message:"请重新输入登陆密码!"},{validator:this.compareToFirstPassword}]}},model:{},labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},form:this.$form.createForm(this)}},created:function(){},methods:{show:function(e){var a=this;this.form.resetFields(),this.visible=!0,this.model.username=e,this.$nextTick((function(){a.form.setFieldsValue({username:e})}))},close:function(){this.$emit("close"),this.visible=!1,this.disableSubmit=!1,this.selectedRole=[]},handleSubmit:function(){var e=this;this.form.validateFields((function(a,r){if(!a){e.confirmLoading=!0;var s=Object.assign(e.model,r);Object(i["g"])(s).then((function(a){a.success?(e.$message.success(a.message),e.$emit("ok")):e.$message.warning(a.message)})).finally((function(){e.confirmLoading=!1,e.close()}))}}))},handleCancel:function(){this.close()},validateToNextPassword:function(e,a,r){var s=this.form,o=s.getFieldValue("confirmpassword");a&&o&&a!==o&&r("两次输入的密码不一样!"),a&&this.confirmDirty&&s.validateFields(["confirm"],{force:!0}),r()},compareToFirstPassword:function(e,a,r){var s=this.form;a&&a!==s.getFieldValue("password")?r("两次输入的密码不一样!"):r()},handleConfirmBlur:function(e){var a=e.target.value;this.confirmDirty=this.confirmDirty||!!a}}},l=t,n=r("2877"),d=Object(n["a"])(l,s,o,!1,null,null,null);a["default"]=d.exports}}]);
|