import{d as H,r as l,a as V,o as W,g as i,c as x,k as D,e as o,w as u,b as p,t as k,l as B,C as M,D as N,E as _,_ as P}from"./index-CUnFTKV2.js";import T from"./WelfareHouseTable-RrNuh8TC.js";import{W as q,g as A,d as F,u as I}from"./WelfareHouseFormDialog-8KIpLOrB.js";const L={class:"page-container"},U={class:"card-header"},$={class:"header-actions"},j=H({__name:"list",setup(G){const c=l(!1),f=l([]),g=l(0),s=V({page:1,pageSize:20}),n=l(!1),r=l(!1),d=l(null),t=async()=>{c.value=!0;try{const e=await A(s);f.value=e.data.list,g.value=e.data.total}finally{c.value=!1}},m=e=>{s.page=e,t()},v=e=>{s.pageSize=e,s.page=1,t()},h=()=>{r.value=!1,d.value=null,n.value=!0},y=e=>{r.value=!0,d.value={...e},n.value=!0},C=async e=>{try{await N.confirm(`确定要删除福利屋入口"${e.name}"吗？删除后不可恢复！`,"删除确认",{type:"warning"}),await F(e.id),_.success("删除成功"),t()}catch{}},w=async(e,a)=>{try{await I(e.id,{status:a}),_.success(a===1?"已启用":"已禁用"),t()}catch{t()}};return W(()=>{t()}),(e,a)=>{const S=i("el-icon"),b=i("el-button"),z=i("el-card");return D(),x("div",L,[o(z,null,{header:u(()=>[p("div",U,[a[2]||(a[2]=p("span",null,"福利屋入口",-1)),p("div",$,[o(b,{type:"primary",onClick:h},{default:u(()=>[o(S,null,{default:u(()=>[o(B(M))]),_:1}),a[1]||(a[1]=k("新增入口 ",-1))]),_:1})])])]),default:u(()=>[o(T,{data:f.value,loading:c.value,total:g.value,page:s.page,"page-size":s.pageSize,onPageChange:m,onSizeChange:v,onEdit:y,onDelete:C,onStatusChange:w},null,8,["data","loading","total","page","page-size"])]),_:1}),o(q,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=E=>n.value=E),"welfare-house":d.value,"is-edit":r.value,onSuccess:t},null,8,["modelValue","welfare-house","is-edit"])])}}}),Q=P(j,[["__scopeId","data-v-3fbcba91"]]);export{Q as default};
