CaptchaModal-DppAXRv_.js 4.2 KB

1
  1. var h=(e,s,i)=>new Promise((l,p)=>{var c=t=>{try{n(i.next(t))}catch(o){p(o)}},m=t=>{try{n(i.throw(t))}catch(o){p(o)}},n=t=>t.done?l(t.value):Promise.resolve(t.value).then(c,m);n((i=i.apply(e,s)).next())});import{d as v,f as F,r as I,ag as C,aB as S,ar as f,aD as y,k,at as w,aq as B}from"./vue-vendor-Be68asQ6.js";import{B as b}from"./index-CETWS1o0.js";import"./index-D68l__AG.js";import{i as R}from"./checkcode-DLY3GIII.js";import{ac as q,u as D,bV as K,j as $,a as j}from"./index-BFfnEkVs.js";import{B as x}from"./BasicForm-Cv-dsB-e.js";import{u as O}from"./useForm-kcRIHoe0.js";import"./BasicModal-D4gc2R81.js";import"./antd-vue-vendor-DcqS7Wvq.js";import"./useTimeout-Ca5eqGu-.js";import"./vxe-table-vendor-DHF2TRpV.js";import"./useWindowSizeFn-BTSGGcie.js";import"./index-BZ_MXCtW.js";import"./index-BIPzXG41.js";import"./index-CXEQnmRq.js";import"./useIntersectionObserver-Bl62RIZ4.js";import"./componentMap-BUTAcOmo.js";import"./useFormItem-CtGMPcLp.js";import"./download-CjoX0_mR.js";import"./base64Conver-24EVOS6V.js";import"./index-D1703ozz.js";import"./index-Bi7PIj53.js";import"./useCountdown-B7iR27pS.js";import"./useFormItemSingle-nLM0QlcI.js";import"./JSelectUser-DCwPqRxp.js";import"./props-BPxWJPuD.js";import"./JSelectBiz-Be8KsC5j.js";import"./JAddInput-BBXQvvpq.js";import"./areaDataUtil-Cik-Rc_P.js";import"./index-BOEzG86y.js";import"./index-BNFwynfr.js";import"./bem-BvvqSl-N.js";import"./props-Cw7AfxGV.js";import"./useContextMenu-BDwmjIwb.js";import"./depart.api-CDwTvdwQ.js";import"./JSelectDept-DT6g7V5M.js";import"./JPopup-DKJW27Yk.js";import"./JEllipsis-C04xKxcI.js";import"./JUpload-cB_Qj2H2.js";import"./index-iuayQczx.js";import"./index-DJQB4_Pr.js";import"./JAreaLinkage-BNOKwn5l.js";import"./JCodeEditor-CSivhUhT.js";import"./htmlmixed-DNSd26j0.js";import"./vue-DbzutmLn.js";/* empty css */import"./EasyCronInput-wCv2YMHn.js";const V=v({name:"CaptchaModal",components:{BasicModal:b,BasicForm:x},emits:["ok","register"],setup(e,{emit:s}){const i=F("验证码"),l=[{field:"captcha",component:"Input",label:"图片验证码",rules:[{required:!0}],slot:"captchaSlot"}],[p,{resetFields:c,validate:m}]=O({schemas:l,showActionButtonGroup:!1,baseRowStyle:{"justify-content":"center",display:"grid","margin-top":"10px"},rowProps:{justify:"center"},labelCol:{span:24},wrapperCol:{span:24}}),[n,{setModalProps:t,closeModal:o}]=q(u=>h(null,null,function*(){t({confirmLoading:!0}),yield c(),yield d(),t({confirmLoading:!1})})),a=I({randCodeImage:"",requestCodeSuccess:!1,checkKey:-1}),{createMessage:r}=D();function d(){return h(this,null,function*(){yield c(),a.checkKey=new Date().getTime()+Math.random().toString(36).slice(-4),K(a.checkKey).then(u=>{a.randCodeImage=u,a.requestCodeSuccess=!0})})}function M(){return h(this,null,function*(){let u=yield m();$.post({url:"/sys/smsCheckCaptcha",params:{captcha:u.captcha,checkKey:a.checkKey}},{isTransformResponse:!1}).then(g=>{g.success?(s("ok"),o()):(r.warning(g.message),d())}).catch(g=>{r.warning(g.message),d()})})}function _(){o()}return{title:i,registerForm:p,registerModal:n,handleSubmit:M,handleCancel:_,randCodeData:a,codeImage:R,getCaptchaCode:d}}}),A={style:{width:"100%",display:"flex"}},E={class:"margin-left10"},H=["src"],L=["src"];function N(e,s,i,l,p,c){const m=C("a-input"),n=C("BasicForm"),t=C("BasicModal");return f(),S(t,{onRegister:e.registerModal,width:"450px",minHeight:100,title:e.title,onOk:e.handleSubmit,destroyOnClose:"",canFullscreen:!1},{default:y(()=>[k(n,{onRegister:e.registerForm},{captchaSlot:y(({model:o,field:a})=>[w("div",A,[k(m,{style:{width:"200px"},value:o[a],"onUpdate:value":r=>o[a]=r,placeholder:"请输入图片验证码"},null,8,["value","onUpdate:value"]),w("div",E,[e.randCodeData.requestCodeSuccess?(f(),B("img",{key:0,class:"pointer",style:{"margin-top":"2px","max-width":"initial",height:"30px"},src:e.randCodeData.randCodeImage,onClick:s[0]||(s[0]=(...r)=>e.getCaptchaCode&&e.getCaptchaCode(...r))},null,8,H)):(f(),B("img",{key:1,class:"pointer",style:{"margin-top":"2px","max-width":"initial",height:"30px"},src:e.codeImage,onClick:s[1]||(s[1]=(...r)=>e.getCaptchaCode&&e.getCaptchaCode(...r))},null,8,L))])])]),_:1},8,["onRegister"])]),_:1},8,["onRegister","title","onOk"])}const Ve=j(V,[["render",N],["__scopeId","data-v-6cdbc9e8"]]);export{Ve as default};