import{_ as T}from"./index.vue_vue_type_script_setup_true_lang-C2H7PsW9.js";import{x as C,s as Y,k as q,r as _,l as H,y as I,O as e,G as N,F as a,u as s,E as P,ae as b,j as E,K as c,C as Q,L as h,z as D}from"./vue-vendor-vBC20LeU.js";import{r as j,_ as z}from"./index-D7dBOFlH.js";import{F as G,J as O,G as J,H as A,i as W,N as X,Q as Z,R as ee,k as le,K as te,L as ae,M as oe}from"./element-plus-DckSU5ni.js";import"./axios-CG2WSiiR.js";const se=y=>j.get({url:"/message.smsLog/list",params:y}),ne={class:"message-log"},re={class:"flex mt-4 justify-end"},ue=C({name:"MessageLog"}),de=C({...ue,setup(y){const v=Y(),o=q({page:1,limit:10,mobile:"",template_key:"",gateway:"",status:""}),d=_(null),V=_(0),i=_(!1),w=_([]),f=async()=>{i.value=!0,se({...o,start_time:d.value?.[0]||"",end_time:d.value?.[1]||""}).then(m=>{w.value=m.data||[],V.value=m.total||0,i.value=!1}).catch(()=>{i.value=!1})},p=()=>{o.page=1,f()},F=()=>{v.value?.resetFields(),d.value=null,p()},L=m=>{if(!m)return"";const l=new Date(m*1e3),n=r=>String(r).padStart(2,"0");return`${l.getFullYear()}-${n(l.getMonth()+1)}-${n(l.getDate())} ${n(l.getHours())}:${n(l.getMinutes())}:${n(l.getSeconds())}`};return H(()=>{f()}),(m,l)=>{const n=W,r=A,g=Z,M=X,$=ee,k=le,K=J,x=G,u=te,R=ae,U=oe,B=T,S=O;return D(),I("div",ne,[e(x,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(K,{class:"mb-[-16px]",ref_key:"queryFormRef",ref:v,model:s(o),inline:""},{default:a(()=>[e(r,{class:"w-[220px]",label:"手机号",prop:"mobile"},{default:a(()=>[e(n,{modelValue:s(o).mobile,"onUpdate:modelValue":l[0]||(l[0]=t=>s(o).mobile=t),placeholder:"请输入手机号",clearable:"",onKeyup:b(p,["enter"])},null,8,["modelValue"])]),_:1}),e(r,{class:"w-[220px]",label:"模板键名",prop:"template_key"},{default:a(()=>[e(n,{modelValue:s(o).template_key,"onUpdate:modelValue":l[1]||(l[1]=t=>s(o).template_key=t),placeholder:"请输入模板键名",clearable:"",onKeyup:b(p,["enter"])},null,8,["modelValue"])]),_:1}),e(r,{class:"w-[220px]",label:"网关",prop:"gateway"},{default:a(()=>[e(n,{modelValue:s(o).gateway,"onUpdate:modelValue":l[2]||(l[2]=t=>s(o).gateway=t),placeholder:"请输入网关",clearable:"",onKeyup:b(p,["enter"])},null,8,["modelValue"])]),_:1}),e(r,{class:"w-[220px]",label:"状态",prop:"status"},{default:a(()=>[e(M,{modelValue:s(o).status,"onUpdate:modelValue":l[3]||(l[3]=t=>s(o).status=t),placeholder:"请选择",clearable:""},{default:a(()=>[e(g,{label:"全部",value:""}),e(g,{label:"成功",value:1}),e(g,{label:"失败",value:2})]),_:1},8,["modelValue"])]),_:1}),e(r,{label:"发送时间"},{default:a(()=>[e($,{modelValue:s(d),"onUpdate:modelValue":l[4]||(l[4]=t=>E(d)?d.value=t:null),type:"datetimerange","range-separator":"-","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"YYYY-MM-DD HH:mm:ss",clearable:""},null,8,["modelValue"])]),_:1}),e(r,null,{default:a(()=>[e(k,{type:"primary",onClick:p},{default:a(()=>[...l[6]||(l[6]=[c("搜索",-1)])]),_:1}),e(k,{onClick:F},{default:a(()=>[...l[7]||(l[7]=[c("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),N((D(),P(x,{class:"!border-none",shadow:"never"},{default:a(()=>[e(U,{size:"large",data:s(w)},{default:a(()=>[e(u,{prop:"id",label:"ID",width:"80",align:"center"}),e(u,{prop:"mobile",label:"手机号","min-width":"140",align:"center"}),e(u,{prop:"template_key",label:"模板键名","min-width":"160"}),e(u,{prop:"gateway",label:"网关","min-width":"120"}),e(u,{label:"状态","min-width":"90",align:"center"},{default:a(({row:t})=>[e(R,{type:t.status===1?"success":t.status===2?"danger":"info"},{default:a(()=>[c(h(t.status===1?"成功":t.status===2?"失败":"处理中"),1)]),_:2},1032,["type"])]),_:1}),e(u,{prop:"error_message",label:"错误信息","min-width":"200"}),e(u,{label:"发送时间","min-width":"160"},{default:a(({row:t})=>[c(h(L(t.send_time)),1)]),_:1})]),_:1},8,["data"]),Q("div",re,[e(B,{modelValue:s(o),"onUpdate:modelValue":l[5]||(l[5]=t=>E(o)?o.value=t:null),total:s(V),onChange:f},null,8,["modelValue","total"])])]),_:1})),[[S,s(i)]])])}}}),fe=z(de,[["__scopeId","data-v-96be5b5d"]]);export{fe as default};
