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
10 KiB

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[371],{35431:function(k,A,t){t.r(A);var L=t(97857),c=t.n(L),W=t(15009),l=t.n(W),w=t(99289),v=t.n(w),O=t(5574),j=t.n(O),y=t(48357),$=t(90930),x=t(67539),h=t(39615),C=t(57470),Z=t(64317),R=t(34540),S=t(35312),U=t(13169),g=t(96074),D=t(16250),d=t(9220),i=t(67294),m=t(96974),f=t(80484),r=t(11415),q=t(27484),ee=t.n(q),u=t(85893),te=function(){var F=(0,i.useRef)(),B=(0,i.useRef)(),re=(0,i.useState)(0),G=j()(re,2),z=G[0],ae=G[1],ne=(0,i.useState)(!1),N=j()(ne,2),K=N[0],se=N[1],ie=(0,S.useIntl)(),_e=(0,m.UO)(),I=_e.code,ue=(0,S.useModel)("@@initialState"),V=ue.initialState,E=V==null?void 0:V.currentUser,le=(0,i.useState)(),H=j()(le,2),p=H[0],de=H[1],oe=(0,i.useState)([]),J=j()(oe,2),Q=J[0],ce=J[1],b=function(){return window.innerWidth<=768},me=function(){var n=v()(l()().mark(function e(){var a,_,o;return l()().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return M.next=2,(0,f.sk)({appCode:I||""});case 2:return _=M.sent,_.data&&ae((o=_.data)===null||o===void 0?void 0:o.filter(function(P){return P.status===0}).length),M.abrupt("return",{data:_.data,total:(a=_.data)===null||a===void 0?void 0:a.length,success:!0});case 5:case"end":return M.stop()}},e)}));return function(){return n.apply(this,arguments)}}(),ve=function(){var n=v()(l()().mark(function e(a){var _;return l()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(a){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,(0,f.n4)({deviceId:a});case 4:(_=B.current)===null||_===void 0||_.reload();case 5:case"end":return s.stop()}},e)}));return function(a){return n.apply(this,arguments)}}(),pe=function(){var n=v()(l()().mark(function e(a){var _;return l()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(a){s.next=2;break}return s.abrupt("return");case 2:return s.prev=2,s.next=5,(0,f.ps)({deviceId:a});case 5:(_=B.current)===null||_===void 0||_.reload(),s.next=10;break;case 8:s.prev=8,s.t0=s.catch(2);case 10:case"end":return s.stop()}},e,null,[[2,8]])}));return function(a){return n.apply(this,arguments)}}(),fe=(0,i.useState)({deviceId:{show:!b()},appName:{show:!b()},platform:{show:!b()},deviceBrand:{show:!b()},deviceName:{show:!b()},ip:{show:!b()}}),X=j()(fe,2),he=X[0],Ee=X[1],Pe=[{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",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:"ecpm(\u5143)",dataIndex:"ecpm",hideInSearch:!0,renderText:function(e){return e/100}},{title:"ecpm-\u62BD\u6210\u540E(\u5143)",dataIndex:"ecpmAdmin",hideInSearch:!0,renderText:function(e,a){return e?e/100:E!=null&&E.incomeRate&&a.ecpm?Math.floor(a.ecpm*E.incomeRate/100)/100:"-"}},{title:"\u8BBE\u5907\u54C1\u724C",dataIndex:"deviceBrand",hideInSearch:!0,valueType:"textarea"},{title:"\u8BBE\u5907\u540D",dataIndex:"deviceName",hideInSearch:!0,valueType:"textarea"},{title:"ip",dataIndex:"ip",hideInSearch:!0,valueType:"textarea"},{title:"\u65F6\u95F4",hideInSearch:!0,dataIndex:"createdAt",valueType:"dateTime"},{title:"\u65F6\u95F4",hideInTable:!0,dataIndex:"createdAt",valueType:"dateRange"}],Oe=[{title:"\u8BBE\u5907id",dataIndex:"deviceId",valueType:"text",ellipsis:!0,width:400,copyable:!0},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u6B63\u5E38"},"-1":{text:"\u5DF2\u4E0B\u7EBF"}},filters:!0,onFilter:!0},{title:"\u7ED1\u5B9A\u65F6\u95F4",hideInSearch:!0,dataIndex:"createdAt",valueType:"dateTime"},{title:"\u64CD\u4F5C",dataIndex:"operation",hideInSearch:!0,render:function(e,a){return a.status===0?(0,u.jsx)("a",{onClick:function(){return ve(a.deviceId)},children:"\u4E0B\u7EBF"}):a.status===-1?(0,u.jsx)("a",{onClick:function(){return pe(a.deviceId)},children:"\u4E0A\u7EBF"}):null}}],De=function(){var n=v()(l()().mark(function e(a){var _,o,s;return l()().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,(0,y._5)(c()(c()({},a),{},{code:I}));case 2:return s=P.sent,P.abrupt("return",{data:(_=s.data)===null||_===void 0?void 0:_.data,total:(o=s.data)===null||o===void 0?void 0:o.total,success:!0});case 4:case"end":return P.stop()}},e)}));return function(a){return n.apply(this,arguments)}}(),Me=function(){var n=v()(l()().mark(function e(){var a;return l()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,f.OE)({appCode:I});case 2:a=o.sent,a.data&&de(a.data);case 4:case"end":return o.stop()}},e)}));return function(){return n.apply(this,arguments)}}(),Y=function(){var n=v()(l()().mark(function e(a){var _;return l()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,(0,f.di)(c()(c()({},a),{},{code:I}));case 2:_=s.sent,_.data&&ce(_.data);case 4:case"end":return s.stop()}},e)}));return function(a){return n.apply(this,arguments)}}();(0,i.useEffect)(function(){var n,e;(n=F.current)===null||n===void 0||n.reload(),(e=B.current)===null||e===void 0||e.reload(),Me(),Y(void 0)},[I]);var T=function(e){return e?parseFloat((e/1e5).toFixed(2)):0},je=Q.map(function(n){return{date:function(){var e=n.date+"",a=e.slice(0,4),_=e.slice(4,6),o=e.slice(6,8);return"".concat(a,"-").concat(_,"-").concat(o)}(),income:T(n.income)}}),xe={data:je,xField:"date",yField:"income",tooltip:{name:"\u6536\u5165",field:"income"},axis:{date:{title:"\u65E5\u671F"}},title:"\u7D2F\u8BA1"+T(Q.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,u.jsx)($._z,{children:(0,u.jsxs)(U.Z,{defaultActiveKey:"1",centered:!0,style:{backgroundColor:"white",padding:"20px"},children:[(0,u.jsxs)(D.Z,{tab:"\u8BBE\u5907\u5217\u8868",children:[(0,u.jsx)("p",{style:{textAlign:"center"},children:"\u6B63\u5E38\u4F7F\u7528\u8BBE\u5907\u6570\uFF1A"+z+"\uFF0C\u5269\u4F59\u53EF\u7ED1\u5B9A\u8BBE\u5907\u6570\uFF1A"+Math.max(0,(E!=null&&E.deviceCnt?E.deviceCnt:0)-z)}),(0,u.jsx)(x.Z,{actionRef:B,rowKey:"id",search:!1,request:me,columns:Oe})]},"1"),(0,u.jsx)(D.Z,{tab:"\u5E7F\u544A\u8BE6\u60C5",children:(0,u.jsx)(x.Z,{headerTitle:ie.formatMessage({id:"pages.searchTable.title",defaultMessage:"Enquiry form"}),actionRef:F,rowKey:"id",search:{labelWidth:120},request:De,columns:Pe,columnsState:{value:he,onChange:function(e){Ee(e)}}})},"2"),(0,u.jsxs)(D.Z,{tab:"\u6570\u636E\u603B\u89C8",children:[(0,u.jsx)(d.Z,{onResize:function(e){se(e.width<596)},children:(0,u.jsx)(h.Z,{children:(0,u.jsxs)(h.Z.Group,{direction:K?"column":"row",children:[(0,u.jsx)(h.Z,{statistic:{title:"\u4E0A\u6708\u6536\u5165\uFF08\u5143\uFF09",value:T(p==null?void 0:p.lastMonthIncome)}}),(0,u.jsx)(g.Z,{type:K?"horizontal":"vertical"}),(0,u.jsx)(h.Z,{statistic:{title:"\u672C\u6708\u6536\u5165\uFF08\u5143\uFF09",value:T(p==null?void 0:p.thisMonthIncome)}}),(0,u.jsx)(g.Z,{type:K?"horizontal":"vertical"}),(0,u.jsx)(h.Z,{statistic:{title:"\u4ECA\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:T(p==null?void 0:p.todayIncome)}}),(0,u.jsx)(g.Z,{type:K?"horizontal":"vertical"}),(0,u.jsx)(h.Z,{statistic:{title:"\u6628\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:T(p==null?void 0:p.yesterdayIncome)}})]})})},"resize-observer"),(0,u.jsxs)(C.t,{defaultCollapsed:!0,split:!0,onFinish:Y,children:[(0,u.jsx)(Z.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,u.jsx)(R.Z,{fieldProps:{disabledDate:function(e){return e&&e>=ee()().startOf("day")}},name:"date",label:"\u65F6\u95F4"})]}),(0,u.jsx)(r.Z,c()({},xe))]},"3")]})})};A.default=te},80484:function(k,A,t){t.d(A,{OE:function(){return h},di:function(){return $},n4:function(){return S},ps:function(){return g},sk:function(){return Z}});var L=t(15009),c=t.n(L),W=t(97857),l=t.n(W),w=t(99289),v=t.n(w),O=t(35312);function j(d,i){return y.apply(this,arguments)}function y(){return y=_asyncToGenerator(_regeneratorRuntime().mark(function d(i,m){return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",request("/api/admin/device/calc",_objectSpread({method:"GET",params:_objectSpread({},i)},m||{})));case 1:case"end":return r.stop()}},d)})),y.apply(this,arguments)}function $(d,i){return x.apply(this,arguments)}function x(){return x=v()(c()().mark(function d(i,m){return c()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,O.request)("/api/admin/device/incomeDaily",l()({method:"POST",headers:{"Content-Type":"application/json"},data:i},m||{})));case 1:case"end":return r.stop()}},d)})),x.apply(this,arguments)}function h(d,i){return C.apply(this,arguments)}function C(){return C=v()(c()().mark(function d(i,m){return c()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,O.request)("/api/admin/device/incomeOverview",l()({method:"GET",params:l()({},i)},m||{})));case 1:case"end":return r.stop()}},d)})),C.apply(this,arguments)}function Z(d,i){return R.apply(this,arguments)}function R(){return R=v()(c()().mark(function d(i,m){return c()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,O.request)("/api/admin/device/list",l()({method:"GET",params:l()({},i)},m||{})));case 1:case"end":return r.stop()}},d)})),R.apply(this,arguments)}function S(d,i){return U.apply(this,arguments)}function U(){return U=v()(c()().mark(function d(i,m){return c()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,O.request)("/api/admin/device/offline",l()({method:"POST",params:l()({},i)},m||{})));case 1:case"end":return r.stop()}},d)})),U.apply(this,arguments)}function g(d,i){return D.apply(this,arguments)}function D(){return D=v()(c()().mark(function d(i,m){return c()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,O.request)("/api/admin/device/online",l()({method:"POST",params:l()({},i)},m||{})));case 1:case"end":return r.stop()}},d)})),D.apply(this,arguments)}}}]);