File: /www/server/panel/BTPanel/static/js/today.js
import{O as e,H as t,M as a,bl as s,u as l,a3 as i,c as r,e as c}from"./utils-lib.js?v=1777008528";import{g as o,r as d,a$ as n,i as p,c as u,t as m,s as v,o as x,a1 as h,k as y,l as b,e as f,x as g,q as S,p as _,v as w,aT as H}from"./base-lib.js?v=1777008528";import{g as j,u as C}from"./mail.js?v=1777008528";import{e as k}from"./validator.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index105.js?v=1777008528";import"./column.js?v=1777008528";const A=o("MAIL_OVERVIEW",(()=>{const l=d({delivered:0,bounced:0,received:0,rejected:0}),i=d(),r=d(),c=n({tooltip:{trigger:"axis",order:"seriesDesc",axisPointer:{type:"shadow",label:{formatter:t=>e(t.value,"HH:mm")}}},legend:{top:0,itemGap:16,icon:"circle",itemWidth:10,itemHeight:10,data:["发送成功","发送失败"],textStyle:{lineHeight:12,padding:[0,0,-2,0],rich:{a:{verticalAlign:"middle"}}}},grid:{top:"16%",left:"2%",right:"3%",bottom:"4%",containLabel:!0},xAxis:{type:"category",name:"小时",axisLabel:{formatter:t=>e(t,"HH:mm")}},yAxis:{type:"value",minInterval:1,boundaryGap:[0,"6%"],splitLine:{show:!0,lineStyle:{type:"dashed",width:1,color:"#ebeef5"}}},series:[{type:"bar",name:"发送失败",data:[]},{type:"bar",name:"发送成功",data:[]}]}),o=n({tooltip:{trigger:"axis",order:"seriesDesc",axisPointer:{type:"shadow",label:{formatter:t=>e(t.value,"HH:mm")}}},legend:{top:0,itemGap:16,icon:"circle",itemWidth:10,itemHeight:10,data:["接收成功","接收失败"],textStyle:{lineHeight:12,padding:[0,0,-2,0],rich:{a:{verticalAlign:"middle"}}}},grid:{top:"16%",left:"2%",right:"3%",bottom:"4%",containLabel:!0},xAxis:{type:"category",name:"小时",axisLabel:{formatter:t=>e(t,"HH:mm")}},yAxis:{type:"value",minInterval:1,boundaryGap:[0,"6%"],splitLine:{show:!0,lineStyle:{type:"dashed",width:1,color:"#ebeef5"}}},series:[{type:"bar",name:"接收失败",data:[]},{type:"bar",name:"接收成功",data:[]}]}),u=p((()=>l.value.delivered||0)),m=p((()=>l.value.bounced||0)),v=p((()=>{const e=m.value+u.value;return 0===e?0:(u.value/e*100).toFixed(1)})),x=p((()=>l.value.received||0)),h=p((()=>l.value.rejected||0)),y=p((()=>{const e=h.value+x.value;return 0===e?0:(x.value/e*100).toFixed(1)})),b=e=>{const t=[],a=[],s=[],l=[];e.forEach((e=>{t.push([e.time,e.bounced]),a.push([e.time,e.delivered]),s.push([e.time,e.received]),l.push([e.time,e.rejected])})),c.series=[{type:"bar",name:"发送失败",data:t,stack:"total",itemStyle:{color:"#1A519B"}},{type:"bar",name:"发送成功",data:a,stack:"total",itemStyle:{color:"#91CC75"}}],o.series=[{type:"bar",name:"接收失败",data:l,stack:"total",itemStyle:{color:"#1A519B"}},{type:"bar",name:"接收成功",data:s,stack:"total",itemStyle:{color:"#91CC75"}}]};return{total:l,sendOption:c,receivedOption:o,sendSuccess:u,sendFail:m,sendSuccessRate:v,receiveSuccess:x,receiveFail:h,receiveSuccessRate:y,getData:async(e,d,n,p)=>{t({request:j(),loading:"数据加载中...",success:async({data:t})=>{if(!t.status)return a.error(t.msg);s(t.data)&&(l.value=t.data.stats_dict,r.value=await e(),i.value=await d(),b(t.data.hourly_stats),n(c),p(o))}})},$reset:()=>{l.value={delivered:0,bounced:0,received:0,rejected:0},r.value=null,i.value=null}}})),E=d({period:{total:"--",used:"--",surplus:"--"},free:{total:"--",used:"--",surplus:"--"}}),O=()=>{window.open("https://www.bt.cn/bbs/thread-141971-1-1.html")},L=()=>{k({name:"宝塔邮局",type:36,id:63})},R={class:"flex items-center"},F={class:"p-24px"},I={class:"total-list"},B={class:"total-item"},D={class:"total-value text-primary text-22px"},G={class:"total-item"},q={class:"total-value text-17px"},P={class:"total-item"},W={class:"total-value text-17px"},$={class:"h-200px"},M={class:"p-24px"},V={class:"total-list"},Q={class:"total-item"},T={class:"total-value text-primary text-22px"},z={class:"total-item"},J={class:"total-value text-17px"},K={class:"total-item"},N={class:"total-value text-17px"},U={class:"h-200px"},X=c(u({__name:"today",setup(e){const{payment:s}=l();m(s.value);const c=A(),{sendSuccessRate:o,sendSuccess:d,sendFail:n,receiveSuccessRate:p,receiveSuccess:u,receiveFail:j}=v(c),{BtECharts:k,getEChart:X,setOption:Y,setQuickOption:Z}=i({options:{}}),{BtECharts:ee,getEChart:te,setOption:ae}=i({options:{}});return x((()=>{((e=!1,s=!1)=>{t({request:C(e?{fresh:1}:{}),success:e=>{Object.keys(E.value).forEach((t=>{E.value[t]=e.data.hasOwnProperty(t)?e.data[t]:"--"})),s&&a.success("刷新成功")}})})(),c.getData(X,te,Y,ae)})),h((()=>{c.$reset()})),(e,t)=>{const a=r,s=H;return y(),b("div",null,[f(s,{class:"mb-[14px] !border-none"},{header:g((()=>[S("div",R,[t[2]||(t[2]=S("span",{class:"text-[1.6rem]"},"今日发送",-1)),f(a,{class:"ml-[12px]",onClick:_(L)},{default:g((()=>t[0]||(t[0]=[S("div",{class:"flex items-center"},[S("span",{class:"svgtofont-desired text-[1.6rem]"}),S("span",null,"需求反馈")],-1)]))),_:1},8,["onClick"]),f(a,{class:"ml-[12px]",onClick:_(O)},{default:g((()=>t[1]||(t[1]=[S("div",{class:"flex items-center"},[S("span",{class:"text-[1.2rem]"},">>"),S("span",null,"使用说明")],-1)]))),_:1},8,["onClick"])])])),default:g((()=>[S("div",F,[S("div",I,[S("div",B,[t[3]||(t[3]=S("div",{class:"total-label"},"发送成功率",-1)),S("div",D,w(_(o))+"%",1)]),S("div",G,[t[4]||(t[4]=S("div",{class:"total-label"},"发送成功",-1)),S("div",q,w(_(d)),1)]),S("div",P,[t[5]||(t[5]=S("div",{class:"total-label"},"发送失败",-1)),S("div",W,w(_(n)),1)])]),S("div",$,[f(_(k),{ref:"echartRef",style:{height:"200px"}},null,512)])])])),_:1}),f(s,{class:"!border-none"},{header:g((()=>t[6]||(t[6]=[S("div",{class:"flex items-center"},[S("span",{class:"text-[1.6rem]"},"今日接收")],-1)]))),default:g((()=>[S("div",M,[S("div",V,[S("div",Q,[t[7]||(t[7]=S("div",{class:"total-label"},"接收成功率",-1)),S("div",T,w(_(p))+"%",1)]),S("div",z,[t[8]||(t[8]=S("div",{class:"total-label"},"接收成功",-1)),S("div",J,w(_(u)),1)]),S("div",K,[t[9]||(t[9]=S("div",{class:"total-label"},"接收失败",-1)),S("div",N,w(_(j)),1)])]),S("div",U,[f(_(ee),{ref:"sendEchartRef",style:{height:"200px"}},null,512)])])])),_:1})])}}}),[["__scopeId","data-v-d19fc40f"]]);export{X as default};