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

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[371],{35431:function(W,I,a){a.r(I);var R=a(97857),c=a.n(R),U=a(15009),u=a.n(U),g=a(99289),v=a.n(g),P=a(5574),S=a.n(P),j=a(48357),A=a(90930),O=a(25335),x=a(35312),T=a(13169),y=a(16250),f=a(67294),M=a(80484),m=a(85893),B=function(){var l=(0,f.useRef)(),n=(0,f.useRef)(),p=(0,f.useState)(0),h=S()(p,2),e=h[0],$=h[1],V=(0,x.useIntl)(),N=(0,x.useModel)("@@initialState"),w=N.initialState,E=w==null?void 0:w.currentUser,K=function(){var o=v()(u()().mark(function s(){var r,_,d;return u()().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,(0,j.ln)();case 2:return _=b.sent,d=[],(r=_.data)===null||r===void 0||r.forEach(function(i){d.push({label:i.name,value:i.code})}),b.abrupt("return",d);case 6:case"end":return b.stop()}},s)}));return function(){return o.apply(this,arguments)}}(),D=function(){return window.innerWidth<=768},G=function(){var o=v()(u()().mark(function s(r){var _,d,t;return u()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(r.appName){i.next=2;break}return i.abrupt("return",{data:[],total:0,success:!0});case 2:return i.next=4,(0,M.sk)({appCode:r.appName?r.appName:""});case 4:return d=i.sent,d.data&&$((t=d.data)===null||t===void 0?void 0:t.filter(function(Y){return Y.status===0}).length),i.abrupt("return",{data:d.data,total:(_=d.data)===null||_===void 0?void 0:_.length,success:!0});case 7:case"end":return i.stop()}},s)}));return function(r){return o.apply(this,arguments)}}(),Z=function(){var o=v()(u()().mark(function s(r){var _;return u()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,(0,M.n4)({deviceId:r});case 4:(_=n.current)===null||_===void 0||_.reload();case 5:case"end":return t.stop()}},s)}));return function(r){return o.apply(this,arguments)}}(),k=function(){var o=v()(u()().mark(function s(r){var _;return u()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,(0,M.ps)({deviceId:r});case 5:(_=n.current)===null||_===void 0||_.reload(),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(2);case 10:case"end":return t.stop()}},s,null,[[2,8]])}));return function(r){return o.apply(this,arguments)}}(),F=(0,f.useState)({deviceId:{show:!D()},appName:{show:!D()},platform:{show:!D()},deviceBrand:{show:!D()},deviceName:{show:!D()},ip:{show:!D()}}),L=S()(F,2),z=L[0],H=L[1],J=[{title:"\u5E94\u7528\u540D\u79F0",dataIndex:"appName",valueType:"textarea",request:K},{title:"\u8BBE\u5907id",dataIndex:"deviceId",valueType:"textarea",ellipsis:!0,copyable:!0},{title:"\u5E73\u53F0",dataIndex:"platform",valueEnum:{1:{text:"\u7A7F\u5C71\u7532"},2:{text:"\u817E\u8BAF"},5:{text:"\u5FEB\u624B"},7:{text:"Sigmob"}}},{title:"ecpm(\u5143)",dataIndex:"ecpm",hideInSearch:!0,renderText:function(s){return s/100}},{title:"ecpm-\u62BD\u6210\u540E(\u5143)",dataIndex:"deductEcpm",hideInSearch:!0,renderText:function(s,r){return E!=null&&E.incomeRate&&r.ecpm?Math.floor(r.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"}],Q=[{title:"\u5E94\u7528\u540D\u79F0",dataIndex:"appName",valueType:"textarea",request:K,hideInTable:!0},{title:"\u8BBE\u5907id",dataIndex:"deviceId",valueType:"text",ellipsis:!0,width:400,copyable:!0,hideInSearch:!0},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u6B63\u5E38"},"-1":{text:"\u5DF2\u4E0B\u7EBF"}},filters:!0,onFilter:!0,hideInSearch:!0},{title:"\u7ED1\u5B9A\u65F6\u95F4",hideInSearch:!0,dataIndex:"createdAt",valueType:"dateTime"},{title:"\u64CD\u4F5C",dataIndex:"operation",hideInSearch:!0,render:function(s,r){return r.status===0?(0,m.jsx)("a",{onClick:function(){return Z(r.deviceId)},children:"\u4E0B\u7EBF"}):r.status===-1?(0,m.jsx)("a",{onClick:function(){return k(r.deviceId)},children:"\u4E0A\u7EBF"}):null}}],X=function(){var o=v()(u()().mark(function s(r){var _,d,t;return u()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(r.appName){i.next=2;break}return i.abrupt("return",{data:[],total:0,success:!0});case 2:return i.next=4,(0,j._5)(c()(c()({},r),{},{code:r.appName}));case 4:return t=i.sent,i.abrupt("return",{data:(_=t.data)===null||_===void 0?void 0:_.data,total:(d=t.data)===null||d===void 0?void 0:d.total,success:!0});case 6:case"end":return i.stop()}},s)}));return function(r){return o.apply(this,arguments)}}();return(0,m.jsx)(A._z,{children:(0,m.jsxs)(T.Z,{defaultActiveKey:"1",centered:!0,style:{backgroundColor:"white",padding:"20px"},children:[(0,m.jsxs)(y.Z,{tab:"\u8BBE\u5907\u5217\u8868",children:[(0,m.jsx)("p",{style:{textAlign:"center"},children:"\u6B63\u5E38\u4F7F\u7528\u8BBE\u5907\u6570\uFF1A"+e+"\uFF0C\u5269\u4F59\u53EF\u7ED1\u5B9A\u8BBE\u5907\u6570\uFF1A"+Math.max(0,(E!=null&&E.deviceCnt?E.deviceCnt:0)-e)}),(0,m.jsx)(O.Z,{actionRef:n,rowKey:"id",request:G,columns:Q})]},"1"),(0,m.jsx)(y.Z,{tab:"\u5E7F\u544A\u8BE6\u60C5",children:(0,m.jsx)(O.Z,{headerTitle:V.formatMessage({id:"pages.searchTable.title",defaultMessage:"Enquiry form"}),actionRef:l,rowKey:"id",search:{labelWidth:120},request:X,columns:J,columnsState:{value:z,onChange:function(s){H(s)}}})},"2")]})})};I.default=B},80484:function(W,I,a){a.d(I,{OE:function(){return x},di:function(){return A},n4:function(){return M},ps:function(){return B},sk:function(){return y}});var R=a(15009),c=a.n(R),U=a(97857),u=a.n(U),g=a(99289),v=a.n(g),P=a(35312);function S(l,n){return j.apply(this,arguments)}function j(){return j=_asyncToGenerator(_regeneratorRuntime().mark(function l(n,p){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/api/admin/device/calc",_objectSpread({method:"GET",params:_objectSpread({},n)},p||{})));case 1:case"end":return e.stop()}},l)})),j.apply(this,arguments)}function A(l,n){return O.apply(this,arguments)}function O(){return O=v()(c()().mark(function l(n,p){return c()().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,P.request)("/api/admin/device/incomeDaily",u()({method:"POST",headers:{"Content-Type":"application/json"},data:n},p||{})));case 1:case"end":return e.stop()}},l)})),O.apply(this,arguments)}function x(l,n){return T.apply(this,arguments)}function T(){return T=v()(c()().mark(function l(n,p){return c()().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,P.request)("/api/admin/device/incomeOverview",u()({method:"GET",params:u()({},n)},p||{})));case 1:case"end":return e.stop()}},l)})),T.apply(this,arguments)}function y(l,n){return f.apply(this,arguments)}function f(){return f=v()(c()().mark(function l(n,p){return c()().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,P.request)("/api/admin/device/list",u()({method:"GET",params:u()({},n)},p||{})));case 1:case"end":return e.stop()}},l)})),f.apply(this,arguments)}function M(l,n){return m.apply(this,arguments)}function m(){return m=v()(c()().mark(function l(n,p){return c()().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,P.request)("/api/admin/device/offline",u()({method:"POST",params:u()({},n)},p||{})));case 1:case"end":return e.stop()}},l)})),m.apply(this,arguments)}function B(l,n){return C.apply(this,arguments)}function C(){return C=v()(c()().mark(function l(n,p){return c()().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,P.request)("/api/admin/device/online",u()({method:"POST",params:u()({},n)},p||{})));case 1:case"end":return e.stop()}},l)})),C.apply(this,arguments)}}}]);