import{d as h,r as C,o as _,b as y,e as i,f as l,s as m,j as v,A as r,F as k,k as x,p as S,g as b,t as z}from"./vue.BxlDVA1H.js";import{_ as B}from"./_plugin-vue_export-helper.DlAUqK2U.js";const D={class:"item-com"},P={class:"item-com-title"},w=["onClick"],N={key:0,class:"item-com-pagination"},V=h({__name:"index",props:{type:{type:String,default:"role"},title:{type:String,default:"标题"},label:{type:String,default:"name"},value:{type:String,default:"id"},showPagination:{type:Boolean,default:!1}},emits:["fetchData","itemClick"],setup(s,{emit:d}){const n=s,c=d,t=C({current:"",page:1,limit:20,data:[],total:10}),p=()=>{c("fetchData",{page:t.page,limit:t.limit},e=>{(e==null?void 0:e.code)===2e4&&(t.data=e.data,t.total=(e==null?void 0:e.total)||10)})},g=e=>{t.current=e[n.value],c("itemClick",n.type,e)},u=e=>{t.page=e,p()};return _(()=>{p()}),(e,o)=>{const f=y("el-pagination");return l(),i("div",D,[m("p",P,r(n.title),1),m("ul",{class:"item-com-list",style:S({height:s.showPagination?"calc(100% - 75px)":"calc(100% - 45px)"})},[(l(!0),i(k,null,x(t.data,a=>(l(),i("li",{key:a[n.value],onClick:F=>g(a),class:z(t.current===a[n.value]?"item-com-item active":"item-com-item")},r(a[n.label]),11,w))),128))],4),s.showPagination?(l(),i("div",N,[b(f,{background:"",small:"","hide-on-single-page":"","current-page":t.page,"onUpdate:currentPage":o[0]||(o[0]=a=>t.page=a),"page-size":t.limit,"onUpdate:pageSize":o[1]||(o[1]=a=>t.limit=a),layout:"prev, pager, next","pager-count":5,total:t.total,onCurrentChange:u},null,8,["current-page","page-size","total"])])):v("",!0)])}}}),j=B(V,[["__scopeId","data-v-700132b3"]]);export{j as default};
