import{d as f,Z as y,j as h,ai as v,o as i,c as l,a as m,T as r,F as C,a8 as k,I as x,J as S,U as z,R as B}from"./vue.adf17aba.js";import{_ as D}from"./_plugin-vue_export-helper.c27b6911.js";const P={class:"item-com"},b={class:"item-com-title"},w=["onClick"],I={key:0,class:"item-com-pagination"},N=f({__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=y({current:"",page:1,limit:20,data:[],total:10}),p=()=>{c("fetchData",{page:t.page,limit:t.limit},e=>{(e==null?void 0:e.code)===2e3&&(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 h(()=>{p()}),(e,o)=>{const _=v("el-pagination");return i(),l("div",P,[m("p",b,r(n.title),1),m("ul",{class:"item-com-list",style:S({height:s.showPagination?"calc(100% - 75px)":"calc(100% - 45px)"})},[(i(!0),l(C,null,k(t.data,a=>(i(),l("li",{key:a[n.value],onClick:U=>g(a),class:x(t.current===a[n.value]?"item-com-item active":"item-com-item")},r(a[n.label]),11,w))),128))],4),s.showPagination?(i(),l("div",I,[z(_,{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"])])):B("",!0)])}}});const j=D(N,[["__scopeId","data-v-98323c74"]]);export{j as default};
