2 lines
2.5 KiB
JavaScript
2 lines
2.5 KiB
JavaScript
var f=(e,p,s)=>new Promise((m,r)=>{var d=o=>{try{a(s.next(o))}catch(n){r(n)}},t=o=>{try{a(s.throw(o))}catch(n){r(n)}},a=o=>o.done?m(o.value):Promise.resolve(o.value).then(d,t);a((s=s.apply(e,p)).next())});import{aG as w,a as y,b as $,l as F,f as _,aI as u,o as I,aJ as L,p as g,i as l,n as c,t as k,j as h,q as M,b5 as S,c as b}from"./index.6cd5baf8.js";import{B as R,a as N}from"./index.9b423250.js";import{B as P}from"./BasicForm.98897bf6.js";import{u as U}from"./useForm.35bc34f9.js";import{u as V}from"./lock.5d844c3d.js";import{h as q}from"./header.d801b988.js";import"./useWindowSizeFn.b111f681.js";import"./FullscreenOutlined.5e472b7c.js";import"./index.52ee3ac2.js";import"./index.c21d4698.js";import"./_baseIteratee.4c0536c1.js";import"./index.e9e97d48.js";import"./index.bd69fa8a.js";import"./index.58f2ee69.js";import"./index.45440705.js";import"./index.7717c432.js";import"./index.b5298110.js";import"./index.63db07a3.js";import"./uniqBy.7ebdfad5.js";import"./download.8885bb3e.js";import"./index.a4d3410c.js";const D=y({name:"LockModal",components:{BasicModal:R,BasicForm:P},setup(){const{t:e}=b(),{prefixCls:p}=$("header-lock-modal"),s=F(),m=V(),r=_(()=>{var i;return(i=s.getUserInfo)==null?void 0:i.nickname}),[d,{closeModal:t}]=N(),[a,{validateFields:o,resetFields:n}]=U({showActionButtonGroup:!1,schemas:[{field:"password",label:e("layout.header.lockScreenPassword"),colProps:{span:24},component:"InputPassword",required:!0}]});function v(){return f(this,null,function*(){const C=(yield o()).password;t(),m.setLockInfo({isLock:!0,pwd:C}),yield n()})}const B=_(()=>{const{avatar:i}=s.getUserInfo;return i||q});return{t:e,prefixCls:p,getRealName:r,register:d,registerForm:a,handleLock:v,avatar:B}}}),G=["src"];function j(e,p,s,m,r,d){const t=u("BasicForm"),a=u("a-button"),o=u("BasicModal");return I(),L(o,S({footer:null,title:e.t("layout.header.lockScreen")},e.$attrs,{class:e.prefixCls,onRegister:e.register}),{default:g(()=>[l("div",{class:c(`${e.prefixCls}__entry`)},[l("div",{class:c(`${e.prefixCls}__header`)},[l("img",{src:e.avatar,class:c(`${e.prefixCls}__header-img`)},null,10,G),l("p",{class:c(`${e.prefixCls}__header-name`)},k(e.getRealName),3)],2),h(t,{onRegister:e.registerForm},null,8,["onRegister"]),l("div",{class:c(`${e.prefixCls}__footer`)},[h(a,{type:"primary",block:"",class:"mt-2",onClick:e.handleLock},{default:g(()=>[M(k(e.t("layout.header.lockScreenBtn")),1)]),_:1},8,["onClick"])],2)],2)]),_:1},16,["title","class","onRegister"])}var le=w(D,[["render",j]]);export{le as default};
|