You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 line
8.4 KiB

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