2 lines
6.1 KiB
JavaScript
2 lines
6.1 KiB
JavaScript
var C=(e,p,n)=>new Promise((l,i)=>{var c=s=>{try{o(n.next(s))}catch(a){i(a)}},r=s=>{try{o(n.throw(s))}catch(a){i(a)}},o=s=>s.done?l(s.value):Promise.resolve(s.value).then(c,r);o((n=n.apply(e,p)).next())});import{a as P,o as d,j as w,B as h,p as u,k as f,aF as L,cu as b,gB as F,q as S,cX as $,ba as v,bu as B,aO as O,b as R,c as U,s as A,f as x,aE as m,h as N,l as M,i as g,n as _,t as V,F as q}from"./index.54dd8fb6.js";import{c as D,u as T}from"./index.47bc7150.js";import{a as j,B as z,b as G}from"./index.3d3b0af9.js";import{h as H}from"./header.d801b988.js";import{u as W,B as X}from"./useForm.f7045c13.js";import{m as I}from"./md5.f384781d.js";import"./FullscreenOutlined.8d4d7491.js";import"./index.be495fab.js";import"./useWindowSizeFn.c58342cc.js";import"./useContentViewHeight.a8a28318.js";import"./uniqBy.7d39eb72.js";import"./_baseIteratee.b0a0a030.js";import"./get.0e1df90e.js";import"./index.d7ed52fa.js";import"./index.55393af1.js";import"./useRefs.d5419e97.js";import"./PlusOutlined.979e64f2.js";import"./RedoOutlined.47152d84.js";import"./index.bddd7109.js";import"./lock.34275ba2.js";import"./index.532acd66.js";import"./index.613f50d0.js";import"./useSize.05d6b1d9.js";import"./index.b274985b.js";import"./index.0951859d.js";import"./Checkbox.842af2a5.js";import"./index.73863928.js";import"./index.21d4868f.js";import"./index.6f073bc9.js";import"./index.be3e543c.js";import"./index.12f47237.js";import"./index.484fd188.js";import"./eagerComputed.1aeded3e.js";import"./transButton.d2ae3ef9.js";import"./index.f92b3679.js";import"./_baseEach.7eb9b630.js";import"./download.98ecc8d8.js";import"./index.601f20d9.js";import"./dateUtil.e0bfcbbd.js";const J=P({__name:"passwordModel",emits:["success","register"],setup(e,{emit:p}){const n=[{field:"password",label:"\u5BC6\u7801",required:!0,component:"InputPassword"},{field:"password_confirmation",label:"\u786E\u8BA4\u5BC6\u7801",required:!0,component:"InputPassword"}],[l,{resetFields:i,validate:c}]=W({labelWidth:80,baseColProps:{span:24},schemas:n,showActionButtonGroup:!1,actionColOptions:{span:23}}),[r,{setModalProps:o,closeModal:s}]=j(()=>C(this,null,function*(){i(),o({confirmLoading:!1})}));function a(){return C(this,null,function*(){try{const t=yield c();if(t.password_confirmation!==t.password)return b.error("\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4");o({confirmLoading:!0}),t.password=I(t.password),t.password_confirmation=I(t.password_confirmation),yield F(t),s(),p("success")}finally{o({confirmLoading:!1})}})}return(t,y)=>(d(),w(f(z),L(t.$attrs,{onRegister:f(r),title:"\u4FEE\u6539\u5BC6\u7801",onOk:a}),{default:h(()=>[u(f(X),{onRegister:f(l)},null,8,["onRegister"])]),_:1},16,["onRegister"]))}});const K=P({name:"UserDropdown",components:{Dropdown:$,Menu:v,MenuItem:D(()=>B(()=>import("./DropMenuItem.da253c70.js"),["assets/DropMenuItem.da253c70.js","assets/index.54dd8fb6.js","assets/index.5586d7eb.css"])),MenuDivider:v.Divider,LockAction:D(()=>B(()=>import("./LockModal.38a06815.js"),["assets/LockModal.38a06815.js","assets/LockModal.0068f88c.css","assets/index.54dd8fb6.js","assets/index.5586d7eb.css","assets/index.3d3b0af9.js","assets/index.d0b877f3.css","assets/useWindowSizeFn.c58342cc.js","assets/FullscreenOutlined.8d4d7491.js","assets/useForm.f7045c13.js","assets/useForm.3d990c10.css","assets/index.532acd66.js","assets/index.251e5d3f.css","assets/index.613f50d0.js","assets/index.a18cc309.css","assets/_baseIteratee.b0a0a030.js","assets/get.0e1df90e.js","assets/useSize.05d6b1d9.js","assets/index.b274985b.js","assets/index.3a3c1369.css","assets/index.0951859d.js","assets/index.a3d94619.css","assets/Checkbox.842af2a5.js","assets/index.73863928.js","assets/index.b889af8e.css","assets/index.21d4868f.js","assets/index.614d3a6c.css","assets/index.6f073bc9.js","assets/index.49ada229.css","assets/index.be3e543c.js","assets/index.47f7c782.css","assets/index.12f47237.js","assets/index.579bd49e.css","assets/index.484fd188.js","assets/index.7b8b5e30.css","assets/eagerComputed.1aeded3e.js","assets/transButton.d2ae3ef9.js","assets/index.f92b3679.js","assets/index.0ec4bbd2.css","assets/useRefs.d5419e97.js","assets/_baseEach.7eb9b630.js","assets/download.98ecc8d8.js","assets/index.601f20d9.js","assets/dateUtil.e0bfcbbd.js","assets/uniqBy.7d39eb72.js","assets/lock.34275ba2.js","assets/header.d801b988.js"])),PasswordModel:J},props:{theme:O.oneOf(["dark","light"])},setup(){const{prefixCls:e}=R("header-user-dropdown"),{t:p}=U(),{getShowDoc:n,getUseLockPage:l}=T(),i=A(),c=x(()=>{const{name:k="",avatar:E}=i.getUserInfo||{};return{name:k,avatar:E||H}}),[r,{openModal:o}]=G();function s(){o(!0)}function a(){i.confirmLoginOut()}function t(){b.success("\u64CD\u4F5C\u6210\u529F")}function y(k){switch(k.key){case"logout":a();break;case"setPassword":o(!0);break;case"lock":s();break}}return{prefixCls:e,t:p,getUserInfo:c,handleMenuClick:y,getShowDoc:n,register:r,getUseLockPage:l,handleSuccessModel:t}}}),Q=["src"];function Y(e,p,n,l,i,c){const r=m("MenuItem"),o=m("MenuDivider"),s=m("Menu"),a=m("Dropdown"),t=m("PasswordModel");return d(),N(q,null,[u(a,{placement:"bottomLeft",overlayClassName:`${e.prefixCls}-dropdown-overlay`},{overlay:h(()=>[u(s,{onClick:e.handleMenuClick},{default:h(()=>[u(r,{key:"setPassword",text:"\u4FEE\u6539\u5BC6\u7801",icon:"ion:settings-outline"}),u(o),e.getShowDoc?(d(),w(r,{key:"doc",text:e.t("layout.header.dropdownItemDoc"),icon:"ion:document-text-outline"},null,8,["text"])):M("",!0),e.getShowDoc?(d(),w(o,{key:1})):M("",!0),e.getUseLockPage?(d(),w(r,{key:"lock",text:e.t("layout.header.tooltipLock"),icon:"ion:lock-closed-outline"},null,8,["text"])):M("",!0),u(r,{key:"logout",text:e.t("layout.header.dropdownItemLoginOut"),icon:"ion:power-outline"},null,8,["text"])]),_:1},8,["onClick"])]),default:h(()=>[g("span",{class:_([[e.prefixCls,`${e.prefixCls}--${e.theme}`],"flex"])},[g("img",{class:_(`${e.prefixCls}__header`),src:e.getUserInfo.avatar},null,10,Q),g("span",{class:_(`${e.prefixCls}__info hidden md:block`)},[g("span",{class:_([`${e.prefixCls}__name `,"truncate"])},V(e.getUserInfo.name),3)],2)],2)]),_:1},8,["overlayClassName"]),u(t,{onRegister:e.register,onSuccess:e.handleSuccessModel},null,8,["onRegister","onSuccess"])],64)}var Ne=S(K,[["render",Y]]);export{Ne as default};
|