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.
 
 
 

1 lines
5.9 KiB

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[542],{51572:function(xe,Z,t){t.r(Z),t.d(Z,{default:function(){return q}});var P=t(97857),m=t.n(P),O=t(15009),f=t.n(O),b=t(99289),j=t.n(b),N=t(5574),x=t.n(N),I=t(48357),w=t(11415),u=t(39615),G=t(90930),L=t(25335),V=t(57470),C=t(64317),K=t(34540),W=t(71230),Q=t(7134),U=t(13169),R=t(16250),H=t(27484),J=t.n(H),X=t(9220),o=t(67294),Y=t(96974),v=function(p){return p?parseFloat((p/1e5).toFixed(2)):0},a=t(85893),k=function(){var p=(0,o.useRef)(),ee=(0,o.useState)(void 0),A=x()(ee,2),F=A[0],te=A[1],c=function(){return window.innerWidth<=768},ae=(0,o.useState)({deviceId:{show:!c()},appName:{show:!c()},platform:{show:!c()},deviceBrand:{show:!c()},deviceName:{show:!c()},ip:{show:!c()},advType:{show:!c()}}),D=x()(ae,2),ne=D[0],re=D[1],ie=[{title:"\u8BBE\u5907id",dataIndex:"deviceId",valueType:"textarea",ellipsis:!0,copyable:!0},{title:"\u5E94\u7528\u540D\u79F0",hideInSearch:!0,dataIndex:"appName",valueType:"textarea"},{title:"\u5E73\u53F0",dataIndex:"platform",width:80,valueEnum:{1:{text:"\u7A7F\u5C71\u7532"},2:{text:"\u817E\u8BAF"},3:{text:"\u767E\u5EA6\u8054\u76DF"},4:{text:"Mintegral"},5:{text:"\u5FEB\u624B"},6:{text:"\u6E38\u53EF\u8D62"},7:{text:"Sigmob"},8:{text:"Admob"}}},{title:"\u5E7F\u544A\u7C7B\u578B",dataIndex:"advType",valueEnum:{1:{text:"\u6A2A\u5E45",status:"Default"},2:{text:"\u63D2\u9875",status:"Processing"},3:{text:"\u6FC0\u52B1\u89C6\u9891",status:"Success"}}},{title:"ecpm(\u5143)",dataIndex:"ecpm",hideInSearch:!0,renderText:function(e){return e/100}},{title:"\u8BBE\u5907",dataIndex:"device",hideInSearch:!0,renderText:function(e,i){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:i.deviceBrand}),(0,a.jsx)("p",{children:i.deviceName})]})}},{title:"ip",dataIndex:"ip",hideInSearch:!0,valueType:"textarea"},{title:"\u7528\u6237",dataIndex:"user",hideInSearch:!0,renderText:function(e,i){var s,l,r;if(i.user)return(0,a.jsxs)(W.Z,{children:[(0,a.jsx)(Q.C,{src:(s=i.user)===null||s===void 0?void 0:s.avatar}),(0,a.jsxs)("p",{style:{fontSize:12},children:["id:",i.user.id,(0,a.jsx)("br",{}),((l=i.user)===null||l===void 0?void 0:l.nickname)||((r=i.user)===null||r===void 0?void 0:r.mobile)]})]})}},{title:"\u65F6\u95F4",hideInSearch:!0,dataIndex:"createdAt",valueType:"dateTime"},{title:"\u65F6\u95F4",hideInTable:!0,dataIndex:"createdAt",valueType:"dateRange"}],se=(0,Y.UO)(),y=se.code,de=(0,o.useState)(),E=x()(de,2),d=E[0],le=E[1],ue=(0,o.useState)([]),$=x()(ue,2),z=$[0],oe=$[1],g=u.Z.Divider,ve=(0,o.useState)(!1),B=x()(ve,2),S=B[0],ce=B[1],fe=function(){var n=j()(f()().mark(function e(i){var s;return f()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,I.d1)({appCode:i});case 2:s=r.sent,s.data&&le(s.data);case 4:case"end":return r.stop()}},e)}));return function(i){return n.apply(this,arguments)}}(),M=function(){var n=j()(f()().mark(function e(i){var s;return f()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,I.Zb)(m()(m()({},i),{},{code:y}));case 2:s=r.sent,s.data&&oe(s.data);case 4:case"end":return r.stop()}},e)}));return function(i){return n.apply(this,arguments)}}();(0,o.useEffect)(function(){var n;(n=p.current)===null||n===void 0||n.reload(),fe(y),M({code:y})},[y]);var he=z.map(function(n){return{date:function(){var e=n.date+"",i=e.slice(0,4),s=e.slice(4,6),l=e.slice(6,8);return"".concat(i,"-").concat(s,"-").concat(l)}(),income:v(n.income)}}),me={data:he,xField:"date",yField:"income",tooltip:{name:"\u6536\u5165",field:"income"},axis:{date:{title:"\u65E5\u671F"}},title:"\u7D2F\u8BA1"+v(z.reduce(function(n,e){return n+(e.income?e.income:0)},0))+"\u5143",height:400,label:{text:function(e){return e.income>0?e.income:""},textBaseline:"bottom"}};return(0,a.jsx)(G._z,{children:(0,a.jsxs)(U.Z,{defaultActiveKey:"1",centered:!0,style:{backgroundColor:"white",padding:"20px"},children:[(0,a.jsx)(R.Z,{tab:"\u5E7F\u544A\u8BE6\u60C5",children:(0,a.jsx)(L.Z,{headerTitle:F?"\u8868\u683C\u7D2F\u8BA1\uFF1A"+v(F)+"\u5143":"",actionRef:p,rowKey:"key",search:{labelWidth:120},request:function(){var n=j()(f()().mark(function e(i){var s,l,r,T;return f()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,(0,I._5)(m()(m()({},i),{},{code:y}));case 2:return r=h.sent,i.current===1&&te((T=r.data)===null||T===void 0?void 0:T.sum),h.abrupt("return",{data:(s=r.data)===null||s===void 0?void 0:s.data,total:(l=r.data)===null||l===void 0?void 0:l.total,success:!0});case 5:case"end":return h.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),columns:ie,columnsState:{value:ne,onChange:function(e){re(e)}}})},"1"),(0,a.jsxs)(R.Z,{tab:"\u6570\u636E\u603B\u89C8",children:[(0,a.jsx)(X.Z,{onResize:function(e){ce(e.width<596)},children:(0,a.jsx)(u.Z,{children:(0,a.jsxs)(u.Z.Group,{direction:S?"column":"row",children:[(0,a.jsx)(u.Z,{statistic:{title:"\u4E0A\u6708\u6536\u5165\uFF08\u5143\uFF09",value:v(d==null?void 0:d.lastMonthIncome)}}),(0,a.jsx)(g,{type:S?"horizontal":"vertical"}),(0,a.jsx)(u.Z,{statistic:{title:"\u672C\u6708\u6536\u5165\uFF08\u5143\uFF09",value:v(d==null?void 0:d.thisMonthIncome)}}),(0,a.jsx)(g,{type:S?"horizontal":"vertical"}),(0,a.jsx)(u.Z,{statistic:{title:"\u4ECA\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:v(d==null?void 0:d.todayIncome)}}),(0,a.jsx)(g,{type:S?"horizontal":"vertical"}),(0,a.jsx)(u.Z,{statistic:{title:"\u6628\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:v(d==null?void 0:d.yesterdayIncome)}})]})})},"resize-observer"),(0,a.jsxs)(V.t,{defaultCollapsed:!0,split:!0,onFinish:M,children:[(0,a.jsx)(C.Z,{label:"\u5E73\u53F0",name:"platform",valueEnum:{1:"\u7A7F\u5C71\u7532",2:"\u817E\u8BAF",3:"\u767E\u5EA6\u8054\u76DF",4:"Mintegral",5:"\u5FEB\u624B",6:"\u6E38\u53EF\u8D62",7:"Sigmob",8:"Admob"}}),(0,a.jsx)(C.Z,{name:"advType",label:"\u5E7F\u544A\u7C7B\u578B",valueEnum:{1:"\u6A2A\u5E45",2:"\u63D2\u9875",3:"\u6FC0\u52B1\u89C6\u9891"}}),(0,a.jsx)(K.Z,{fieldProps:{disabledDate:function(e){return e&&e>=J()().startOf("day")}},name:"date",label:"\u65F6\u95F4"})]}),(0,a.jsx)(w.Z,m()({},me))]},"2")]})})},q=k}}]);