import{f as z}from"./user-2cd65a42.js";import{p as P}from"./global-0d825ba6.js";import{u as w}from"./index-8db2df2c.js";import{T as U,L as D,j as K,f as B}from"./ui-ba7aaa7e.js";import{e as I,r as l,d as L,P as i,a3 as r,a4 as a,f as m,H as c}from"./vue-bf422dc1.js";const N={name:"UserSearch"},F=I({...N,emits:["success"],setup(V,{expose:_,emit:v}){const g=v,h=e=>{g("success",e),s.value=!1},y=[{colKey:"id",title:"ID"},{colKey:"username",title:"账号"},{colKey:"operate",title:"选择"}],t=l({defaultPageSize:20,total:0,defaultCurrent:1}),n=l([]),u=l(0),f=async()=>{const{data:e}=await z({page:t.value.defaultCurrent,limit:t.value.defaultPageSize,noUser:u.value});n.value=e.list,t.value={...t.value,total:e.total}},k=e=>{t.value.defaultCurrent=e.current,t.value.defaultPageSize=e.pageSize,f()},x=w(),b=L(()=>({offsetTop:x.isUseTabsRouter?48:0,container:`.${P}-layout`})),s=l(!1);return _({init:e=>{u.value=e,f(),s.value=!0}}),(e,d)=>{const p=U,C=D,S=K,T=B;return i(),r(T,{visible:s.value,"onUpdate:visible":d[0]||(d[0]=o=>s.value=o),"close-on-overlay-click":!1,"destroy-on-close":!0,header:"选择上级用户","close-on-esc-keydown":!1,footer:!1},{default:a(()=>[m(S,{data:n.value,columns:y,"row-key":"id",hover:n.value.length>0,pagination:t.value,"header-affixed-top":b.value,"table-layout":"auto","max-height":"100%",onPageChange:k},{status:a(({row:o})=>[o.status===1?(i(),r(p,{key:0,theme:"success"},{default:a(()=>[c("启用")]),_:1})):(i(),r(p,{key:1,theme:"danger"},{default:a(()=>[c("禁用")]),_:1}))]),operate:a(({row:o})=>[m(C,{theme:"primary",size:"small",onClick:j=>h(o.id)},{default:a(()=>[c("选择")]),_:2},1032,["onClick"])]),_:1},8,["data","hover","pagination","header-affixed-top"])]),_:1},8,["visible"])}}});export{F as _};
