import{q as a,bJ as e,ac as t,f as n,ct as u,M as l}from"./index-545c1a76.js";const i=10,o=1,v=10;function c(c,s=!0){const g=a(),r=a(o),f=a(i),d=a(v),m=a({});s&&(m.value=Object.assign({page:r.value,limit:f.value}));const p=a(!0);function h(){r.value>=100&&(p.value=!0),t.get(c,n(m)).then((a=>{var e;b(),a.data.code===u.SUCCESS?(g.value=a.data,d.value=null==(e=g.value)?void 0:e.total):l.error(a.data.message)})).finally((()=>{b()}))}function b(){p.value=!1}function j(){h()}function S(){r.value=1}return e("paginate",{page:r,limit:f,total:d,changePage:function(a){r.value=a,m.value.page=a,j()},changeLimit:function(a){f.value=a,S(),m.value.page=1,m.value.limit=a,j()}}),{data:g,query:m,search:j,reset:function(){S(),s&&(m.value=Object.assign({page:r.value,limit:f.value})),h()},loading:p}}export{c as u};
