|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2642],{18974:function(x){x.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"}},94671:function(x){x.exports={"data-search-card":"data-search-card___3__W1","data-search-box":"data-search-box___1JO3P","search-btn-item":"search-btn-item___pebTO","activity-echarts":"activity-echarts___30Mkv","coupon-ehcarts":"coupon-ehcarts___2woXy"}},97632:function(x,M,e){"use strict";e.d(M,{Z:function(){return T}});var J=e(58024),R=e(91894),X=e(13062),C=e(71230),q=e(57663),E=e(71577),ee=e(62999),_=e(54680),I=e(89032),o=e(15746),W=e(20228),g=e(11382),m=e(14965),j=e(91774),N=e(67294),O=e(18974),t=e.n(O),n=e(30381),f=e.n(n),r=e(85893),Z=j.Z.RangePicker;function T(s){var i=function(){return(0,r.jsx)("div",{className:t()["loading-card"],children:(0,r.jsx)(g.Z,{size:"large"})})};return(0,r.jsxs)("div",{children:[s.showLoading?(0,r.jsx)(i,{}):null,(0,r.jsx)(R.Z,{className:t()["data-search-card"],children:(0,r.jsxs)(C.Z,{gutter:20,className:t()["data-search-row"],children:[(0,r.jsx)(o.Z,{xs:24,sm:24,md:24,lg:12,xl:6,className:t()["data-search-item"],children:(0,r.jsx)(Z,{size:"middle",className:t()["data-search-sufixx"],value:s.timeRange,onChange:function(y,l){var B=[f()(f()(new Date(l[0])).format("YYYY-MM-DD 00:00:00")),f()(f()(new Date(l[1])).format("YYYY-MM-DD 23:59:59"))];s.onTimePickerChange(B)}})}),(0,r.jsxs)(o.Z,{xs:24,sm:24,md:24,lg:12,xl:6,className:t()["data-search-item"],children:[(0,r.jsx)("div",{className:s.searchDayIndex===0?"".concat(t()["data-search-day"]," ").concat(t()["search-day-selected"]):"".concat(t()["data-search-day"]),onClick:function(){return s.onChangeTimeIndex(0)},children:"\u4ECA\u5929"}),(0,r.jsx)("div",{className:s.searchDayIndex===1?"".concat(t()["data-search-day"]," ").concat(t()["search-day-selected"]):"".concat(t()["data-search-day"]),onClick:function(){return s.onChangeTimeIndex(1)},children:"\u6628\u5929"}),(0,r.jsx)("div",{className:s.searchDayIndex===2?"".concat(t()["data-search-day"]," ").concat(t()["search-day-selected"]):"".concat(t()["data-search-day"]),onClick:function(){return s.onChangeTimeIndex(2)},children:"\u8FD17\u5929"}),(0,r.jsx)("div",{className:s.searchDayIndex===3?"".concat(t()["data-search-day"]," ").concat(t()["search-day-selected"]):"".concat(t()["data-search-day"]),onClick:function(){return s.onChangeTimeIndex(3)},children:"\u8FD130\u5929"})]}),(0,r.jsx)(o.Z,{xs:24,sm:24,md:24,lg:12,xl:6,className:t()["data-search-item"],children:(0,r.jsx)(_.Z,{className:t()["data-search-sufixx"],dropdownStyle:{maxHeight:400,overflow:"auto"},value:s.currentOrg.title,treeData:s.orgTree,onSelect:function(y,l){l.type===2||l===3?s.onCurrentOrgChange(l):s.onCurrentOrgChange("")},placeholder:"\u8BF7\u9009\u62E9\u7EC4\u7EC7\u67B6\u6784",treeDefaultExpandAll:!0})}),(0,r.jsx)(o.Z,{xs:24,sm:24,md:12,lg:12,xl:6,className:t()["data-search-item"],children:(0,r.jsxs)("div",{className:t()["data-search-btns"],children:[(0,r.jsx)(E.Z,{className:t()["search-btn-item"],onClick:s.onResetSearch,children:"\u91CD\u7F6E"}),(0,r.jsx)(E.Z,{className:t()["search-btn-item"],type:"primary",onClick:s.onQueryBtn,children:"\u67E5\u8BE2"})]})})]})})]})}},25647:function(x,M,e){"use strict";e.r(M),e.d(M,{default:function(){return D}});var J=e(13062),R=e(71230),X=e(89032),C=e(15746),q=e(58024),E=e(91894),ee=e(34792),_=e(48086),I=e(3182),o=e(2824),W=e(94043),g=e.n(W),m=e(67294),j=e(78009),N=e(97632),O=e(29933),t=e(30381),n=e.n(t),f=e(94671),r=e.n(f),Z=e(11849),T=e(48971),s={getOrgTree:function(){return(0,T.WY)("/kitchen/api/report-statistics/org-tree",{method:"GET"})},getReportStatisticsMarketing:function(l){return(0,T.WY)("/kitchen/api/report-statistics/marketing",{method:"POST",data:(0,Z.Z)({},l)})}},i=e(85893);function D(){var y=(0,m.useState)(0),l=(0,o.Z)(y,2),B=l[0],ae=l[1],te=(0,m.useState)([n()(n()(new Date(Date.now())).format("YYYY-MM-DD 00:00:00")),n()(n()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))]),K=(0,o.Z)(te,2),L=K[0],U=K[1],ne=(0,m.useState)([]),p=(0,o.Z)(ne,2),re=p[0],se=p[1],ce=(0,m.useState)(!1),w=(0,o.Z)(ce,2),oe=w[0],P=w[1],de=(0,m.useState)(""),G=(0,o.Z)(de,2),F=G[0],Q=G[1],ie=(0,m.useState)([]),z=(0,o.Z)(ie,2),b=z[0],le=z[1],ue=(0,m.useState)([]),H=(0,o.Z)(ue,2),V=H[0],he=H[1],Y=null,S=null,me=function(c){ae(c);var a=[];switch(c){case 0:a=[n()(n()(new Date(Date.now())).format("YYYY-MM-DD 00:00:00")),n()(n()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))];break;case 1:a=[n()(n()(new Date(Date.now()-24*60*60*1e3)).format("YYYY-MM-DD 00:00:00")),n()(n()(new Date(Date.now()-24*60*60*1e3)).format("YYYY-MM-DD 23:59:59"))];break;case 2:a=[n()(n()(new Date(Date.now()-24*60*60*1e3*7)).format("YYYY-MM-DD 00:00:00")),n()(n()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))];break;case 3:a=[n()(n()(new Date(Date.now()-24*60*60*1e3*30)).format("YYYY-MM-DD 00:00:00")),n()(n()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))];break}U(a)},ve=function(){var u=(0,I.Z)(g().mark(function c(){var a,v;return g().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return P(!0),h.next=3,s.getOrgTree();case 3:a=h.sent,P(!1),a.statusCode===200?(v=a.data,De(v),se(v)):_.default.error(a.errors||"\u83B7\u53D6\u7EC4\u7EC7\u6811\u51FA\u9519");case 6:case"end":return h.stop()}},c)}));return function(){return u.apply(this,arguments)}}(),De=function u(c){c.forEach(function(a){a.children&&a.children.length>0?u(a.children):a.type===2||a.type===3?a.disabled=!1:a.disabled=!0})},ge=function(){Q("")},fe=function(c){Q(c)},xe=function(c){U(c)},k=function(){var u=(0,I.Z)(g().mark(function c(){var a;return g().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return P(!0),d.next=3,s.getReportStatisticsMarketing({sTime:L[0]._i,eTime:L[1]._i,key:[F.key||""]});case 3:a=d.sent,P(!1),a.statusCode===200?(le(a.data.activity),he(a.data.coupon)):_.default.error(a.errors||"\u83B7\u53D6\u8425\u9500\u62A5\u8868\u5217\u8868\u51FA\u9519");case 6:case"end":return d.stop()}},c)}));return function(){return u.apply(this,arguments)}}(),Ee=function(){var c=document.getElementById("activity-echarts");Y=O.S1(c);var a=[],v=[];b.forEach(function(h){a.push(h.activityName),v.push(h.numberParticipants)});var d={title:{text:"\u6D3B\u52A8\u62A5\u8868"},tooltip:{trigger:"axis"},toolbox:{feature:{saveAsImage:{}}},xAxis:{type:"category",data:a},yAxis:{type:"value"},series:[{data:v,type:"bar",showBackground:!0,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}]};d&&Y.setOption(d)},ye=function(){var c=document.getElementById("coupon-ehcarts");S=O.S1(c);var a=[],v=[],d=[],h=[];V.forEach(function(A){a.push(A.couponName),v.push(A.preferentialAmount),d.push(A.send),h.push(A.get)});var $={title:{text:"\u4F18\u60E0\u5238\u62A5\u8868"},tooltip:{trigger:"axis"},legend:{data:["\u4F18\u60E0\u91D1\u989D","\u53D1\u653E\u6570\u91CF","\u9886\u53D6\u6570\u91CF"]},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},toolbox:{feature:{saveAsImage:{}}},xAxis:{type:"category",boundaryGap:!1,data:a},yAxis:{type:"value"},series:[{name:"\u4F18\u60E0\u91D1\u989D",type:"line",stack:"Total",data:v},{name:"\u53D1\u653E\u6570\u91CF",type:"line",stack:"Total",data:d},{name:"\u9886\u53D6\u6570\u91CF",type:"line",stack:"Total",data:h}]};$&&S.setOption($)};return(0,m.useEffect)(function(){ve(),k()},[]),(0,m.useEffect)(function(){Ee(),ye(),window.onresize=function(){Y&&S&&(Y.resize(),S.resize())}},[b,V]),(0,i.jsxs)(j.ZP,{children:[(0,i.jsx)(N.Z,{orgTree:re,timeRange:L,searchDayIndex:B,currentOrg:F,showLoading:oe,onTimePickerChange:xe,onChangeTimeIndex:me,onCurrentOrgChange:fe,onResetSearch:ge,onQueryBtn:k}),(0,i.jsxs)(R.Z,{gutter:10,children:[(0,i.jsx)(C.Z,{xs:24,sm:24,md:24,lg:8,xl:8,children:(0,i.jsx)(E.Z,{children:(0,i.jsx)("div",{id:"activity-echarts",className:r()["activity-echarts"]})})}),(0,i.jsx)(C.Z,{xs:24,sm:24,md:24,lg:16,xl:16,children:(0,i.jsx)(E.Z,{children:(0,i.jsx)("div",{id:"coupon-ehcarts",className:r()["coupon-ehcarts"]})})})]})]})}}}]);
|