var f=(e,d,o)=>new Promise((p,r)=>{var m=s=>{try{a(o.next(s))}catch(n){r(n)}},t=s=>{try{a(o.throw(s))}catch(n){r(n)}},a=s=>s.done?p(s.value):Promise.resolve(s.value).then(m,t);a((o=o.apply(e,d)).next())});import{u as $,an as w,v as y,_ as F}from"./index.js";import{B as L,a as M}from"./index-8a6826ba.js";import{B as S,u as I}from"./useForm-baba730a.js";import{u as N}from"./lock-a170f962.js";import{h as R}from"./header-b90f4bbc.js";import{d as b,c as _,Z as P,a4 as U,a5 as g,a9 as V,a6 as u,$ as c,a1 as i,a0 as k,k as h,G as D}from"./vue-72a104e4.js";import"./antd-0679333d.js";import"./useWindowSizeFn-1db11f4f.js";import"./copyTextToClipboard-3ca69a78.js";const G=b({name:"LockModal",components:{BasicModal:L,BasicForm:S},setup(){const{t:e}=y(),{prefixCls:d}=$("header-lock-modal"),o=w(),p=N(),r=_(()=>{var l;return(l=o.getUserInfo)==null?void 0:l.realName}),[m,{closeModal:t}]=M(),[a,{validateFields:s,resetFields:n}]=I({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 s()).password;t(),p.setLockInfo({isLock:!0,pwd:C}),yield n()})}const B=_(()=>{const{avatar:l}=o.getUserInfo;return l||R});return{t:e,prefixCls:d,getRealName:r,register:m,registerForm:a,handleLock:v,avatar:B}}});const q=["src"];function z(e,d,o,p,r,m){const t=u("BasicForm"),a=u("a-button"),s=u("BasicModal");return P(),U(s,V({footer:null,title:e.t("layout.header.lockScreen")},e.$attrs,{class:e.prefixCls,onRegister:e.register}),{default:g(()=>[c("div",{class:i(`${e.prefixCls}__entry`)},[c("div",{class:i(`${e.prefixCls}__header`)},[c("img",{src:e.avatar,class:i(`${e.prefixCls}__header-img`)},null,10,q),c("p",{class:i(`${e.prefixCls}__header-name`)},k(e.getRealName),3)],2),h(t,{onRegister:e.registerForm},null,8,["onRegister"]),c("div",{class:i(`${e.prefixCls}__footer`)},[h(a,{type:"primary",block:"",class:"mt-2",onClick:e.handleLock},{default:g(()=>[D(k(e.t("layout.header.lockScreenBtn")),1)]),_:1},8,["onClick"])],2)],2)]),_:1},16,["title","class","onRegister"])}const W=F(G,[["render",z]]);export{W as default};
