import{d as Q,r as s,a as M,o as N,g as u,c as U,k as K,e,w as o,f as T,t as _,l as g,O as $,s as q,b as C,C as A,D as I,E as O,_ as R}from"./index-CUnFTKV2.js";import j from"./QyLevelTable-CEwjoCU-.js";import{_ as F}from"./QyLevelFormDialog.vue_vue_type_script_setup_true_lang-BuWBNAcc.js";import G from"./QyLevelPrizeDialog--p4Pc1Hk.js";import{e as H,f as J}from"./qylevel-DtP7HHIT.js";import"./QyLevelPrizeFormDialog-BSQSJnTT.js";import"./coupon-C54tWHNa.js";const W={class:"page-container"},X={class:"card-header"},Y=Q({__name:"list",setup(Z){const p=s(!1),y=s([]),V=s(0),t=M({page:1,pageSize:20,keyword:void 0}),r=s(!1),c=s(!1),d=s(null),f=s(!1),n=async()=>{p.value=!0;try{const l=await H(t);y.value=l.data.list,V.value=l.data.total}finally{p.value=!1}},h=()=>{t.page=1,n()},k=()=>{t.keyword=void 0,t.page=1,n()},w=l=>{t.page=l,n()},b=l=>{t.pageSize=l,t.page=1,n()},D=()=>{f.value=!1,d.value=null,r.value=!0},E=l=>{f.value=!0,d.value={...l},r.value=!0},S=async l=>{try{await I.confirm(`确定要删除等级"${l.title}"吗？删除后不可恢复！`,"删除确认",{type:"warning"}),await J(l.id),O.success("删除成功"),n()}catch{}},x=l=>{d.value={...l},c.value=!0};return N(()=>{n()}),(l,a)=>{const m=u("el-icon"),v=u("el-button"),L=u("el-input"),z=u("el-form-item"),P=u("el-form"),B=u("el-card");return K(),U("div",W,[e(B,null,{header:o(()=>[C("div",X,[a[4]||(a[4]=C("span",null,"权益等级管理",-1)),e(v,{type:"primary",onClick:D},{default:o(()=>[e(m,null,{default:o(()=>[e(g(A))]),_:1}),a[3]||(a[3]=_("新增 ",-1))]),_:1})])]),default:o(()=>[e(P,{inline:!0,class:"search-form"},{default:o(()=>[e(z,{label:"关键词"},{default:o(()=>[e(L,{modelValue:t.keyword,"onUpdate:modelValue":a[0]||(a[0]=i=>t.keyword=i),placeholder:"请输入等级名称",clearable:"",onKeyup:T(h,["enter"])},null,8,["modelValue"])]),_:1}),e(z,null,{default:o(()=>[e(v,{type:"primary",onClick:h},{default:o(()=>[e(m,null,{default:o(()=>[e(g($))]),_:1}),a[5]||(a[5]=_("搜索 ",-1))]),_:1}),e(v,{onClick:k},{default:o(()=>[e(m,null,{default:o(()=>[e(g(q))]),_:1}),a[6]||(a[6]=_("重置 ",-1))]),_:1})]),_:1})]),_:1}),e(j,{data:y.value,loading:p.value,total:V.value,page:t.page,"page-size":t.pageSize,onPageChange:w,onSizeChange:b,onEdit:E,onPrizes:x,onDelete:S},null,8,["data","loading","total","page","page-size"])]),_:1}),e(F,{modelValue:r.value,"onUpdate:modelValue":a[1]||(a[1]=i=>r.value=i),level:d.value,"is-edit":f.value,onSuccess:n},null,8,["modelValue","level","is-edit"]),e(G,{modelValue:c.value,"onUpdate:modelValue":a[2]||(a[2]=i=>c.value=i),level:d.value},null,8,["modelValue","level"])])}}}),ue=R(Y,[["__scopeId","data-v-d3fdf3d0"]]);export{ue as default};
