| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d5c2a"],{7050:function(t,e,n){"use strict";n.r(e);var c=function(){var t=this,e=t._self._c;return e("div",{staticClass:"cl-sms-btn"},[t._t("reference",(function(){return[e("el-button",{attrs:{size:"small"},on:{click:t.openForm}},[t._v(t._s(t.count==t.count2?"获取验证码":t.count2+"s后重试"))])]})),e("x-form",{ref:"x-form"})],2)},a=[],r=n("1ac7"),o=n("ee85"),s=n("da6a"),i=(n("1ae1"),{props:{count:{type:Number,default:60}},data:function(){var t=this.count;return{timer:null,svg:"",captchaId:"",loading:!1,count2:t}},methods:{getCaptcha:function(){var t=this;return Object(s["a"])(Object(o["a"])().mark((function e(){var n,c,a;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loading=!0,e.next=3,t.$service.common.captcha({height:40,width:120});case 3:n=e.sent,c=n.data,a=n.captchaId,t.svg=c,t.captchaId=a,t.loading=!1;case 9:case"end":return e.stop()}}),e)})))()},openForm:function(){var t=this;return Object(s["a"])(Object(o["a"])().mark((function e(){var n;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.$createElement,t.count2==t.count){e.next=3;break}return e.abrupt("return",!1);case 3:n=t,t.$refs["x-form"].open({props:{title:"图片验证码",width:"400px"},items:[{prop:"code",component:{name:"image-code",data:function(){return{code:""}},mounted:function(){n.getCaptcha()},watch:{code:function(t){this.$emit("input",t)}},render:function(){var t=this,e=arguments[0];return e("el-row",{attrs:{type:"flex"},directives:[{name:"loading",value:n.loading}]},[e("el-input",{attrs:{maxlength:"4"},style:{width:"240px"},model:{value:t.code,callback:function(e){t.code=e}}}),e("div",{class:"svg",on:{click:n.getCaptcha},style:{height:"30px",width:"120px",position:"relative",top:"-10px"},domProps:Object(r["a"])({},{innerHTML:n.svg})})])}},rules:[{required:!0,message:"图片验证码不能为空"},{min:4,max:4,message:"图片验证码为4个字符",trigger:"blur"}]}],on:{submit:function(e,n){t.$message.success("发送短信验证码成功"),n(),t.send(),t.$emit("success",t.captchaId)}}});case 5:case"end":return e.stop()}}),e)})))()},send:function(){var t=this;this.count2=this.count-1,this.timer=setInterval((function(){t.count2-=1,t.count2<=0&&(t.count2=t.count,clearInterval(t.timer))}),1e3)}}}),u=i,l=n("1805"),p=Object(l["a"])(u,c,a,!1,null,null,null);e["default"]=p.exports}}]);
|