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

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