import{d as E,r as f,G as b,g as s,J as H,c as g,k as o,K as I,e as a,z,w as n,t as p,x as h,b as U,l as W,L as $,_ as j}from"./index-CUnFTKV2.js";const G={class:"welfarehouse-table"},J={class:"image-error"},K={key:1,class:"no-image"},L={key:0,class:"url-text"},q={key:1,class:"no-image"},A=E({__name:"WelfareHouseTable",props:{data:{},loading:{type:Boolean},total:{},page:{},pageSize:{}},emits:["page-change","size-change","edit","delete","status-change"],setup(r,{emit:C}){const d=r,c=C,u=f(d.page),_=f(d.pageSize);b(()=>d.page,t=>{u.value=t}),b(()=>d.pageSize,t=>{_.value=t});const k=t=>{c("page-change",t)},w=t=>{c("size-change",t)},x=t=>{c("edit",t)},y=t=>{c("delete",t)},S=(t,l)=>{c("status-change",t,l)};return(t,l)=>{const i=s("el-table-column"),B=s("el-icon"),D=s("el-image"),P=s("el-switch"),v=s("el-button"),T=s("el-table"),N=s("el-pagination"),V=H("loading");return o(),g("div",G,[I((o(),z(T,{data:r.data,border:"",stripe:""},{default:n(()=>[a(i,{prop:"id",label:"ID",width:"80",align:"center"}),a(i,{prop:"name",label:"名称","min-width":"120",align:"center"},{default:n(({row:e})=>[p(h(e.name||"-"),1)]),_:1}),a(i,{label:"图片",width:"100",align:"center"},{default:n(({row:e})=>[e.image?(o(),z(D,{key:0,src:e.image,"preview-src-list":[e.image],fit:"cover",class:"table-image","preview-teleported":"",lazy:""},{error:n(()=>[U("div",J,[a(B,null,{default:n(()=>[a(W($))]),_:1})])]),_:1},8,["src","preview-src-list"])):(o(),g("span",K,"-"))]),_:1}),a(i,{label:"跳转链接","min-width":"180"},{default:n(({row:e})=>[e.url?(o(),g("span",L,h(e.url),1)):(o(),g("span",q,"-"))]),_:1}),a(i,{prop:"sort",label:"排序",width:"80",align:"center"}),a(i,{label:"状态",width:"90",align:"center"},{default:n(({row:e})=>[a(P,{"model-value":e.status===1,onChange:m=>S(e,m?1:0),"inline-prompt":"","active-text":"开","inactive-text":"关"},null,8,["model-value","onChange"])]),_:1}),a(i,{label:"创建时间",width:"160",align:"center"},{default:n(({row:e})=>[p(h(e.createTime||"-"),1)]),_:1}),a(i,{label:"操作",width:"130",align:"center",fixed:"right"},{default:n(({row:e})=>[a(v,{type:"primary",link:"",size:"small",onClick:m=>x(e)},{default:n(()=>[...l[2]||(l[2]=[p(" 编辑 ",-1)])]),_:1},8,["onClick"]),a(v,{type:"danger",link:"",size:"small",onClick:m=>y(e)},{default:n(()=>[...l[3]||(l[3]=[p(" 删除 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])),[[V,r.loading]]),a(N,{"current-page":u.value,"onUpdate:currentPage":l[0]||(l[0]=e=>u.value=e),"page-size":_.value,"onUpdate:pageSize":l[1]||(l[1]=e=>_.value=e),"page-sizes":[10,20,50,100],total:r.total,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:w,onCurrentChange:k,class:"pagination"},null,8,["current-page","page-size","total"])])}}}),M=j(A,[["__scopeId","data-v-9e919038"]]);export{M as default};
