import{d as V,r as B,G as x,g as c,J,c as d,k as s,K as $,e as t,z as f,w as a,t as p,x as o,b as _,l as r,L as k,_ as A}from"./index-CUnFTKV2.js";import{a as S,d as G,F as K,b as X}from"./floatball-LY_7NrvV.js";const Y={class:"floatball-table"},q={class:"image-error"},H={key:1,class:"no-image"},M={class:"image-error"},O={key:1,class:"no-image"},Q={class:"image-error"},R={key:1,class:"no-image"},W={key:0,class:"url-text"},Z={key:1,class:"no-image"},ee=V({__name:"FloatBallTable",props:{data:{},loading:{type:Boolean},total:{},page:{},pageSize:{}},emits:["page-change","size-change","edit","delete","status-change"],setup(u,{emit:D}){const m=u,g=D,h=B(m.page),v=B(m.pageSize);x(()=>m.page,l=>{h.value=l}),x(()=>m.pageSize,l=>{v.value=l});const F=l=>{g("page-change",l)},P=l=>{g("size-change",l)},T=l=>{g("edit",l)},j=l=>{g("delete",l)},E=(l,i)=>{g("status-change",l,i)};return(l,i)=>{const n=c("el-table-column"),b=c("el-icon"),y=c("el-image"),w=c("el-tag"),U=c("el-switch"),C=c("el-button"),I=c("el-table"),L=c("el-pagination"),N=J("loading");return s(),d("div",Y,[$((s(),f(I,{data:u.data,border:"",stripe:""},{default:a(()=>[t(n,{prop:"id",label:"ID",width:"70",align:"center"}),t(n,{prop:"title",label:"标题",width:"120",align:"center"},{default:a(({row:e})=>[p(o(e.title||"-"),1)]),_:1}),t(n,{label:"悬浮球图片",width:"100",align:"center"},{default:a(({row:e})=>[e.image?(s(),f(y,{key:0,src:e.image,"preview-src-list":[e.image],fit:"cover",class:"table-image","preview-teleported":"",lazy:""},{error:a(()=>[_("div",q,[t(b,null,{default:a(()=>[t(r(k))]),_:1})])]),_:1},8,["src","preview-src-list"])):(s(),d("span",H,"-"))]),_:1}),t(n,{label:"背景图",width:"100",align:"center"},{default:a(({row:e})=>[e.imageBj?(s(),f(y,{key:0,src:e.imageBj,"preview-src-list":[e.imageBj],fit:"cover",class:"table-image","preview-teleported":"",lazy:""},{error:a(()=>[_("div",M,[t(b,null,{default:a(()=>[t(r(k))]),_:1})])]),_:1},8,["src","preview-src-list"])):(s(),d("span",O,"-"))]),_:1}),t(n,{label:"详情图",width:"100",align:"center"},{default:a(({row:e})=>[e.imageDetails?(s(),f(y,{key:0,src:e.imageDetails,"preview-src-list":[e.imageDetails],fit:"cover",class:"table-image","preview-teleported":"",lazy:""},{error:a(()=>[_("div",Q,[t(b,null,{default:a(()=>[t(r(k))]),_:1})])]),_:1},8,["src","preview-src-list"])):(s(),d("span",R,"-"))]),_:1}),t(n,{label:"类型",width:"100",align:"center"},{default:a(({row:e})=>[t(w,{type:e.type===r(S).ShowImage?"info":"primary",size:"small"},{default:a(()=>[p(o(r(G)[e.type]||"未知"),1)]),_:2},1032,["type"])]),_:1}),t(n,{label:"跳转链接","min-width":"150"},{default:a(({row:e})=>[e.type===r(S).JumpPage&&e.linkUrl?(s(),d("span",W,o(e.linkUrl),1)):(s(),d("span",Z,"-"))]),_:1}),t(n,{label:"位置",width:"100",align:"center"},{default:a(({row:e})=>[_("span",null,o(e.positionX)+", "+o(e.positionY),1)]),_:1}),t(n,{label:"尺寸",width:"100",align:"center"},{default:a(({row:e})=>[_("span",null,o(e.width)+" × "+o(e.height),1)]),_:1}),t(n,{label:"特效",width:"100",align:"center"},{default:a(({row:e})=>[t(w,{type:e.effect===r(K).Scale?"success":"info",size:"small"},{default:a(()=>[p(o(r(X)[e.effect]||"无特效"),1)]),_:2},1032,["type"])]),_:1}),t(n,{label:"状态",width:"90",align:"center"},{default:a(({row:e})=>[t(U,{"model-value":e.status===1,onChange:z=>E(e,z?1:0),"inline-prompt":"","active-text":"开","inactive-text":"关"},null,8,["model-value","onChange"])]),_:1}),t(n,{label:"创建时间",width:"160",align:"center"},{default:a(({row:e})=>[p(o(e.createdAt||"-"),1)]),_:1}),t(n,{label:"操作",width:"130",align:"center",fixed:"right"},{default:a(({row:e})=>[t(C,{type:"primary",link:"",size:"small",onClick:z=>T(e)},{default:a(()=>[...i[2]||(i[2]=[p(" 编辑 ",-1)])]),_:1},8,["onClick"]),t(C,{type:"danger",link:"",size:"small",onClick:z=>j(e)},{default:a(()=>[...i[3]||(i[3]=[p(" 删除 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])),[[N,u.loading]]),t(L,{"current-page":h.value,"onUpdate:currentPage":i[0]||(i[0]=e=>h.value=e),"page-size":v.value,"onUpdate:pageSize":i[1]||(i[1]=e=>v.value=e),"page-sizes":[10,20,50,100],total:u.total,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:P,onCurrentChange:F,class:"pagination"},null,8,["current-page","page-size","total"])])}}}),le=A(ee,[["__scopeId","data-v-003b6c43"]]);export{le as default};
