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