1 |
- var d=(e,t,a)=>new Promise((c,l)=>{var m=s=>{try{r(a.next(s))}catch(o){l(o)}},i=s=>{try{r(a.throw(s))}catch(o){l(o)}},r=s=>s.done?c(s.value):Promise.resolve(s.value).then(m,i);r((a=a.apply(e,t)).next())});import{a as y,b as M}from"./ExclamationCircleOutlined-Ca0mYuiu.js";import{b as _,aq as h,a as B,ao as w,v as I,ap as C,_ as L}from"./entry/index-DJx93RYF-1731481145019.js";import{a3 as v,M as D}from"./antd-CBeLo_oO.js";import{l as R,d as O,f as k,r as S,k as g,a9 as u,_ as T,a6 as b,a7 as p,G as x,a2 as A,a0 as $,aa as V}from"./vue-B5pbXMv7.js";import{B as F,a as N}from"./index-Cuu0w1HY.js";import{B as P,u as H}from"./useTable-B6PunZL5.js";import"./index-BIj58_Cj.js";import"./index-wDJjh9Os.js";import"./useWindowSizeFn-BxA6-zLj.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-BzfGKMh3.js";import"./index-DkGmfgEA.js";import"./plugin-C2XGVjF6.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-lvT7rWOs.js";const{t:n}=_(),j=[{title:n("sys.taskLog.startedAt"),dataIndex:"startedAt",width:50,customRender:({record:e})=>h(e.startedAt)},{title:n("sys.taskLog.finishedAt"),dataIndex:"finishedAt",width:50,customRender:({record:e})=>h(e.finishedAt)},{title:n("sys.taskLog.result"),dataIndex:"result",width:30,customRender:({record:e})=>{let t="";return e.result===1?t=n("common.successful"):t=n("common.failed"),R(v,{color:e.result===1?"green":"red"},t)}}],q=[{field:"result",label:n("sys.taskLog.result"),component:"Select",colProps:{span:8},defaultValue:0,componentProps:{options:[{label:n("common.all"),value:0},{label:n("common.successful"),value:1},{label:n("common.failed"),value:2}]}}],E=(e,t="notice")=>B.post({url:"/sys-api/task_log/list",params:e},{errorMessageMode:t}),G=(e,t="notice")=>B.post({url:"/sys-api/task_log/delete",params:e},{errorMessageMode:t,successMessageMode:t}),W=O({components:{BasicModal:F,BasicTable:P,DeleteOutlined:y,Button:w},setup(){const{t:e}=I.useI18n(),t=k(),a=k(!1),{notification:c}=C(),l=S({}),[m,{reload:i}]=H({title:e("sys.task.taskList"),api:E,columns:j,formConfig:{labelWidth:120,schemas:q},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,rowKey:"id",rowSelection:{type:"checkbox",onChange:(o,f)=>{t.value=o,a.value=o.length>0}}}),[r]=N(o=>d(this,null,function*(){l.taskId=o.record.id}));function s(){return d(this,null,function*(){D.confirm({title:e("common.deleteConfirm"),icon:g(M),onOk(){return d(this,null,function*(){const f=yield G({ids:t.value});f.code===0&&(a.value=!1,c.success({message:e("common.successful"),description:e(f.msg),duration:3}),yield i())})},onCancel(){}})})}return{t:e,registerTable:m,showDeleteButton:a,handleBatchDelete:s,registerModal:r,searchInfo:l}}});function z(e,t,a,c,l,m){const i=u("DeleteOutlined"),r=u("Button"),s=u("BasicTable"),o=u("BasicModal");return T(),b(o,V(e.$attrs,{title:e.t("sys.taskLog.taskLogList"),onRegister:e.registerModal,wrapperFooterOffset:50,cancelText:e.t("common.closeText"),showOkBtn:!1}),{default:p(()=>[g(s,{onRegister:e.registerTable,searchInfo:e.searchInfo,class:"tableHeight"},{tableTitle:p(()=>[e.showDeleteButton?(T(),b(r,{key:0,type:"primary",danger:"",onClick:e.handleBatchDelete},{icon:p(()=>[g(i)]),default:p(()=>[x(" "+A(e.t("common.delete")),1)]),_:1},8,["onClick"])):$("",!0)]),_:1},8,["onRegister","searchInfo"])]),_:1},16,["title","onRegister","cancelText"])}const ge=L(W,[["render",z]]);export{ge as default};
|