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