LoginFormTitle.c7dbb9c6.js 2.4 KB

1
  1. var v=Object.defineProperty;var F=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var h=(e,t,o)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,p=(e,t)=>{for(var o in t||(t={}))w.call(t,o)&&h(e,o,t[o]);if(F)for(var o of F(t))x.call(t,o)&&h(e,o,t[o]);return e};var m=(e,t,o)=>new Promise((s,a)=>{var d=n=>{try{i(o.next(n))}catch(r){a(r)}},f=n=>{try{i(o.throw(n))}catch(r){a(r)}},i=n=>n.done?s(n.value):Promise.resolve(n.value).then(d,f);i((o=o.apply(e,t)).next())});import{s as I,f as c,c as O,i as l,a as T,o as S,h as j,t as B}from"./index.7e08ba81.js";var P=(e=>(e[e.LOGIN=0]="LOGIN",e[e.REGISTER=1]="REGISTER",e[e.RESET_PASSWORD=2]="RESET_PASSWORD",e[e.MOBILE=3]="MOBILE",e[e.QR_CODE=4]="QR_CODE",e))(P||{});const y=I(0);function C(){function e(s){y.value=s}const t=c(()=>y.value);function o(){e(0)}return{setLoginState:e,getLoginState:t,handleBackLogin:o}}function k(e){function t(){return m(this,null,function*(){const o=l(e);return o?yield o.validate():void 0})}return{validForm:t}}function A(e){const{t}=O(),o=c(()=>R(t("sys.login.accountPlaceholder"))),s=c(()=>R(t("sys.login.passwordPlaceholder"))),a=c(()=>R(t("sys.login.smsPlaceholder"))),d=c(()=>R(t("sys.login.mobilePlaceholder"))),f=(r,u)=>m(this,null,function*(){return u?Promise.resolve():Promise.reject(t("sys.login.policyPlaceholder"))}),i=r=>(u,g)=>m(this,null,function*(){return g?g!==r?Promise.reject(t("sys.login.diffPwd")):Promise.resolve():Promise.reject(t("sys.login.passwordPlaceholder"))});return{getFormRules:c(()=>{const r=l(o),u=l(s),g=l(a),b=l(d),_={sms:g,mobile:b};switch(l(y)){case 1:return p({account:r,password:u,confirmPassword:[{validator:i(e==null?void 0:e.password),trigger:"change"}],policy:[{validator:f,trigger:"change"}]},_);case 2:return p({account:r},_);case 3:return _;default:return{account:r,password:u}}})}}function R(e){return[{required:!0,message:e,trigger:"change"}]}const E={class:"mb-3 text-2xl font-bold text-center xl:text-3xl enter-x xl:text-left"},G=T({__name:"LoginFormTitle",setup(e){const{t}=O(),{getLoginState:o}=C(),s=c(()=>({[P.LOGIN]:t("sys.login.signInFormTitle"),[P.QR_CODE]:t("sys.login.qrSignInFormTitle")})[l(o)]);return(a,d)=>(S(),j("h2",E,B(s.value),1))}});var N=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"}));export{P as L,G as _,A as a,k as b,N as c,C as u};