import{d as R,r as o,a as U,o as q,g as d,c as A,k as F,e as t,w as u,l as v,b as _,t as I,C as L,D as j,E as C,_ as G}from"./index-CUnFTKV2.js";import H from"./SignConfigTable-B13489UO.js";import J from"./SignConfigFormDialog-t1Ed9owk.js";import K from"./RewardConfigDialog-BRNtGpHe.js";import{a as r,g as O,d as Q,e as W,f as X}from"./signconfig-B-QeZryi.js";import"./reward-Baf2bADU.js";import"./coupon-C54tWHNa.js";const Y={class:"page-container"},Z={class:"card-header"},$={class:"header-actions"},ee=R({__name:"list",setup(ae){const c=o(r.Daily),p=o(!1),y=o([]),h=o(0),l=U({page:1,pageSize:20,type:r.Daily,keyword:void 0}),g=o(!1),f=o(!1),m=o(!1),s=o(null),n=async()=>{p.value=!0;try{const e=await O(l);y.value=e.data.list,h.value=e.data.total}finally{p.value=!1}},b=e=>{l.type=e,l.page=1,n()},V=e=>{l.page=e,n()},w=e=>{l.pageSize=e,l.page=1,n()},D=()=>{m.value=!1,s.value=null,g.value=!0},E=e=>{m.value=!0,s.value={...e},g.value=!0},z=e=>{s.value={...e},f.value=!0},x=async e=>{try{await j.confirm("确定要删除该签到配置吗？删除后不可恢复！","删除确认",{type:"warning"}),await Q(e.id),C.success("删除成功"),n()}catch{}},T=async(e,a)=>{try{await W(e.id,{status:a}),C.success("状态更新成功"),n()}catch{n()}},k=async(e,a)=>{try{await X(e.id,{sort:a}),C.success("排序更新成功"),n()}catch{n()}};return q(()=>{n()}),(e,a)=>{const B=d("el-icon"),M=d("el-button"),S=d("el-tab-pane"),N=d("el-tabs"),P=d("el-card");return F(),A("div",Y,[t(P,null,{header:u(()=>[_("div",Z,[a[4]||(a[4]=_("span",null,"签到配置",-1)),_("div",$,[t(M,{type:"primary",onClick:D},{default:u(()=>[t(B,null,{default:u(()=>[t(v(L))]),_:1}),a[3]||(a[3]=I("新增配置 ",-1))]),_:1})])])]),default:u(()=>[t(N,{modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=i=>c.value=i),onTabChange:b},{default:u(()=>[t(S,{label:"每日签到",name:v(r).Daily},null,8,["name"]),t(S,{label:"累计签到",name:v(r).Cumulative},null,8,["name"])]),_:1},8,["modelValue"]),t(H,{data:y.value,loading:p.value,total:h.value,page:l.page,"page-size":l.pageSize,"sign-type":c.value,onPageChange:V,onSizeChange:w,onEdit:E,onEditReward:z,onDelete:x,onStatusChange:T,onSortChange:k},null,8,["data","loading","total","page","page-size","sign-type"])]),_:1}),t(J,{modelValue:g.value,"onUpdate:modelValue":a[1]||(a[1]=i=>g.value=i),"sign-config":s.value,"is-edit":m.value,"sign-type":c.value,onSuccess:n},null,8,["modelValue","sign-config","is-edit","sign-type"]),t(K,{modelValue:f.value,"onUpdate:modelValue":a[2]||(a[2]=i=>f.value=i),"sign-config":s.value,onSuccess:n},null,8,["modelValue","sign-config"])])}}}),ue=G(ee,[["__scopeId","data-v-3df7cbbd"]]);export{ue as default};
