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