Files
aiot-platform-ui/apps/web-antd/dist/js/index-Hb78a8HA.js

2 lines
4.9 KiB
JavaScript

var E=(a,t,e)=>new Promise((f,p)=>{var d=o=>{try{u(e.next(o))}catch(i){p(i)}},C=o=>{try{u(e.throw(o))}catch(i){p(i)}},u=o=>o.done?f(o.value):Promise.resolve(o.value).then(d,C);u((e=e.apply(a,t)).next())});import{aq as b,ar as T,au as h,a9 as x}from"./bootstrap-DsjPfOC_.js";import{_ as V}from"./wx-account-select.vue_vue_type_script_setup_true_lang-BifvCgys.js";import"./wx-material-select.vue_vue_type_script_setup_true_lang-ojAC4QWa.js";import"./wx-video-play.vue_vue_type_script_setup_true_lang-H2pAIssH.js";import"./wx-voice-play.vue_vue_type_script_setup_true_lang-DWoDJN0e.js";import{cS as S,di as N,dj as $,m as q,b9 as g,ab as B,b2 as G,bJ as m,j as s,u as r,ae as A,dS as M,cA as P,dT as j}from"../jse/index-index-CO0ZsLf2.js";import{_ as H}from"./content-wrap.vue_vue_type_script_setup_true_lang-BpjRsiVS.js";import{u as _,_ as w}from"./use-echarts-DBBPKzKQ.js";import{_ as z}from"./page.vue_vue_type_script_setup_true_lang-BL-xU9lB.js";import"./index-9LUz1I1h.js";import"./vxe-table-C9eY8pUC.js";import"./dict-tag.vue_vue_type_script_setup_true_lang-BZwqGgTH.js";import"./wx-news.vue_vue_type_script_setup_true_lang-fcs7C6QO.js";import"./use-vxe-grid-z_YbcgDZ.js";function J(a){return b.get("/mp/statistics/upstream-message",{params:a})}function Q(a){return b.get("/mp/statistics/user-summary",{params:a})}function K(a){return b.get("/mp/statistics/user-cumulate",{params:a})}function L(a){return b.get("/mp/statistics/interface-summary",{params:a})}function W(a,t){return{color:["#67C23A","#E5323E"],legend:{data:["新增用户","取消关注的用户"]},tooltip:{},xAxis:{data:t},yAxis:{minInterval:1},series:[{name:"新增用户",type:"bar",label:{show:!0},barGap:0,data:a.map(e=>e.newUser)},{name:"取消关注的用户",type:"bar",label:{show:!0},data:a.map(e=>e.cancelUser)}]}}function X(a,t){return{legend:{data:["累计用户量"]},xAxis:{type:"category",data:t},yAxis:{minInterval:1},series:[{name:"累计用户量",data:a.map(e=>e.cumulateUser),type:"line",smooth:!0,label:{show:!0}}]}}function Z(a,t){return{color:["#67C23A","#E5323E"],legend:{data:["用户发送人数","用户发送条数"]},tooltip:{},xAxis:{data:t},yAxis:{minInterval:1},series:[{name:"用户发送人数",type:"line",smooth:!0,label:{show:!0},data:a.map(e=>e.msgUser)},{name:"用户发送条数",type:"line",smooth:!0,label:{show:!0},data:a.map(e=>e.msgCount)}]}}function ee(a,t){return{color:["#67C23A","#E5323E","#E6A23C","#409EFF"],legend:{data:["被动回复用户消息的次数","失败次数","最大耗时","总耗时"]},tooltip:{},xAxis:{data:t},yAxis:{},series:[{name:"被动回复用户消息的次数",type:"bar",label:{show:!0},barGap:0,data:a.map(e=>e.callbackCount)},{name:"失败次数",type:"bar",label:{show:!0},data:a.map(e=>e.failCount)},{name:"最大耗时",type:"bar",label:{show:!0},data:a.map(e=>e.maxTimeCost)},{name:"总耗时",type:"bar",label:{show:!0},data:a.map(e=>e.totalTimeCost)}]}}function ae(){return[{fieldName:"accountId",label:"公众号",component:"Input"},{fieldName:"dateRange",label:"时间范围",component:"RangePicker",componentProps:{format:"YYYY-MM-DD",valueFormat:"YYYY-MM-DD HH:mm:ss"},defaultValue:[S(N(new Date(Date.now()-3600*1e3*24*7))),S($(new Date(Date.now()-3600*1e3*24)))]}]}const te={class:"flex h-1/3 w-full gap-4"},re={class:"mt-4 flex h-1/3 w-full gap-4"},be=q({__name:"index",setup(a){const t=g(),{renderEcharts:e}=_(t),f=g(),{renderEcharts:p}=_(f),d=g(),{renderEcharts:C}=_(d),u=g(),{renderEcharts:o}=_(u);function i(c){return E(this,null,function*(){const l=c.accountId;if(!l){x.warning("请先选择公众号");return}const n=c.dateRange;if(!n){x.warning("请先选择时间范围");return}if(M(n[0],n[1])>=7){x.error("时间间隔 7 天以内,请重新选择");return}const I=M(n[0],n[1]),y=Array.from({length:I},(se,v)=>P(j(n[0],v),"YYYY-MM-DD")),U=yield Q({accountId:l,date:n});yield e(W(U,y));const k=yield K({accountId:l,date:n});yield p(X(k,y));const F=yield J({accountId:l,date:n});yield C(Z(F,y));const O=yield L({accountId:l,date:n});yield o(ee(O,y))})}function R(c){D.setValues({accountId:c}),D.submitForm()}const[Y,D]=T({commonConfig:{componentProps:{class:"w-full"}},layout:"horizontal",schema:ae(),wrapperClass:"grid-cols-1 md:grid-cols-2",handleSubmit:i});return(c,l)=>(G(),B(r(z),{"auto-content-height":""},{default:m(()=>[s(r(H),{class:"h-full w-full"},{default:m(()=>[s(r(Y),null,{accountId:m(()=>[s(r(V),{onChange:R})]),_:1}),A("div",te,[s(r(h),{class:"h-full w-1/2",title:"用户增减数据"},{default:m(()=>[s(r(w),{ref_key:"userSummaryRef",ref:t},null,512)]),_:1}),s(r(h),{class:"h-full w-1/2",title:"累计用户数据"},{default:m(()=>[s(r(w),{ref_key:"userCumulateRef",ref:f},null,512)]),_:1})]),A("div",re,[s(r(h),{class:"h-full w-1/2",title:"消息发送概况数据"},{default:m(()=>[s(r(w),{ref_key:"upstreamMessageRef",ref:d},null,512)]),_:1}),s(r(h),{class:"h-full w-1/2",title:"接口分析数据"},{default:m(()=>[s(r(w),{ref_key:"interfaceSummaryRef",ref:u},null,512)]),_:1})])]),_:1})]),_:1}))}});export{be as default};