import{dc as x}from"./echarts-bf9d612c.js";import{g as y}from"./workbench-ff9899e7.js";import{y as g,R as b,b as w,v as A,w as k}from"./ui-ba7aaa7e.js";import{e as C,r as l,P as D,a3 as B,a4 as o,f as n,a5 as V,H as _,I as z}from"./vue-bf422dc1.js";import{_ as L}from"./index-8db2df2c.js";import"./icons-a8498fb6.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";const R={name:"DashboardBase"},T=C({...R,setup(O){const m=async()=>{r()},s=l("month"),c=()=>({legend:{icon:"rect",itemWidth:12,itemHeight:4,itemGap:48,textStyle:{fontSize:12},left:"center",bottom:"0",orient:"horizontal",data:["交易额","结算额"]},tooltip:{trigger:"item"},grid:{left:"5px",right:"5px",containLabel:!0,bottom:"60px"},xAxis:[{type:"category",data:a.value.xAxis,axisTick:{alignWithLabel:!0}}],yAxis:[{type:"value",axisTick:{alignWithLabel:!0},axisLabel:{formatter:e=>`${e} 元`}}],series:[{type:"bar",name:"交易额",data:a.value.series},{type:"bar",name:"结算额",data:a.value.finallyAmount}]}),a=l({xAxis:[],series:[],finallyAmount:[]}),t=l();(async()=>{const{data:e}=await y();t.value=e,await r()})();const r=async()=>{if(a.value.xAxis=[],a.value.series=[],a.value.finallyAmount=[],s.value==="week")for(let e=0;e<t.value.res_week.length;e++)a.value.xAxis.push(t.value.res_week[e].week),a.value.series.push(t.value.res_week[e].day_amount),a.value.finallyAmount.push(t.value.res_week[e].finally_amount);else for(let e=0;e<t.value.res_month.length;e++)a.value.xAxis.push(t.value.res_month[e].month),a.value.series.push(t.value.res_month[e].month_amount),a.value.finallyAmount.push(t.value.res_month[e].month_finally_amount)};return(e,i)=>{const u=g,d=b,p=w,f=A,v=k;return D(),B(v,{gutter:[16,16]},{default:o(()=>[n(f,{xs:12,xl:12},{default:o(()=>[n(p,{bordered:!1,title:"交易统计",class:V({"dashboard-overview-card":!0,"overview-panel":!0})},{actions:o(()=>[n(d,{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),variant:"default-filled",onChange:m},{default:o(()=>[n(u,{value:"week"},{default:o(()=>[_("最近7天")]),_:1}),n(u,{value:"month"},{default:o(()=>[_("月度统计")]),_:1})]),_:1},8,["modelValue"])]),default:o(()=>[n(z(x),{class:"chart",option:c(),autoresize:""},null,8,["option"])]),_:1})]),_:1})]),_:1})}}});const q=L(T,[["__scopeId","data-v-ba600273"]]);export{q as default};
