import{a as P,R as d}from"./reward-Baf2bADU.js";import{d as U,r as h,G as y,g as c,J as N,c as p,k as s,K as V,e as t,z as F,w as n,t as i,x as r,l as b,F as z,_ as $}from"./index-CUnFTKV2.js";const j={class:"reward-table"},A={key:0,class:"coupon-info"},G={key:1,class:"no-data"},J=U({__name:"RewardTable",props:{data:{},loading:{type:Boolean},total:{},page:{},pageSize:{}},emits:["page-change","size-change","edit","delete"],setup(g,{emit:v}){const u=g,_=v,m=h(u.page),f=h(u.pageSize);y(()=>u.page,a=>{m.value=a}),y(()=>u.pageSize,a=>{f.value=a});const C=a=>{switch(a){case d.Diamond:return"primary";case d.UUCoin:return"success";case d.DaDaCoin:return"warning";case d.Coupon:return"danger";default:return"info"}},k=a=>{_("page-change",a)},T=a=>{_("size-change",a)},D=a=>{_("edit",a)},x=a=>{_("delete",a)};return(a,l)=>{const o=c("el-table-column"),S=c("el-tag"),w=c("el-button"),I=c("el-table"),R=c("el-pagination"),B=N("loading");return s(),p("div",j,[V((s(),F(I,{data:g.data,border:"",stripe:""},{default:n(()=>[t(o,{prop:"id",label:"ID",width:"70",align:"center"}),t(o,{prop:"rewardId",label:"奖励ID",width:"150",align:"center"},{default:n(({row:e})=>[i(r(e.rewardId||"-"),1)]),_:1}),t(o,{label:"奖励类型",width:"100",align:"center"},{default:n(({row:e})=>[t(S,{type:C(e.rewardType),size:"small"},{default:n(()=>[i(r(e.rewardTypeName||b(P)[e.rewardType]||"未知"),1)]),_:2},1032,["type"])]),_:1}),t(o,{label:"奖励值",width:"120",align:"center"},{default:n(({row:e})=>[e.rewardType===b(d).Coupon?(s(),p(z,{key:0},[e.coupon?(s(),p("span",A,r(e.coupon.title),1)):(s(),p("span",G,"优惠券ID: "+r(e.rewardExtend),1))],64)):(s(),p(z,{key:1},[i(r(e.rewardValue),1)],64))]),_:1}),t(o,{label:"关联ID",width:"100",align:"center"},{default:n(({row:e})=>[i(r(e.rewardExtend||"-"),1)]),_:1}),t(o,{prop:"description",label:"描述","min-width":"150"},{default:n(({row:e})=>[i(r(e.description||"-"),1)]),_:1}),t(o,{label:"创建时间",width:"160",align:"center"},{default:n(({row:e})=>[i(r(e.createdAt||"-"),1)]),_:1}),t(o,{label:"操作",width:"130",align:"center",fixed:"right"},{default:n(({row:e})=>[t(w,{type:"primary",link:"",size:"small",onClick:E=>D(e)},{default:n(()=>[...l[2]||(l[2]=[i(" 编辑 ",-1)])]),_:1},8,["onClick"]),t(w,{type:"danger",link:"",size:"small",onClick:E=>x(e)},{default:n(()=>[...l[3]||(l[3]=[i(" 删除 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])),[[B,g.loading]]),t(R,{"current-page":m.value,"onUpdate:currentPage":l[0]||(l[0]=e=>m.value=e),"page-size":f.value,"onUpdate:pageSize":l[1]||(l[1]=e=>f.value=e),"page-sizes":[10,20,50,100],total:g.total,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:T,onCurrentChange:k,class:"pagination"},null,8,["current-page","page-size","total"])])}}}),q=$(J,[["__scopeId","data-v-2ac71bae"]]);export{q as default};
