var f=(e,p,a)=>new Promise((d,s)=>{var m=o=>{try{r(a.next(o))}catch(n){s(n)}},t=o=>{try{r(a.throw(o))}catch(n){s(n)}},r=o=>o.done?d(o.value):Promise.resolve(o.value).then(m,t);r((a=a.apply(e,p)).next())});import{aH as C,a as w,b as y,l as $,f as _,o as x,aK as F,p as h,i as l,n as c,t as g,j as k,q as L,b6 as M,c as S,aJ as u}from"./index.bde7963b.js";import{B as I,a as R}from"./index.4b403226.js";import{B as N}from"./BasicForm.948b0243.js";import{u as P}from"./useForm.b21b423d.js";import{u as U}from"./lock.e24f9ae8.js";import{h as V}from"./header.d801b988.js";import"./useWindowSizeFn.ada338ad.js";import"./uniqBy.3333e3da.js";import"./_baseIteratee.34b68bfe.js";import"./index.0103b3aa.js";import"./index.3289c967.js";import"./index.9b1e5ec7.js";import"./index.dcd3d2b7.js";import"./index.18602d99.js";import"./index.bfd670f8.js";import"./index.13318916.js";import"./index.ce7c5e55.js";import"./index.b75cc0a1.js";import"./download.dc299cb5.js";const q=w({name:"LockModal",components:{BasicModal:I,BasicForm:N},setup(){const{t:e}=S(),{prefixCls:p}=y("header-lock-modal"),a=$(),d=U(),s=_(()=>{var i;return(i=a.getUserInfo)==null?void 0:i.nickname}),[m,{closeModal:t}]=R(),[r,{validateFields:o,resetFields:n}]=P({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 B=(yield o()).password;t(),d.setLockInfo({isLock:!0,pwd:B}),yield n()})}const b=_(()=>{const{avatar:i}=a.getUserInfo;return i||V});return{t:e,prefixCls:p,getRealName:s,register:m,registerForm:r,handleLock:v,avatar:b}}}),D=["src"];function j(e,p,a,d,s,m){const t=u("BasicForm"),r=u("a-button"),o=u("BasicModal");return x(),F(o,M({footer:null,title:e.t("layout.header.lockScreen")},e.$attrs,{class:e.prefixCls,onRegister:e.register}),{default:h(()=>[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,D),l("p",{class:c(`${e.prefixCls}__header-name`)},g(e.getRealName),3)],2),k(t,{onRegister:e.registerForm},null,8,["onRegister"]),l("div",{class:c(`${e.prefixCls}__footer`)},[k(r,{type:"primary",block:"",class:"mt-2",onClick:e.handleLock},{default:h(()=>[L(g(e.t("layout.header.lockScreenBtn")),1)]),_:1},8,["onClick"])],2)],2)]),_:1},16,["title","class","onRegister"])}var ne=C(q,[["render",j]]);export{ne as default};
