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