import{d as P,r as f,G as b,g as o,J as w,c as p,k as l,K as V,e as a,z as k,w as n,t as _,x as d,b as z,l as c,L as E,_ as $}from"./index-CUnFTKV2.js";import{A as r,b as F}from"./advert-y3Emov1a.js";const G={class:"advert-table"},K={class:"image-error"},W={key:1,class:"no-image"},X={key:0},Y={key:1},q={key:2},H={key:3,class:"url-text"},M={key:4},O=P({__name:"AdvertTable",props:{data:{},loading:{type:Boolean},total:{},page:{},pageSize:{}},emits:["page-change","size-change","edit","delete"],setup(g,{emit:C}){const u=g,m=C,h=f(u.page),v=f(u.pageSize);b(()=>u.page,t=>{h.value=t}),b(()=>u.pageSize,t=>{v.value=t});const T=t=>F[t]||"未知",S=t=>{m("page-change",t)},j=t=>{m("size-change",t)},x=t=>{m("edit",t)},D=t=>{m("delete",t)};return(t,s)=>{const i=o("el-table-column"),N=o("el-tag"),A=o("el-icon"),I=o("el-image"),y=o("el-button"),U=o("el-table"),B=o("el-pagination"),J=w("loading");return l(),p("div",G,[V((l(),k(U,{data:g.data,border:"",stripe:""},{default:n(()=>[a(i,{prop:"id",label:"ID",width:"80",align:"center"}),a(i,{label:"广告类型",width:"120",align:"center"},{default:n(({row:e})=>[a(N,{size:"small"},{default:n(()=>[_(d(e.typeName),1)]),_:2},1024)]),_:1}),a(i,{label:"广告图片",width:"150",align:"center"},{default:n(({row:e})=>[e.imageUrl?(l(),k(I,{key:0,src:e.imageUrl,"preview-src-list":[e.imageUrl],fit:"cover",class:"advert-image","preview-teleported":""},{error:n(()=>[z("div",K,[a(A,null,{default:n(()=>[a(c(E))]),_:1})])]),_:1},8,["src","preview-src-list"])):(l(),p("span",W,"暂无图片"))]),_:1}),a(i,{label:"跳转类型",width:"120",align:"center"},{default:n(({row:e})=>[z("span",null,d(e.jumpTypeName||T(e.jumpType)),1)]),_:1}),a(i,{label:"跳转目标","min-width":"150"},{default:n(({row:e})=>[e.jumpType===c(r).None?(l(),p("span",X,"-")):e.jumpType===c(r).Coupon?(l(),p("span",Y,"优惠券ID: "+d(e.couponId),1)):e.jumpType===c(r).YiFanShang||e.jumpType===c(r).WuXianShang||e.jumpType===c(r).LianJiShang?(l(),p("span",q," 盒子ID: "+d(e.goodsId),1)):e.jumpType===c(r).CustomUrl?(l(),p("span",H,d(e.urlLink),1)):(l(),p("span",M,"-"))]),_:1}),a(i,{prop:"sort",label:"排序值",width:"100",align:"center"}),a(i,{label:"创建时间",width:"160",align:"center"},{default:n(({row:e})=>[_(d(e.createdAt||"-"),1)]),_:1}),a(i,{label:"操作",width:"150",align:"center",fixed:"right"},{default:n(({row:e})=>[a(y,{type:"primary",link:"",size:"small",onClick:L=>x(e)},{default:n(()=>[...s[2]||(s[2]=[_(" 编辑 ",-1)])]),_:1},8,["onClick"]),a(y,{type:"danger",link:"",size:"small",onClick:L=>D(e)},{default:n(()=>[...s[3]||(s[3]=[_(" 删除 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])),[[J,g.loading]]),a(B,{"current-page":h.value,"onUpdate:currentPage":s[0]||(s[0]=e=>h.value=e),"page-size":v.value,"onUpdate:pageSize":s[1]||(s[1]=e=>v.value=e),"page-sizes":[10,20,50,100],total:g.total,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:j,onCurrentChange:S,class:"pagination"},null,8,["current-page","page-size","total"])])}}}),Z=$(O,[["__scopeId","data-v-0e1cc97d"]]);export{Z as default};
