import{e as z,r,d as y,a2 as N,M as V,P as d,a3 as u,a4 as t,a7 as C,ab as M,A as m,f as n,B as A,I as F,H as _,a9 as I}from"./vue-bf422dc1.js";import{_ as L,l as j,d as H}from"./edit.vue_vue_type_script_setup_true_lang-5c715297.js";import{p as U}from"./global-0d825ba6.js";import{u as q}from"./index-8db2df2c.js";import{_ as E}from"./search.vue_vue_type_script_setup_true_lang-2b811a8e.js";import{M as G,B as J,p as O,L as Q,S as W,a as X,b as Y}from"./ui-ba7aaa7e.js";import"./index.vue_vue_type_script_setup_true_lang-b9ebc9cb.js";import"./config-3b189d83.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";const Z=[{colKey:"id",title:"ID"},{colKey:"username",title:"用户名"},{colKey:"avatar",title:"头像"},{colKey:"nickname",title:"昵称"},{colKey:"created_at",title:"创建时间"},{colKey:"operate",title:"操作"}],ee={class:"category-header c-flex"},_e=z({__name:"index",setup(ae){const l=r(!1),k=y(()=>l.value?"收起搜索":"展开搜索"),s=r({defaultPageSize:20,total:0,defaultCurrent:1}),p=r([]),c=r(),i=async(a={})=>{c.value={...a};const{data:e}=await j({page:s.value.defaultCurrent,limit:s.value.defaultPageSize,...c.value});p.value=e.list,s.value.total=e.total};i();const x=a=>{s.value.defaultCurrent=a.current,s.value.defaultPageSize=a.pageSize,i(c.value)},S=q(),b=y(()=>({offsetTop:S.isUseTabsRouter?48:0,container:`.${U}-layout`})),v=r(),h=(a=0)=>{var e;(e=v.value)==null||e.init(a)},w=async a=>{const{data:e}=await H({id:a});e.code===1&&(G.success("删除成功"),i(c.value))};return(a,e)=>{const B=J,D=O,R=N("wp-image"),g=Q,$=W,K=X,P=Y,f=V("perms");return d(),u(P,{title:"管理员管理",class:"basic-container",bordered:!1},{actions:t(()=>[C("a",{href:"javascript:void(0)",onClick:e[0]||(e[0]=o=>l.value=!l.value)},M(k.value),1)]),default:t(()=>[C("div",ee,[m(n(E,{ref:"searchFormRef",onSuccess:i},null,512),[[A,l.value]])]),n(K,{ref:"tableRef","row-key":"id",data:p.value,columns:F(Z),hover:p.value.length>0,"header-affixed-top":b.value,pagination:s.value,"lazy-load":"","table-layout":"auto","max-height":"auto",onPageChange:x},{topContent:t(()=>[m((d(),u(B,{theme:"primary",onClick:e[1]||(e[1]=o=>h())},{default:t(()=>[_("添加")]),_:1})),[[f,["adminapi/permission/admin/add"]]]),n(D)]),avatar:t(({row:o})=>[n(R,{src:o.avatar,style:{width:"60px",height:"60px"},shape:"circle"},null,8,["src"])]),operate:t(({row:o})=>[n($,null,{default:t(()=>[m((d(),u(g,{theme:"primary",hover:"color",onClick:T=>h(o.id)},{default:t(()=>[_("编辑")]),_:2},1032,["onClick"])),[[f,["adminapi/permission/admin/edit"]]]),o.id!=1?m((d(),u(g,{key:0,theme:"danger",hover:"color",onClick:T=>w(o.id)},{default:t(()=>[_("删除")]),_:2},1032,["onClick"])),[[f,["adminapi/permission/admin/del"]]]):I("",!0)]),_:2},1024)]),_:1},8,["data","columns","hover","header-affixed-top","pagination"]),n(L,{ref_key:"editRef",ref:v,onSuccess:i},null,512)]),_:1})}}});export{_e as default};
