|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[6763],{18974:function(_){_.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"}},5032:function(_){_.exports={"data-search-card":"data-search-card___M6nke","data-search-row":"data-search-row___3PMu2","data-search-item":"data-search-item___2UlXn","data-search-prefix":"data-search-prefix___icpVX","search-btn-item":"search-btn-item___1D2io","data-search-day":"data-search-day___2meX3","search-day-selected":"search-day-selected___X0xyP","data-search-sufixx":"data-search-sufixx___2M50P","loading-card":"loading-card___Et78m","member-card-box":"member-card-box___2eZXL","member-card-prefix":"member-card-prefix___1y0yw","member-card-sufixx":"member-card-sufixx___2v95D","new-member":"new-member___V3uRz","repur-chase":"repur-chase___1mB1Y","member-card":"member-card___5_ExE","member-row-common":"member-row-common___2OrNr"}},97632:function(_,y,e){"use strict";e.d(y,{Z:function(){return T}});var k=e(58024),O=e(91894),q=e(13062),g=e(71230),ee=e(57663),f=e(71577),ae=e(62999),P=e(54680),R=e(89032),m=e(15746),U=e(20228),D=e(11382),i=e(14965),A=e(91774),W=e(67294),S=e(18974),r=e.n(S),N=e(30381),s=e.n(N),n=e(85893),Y=A.Z.RangePicker;function T(a){var I=function(){return(0,n.jsx)("div",{className:r()["loading-card"],children:(0,n.jsx)(D.Z,{size:"large"})})};return(0,n.jsxs)("div",{children:[a.showLoading?(0,n.jsx)(I,{}):null,(0,n.jsx)(O.Z,{className:r()["data-search-card"],children:(0,n.jsxs)(g.Z,{gutter:20,className:r()["data-search-row"],children:[(0,n.jsx)(m.Z,{xs:24,sm:24,md:24,lg:12,xl:6,className:r()["data-search-item"],children:(0,n.jsx)(Y,{size:"middle",className:r()["data-search-sufixx"],value:a.timeRange,onChange:function(v,h){var Z=[s()(s()(new Date(h[0])).format("YYYY-MM-DD 00:00:00")),s()(s()(new Date(h[1])).format("YYYY-MM-DD 23:59:59"))];a.onTimePickerChange(Z)}})}),(0,n.jsxs)(m.Z,{xs:24,sm:24,md:24,lg:12,xl:6,className:r()["data-search-item"],children:[(0,n.jsx)("div",{className:a.searchDayIndex===0?"".concat(r()["data-search-day"]," ").concat(r()["search-day-selected"]):"".concat(r()["data-search-day"]),onClick:function(){return a.onChangeTimeIndex(0)},children:"\u4ECA\u5929"}),(0,n.jsx)("div",{className:a.searchDayIndex===1?"".concat(r()["data-search-day"]," ").concat(r()["search-day-selected"]):"".concat(r()["data-search-day"]),onClick:function(){return a.onChangeTimeIndex(1)},children:"\u6628\u5929"}),(0,n.jsx)("div",{className:a.searchDayIndex===2?"".concat(r()["data-search-day"]," ").concat(r()["search-day-selected"]):"".concat(r()["data-search-day"]),onClick:function(){return a.onChangeTimeIndex(2)},children:"\u8FD17\u5929"}),(0,n.jsx)("div",{className:a.searchDayIndex===3?"".concat(r()["data-search-day"]," ").concat(r()["search-day-selected"]):"".concat(r()["data-search-day"]),onClick:function(){return a.onChangeTimeIndex(3)},children:"\u8FD130\u5929"})]}),(0,n.jsx)(m.Z,{xs:24,sm:24,md:24,lg:12,xl:6,className:r()["data-search-item"],children:(0,n.jsx)(P.Z,{className:r()["data-search-sufixx"],dropdownStyle:{maxHeight:400,overflow:"auto"},value:a.currentOrg.title,treeData:a.orgTree,onSelect:function(v,h){h.type===2||h===3?a.onCurrentOrgChange(h):a.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:r()["data-search-item"],children:(0,n.jsxs)("div",{className:r()["data-search-btns"],children:[(0,n.jsx)(f.Z,{className:r()["search-btn-item"],onClick:a.onResetSearch,children:"\u91CD\u7F6E"}),(0,n.jsx)(f.Z,{className:r()["search-btn-item"],type:"primary",onClick:a.onQueryBtn,children:"\u67E5\u8BE2"})]})})]})})]})}},15111:function(_,y,e){"use strict";e.r(y),e.d(y,{default:function(){return I}});var k=e(13062),O=e(71230),q=e(89032),g=e(15746),ee=e(58024),f=e(91894),ae=e(34792),P=e(48086),R=e(3182),m=e(2824),U=e(94043),D=e.n(U),i=e(67294),A=e(78009),W=e(97632),S=e(5032),r=e.n(S),N=e(30381),s=e.n(N),n=e(48971),Y={getOrgTree:function(){return(0,n.WY)("/kitchen/api/report-statistics/org-tree",{method:"GET"})},getMemberReport:function(v){return(0,n.WY)("/kitchen/api/report-statistics/user-report",{method:"POST",data:v})}},T=e(29933),a=e(85893);function I(){var u=(0,i.useState)(0),v=(0,m.Z)(u,2),h=v[0],Z=v[1],re=(0,i.useState)([s()(s()(new Date(Date.now())).format("YYYY-MM-DD 00:00:00")),s()(s()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))]),K=(0,m.Z)(re,2),B=K[0],p=K[1],te=(0,i.useState)([]),F=(0,m.Z)(te,2),se=F[0],ne=F[1],ce=(0,i.useState)(!1),V=(0,m.Z)(ce,2),de=V[0],j=V[1],oe=(0,i.useState)(""),z=(0,m.Z)(oe,2),w=z[0],G=z[1],me=(0,i.useState)({userCount:0,newAddUser:[],repurChase:[]}),X=(0,m.Z)(me,2),b=X[0],ie=X[1],le=(0,i.useState)(0),Q=(0,m.Z)(le,2),ue=Q[0],he=Q[1],xe=(0,i.useState)(0),H=(0,m.Z)(xe,2),fe=H[0],De=H[1],C=null,E=null,ve=function(c){Z(c);var t=[];switch(c){case 0:t=[s()(s()(new Date(Date.now())).format("YYYY-MM-DD 00:00:00")),s()(s()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))];break;case 1:t=[s()(s()(new Date(Date.now()-24*60*60*1e3)).format("YYYY-MM-DD 00:00:00")),s()(s()(new Date(Date.now()-24*60*60*1e3)).format("YYYY-MM-DD 23:59:59"))];break;case 2:t=[s()(s()(new Date(Date.now()-24*60*60*1e3*7)).format("YYYY-MM-DD 00:00:00")),s()(s()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))];break;case 3:t=[s()(s()(new Date(Date.now()-24*60*60*1e3*30)).format("YYYY-MM-DD 00:00:00")),s()(s()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))];break}p(t)},_e=function(){var l=(0,R.Z)(D().mark(function c(){var t,d;return D().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return j(!0),o.next=3,Y.getOrgTree();case 3:t=o.sent,j(!1),t.statusCode===200?(d=t.data,ge(d),ne(d)):P.default.error(t.errors||"\u83B7\u53D6\u7EC4\u7EC7\u6811\u51FA\u9519");case 6:case"end":return o.stop()}},c)}));return function(){return l.apply(this,arguments)}}(),ge=function l(c){c.forEach(function(t){t.children&&t.children.length>0?l(t.children):t.type===2||t.type===3?t.disabled=!1:t.disabled=!0})},$=function(){var l=(0,R.Z)(D().mark(function c(){var t,d,x,o;return D().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return t={shopIds:[w.key],startTime:B[0],endTime:B[1]},w.key||delete t.shopIds,j(!0),M.next=5,Y.getMemberReport(t);case 5:d=M.sent,j(!1),d.statusCode===200?(x=0,o=0,d.data.newAddUser.forEach(function(L){x+=L.userValue}),d.data.repurChase.forEach(function(L){o+=L.userValue}),he(x),De(o),ie(d.data)):P.default.error(d.errors||"\u83B7\u53D6\u4F1A\u5458\u62A5\u8868\u5931\u8D25");case 8:case"end":return M.stop()}},c)}));return function(){return l.apply(this,arguments)}}(),Ce=function(){var c=document.getElementById("new-member");C||(C=T.S1(c));var t=[],d=[];b.newAddUser.forEach(function(o){var J=new Date(o.userKey);t.push(J.toLocaleDateString()),d.push(o.userValue)});var x={title:{text:"\u65B0\u589E\u4F1A\u5458"},tooltip:{trigger:"axis"},toolbox:{feature:{saveAsImage:{}}},xAxis:{type:"category",data:t},yAxis:{type:"value"},series:[{data:d,type:"bar"}]};C.setOption(x)},Ee=function(){var c=document.getElementById("repur-chase");E||(E=T.S1(c));var t=[],d=[];b.repurChase.forEach(function(o){t.push(o.userKey),d.push(o.userValue)});var x={title:{text:"\u590D\u8D2D\u6B21\u6570"},tooltip:{trigger:"axis",axisPointer:{label:{show:!0,formatter:"\u590D\u8D2D{value}\u6B21"}}},toolbox:{feature:{saveAsImage:{}}},xAxis:{type:"category",data:t},yAxis:{type:"value"},series:[{data:d,type:"line",smooth:!0}]};E.setOption(x)},Me=function(){G("")},ye=function(c){G(c)},Oe=function(c){p(c)};return(0,i.useEffect)(function(){_e(),$()},[]),(0,i.useEffect)(function(){Ce(),Ee(),window.onresize=function(){C&&E&&(C.resize(),E.resize())}},[b]),(0,a.jsxs)(A.ZP,{children:[(0,a.jsx)(W.Z,{orgTree:se,timeRange:B,searchDayIndex:h,currentOrg:w,showLoading:de,onTimePickerChange:Oe,onChangeTimeIndex:ve,onCurrentOrgChange:ye,onResetSearch:Me,onQueryBtn:$}),(0,a.jsxs)(O.Z,{gutter:10,className:r()["member-row-common"],children:[(0,a.jsx)(g.Z,{xs:24,sm:24,md:24,lg:8,xl:6,children:(0,a.jsxs)(f.Z,{className:r()["member-card"],children:[(0,a.jsxs)("div",{className:r()["member-card-box"],children:[(0,a.jsx)("div",{className:r()["member-card-prefix"],children:"\u4F1A\u5458\u603B\u91CF"}),(0,a.jsx)("div",{className:r()["member-card-sufixx"],children:b.userCount})]}),(0,a.jsxs)("div",{className:r()["member-card-box"],children:[(0,a.jsx)("div",{className:r()["member-card-prefix"],children:"\u65B0\u589E\u4F1A\u5458"}),(0,a.jsx)("div",{className:r()["member-card-sufixx"],children:ue})]}),(0,a.jsxs)("div",{className:r()["member-card-box"],children:[(0,a.jsx)("div",{className:r()["member-card-prefix"],children:"\u590D\u8D2D\u6570\u91CF"}),(0,a.jsx)("div",{className:r()["member-card-sufixx"],children:fe})]})]})}),(0,a.jsx)(g.Z,{xs:24,sm:24,md:24,lg:16,xl:18,children:(0,a.jsx)(f.Z,{children:(0,a.jsx)("div",{id:"repur-chase",className:r()["repur-chase"]})})})]}),(0,a.jsx)(O.Z,{children:(0,a.jsx)(g.Z,{xs:24,sm:24,md:24,lg:24,xl:24,children:(0,a.jsx)(f.Z,{children:(0,a.jsx)("div",{id:"new-member",className:r()["new-member"]})})})})]})}}}]);
|