"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[371],{89793:function(we,M,t){t.r(M),t.d(M,{default:function(){return se}});var L=t(97857),o=t.n(L),N=t(15009),l=t.n(N),Q=t(99289),h=t.n(Q),W=t(5574),C=t.n(W),H=t(90930),b=t(85601),S=t(31847),J=t(57470),V=t(64317),X=t(34540),I=t(35312),Y=t(13169),w=t(96074),R=t(16250),k=t(9220),y=t(67294),q=t(96974),_=t(48357);function ee(v,c){return $.apply(this,arguments)}function $(){return $=h()(l()().mark(function v(c,p){return l()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",(0,I.request)("/api/admin/device/incomeDaily",o()({method:"POST",headers:{"Content-Type":"application/json"},data:c},p||{})));case 1:case"end":return i.stop()}},v)})),$.apply(this,arguments)}function te(v,c){return E.apply(this,arguments)}function E(){return E=h()(l()().mark(function v(c,p){return l()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",(0,I.request)("/api/admin/device/incomeOverview",o()({method:"GET",params:o()({},c)},p||{})));case 1:case"end":return i.stop()}},v)})),E.apply(this,arguments)}function ae(v,c){return O.apply(this,arguments)}function O(){return O=h()(l()().mark(function v(c,p){return l()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",(0,I.request)("/api/admin/device/list",o()({method:"GET",params:o()({},c)},p||{})));case 1:case"end":return i.stop()}},v)})),O.apply(this,arguments)}function re(v,c){return A.apply(this,arguments)}function A(){return A=h()(l()().mark(function v(c,p){return l()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",(0,I.request)("/api/admin/device/offline",o()({method:"POST",params:o()({},c)},p||{})));case 1:case"end":return i.stop()}},v)})),A.apply(this,arguments)}var ne=t(92296),ie=t(27484),ue=t.n(ie),n=t(85893),le=function(){var c=(0,y.useRef)(),p=(0,y.useRef)(),D=(0,y.useState)(0),i=C()(D,2),B=i[0],de=i[1],ce=(0,y.useState)(!1),z=C()(ce,2),Z=z[0],oe=z[1],ve=(0,I.useIntl)(),fe=(0,q.UO)(),j=fe.code,pe=(0,I.useModel)("@@initialState"),F=pe.initialState,m=F==null?void 0:F.currentUser,he=(0,y.useState)(),P=C()(he,2),f=P[0],me=P[1],xe=(0,y.useState)([]),G=C()(xe,2),U=G[0],ye=G[1],ge=function(){var a=h()(l()().mark(function e(){var r,u,s;return l()().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,ae({appCode:j||""});case 2:return u=g.sent,u.data&&de((s=u.data)===null||s===void 0?void 0:s.filter(function(x){return x.status===0}).length),g.abrupt("return",{data:u.data,total:(r=u.data)===null||r===void 0?void 0:r.length,success:!0});case 5:case"end":return g.stop()}},e)}));return function(){return a.apply(this,arguments)}}(),Se=function(){var a=h()(l()().mark(function e(r){var u;return l()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(r){d.next=2;break}return d.abrupt("return");case 2:return d.next=4,re({deviceId:r});case 4:(u=p.current)===null||u===void 0||u.reload();case 5:case"end":return d.stop()}},e)}));return function(r){return a.apply(this,arguments)}}(),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",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:"deductEcpm",hideInSearch:!0,renderText:function(e,r){return m!=null&&m.incomeRate&&r.ecpm?Math.floor(r.ecpm*m.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"}],je=[{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,r){return r.status===0?(0,n.jsx)("a",{onClick:function(){return Se(r.deviceId)},children:"\u4E0B\u7EBF"}):null}}],Te=function(){var a=h()(l()().mark(function e(r){var u,s,d;return l()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,(0,_._5)(o()(o()({},r),{},{code:j}));case 2:return d=x.sent,x.abrupt("return",{data:(u=d.data)===null||u===void 0?void 0:u.data,total:(s=d.data)===null||s===void 0?void 0:s.total,success:!0});case 4:case"end":return x.stop()}},e)}));return function(r){return a.apply(this,arguments)}}(),De=function(){var a=h()(l()().mark(function e(){var r;return l()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,te({appCode:j});case 2:r=s.sent,r.data&&me(r.data);case 4:case"end":return s.stop()}},e)}));return function(){return a.apply(this,arguments)}}(),K=function(){var a=h()(l()().mark(function e(r){var u;return l()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,ee(o()(o()({},r),{},{code:j}));case 2:u=d.sent,u.data&&ye(u.data);case 4:case"end":return d.stop()}},e)}));return function(r){return a.apply(this,arguments)}}();(0,y.useEffect)(function(){var a,e;(a=c.current)===null||a===void 0||a.reload(),(e=p.current)===null||e===void 0||e.reload(),De(),K(void 0)},[j]);var T=function(e){return e?parseFloat((e/1e5).toFixed(2)):0},Ce=U.map(function(a){return{date:function(){var e=a.date+"",r=e.slice(0,4),u=e.slice(4,6),s=e.slice(6,8);return"".concat(r,"-").concat(u,"-").concat(s)}(),income:T(a.income)}}),Ze={data:Ce,xField:"date",yField:"income",tooltip:{name:"\u6536\u5165",field:"income"},axis:{date:{title:"\u65E5\u671F"}},title:"\u7D2F\u8BA1"+T(U.reduce(function(a,e){return a+(e.income?e.income:0)},0))+"\u5143",height:400,label:{text:function(e){return e.income>0?e.income:""},textBaseline:"bottom"}};return(0,n.jsx)(H._z,{children:(0,n.jsxs)(Y.Z,{defaultActiveKey:"1",centered:!0,style:{backgroundColor:"white",padding:"20px"},children:[(0,n.jsxs)(R.Z,{tab:"\u8BBE\u5907\u5217\u8868",children:[(0,n.jsx)("p",{style:{textAlign:"center"},children:"\u6B63\u5E38\u4F7F\u7528\u8BBE\u5907\u6570\uFF1A"+B+"\uFF0C\u5269\u4F59\u53EF\u7ED1\u5B9A\u8BBE\u5907\u6570\uFF1A"+Math.max(0,(m!=null&&m.deviceCnt?m.deviceCnt:0)-B)}),(0,n.jsx)(b.Z,{actionRef:p,rowKey:"id",search:!1,request:ge,columns:je})]},"1"),(0,n.jsx)(R.Z,{tab:"\u5E7F\u544A\u8BE6\u60C5",children:(0,n.jsx)(b.Z,{headerTitle:ve.formatMessage({id:"pages.searchTable.title",defaultMessage:"Enquiry form"}),actionRef:c,rowKey:"id",search:{labelWidth:120},request:Te,columns:Ie})},"2"),(0,n.jsxs)(R.Z,{tab:"\u6570\u636E\u603B\u89C8",children:[(0,n.jsx)(k.Z,{onResize:function(e){oe(e.width<596)},children:(0,n.jsx)(S.Z,{children:(0,n.jsxs)(S.Z.Group,{direction:Z?"column":"row",children:[(0,n.jsx)(S.Z,{statistic:{title:"\u4E0A\u6708\u6536\u5165\uFF08\u5143\uFF09",value:T(f==null?void 0:f.lastMonthIncome)}}),(0,n.jsx)(w.Z,{type:Z?"horizontal":"vertical"}),(0,n.jsx)(S.Z,{statistic:{title:"\u672C\u6708\u6536\u5165\uFF08\u5143\uFF09",value:T(f==null?void 0:f.thisMonthIncome)}}),(0,n.jsx)(w.Z,{type:Z?"horizontal":"vertical"}),(0,n.jsx)(S.Z,{statistic:{title:"\u4ECA\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:T(f==null?void 0:f.todayIncome)}}),(0,n.jsx)(w.Z,{type:Z?"horizontal":"vertical"}),(0,n.jsx)(S.Z,{statistic:{title:"\u6628\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:T(f==null?void 0:f.yesterdayIncome)}})]})})},"resize-observer"),(0,n.jsxs)(J.t,{defaultCollapsed:!0,split:!0,onFinish:K,children:[(0,n.jsx)(V.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,n.jsx)(X.Z,{fieldProps:{disabledDate:function(e){return e&&e>=ue()().startOf("day")}},name:"date",label:"\u65F6\u95F4"})]}),(0,n.jsx)(ne.Z,o()({},Ze))]},"3")]})})},se=le}}]);