import{a,aa as e,O as l}from"./index-d4baa715.js";function t(t){const u=a({pageNo:1,pageSize:10}),n=a({}),s=a([]),v=a(0),i=a(!1);async function o(){if(!i.value)try{i.value=!0;const a=await t.request({...u.value,...n.value});s.value=[...s.value,...a.list],v.value=a.total}finally{i.value=!1}}async function r(){s.value.length>=v.value||(u.value.pageNo++,await o())}async function c(){u.value.pageNo=1,v.value=0,s.value=[],await o()}return e((async()=>{0!==v.value&&s.value.length<v.value&&await r()})),l((async()=>{t.load&&await c()})),{page:u,otherParams:n,list:s,total:v,loading:i,getList:o,pageAdd:r,refreshPage:c,refreshAllParams:async function(){n.value={},u.value.pageNo=1,v.value=0,s.value=[],await o()}}}export{t as u};
