"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9037],{63768:function(L,m,n){n.r(m),n.d(m,{default:function(){return P}});var D=n(26068),f=n.n(D),G=n(48305),x=n.n(G),p=n(50959),j=n(40676),F=n(14417),r=n(87980),s=n(23885),a=n(57385),$=n(90228),h=n.n($),M=n(87999),g=n.n(M),y=n(7485);function N(i){return Z.apply(this,arguments)}function Z(){return Z=g()(h()().mark(function i(l){return h()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,y.request)("/api/orders/statMallStatistics",f()({method:"GET"},l||{})));case 1:case"end":return u.stop()}},i)})),Z.apply(this,arguments)}function R(i){return E.apply(this,arguments)}function E(){return E=g()(h()().mark(function i(l){return h()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,y.request)("/api/orders/getAmountAndGoodsCount",f()({method:"GET"},l||{})));case 1:case"end":return u.stop()}},i)})),E.apply(this,arguments)}var B=n(54569),t=n(11527),P=function(){var i,l,c,u,W=(0,p.useState)([]),A=x()(W,2),S=A[0],z=A[1],H=(0,p.useState)([]),C=x()(H,2),e=C[0],I=C[1],J=(0,p.useState)([]),T=x()(J,2),O=T[0],Q=T[1],K={title:{visible:!0,text:"\u5546\u57CE(\u5546\u54C1\u6570\u91CF/\u91D1\u989D)-\u6298\u7EBF\u56FE"},padding:"auto",forceFit:!0,data:S,xField:"date",yField:"value",yAxis:{label:{formatter:function(o){return"".concat(o).replace(/\d{1,3}(?=(\d{3})+$)/g,function(d){return"".concat(d,",")})}}},legend:{position:"right-top"},seriesField:"type",color:function(o){return o==="register"?"#93D072":"#2D71E7"},responsive:!0};return(0,p.useEffect)(function(){N().then(function(v){I(v.data)}),R().then(function(v){var o=[];v.data.map(function(d,U){o.push({date:d.createTime,type:"shop",value:Number(d.goodsCount)}),o.push({date:d.createTime,type:"money",value:Number(d.amountCount)})}),console.log(o),z(o)})},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z,{children:"\u5145\u7535\u6869"}),(0,t.jsxs)(F.Z,{gutter:10,children:[(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4ECA\u65E5\u5145\u7535",value:e==null||(i=e.device_count)===null||i===void 0?void 0:i.today,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u6628\u65E5\u5145\u7535",value:e==null||(l=e.device_count)===null||l===void 0?void 0:l.yesterday,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4E0A\u5468\u5145\u7535",value:e==null||(c=e.device_count)===null||c===void 0?void 0:c.week,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4E0A\u6708\u5145\u7535",value:e==null||(u=e.device_count)===null||u===void 0?void 0:u.month,precision:2,prefix:"\uFFE5"})})})]}),(0,t.jsx)(j.Z,{children:"\u5546\u57CE"}),(0,t.jsxs)(F.Z,{gutter:10,children:[(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4ECA\u5929\u6210\u4EA4",value:e==null?void 0:e.todayTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u6628\u5929\u6210\u4EA4",value:e==null?void 0:e.yesterdayTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4E0A\u5468\u6210\u4EA4",value:e==null?void 0:e.lastWeekTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4E0A\u6708\u6210\u4EA4",value:e==null?void 0:e.lastMonthTransaction,precision:2,prefix:"\uFFE5"})})})]}),(0,t.jsx)(j.Z,{children:"\u5546\u57CE(\u5546\u54C1\u6570\u91CF/\u91D1\u989D)-\u6298\u7EBF\u56FE"}),S.length!=0?(0,t.jsx)(B.Z,f()({},K)):(0,t.jsx)(t.Fragment,{})]})}}}]);
