LogModal-DLWzzJQj.js 4.0 KB

1
  1. var d=(e,o,n)=>new Promise((c,r)=>{var m=a=>{try{l(n.next(a))}catch(s){r(s)}},i=a=>{try{l(n.throw(a))}catch(s){r(s)}},l=a=>a.done?c(a.value):Promise.resolve(a.value).then(m,i);l((n=n.apply(e,o)).next())});import{a as B,b as T}from"./ExclamationCircleOutlined-BR1Enpph.js";import{b as L,aq as M,a as w,ao as _,v,ap as k,_ as S}from"./entry/index-CP6zkLsN-1726190694502.js";import{c as C}from"./components-BeQPfdVC.js";import{l as y,d as x,f as h,r as D,k as g,a6 as p,_ as b,a7 as I,a8 as u,G as O,a2 as R,a0 as P,aa as j}from"./vue-CmlY4eyV.js";import{B as $,a as V}from"./index-5JuY20kX.js";import{B as E,u as F}from"./useTable-CaBV0A9D.js";import"./index-BPgn07DB.js";import{M as N}from"./antd-Bp5u6ujY.js";import"./index-Ci2v5RRf.js";import"./index-caYAhZot.js";import"./useWindowSizeFn-c2oM7mG1.js";import"./useForm-DYTnyn58.js";import"./index-D5QnXKgB.js";import"./tree-Cz4SXb17.js";import"./copyTextToClipboard-o-L2h2rZ.js";import"./index-BAxfTGAN.js";import"./index-Ci1vkPDT.js";import"./index-B_Pz7KLI.js";import"./plugin-BdCvh_fX.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C4hclMrd.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-Dv9W1z21.js";const{t}=L(),A=[{title:t("mcms.emailLog.target"),dataIndex:"target",width:50},{title:t("mcms.emailLog.subject"),dataIndex:"subject",width:30},{title:t("mcms.emailLog.content"),dataIndex:"content",width:100},{title:t("mcms.emailLog.sendStatus"),dataIndex:"sendStatus",width:30,customRender:({record:e})=>{let o="";return e.sendStatus===1?o=t("common.successful"):o=t("common.failed"),y(C.Tag,{color:e.sendStatus===1?"green":"red"},o)}},{title:t("mcms.emailLog.provider"),dataIndex:"provider",width:30},{title:t("common.createTime"),dataIndex:"createdAt",width:40,customRender:({record:e})=>M(e.createdAt)}],H=[{field:"target",label:t("mcms.emailLog.target"),component:"Input",colProps:{span:8}},{field:"subject",label:t("mcms.emailLog.subject"),component:"Input",colProps:{span:8}},{field:"provider",label:t("mcms.emailLog.provider"),component:"Input",colProps:{span:8}},{field:"sendStatus",label:t("mcms.emailLog.sendStatus"),component:"Select",colProps:{span:8},defaultValue:0,componentProps:{options:[{label:t("common.all"),value:0},{label:t("common.successful"),value:1},{label:t("common.failed"),value:2}]}}],q=(e,o="notice")=>w.post({url:"/sys-api/email_log/list",params:e},{errorMessageMode:o}),G=(e,o="notice")=>w.post({url:"/sys-api/email_log/delete",params:e},{errorMessageMode:o,successMessageMode:o}),W=x({components:{BasicModal:$,BasicTable:E,DeleteOutlined:B,Button:_},setup(){const{t:e}=v.useI18n(),o=h(),n=h(!1),{notification:c}=k(),r=D({}),[m,{reload:i}]=F({title:e("sys.task.taskList"),api:q,columns:A,formConfig:{labelWidth:120,schemas:H},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,rowKey:"id",rowSelection:{type:"checkbox",onChange:(s,f)=>{o.value=s,n.value=s.length>0}}}),[l]=V(s=>d(this,null,function*(){r.taskId=s.record.id}));function a(){return d(this,null,function*(){N.confirm({title:e("common.deleteConfirm"),icon:g(T),onOk(){return d(this,null,function*(){const f=yield G({ids:o.value});f.code===0&&(n.value=!1,c.success({message:e("common.successful"),description:e(f.msg),duration:3}),yield i())})},onCancel(){}})})}return{t:e,registerTable:m,showDeleteButton:n,handleBatchDelete:a,registerModal:l,searchInfo:r}}});function z(e,o,n,c,r,m){const i=p("DeleteOutlined"),l=p("Button"),a=p("BasicTable"),s=p("BasicModal");return b(),I(s,j(e.$attrs,{title:e.t("mcms.emailLog.emailLogList"),onRegister:e.registerModal,wrapperFooterOffset:50,cancelText:e.t("common.closeText"),showOkBtn:!1}),{default:u(()=>[g(a,{onRegister:e.registerTable,searchInfo:e.searchInfo,class:"tableHeight"},{tableTitle:u(()=>[e.showDeleteButton?(b(),I(l,{key:0,type:"primary",danger:"",onClick:e.handleBatchDelete},{icon:u(()=>[g(i)]),default:u(()=>[O(" "+R(e.t("common.delete")),1)]),_:1},8,["onClick"])):P("",!0)]),_:1},8,["onRegister","searchInfo"])]),_:1},16,["title","onRegister","cancelText"])}const be=S(W,[["render",z]]);export{be as default};