import{d as R,r as l,a as V,o as x,g as u,c as T,k as b,e as o,w as r,b as p,t as D,l as B,C as M,D as N,E as P,_ as q}from"./index-CUnFTKV2.js";import A from"./RewardSearchForm-BDOmIxK6.js";import F from"./RewardTable-DnPC2Pm1.js";import{_ as I}from"./RewardFormDialog.vue_vue_type_script_setup_true_lang-L6XwvkJP.js";import{g as L,d as U}from"./reward-Baf2bADU.js";import"./coupon-C54tWHNa.js";const $={class:"page-container"},j={class:"card-header"},G={class:"header-actions"},H=R({__name:"list",setup(J){const d=l(!1),g=l([]),_=l(0),a=V({page:1,pageSize:20,rewardType:void 0,keyword:void 0}),n=l(!1),i=l(!1),c=l(null),t=async()=>{d.value=!0;try{const e=await L(a);g.value=e.data.list,_.value=e.data.total}finally{d.value=!1}},f=e=>{a.rewardType=e.rewardType,a.keyword=e.keyword,a.page=1,t()},m=()=>{a.rewardType=void 0,a.keyword=void 0,a.page=1,t()},v=e=>{a.page=e,t()},w=e=>{a.pageSize=e,a.page=1,t()},h=()=>{i.value=!1,c.value=null,n.value=!0},y=e=>{i.value=!0,c.value={...e},n.value=!0},C=async e=>{try{await N.confirm("确定要删除该奖励配置吗？删除后不可恢复！","删除确认",{type:"warning"}),await U(e.id),P.success("删除成功"),t()}catch{}};return x(()=>{t()}),(e,s)=>{const S=u("el-icon"),k=u("el-button"),z=u("el-card");return b(),T("div",$,[o(z,null,{header:r(()=>[p("div",j,[s[2]||(s[2]=p("span",null,"奖励管理",-1)),p("div",G,[o(k,{type:"primary",onClick:h},{default:r(()=>[o(S,null,{default:r(()=>[o(B(M))]),_:1}),s[1]||(s[1]=D("新增奖励 ",-1))]),_:1})])])]),default:r(()=>[o(A,{onSearch:f,onReset:m}),o(F,{data:g.value,loading:d.value,total:_.value,page:a.page,"page-size":a.pageSize,onPageChange:v,onSizeChange:w,onEdit:y,onDelete:C},null,8,["data","loading","total","page","page-size"])]),_:1}),o(I,{modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=E=>n.value=E),reward:c.value,"is-edit":i.value,onSuccess:t},null,8,["modelValue","reward","is-edit"])])}}}),Z=q(H,[["__scopeId","data-v-79f3e6f9"]]);export{Z as default};
