var m=(e,c,t)=>new Promise((f,i)=>{var h=o=>{try{s(t.next(o))}catch(r){i(r)}},a=o=>{try{s(t.throw(o))}catch(r){i(r)}},s=o=>o.done?f(o.value):Promise.resolve(o.value).then(h,a);s((t=t.apply(e,c)).next())});import{i as v}from"./index-oK_hln-O.js";import{B as L,u as R}from"./useTable-CDqjUv9a.js";import{T as I}from"./useForm-S2-4SPyv.js";import{ao as $,v as E,_ as O}from"./entry/index-BFpON5wd-1719886843165.js";import{u as A}from"./index-D8-pH9_c.js";import{T as F,g as N,c as V,s as U,d as w}from"./TaskDrawer-Clbo6PvM.js";import j from"./LogModal-DJbBiTzO.js";import{b as G}from"./index-Cx3rMS0Q.js";import{M as W}from"./antd-V2f1Ijkg.js";import{d as q,f as y,k as p,a7 as l,_ as C,$ as z,a9 as u,a8 as _,G as B,a1 as D,ab as M}from"./vue-B3Yl1XMW.js";import"./ExclamationCircleOutlined-CvjJlgYP.js";import"./index-eZbZN8hc.js";import"./plugin-DHZ68pLH.js";import"./useWindowSizeFn-IiF7s4QS.js";import"./onMountedOrActivated-Cz7FEpZo.js";import"./sortable.esm-CnNXHMH-.js";import"./index-D--g-WIs.js";import"./tree-Dcz2GpQj.js";import"./copyTextToClipboard-TytJuPBe.js";import"./useSortable-Dipa7Xkv.js";import"./index-BN89L_L8.js";import"./index-DBtUZ0LU.js";const H=q({name:"TaskManagement",components:{BasicTable:L,TaskDrawer:F,TableAction:I,Button:$,LogModal:j},setup(){const{t:e}=E.useI18n(),c=y(),t=y(!1),[f,{openDrawer:i}]=A(),[h,{reload:a}]=R({title:e("sys.task.taskList"),api:N,columns:V,formConfig:{labelWidth:120,schemas:U},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:60,title:e("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",onChange:(n,T)=>{c.value=n,t.value=n.length>0}}}),[s,{openModal:o}]=G();function r(n){o(!0,{record:n})}function g(){i(!0,{isUpdate:!1})}function k(n){i(!0,{record:n,isUpdate:!0})}function b(n){return m(this,null,function*(){(yield w({ids:[n.id]})).code===0&&(yield a())})}function d(){return m(this,null,function*(){W.confirm({title:e("common.deleteConfirm"),icon:p(v.ExclamationCircleOutlined),onOk(){return m(this,null,function*(){(yield w({ids:c.value})).code===0&&(t.value=!1,yield a())})},onCancel(){}})})}function S(){return m(this,null,function*(){yield a()})}return{t:e,registerTable:h,registerDrawer:f,registerModal:s,handleOpenLogModal:r,handleCreate:g,handleEdit:k,handleDelete:b,handleSuccess:S,handleBatchDelete:d,showDeleteButton:t}}});function J(e,c,t,f,i,h){const a=l("Button"),s=l("a-button"),o=l("TableAction"),r=l("BasicTable"),g=l("TaskDrawer"),k=l("LogModal");return C(),z("div",null,[p(r,{onRegister:e.registerTable},{tableTitle:u(()=>[e.showDeleteButton?(C(),_(a,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:u(()=>[B(D(e.t("common.delete")),1)]),_:1},8,["onClick"])):M("",!0)]),toolbar:u(()=>[p(s,{type:"primary",onClick:e.handleCreate},{default:u(()=>[B(D(e.t("sys.task.addTask")),1)]),_:1},8,["onClick"])]),bodyCell:u(({column:b,record:d})=>[b.key==="action"?(C(),_(o,{key:0,actions:[{icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,d)},{icon:"ic:round-library-books",onClick:e.handleOpenLogModal.bind(null,d)},{icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,d)}}]},null,8,["actions"])):M("",!0)]),_:1},8,["onRegister"]),p(g,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"]),p(k,{onRegister:e.registerModal,defaultFullscreen:!0},null,8,["onRegister"])])}const ge=O(H,[["render",J]]);export{ge as default};