import{T as v}from"./table.ce855193.js";import{u as h,r as c,a as d,a3 as C,d4 as S,d5 as U,o as b,b as w,e as p,f as x,d6 as z,cI as M}from"./index.ab0d47a4.js";import{c as P,_ as Q}from"./user-modal.cfcef721.js";import T from"./user-search.b47c3e66.js";import{_ as R}from"./_plugin-vue_export-helper.cdc0426e.js";import"./default.76e08716.js";import"./index.49a4d642.js";import"./KeyCode.99f746d5.js";import"./index.58d81b67.js";import"./useState.01763bb3.js";import"./useFlexGapSupport.f5eec5c4.js";import"./index.9c196d1a.js";import"./index.b2c65497.js";import"./index.0857d90f.js";import"./index.b49a664b.js";import"./index.5ec54e89.js";import"./index.cef07818.js";import"./index.8c51b797.js";import"./index.9914bffc.js";import"./index.0e96b1ad.js";import"./index.ced49a81.js";import"./iconUtil.60568eec.js";import"./conf.a6a301e5.js";import"./index.9923b5dc.js";import"./Password.ee3cd4fa.js";import"./role.efebb491.js";import"./useModal.67c34fed.js";import"./useSearch.2eb8f7a1.js";const $={class:"user"},B={__name:"user",setup(D){const u=h();u.$subscribe((e,t)=>{t.isPush&&(s(),t.isPush=!1)});const l=c(!1),n=c([]),r=c(),o=d({title:"",type:""}),a=d({current:1,pageSize:5,total:0,pageSizeOptions:["5","10","50"],showTotal:e=>`\u5171 ${e} \u6761\u6570\u636E`,onChange:(e,t)=>{a.current=e,a.pageSize=t,s()}});C(()=>{s()});const s=(e=null)=>{let t=a.current,m=a.pageSize;l.value?U({offset:t,limit:m,username:e==null?void 0:e.username,nickname:e==null?void 0:e.nickname}).then(i=>{n.value=i.data.items,a.total=i.data.total}):S({offset:t,limit:m}).then(i=>{n.value=i.data.items,a.total=i.data.total})},_=e=>{l.value=!0,s(e)},y=()=>{l.value=!1,u.isPush=!0},f=async e=>{const t=await z(e.id);M(t),s()},g=async()=>{o.title="\u65B0\u589E\u7528\u6237",o.type="create",r.value.showModal=!r.value.showModal},k=async e=>{o.title="\u7F16\u8F91\u7528\u6237",o.type="update",r.value.openModal(e)};return(e,t)=>(b(),w("div",$,[p(T,{onQueryClick:_,onResetClick:y}),p(v,{columns:x(P),"data-source":n.value,pagination:a,"page-name":"user","list-title":"\u7528\u6237\u5217\u8868",onCreateClick:g,onUpdateClick:k,onDeleteClick:f},null,8,["columns","data-source","pagination"]),p(Q,{ref_key:"modalRef",ref:r,"modal-title":o.title,"modal-type":o.type},null,8,["modal-title","modal-type"])]))}},pe=R(B,[["__scopeId","data-v-4a6e3181"]]);export{pe as default};
