import{C as e,r as a,c as t,P as l,S as r,R as n,u as s,F as o,a0 as u,J as i,N as d}from"./chunk-BRI0aX6c.js";import{u as c}from"./chunk-DwkOxDMO.js";import{b as p}from"./souav-I_ihqEhP.js";const b={class:"flex w-full flex-row items-center justify-center space-x-2"},v=["disabled"],x=["disabled"],f={class:"flex h-8 flex-1 items-center justify-center rounded-[3px] border bg-transparent"},g={class:"text-base font-medium"},m={class:"flex h-8 flex-1 items-center justify-center space-x-0.5"},y=["max"],w=["disabled"],h=["disabled"],P=p(e({__name:"PaginationView",props:{totalPage:{},pageSize:{default:10},currentPage:{default:1}},emits:["update:currentPage"],setup(e,{emit:p}){const P=e,j=p,k=a(P.currentPage),C=a(null),N=P.totalPage,_=()=>{1!==k.value&&(k.value=1,j("update:currentPage",1))},q=()=>{k.value>1&&(k.value--,j("update:currentPage",k.value))},S=()=>{k.value<N&&(k.value++,j("update:currentPage",k.value))},V=()=>{k.value!==N&&(k.value=N,j("update:currentPage",N))},z=()=>{C.value&&C.value>=1&&C.value<=N&&(k.value=C.value,j("update:currentPage",C.value),C.value=null)},F=c();return t(()=>{var e;(null==(e=F.query)?void 0:e.pageNo)?k.value=Number(F.query.pageNo):k.value=1}),(e,a)=>(d(),l("div",b,[r("button",{onClick:_,disabled:1===k.value,class:"flex h-8 w-8 bg-transparent items-center justify-center rounded-[3px] border transition-colors disabled:cursor-not-allowed disabled:opacity-50"},a[1]||(a[1]=[r("i",{class:"iconfont icon-previous-page text-lg"},null,-1)]),8,v),r("button",{onClick:q,disabled:1===k.value,class:"flex h-8 w-8 bg-transparent items-center justify-center rounded-[3px] border transition-colors disabled:cursor-not-allowed disabled:opacity-50"},a[2]||(a[2]=[r("i",{class:"iconfont icon-arrowleft text-lg"},null,-1)]),8,x),r("div",f,[r("span",g,n(k.value)+" / "+n(s(N)),1)]),r("div",m,[o(r("input",{type:"number","onUpdate:modelValue":a[0]||(a[0]=e=>C.value=e),onKeyup:i(z,["enter"]),min:"1",max:s(N),class:"h-8 flex-grow rounded-[3px] border bg-transparent text-center focus:outline-none placeholder-gray-500 text-[14px]",placeholder:"页码"},null,40,y),[[u,C.value,void 0,{number:!0}]]),r("button",{onClick:z,class:"h-8 w-8 bg-transparent rounded-[3px] border transition-colors"},"Go")]),r("button",{onClick:S,disabled:k.value===s(N),class:"flex h-8 w-8 bg-transparent items-center justify-center rounded-[3px] border transition-colors disabled:cursor-not-allowed disabled:opacity-50"},a[3]||(a[3]=[r("i",{class:"iconfont icon-arrowright text-lg"},null,-1)]),8,w),r("button",{onClick:V,disabled:k.value===s(N),class:"flex h-8 w-8 bg-transparent items-center justify-center rounded-[3px] border transition-colors disabled:cursor-not-allowed disabled:opacity-50"},a[4]||(a[4]=[r("i",{class:"iconfont icon-next-pages text-lg"},null,-1)]),8,h)]))}}),[["__scopeId","data-v-17cc2951"]]);export{P};
