(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[1142],{18974:function(f){f.exports={"data-search-card":"data-search-card___fc1xW","data-search-row":"data-search-row___FtrAv","data-search-item":"data-search-item___g5H_b","data-search-prefix":"data-search-prefix___bxf2p","search-btn-item":"search-btn-item___1lD6h","data-search-day":"data-search-day___1AMa5","search-day-selected":"search-day-selected___1rdk5","data-search-sufixx":"data-search-sufixx___3Ht7c","loading-card":"loading-card___2AdV6","member-card-box":"member-card-box___1GV0Y","member-card-prefix":"member-card-prefix___3LNuc","member-card-sufixx":"member-card-sufixx___AFiDV","new-member":"new-member___2TlTQ","repur-chase":"repur-chase___1cYei","member-card":"member-card___3syWs","member-row-common":"member-row-common___1sZlj"}},5525:function(f){f.exports={"top-goods":"top-goods___3IvoO","top-goods-line":"top-goods-line___2RCLw"}},97632:function(f,C,e){"use strict";e.d(C,{Z:function(){return d}});var $=e(58024),Y=e(91894),J=e(13062),M=e(71230),X=e(57663),v=e(71577),x=e(62999),K=e(54680),I=e(89032),m=e(15746),D=e(20228),u=e(11382),U=e(14965),S=e(91774),A=e(67294),j=e(18974),a=e.n(j),R=e(30381),g=e.n(R),n=e(85893),y=S.Z.RangePicker;function d(s){var E=function(){return(0,n.jsx)("div",{className:a()["loading-card"],children:(0,n.jsx)(u.Z,{size:"large"})})};return(0,n.jsxs)("div",{children:[s.showLoading?(0,n.jsx)(E,{}):null,(0,n.jsx)(Y.Z,{className:a()["data-search-card"],children:(0,n.jsxs)(M.Z,{gutter:20,className:a()["data-search-row"],children:[(0,n.jsx)(m.Z,{xs:24,sm:24,md:24,lg:12,xl:6,className:a()["data-search-item"],children:(0,n.jsx)(y,{size:"middle",className:a()["data-search-sufixx"],value:s.timeRange,onChange:function(Z,h){var L=[g()(g()(new Date(h[0])).format("YYYY-MM-DD 00:00:00")),g()(g()(new Date(h[1])).format("YYYY-MM-DD 23:59:59"))];s.onTimePickerChange(L)}})}),(0,n.jsxs)(m.Z,{xs:24,sm:24,md:24,lg:12,xl:6,className:a()["data-search-item"],children:[(0,n.jsx)("div",{className:s.searchDayIndex===0?"".concat(a()["data-search-day"]," ").concat(a()["search-day-selected"]):"".concat(a()["data-search-day"]),onClick:function(){return s.onChangeTimeIndex(0)},children:"\u4ECA\u5929"}),(0,n.jsx)("div",{className:s.searchDayIndex===1?"".concat(a()["data-search-day"]," ").concat(a()["search-day-selected"]):"".concat(a()["data-search-day"]),onClick:function(){return s.onChangeTimeIndex(1)},children:"\u6628\u5929"}),(0,n.jsx)("div",{className:s.searchDayIndex===2?"".concat(a()["data-search-day"]," ").concat(a()["search-day-selected"]):"".concat(a()["data-search-day"]),onClick:function(){return s.onChangeTimeIndex(2)},children:"\u8FD17\u5929"}),(0,n.jsx)("div",{className:s.searchDayIndex===3?"".concat(a()["data-search-day"]," ").concat(a()["search-day-selected"]):"".concat(a()["data-search-day"]),onClick:function(){return s.onChangeTimeIndex(3)},children:"\u8FD130\u5929"})]}),(0,n.jsx)(m.Z,{xs:24,sm:24,md:24,lg:12,xl:6,className:a()["data-search-item"],children:(0,n.jsx)(K.Z,{className:a()["data-search-sufixx"],dropdownStyle:{maxHeight:400,overflow:"auto"},value:s.currentOrg.title,treeData:s.orgTree,onSelect:function(Z,h){h.type===2||h===3?s.onCurrentOrgChange(h):s.onCurrentOrgChange("")},placeholder:"\u8BF7\u9009\u62E9\u7EC4\u7EC7\u67B6\u6784",treeDefaultExpandAll:!0})}),(0,n.jsx)(m.Z,{xs:24,sm:24,md:12,lg:12,xl:6,className:a()["data-search-item"],children:(0,n.jsxs)("div",{className:a()["data-search-btns"],children:[(0,n.jsx)(v.Z,{className:a()["search-btn-item"],onClick:s.onResetSearch,children:"\u91CD\u7F6E"}),(0,n.jsx)(v.Z,{className:a()["search-btn-item"],type:"primary",onClick:s.onQueryBtn,children:"\u67E5\u8BE2"})]})})]})})]})}},99531:function(f,C,e){"use strict";e.r(C),e.d(C,{default:function(){return s}});var $=e(13062),Y=e(71230),J=e(89032),M=e(15746),X=e(58024),v=e(91894),x=e(39428),K=e(34792),I=e(48086),m=e(3182),D=e(2824),u=e(67294),U=e(78009),S=e(97632),A=e(72866),j=e(30381),a=e.n(j),R=e(5525),g=e.n(R),n=e(48971),y={getOrgTree:function(){return(0,n.WY)("/kitchen/api/report-statistics/org-tree",{method:"GET"})},getProductEcharts:function(c){return(0,n.WY)("/kitchen/api/report-statistics/productc",{method:"POST",data:c})}},d=e(85893);function s(){var E=(0,u.useState)(0),c=(0,D.Z)(E,2),Z=c[0],h=c[1],L=(0,u.useState)([a()(a()(new Date(Date.now())).format("YYYY-MM-DD 00:00:00")),a()(a()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))]),N=(0,D.Z)(L,2),B=N[0],G=N[1],b=(0,u.useState)([]),p=(0,D.Z)(b,2),k=p[0],q=p[1],ee=(0,u.useState)(!1),w=(0,D.Z)(ee,2),ae=w[0],O=w[1],te=(0,u.useState)(""),H=(0,D.Z)(te,2),W=H[0],F=H[1],ne=(0,u.useState)([]),z=(0,D.Z)(ne,2),Q=z[0],se=z[1],_=null,T=null,re=function(r){h(r);var t=[];switch(r){case 0:t=[a()(a()(new Date(Date.now())).format("YYYY-MM-DD 00:00:00")),a()(a()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))];break;case 1:t=[a()(a()(new Date(Date.now()-24*60*60*1e3)).format("YYYY-MM-DD 00:00:00")),a()(a()(new Date(Date.now()-24*60*60*1e3)).format("YYYY-MM-DD 23:59:59"))];break;case 2:t=[a()(a()(new Date(Date.now()-24*60*60*1e3*7)).format("YYYY-MM-DD 00:00:00")),a()(a()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))];break;case 3:t=[a()(a()(new Date(Date.now()-24*60*60*1e3*30)).format("YYYY-MM-DD 00:00:00")),a()(a()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))];break}G(t)},oe=function(){var i=(0,m.Z)((0,x.Z)().mark(function r(){var t,l;return(0,x.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return O(!0),o.next=3,y.getOrgTree();case 3:t=o.sent,O(!1),t.statusCode===200?(l=t.data,de(l),q(l)):I.default.error(t.errors||"\u83B7\u53D6\u7EC4\u7EC7\u6811\u51FA\u9519");case 6:case"end":return o.stop()}},r)}));return function(){return i.apply(this,arguments)}}(),de=function i(r){r.forEach(function(t){t.children&&t.children.length>0?i(t.children):t.type===2||t.type===3?t.disabled=!1:t.disabled=!0})},ce=function(){F("")},ie=function(r){F(r)},le=function(r){G(r)},V=function(){var i=(0,m.Z)((0,x.Z)().mark(function r(){var t,l;return(0,x.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return t={top:10,shopIds:[W.key],startTime:B[0],endTime:B[1]},W.key||delete t.shopIds,O(!0),o.next=5,y.getProductEcharts(t);case 5:l=o.sent,O(!1),l.statusCode===200?se(l.data.topGoods):I.default.error(l.errors||"\u83B7\u53D6\u70ED\u9500\u4EA7\u54C1\u6570\u636E\u51FA\u9519");case 8:case"end":return o.stop()}},r)}));return function(){return i.apply(this,arguments)}}(),ue=function(){var r=document.getElementById("top-goods");T=A.S1(r);var t=[],l=[];Q.forEach(function(o){t.push(o.name),l.push(o.count)});var P={title:{show:!0,text:"\u70ED\u9500\u5546\u54C1"},tooltip:{trigger:"axis",axisPointer:{label:{show:!0,formatter:"\u70ED\u9500\u5546\u54C1"}}},toolbox:{feature:{saveAsImage:{}}},xAxis:{type:"category",data:t},yAxis:{type:"value"},series:[{data:l,type:"bar",showBackground:!0,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}]};P&&T.setOption(P)},he=function(){var r=document.getElementById("top-goods-line");_=A.S1(r);var t={title:{show:!0,text:"\u70ED\u9500\u5546\u54C1"},toolbox:{feature:{saveAsImage:{}}},tooltip:{trigger:"axis",axisPointer:{label:{show:!0,formatter:"\u70ED\u9500\u5546\u54C1"}}},xAxis:{type:"category",data:["00:00","01:00","02:00","03:00","04:00","05:00","06:00"]},yAxis:{type:"value"},series:[{data:[150,230,224,218,135,147,260],type:"line"}]};t&&_.setOption(t)};return(0,u.useEffect)(function(){oe(),V()},[]),(0,u.useEffect)(function(){ue(),he(),window.onresize=function(){_&&T&&(_.resize(),T.resize())}},[Q]),(0,d.jsxs)(U.ZP,{children:[(0,d.jsx)(S.Z,{orgTree:k,timeRange:B,searchDayIndex:Z,currentOrg:W,showLoading:ae,onTimePickerChange:le,onChangeTimeIndex:re,onCurrentOrgChange:ie,onResetSearch:ce,onQueryBtn:V}),(0,d.jsxs)(Y.Z,{gutter:10,children:[(0,d.jsx)(M.Z,{xs:24,sm:24,md:24,lg:8,xl:8,children:(0,d.jsx)(v.Z,{children:(0,d.jsx)("div",{id:"top-goods",className:g()["top-goods"]})})}),(0,d.jsx)(M.Z,{xs:24,sm:24,md:24,lg:16,xl:16,children:(0,d.jsx)(v.Z,{children:(0,d.jsx)("div",{id:"top-goods-line",className:g()["top-goods-line"]})})})]})]})}}}]);