import{d as x,g as d,J as y,c as w,k as m,K as z,z as D,w as n,e as t,b as B,x as _,t as c,_ as T}from"./index-CUnFTKV2.js";const I={class:"danye-table"},N=x({__name:"DanyeTable",props:{data:{},loading:{type:Boolean}},emits:["edit","toggle-optimizer","clear","delete"],setup(p,{emit:g}){const o=g,u=l=>{o("edit",l)},b=(l,a)=>{o("toggle-optimizer",l,a)},f=l=>{o("clear",l)},v=l=>{o("delete",l)};return(l,a)=>{const i=d("el-table-column"),k=d("el-switch"),r=d("el-button"),h=d("el-table"),C=y("loading");return m(),w("div",I,[z((m(),D(h,{data:p.data,border:"",stripe:""},{default:n(()=>[t(i,{prop:"id",label:"ID",width:"80",align:"center"}),t(i,{prop:"title",label:"标题","min-width":"200"},{default:n(({row:e})=>[B("span",null,_(e.title),1)]),_:1}),t(i,{label:"图片优化",width:"120",align:"center"},{default:n(({row:e})=>[t(k,{"model-value":e.isImageOptimizer,onChange:s=>b(e,s),"active-text":"开","inactive-text":"关","inline-prompt":""},null,8,["model-value","onChange"])]),_:1}),t(i,{label:"更新时间",width:"180",align:"center"},{default:n(({row:e})=>[c(_(e.updateTime||"-"),1)]),_:1}),t(i,{label:"操作",width:"200",align:"center",fixed:"right"},{default:n(({row:e})=>[t(r,{type:"primary",link:"",size:"small",onClick:s=>u(e)},{default:n(()=>[...a[0]||(a[0]=[c(" 编辑 ",-1)])]),_:1},8,["onClick"]),t(r,{type:"warning",link:"",size:"small",onClick:s=>f(e)},{default:n(()=>[...a[1]||(a[1]=[c(" 清空 ",-1)])]),_:1},8,["onClick"]),t(r,{type:"danger",link:"",size:"small",onClick:s=>v(e)},{default:n(()=>[...a[2]||(a[2]=[c(" 删除 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])),[[C,p.loading]])])}}}),$=T(N,[["__scopeId","data-v-e5889fee"]]);export{$ as default};
