import{T as h}from"./table.ce855193.js";import{g as R,q as S,d as b}from"./role.efebb491.js";import{c as x,_ as z}from"./role-modal.b5f7d15c.js";import Q from"./role-search.a10c3ca3.js";import{u as T,r as p,a as d,a3 as w,b0 as M,o as P,b as $,e as c,f as m,cI as q}from"./index.ab0d47a4.js";import{_ as B}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"./menu.5caae388.js";import"./useModal.67c34fed.js";import"./useSearch.2eb8f7a1.js";const D={class:"role"},I={__name:"role",setup(E){T().$subscribe((t,e)=>{e.isPush&&(a(),e.isPush=!1)});const l=p(!1),r=p([]),o=d({current:1,pageSize:5,total:0,pageSizeOptions:["5","10","50"],showTotal:t=>`\u5171 ${t} \u6761\u6570\u636E`,onChange:(t,e)=>{o.current=t,o.pageSize=e,a()}});w(()=>{a()});const a=(t=null)=>{let e=o.current,u=o.pageSize;l.value?S({offset:e,limit:u,name:t==null?void 0:t.name}).then(i=>{r.value=i.data.items,o.total=i.data.total}):R({offset:e,limit:u}).then(i=>{r.value=i.data.items,o.total=i.data.total})},_=t=>{l.value=!0,a(t)},f=()=>{l.value=!1,a()},g=async t=>{const e=await b(t.id);q(e),a()},n=p(),s=d({title:"",type:""}),y=()=>{s.title="\u65B0\u589E\u89D2\u8272",s.type="create",n.value.showModal=!0},v=t=>{s.title="\u7F16\u8F91\u89D2\u8272",s.type="update",n.value.openModal(t)},{title:k,type:C}=M(s);return(t,e)=>(P(),$("div",D,[c(Q,{onQueryClick:_,onResetClick:f}),c(h,{columns:m(x),"data-source":r.value,pagination:o,"page-name":"role","list-title":"\u89D2\u8272\u5217\u8868",onCreateClick:y,onUpdateClick:v,onDeleteClick:g},null,8,["columns","data-source","pagination"]),c(z,{ref_key:"modalRef",ref:n,"modal-title":m(k),"modal-type":m(C)},null,8,["modal-title","modal-type"])]))}},_t=B(I,[["__scopeId","data-v-fa550a68"]]);export{_t as default};
