import{T as N,a as m}from"./task-DlYETVMU.js";import{d as P,r as b,G as f,g as r,J as V,c as E,k as h,K as I,e as a,z as U,w as n,t as i,x as o,l as $,b as j,_ as A}from"./index-CUnFTKV2.js";const G={class:"task-table"},J={class:"reward-value"},K=P({__name:"TaskTable",props:{data:{},loading:{type:Boolean},total:{},page:{},pageSize:{}},emits:["page-change","size-change","edit","delete"],setup(c,{emit:y}){const d=c,p=y,g=b(d.page),u=b(d.pageSize);f(()=>d.page,t=>{g.value=t}),f(()=>d.pageSize,t=>{u.value=t});const z=t=>{switch(t){case m.Daily:return"primary";case m.Weekly:return"success";default:return"info"}},k=t=>{p("page-change",t)},v=t=>{p("size-change",t)},T=t=>{p("edit",t)},C=t=>{p("delete",t)};return(t,l)=>{const s=r("el-table-column"),w=r("el-tag"),_=r("el-button"),x=r("el-table"),S=r("el-pagination"),D=V("loading");return h(),E("div",G,[I((h(),U(x,{data:c.data,border:"",stripe:""},{default:n(()=>[a(s,{prop:"id",label:"ID",width:"70",align:"center"}),a(s,{label:"任务分类",width:"100",align:"center"},{default:n(({row:e})=>[a(w,{type:z(e.type),size:"small"},{default:n(()=>[i(o(e.typeName||$(N)[e.type]||"未知"),1)]),_:2},1032,["type"])]),_:1}),a(s,{prop:"title",label:"任务名称","min-width":"180"},{default:n(({row:e})=>[i(o(e.title||"-"),1)]),_:1}),a(s,{label:"任务次数",width:"100",align:"center"},{default:n(({row:e})=>[i(o(e.number??"-"),1)]),_:1}),a(s,{label:"欧气值",width:"100",align:"center"},{default:n(({row:e})=>[j("span",J,o(e.zNumber??"-"),1)]),_:1}),a(s,{label:"排序",width:"80",align:"center"},{default:n(({row:e})=>[i(o(e.sort??0),1)]),_:1}),a(s,{label:"创建时间",width:"160",align:"center"},{default:n(({row:e})=>[i(o(e.createdAt||"-"),1)]),_:1}),a(s,{label:"操作",width:"130",align:"center",fixed:"right"},{default:n(({row:e})=>[a(_,{type:"primary",link:"",size:"small",onClick:B=>T(e)},{default:n(()=>[...l[2]||(l[2]=[i(" 编辑 ",-1)])]),_:1},8,["onClick"]),a(_,{type:"danger",link:"",size:"small",onClick:B=>C(e)},{default:n(()=>[...l[3]||(l[3]=[i(" 删除 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])),[[D,c.loading]]),a(S,{"current-page":g.value,"onUpdate:currentPage":l[0]||(l[0]=e=>g.value=e),"page-size":u.value,"onUpdate:pageSize":l[1]||(l[1]=e=>u.value=e),"page-sizes":[10,20,50,100],total:c.total,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:v,onCurrentChange:k,class:"pagination"},null,8,["current-page","page-size","total"])])}}}),q=A(K,[["__scopeId","data-v-62c994c8"]]);export{q as default};
