index-DPLVt2jd.js 3.5 KB

1
  1. var u=(e,c,t)=>new Promise((f,l)=>{var h=o=>{try{s(t.next(o))}catch(r){l(r)}},n=o=>{try{s(t.throw(o))}catch(r){l(r)}},s=o=>o.done?f(o.value):Promise.resolve(o.value).then(h,n);s((t=t.apply(e,c)).next())});import{i as v}from"./index-BQgPd3bX.js";import{B as L,u as R}from"./useTable-B6PunZL5.js";import{T as F}from"./index-BIj58_Cj.js";import{ao as I,v as E,_ as $}from"./entry/index-DJx93RYF-1731481145019.js";import{u as O}from"./index-CzIUqxsa.js";import{T as A,g as N,c as V,s as U,d as w}from"./TaskDrawer-DT3R5oyx.js";import j from"./LogModal-BVqrwZwD.js";import{b as G}from"./index-Cuu0w1HY.js";import{M as q}from"./antd-CBeLo_oO.js";import{d as z,f as y,k as p,a9 as i,_ as C,$ as H,a7 as d,a6 as D,G as _,a2 as B,a0 as M}from"./vue-B5pbXMv7.js";import"./ExclamationCircleOutlined-Ca0mYuiu.js";import"./useForm-pwHPrILC.js";import"./index-D_SNX-7K.js";import"./tree-BtJaOqz0.js";import"./copyTextToClipboard-Dngb1Nn3.js";import"./index-BDsRYE32.js";import"./index-wDJjh9Os.js";import"./index-BzfGKMh3.js";import"./index-DkGmfgEA.js";import"./plugin-C2XGVjF6.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./useWindowSizeFn-BxA6-zLj.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-lvT7rWOs.js";const J=z({name:"TaskManagement",components:{BasicTable:L,TaskDrawer:A,TableAction:F,Button:I,LogModal:j},setup(){const{t:e}=E.useI18n(),c=y(),t=y(!1),[f,{openDrawer:l}]=O(),[h,{reload:n}]=R({title:e("sys.task.taskList"),api:N,columns:V,formConfig:{schemas:U},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:80,title:e("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",onChange:(a,T)=>{c.value=a,t.value=a.length>0}}}),[s,{openModal:o}]=G();function r(a){o(!0,{record:a})}function g(){l(!0,{isUpdate:!1})}function k(a){l(!0,{record:a,isUpdate:!0})}function b(a){return u(this,null,function*(){(yield w({ids:[a.id]})).code===0&&(yield n())})}function m(){return u(this,null,function*(){q.confirm({title:e("common.deleteConfirm"),icon:p(v.ExclamationCircleOutlined),onOk(){return u(this,null,function*(){(yield w({ids:c.value})).code===0&&(t.value=!1,yield n())})},onCancel(){}})})}function S(){return u(this,null,function*(){yield n()})}return{t:e,registerTable:h,registerDrawer:f,registerModal:s,handleOpenLogModal:r,handleCreate:g,handleEdit:k,handleDelete:b,handleSuccess:S,handleBatchDelete:m,showDeleteButton:t}}});function K(e,c,t,f,l,h){const n=i("Button"),s=i("a-button"),o=i("TableAction"),r=i("BasicTable"),g=i("TaskDrawer"),k=i("LogModal");return C(),H("div",null,[p(r,{onRegister:e.registerTable},{tableTitle:d(()=>[e.showDeleteButton?(C(),D(n,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:d(()=>[_(B(e.t("common.delete")),1)]),_:1},8,["onClick"])):M("",!0)]),toolbar:d(()=>[p(s,{type:"primary",onClick:e.handleCreate},{default:d(()=>[_(B(e.t("sys.task.addTask")),1)]),_:1},8,["onClick"])]),bodyCell:d(({column:b,record:m})=>[b.key==="action"?(C(),D(o,{key:0,actions:[{label:"编辑",onClick:e.handleEdit.bind(null,m)},{label:"日志列表",onClick:e.handleOpenLogModal.bind(null,m)},{label:"删除",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,m)}}]},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 Ce=$(J,[["render",K]]);export{Ce as default};