选煤厂安全管理系统前端代码
houzhongjian
2024-11-25 37b2044f04a09e89f82f8484279b5f06b7194481
1
import{d as Y,a0 as Z,a8 as J,r as h,u as ee,v as ae,ad as te,a as e,A as le,b as se,o as M,c as oe,C as n,n as T,D as u,a9 as U,k as a,B as l,aa as ne,P as ie,ae as re,g as pe,h as de,a2 as me,O as q,ab as ce,J as ue,ac as fe,y as ge,af as xe,ag as C,ah as he,ai as we,aj as ye,ak as _e,al as be,S as ve,am as Fe,a7 as ke,an as Ve,ao as Ne,ap as Pe,W as Le,E as Se,G as je,aq as Ee,ar as Me,H as Te}from"./index-BP6bNRoi.js";import{_ as Ue}from"./Verify-Caf2Rnns.js";import{_ as qe}from"./XButton-BfzTlH8o.js";import{_ as I}from"./logo-BKeFBQsR.js";import{_ as Ce}from"./login-box-bg-CgotIC_L.js";import{u as v}from"./useIcon-DZqEaX5R.js";import{T as Ie}from"./ThemeSwitch-kktbYEVv.js";import{_ as Re}from"./LocaleDropdown.vue_vue_type_script_setup_true_lang-C1_iMzaR.js";import{u as ze,L as Ge,_ as Oe,a as Ke}from"./LoginFormTitle.vue_vue_type_script_setup_true_lang-BdHKqTBo.js";import{r as F}from"./formRules-9V-NAySD.js";import"./el-dropdown-item-BW-wC9MJ.js";const k=w=>(Se("data-v-717dc502"),w=w(),je(),w),$e={class:"relative mx-auto h-full flex"},Ae={class:"relative flex items-center text-white"},Be=k(()=>n("img",{alt:"",class:"mr-10px h-48px w-48px",src:I},null,-1)),De={class:"text-20px font-bold"},He={class:"h-[calc(100%-60px)] flex items-center justify-center"},Qe=k(()=>n("img",{key:"1",alt:"",class:"w-350px",src:Ce},null,-1)),We={key:"2",class:"text-3xl text-white"},Xe={key:"3",class:"mt-5 text-14px font-normal text-white"},Ye={class:"relative flex-1 p-30px dark:bg-[var(--login-bg-color)] lt-sm:p-10px"},Ze={class:"flex items-center justify-between text-white at-2xl:justify-end at-xl:justify-end"},Je={class:"flex items-center at-2xl:hidden at-xl:hidden"},ea=k(()=>n("img",{alt:"",class:"mr-10px h-48px w-48px",src:I},null,-1)),aa={class:"text-20px font-bold"},ta={class:"flex items-center justify-end space-x-10px"},la={class:"m-auto h-full w-[100%] flex items-center at-2xl:max-w-500px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px"},sa=Te(Y({name:"SocialLogin",__name:"SocialLogin",setup(w){const{t:m}=ue(),r=Z(),V=J(),{getPrefixCls:R}=fe(),N=R("login"),z=v({icon:"ep:house"}),G=v({icon:"ep:avatar"}),O=v({icon:"ep:lock"}),P=h(),{validForm:K}=Ke(P),{getLoginState:$}=ze(),{push:A}=ee(),B=ae(),_=h(!1),L=h(),D=h("blockPuzzle"),H=te(()=>e($)===Ge.LOGIN),Q={tenantName:[F],username:[F],password:[F]},t=le({isShowPassword:!1,captchaEnable:!0,tenantEnable:!0,loginForm:{tenantName:"iailab",username:"admin",password:"admin123",captchaVerification:"",rememberMe:!1}}),S=async()=>{t.captchaEnable?L.value.show():await E({})},j=h();function y(o){return new URL(decodeURIComponent(location.href)).searchParams.get(o)??""}const E=async o=>{var s,p;_.value=!0;try{if(await(async()=>{if(t.tenantEnable){const b=await Ee(t.loginForm.tenantName);Me(b)}})(),!await K())return;let i=y("redirect");const c=y("type"),f=(s=r==null?void 0:r.query)==null?void 0:s.code,g=(p=r==null?void 0:r.query)==null?void 0:p.state,x=await we({username:t.loginForm.username,password:t.loginForm.password,captchaVerification:o.captchaVerification,socialCode:f,socialState:g,socialType:c});if(!x)return;j.value=ye.service({lock:!0,text:"\u6B63\u5728\u52A0\u8F7D\u7CFB\u7EDF\u4E2D...",background:"rgba(0, 0, 0, 0.7)"}),t.loginForm.rememberMe?_e(t.loginForm):be(),C(x),i||(i="/"),i.indexOf("sso")!==-1?window.location.href=window.location.href.replace("/login?redirect=",""):A({path:i||B.addRouters[0].path})}finally{_.value=!1,j.value.close()}};return se(()=>{(()=>{const o=ge();o&&(t.loginForm={...t.loginForm,username:o.username?o.username:t.loginForm.username,password:o.password?o.password:t.loginForm.password,rememberMe:!!o.rememberMe,tenantName:o.tenantName?o.tenantName:t.loginForm.tenantName})})(),(async()=>{var o,s;try{const p=y("type"),i=y("redirect"),c=(o=r==null?void 0:r.query)==null?void 0:o.code,f=(s=r==null?void 0:r.query)==null?void 0:s.state,g=await xe(p,c,f);C(g),he.push({path:i||"/"})}catch{}})()}),(o,s)=>{const p=ve,i=Fe,c=ke,f=Ve,g=Ne,x=Pe,b=qe,W=Ue,X=Le;return M(),oe("div",{class:T([e(N),"relative h-[100%] lt-xl:bg-[var(--login-bg-color)] lt-md:px-10px lt-sm:px-10px lt-xl:px-10px"])},[n("div",$e,[n("div",{class:T(`${e(N)}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden`)},[n("div",Ae,[Be,n("span",De,u(e(U)(e(V).getTitle)),1)]),n("div",He,[a(ne,{appear:"","enter-active-class":"animate__animated animate__bounceInLeft",tag:"div"},{default:l(()=>[Qe,n("div",We,u(e(m)("login.welcome")),1),n("div",Xe,u(e(m)("login.message")),1)]),_:1})])],2),n("div",Ye,[n("div",Ze,[n("div",Je,[ea,n("span",aa,u(e(U)(e(V).getTitle)),1)]),n("div",ta,[a(e(Ie)),a(e(Re),{class:"dark:text-white lt-xl:text-white"})])]),a(ce,{appear:"","enter-active-class":"animate__animated animate__bounceInRight"},{default:l(()=>[n("div",la,[ie(a(X,{ref_key:"formLogin",ref:P,model:e(t).loginForm,rules:Q,class:"login-form","label-position":"top","label-width":"120px",size:"large"},{default:l(()=>[a(x,{style:{"margin-right":"-10px","margin-left":"-10px"}},{default:l(()=>[a(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(p,null,{default:l(()=>[a(Oe,{style:{width:"100%"}})]),_:1})]),_:1}),a(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[e(t).tenantEnable?(M(),pe(p,{key:0,prop:"tenantName"},{default:l(()=>[a(c,{modelValue:e(t).loginForm.tenantName,"onUpdate:modelValue":s[0]||(s[0]=d=>e(t).loginForm.tenantName=d),placeholder:e(m)("login.tenantNamePlaceholder"),"prefix-icon":e(z),link:"",type:"primary"},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})):de("",!0)]),_:1}),a(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(p,{prop:"username"},{default:l(()=>[a(c,{modelValue:e(t).loginForm.username,"onUpdate:modelValue":s[1]||(s[1]=d=>e(t).loginForm.username=d),placeholder:e(m)("login.usernamePlaceholder"),"prefix-icon":e(G)},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),a(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(p,{prop:"password"},{default:l(()=>[a(c,{modelValue:e(t).loginForm.password,"onUpdate:modelValue":s[2]||(s[2]=d=>e(t).loginForm.password=d),placeholder:e(m)("login.passwordPlaceholder"),"prefix-icon":e(O),"show-password":"",type:"password",onKeyup:s[3]||(s[3]=me(d=>S(),["enter"]))},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),a(i,{span:24,style:{"padding-right":"10px","padding-left":"10px","margin-top":"-20px","margin-bottom":"-20px"}},{default:l(()=>[a(p,null,{default:l(()=>[a(x,{justify:"space-between",style:{width:"100%"}},{default:l(()=>[a(i,{span:6},{default:l(()=>[a(f,{modelValue:e(t).loginForm.rememberMe,"onUpdate:modelValue":s[4]||(s[4]=d=>e(t).loginForm.rememberMe=d)},{default:l(()=>[q(u(e(m)("login.remember")),1)]),_:1},8,["modelValue"])]),_:1}),a(i,{offset:6,span:12},{default:l(()=>[a(g,{style:{float:"right"},type:"primary"},{default:l(()=>[q(u(e(m)("login.forgetPassword")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),a(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(p,null,{default:l(()=>[a(b,{loading:e(_),title:e(m)("login.login"),class:"w-[100%]",type:"primary",onClick:s[5]||(s[5]=d=>S())},null,8,["loading","title"])]),_:1})]),_:1}),a(W,{ref_key:"verify",ref:L,captchaType:e(D),imgSize:{width:"400px",height:"200px"},mode:"pop",onSuccess:E},null,8,["captchaType"])]),_:1})]),_:1},8,["model"]),[[re,e(H)]])])]),_:1})])])],2)}}}),[["__scopeId","data-v-717dc502"]]);export{sa as default};