import{ay as p,b as u,d as c,_ as d,c as m,e as z,f,h}from"./index.0308b213.js";let r={};function V(e){console.log(e);const{page:t=1,size:i=15,callback:l,params:s={}}=e;r=Object.assign({},p(s));const n=u({page:t,size:i,loading:!1,count:0,lists:[]}),o=()=>n.loading?Promise.reject():(n.loading=!0,l({page_no:n.page,page_size:n.size,...s}).then(a=>(n.count=a==null?void 0:a.count,n.lists=a==null?void 0:a.lists,Promise.resolve(a))).catch(a=>Promise.reject(a)).finally(()=>{n.loading=!1}));return{pager:n,requestApi:o,resetParams:()=>{Object.keys(r).forEach(a=>{s[a]=r[a]}),o()},resetPage:()=>{n.page=1,o()}}}const C=c({components:{},props:{modelValue:{type:Object,default:()=>({})},pageSizes:{type:Array,default:()=>[10,20,30,40]},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"}},emits:["change"],setup(e,{emit:t}){return{sizeChange:()=>{e.modelValue.page=1,t("change")},pageChange:()=>{t("change")}}}});const y={class:"pagination"};function P(e,t,i,l,s,n){const o=m("el-pagination");return z(),f("div",y,[h(o,{currentPage:e.modelValue.page,"onUpdate:currentPage":t[0]||(t[0]=g=>e.modelValue.page=g),pageSize:e.modelValue.size,"onUpdate:pageSize":t[1]||(t[1]=g=>e.modelValue.size=g),"page-sizes":e.pageSizes,layout:e.layout,total:e.modelValue.count,"hide-on-single-page":"",onSizeChange:e.sizeChange,onCurrentChange:e.pageChange},null,8,["currentPage","pageSize","page-sizes","layout","total","onSizeChange","onCurrentChange"])])}const v=d(C,[["render",P]]);export{v as P,V as u};
