import{k as e,a9 as a,r,Q as l,ak as t,c as p,w as o,O as u,s as d,F as s}from"./base-lib.js?v=20260328163632";import{aU as i,l as n}from"./utils-lib.js?v=20260328163632";import{y as v}from"./naive-ui.js?v=20260328163632";const c=e({name:"BtPagination",props:{type:{type:String,default:"default",required:!1},row:{type:Number,default:10},page:{type:Number,default:1},total:{type:Number,default:0},displayOrder:{type:Array,default:["pages","size-picker","quick-jumper"],required:!1},pageSizes:{type:Array,default:()=>[10,20,50,100],required:!1},isEnd:{type:Boolean,default:!1,required:!1}},emits:["change","update:page","update:row"],setup(e,{emit:c,attrs:g}){var b;const{row:x,page:m,total:y,isEnd:f}=a(e),k=r(!0),h=l(),z="".concat(null==h?void 0:h.fullPath.replace(/\//g,"_")),S=t(z,x.value||e.pageSizes[0]),w=p((()=>k.value?S.value:x.value)),q=r(null==(b=null==e?void 0:e.pageSizes)?void 0:b.map((e=>i(e)?e:{label:"".concat(e,"条 / 页"),value:e})));o((()=>x.value),(e=>{c("update:row",e),c("change")})),o((()=>m.value),(e=>{c("update:page",e),c("change")}));const j=e=>{S.value=e,x.value=e,e!==x.value&&c("update:row",e),c("update:page",1)},C=e=>{c("update:page",e)};return()=>u(s,null,["default"===e.type?u(v,d({pageSize:w.value,"onUpdate:pageSize":e=>w.value=e,page:m.value,"onUpdate:page":[e=>m.value=e,C],pageSizes:q.value,"display-order":e.displayOrder,itemCount:y.value,goto:()=>n("前往"),"onUpdate:page-size":j},g),null):u("div",{class:"flex items-center h-[28px]"},[m.value>1&&u(s,null,[u("span",{class:"bt-link !border-solid !border-1 !border-[var(--border-color-25)] !px-[10px] !h-[28px] leading-[28px] text-center",onClick:()=>C(1)},[n("首页")]),u("span",{class:"bt-link !border-solid !border-1 !border-[var(--border-color-25)] !px-[10px] !h-[28px] leading-[28px] text-center",onClick:()=>C(m.value-1)},[n("上一页")])]),y.value>0&&y.value>=x.value&&!f.value&&u("span",{class:"bt-link !border-solid !border-1 !border-[var(--border-color-25)] !px-[10px] !h-[28px] leading-[28px] text-center",onClick:()=>C(m.value+1)},[n("下一页")]),u("span",{class:"!border-solid !border-1 !border-[var(--border-color-25)] !px-[10px] !h-[28px] leading-[28px] text-center"},[n("第 {0} 页",[m.value])])])])}});export{c as B};
