"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[371],{89793:function(k,R,e){e.r(R),e.d(R,{default:function(){return L}});var D=e(97857),p=e.n(D),O=e(15009),d=e.n(O),w=e(99289),m=e.n(w),B=e(5574),M=e.n(B),b=e(48357),P=e(90930),$=e(85601),x=e(35312),Z=e(13169),j=e(16250),y=e(67294),U=e(96974);function F(h,c){return g.apply(this,arguments)}function g(){return g=m()(d()().mark(function h(c,o){return d()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,x.request)("/api/admin/device/list",p()({method:"GET",params:p()({},c)},o||{})));case 1:case"end":return r.stop()}},h)})),g.apply(this,arguments)}function G(h,c){return T.apply(this,arguments)}function T(){return T=m()(d()().mark(function h(c,o){return d()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,x.request)("/api/admin/device/offline",p()({method:"POST",params:p()({},c)},o||{})));case 1:case"end":return r.stop()}},h)})),T.apply(this,arguments)}var s=e(85893),K=function(){var c=(0,y.useRef)(),o=(0,y.useRef)(),S=(0,y.useState)(0),r=M()(S,2),E=r[0],N=r[1],z=(0,x.useIntl)(),W=(0,U.UO)(),I=W.code,H=(0,x.useModel)("@@initialState"),A=H.initialState,C=A==null?void 0:A.currentUser,J=function(){var u=m()(d()().mark(function t(){var a,n,l;return d()().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,F({appCode:I||""});case 2:return l=f.sent,N((a=l.data)===null||a===void 0?void 0:a.filter(function(v){return v.status===0}).length),f.abrupt("return",{data:l.data,total:(n=l.data)===null||n===void 0?void 0:n.length,success:!0});case 5:case"end":return f.stop()}},t)}));return function(){return u.apply(this,arguments)}}(),Q=function(){var u=m()(d()().mark(function t(a){var n;return d()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(a){i.next=2;break}return i.abrupt("return");case 2:return i.next=4,G({deviceId:a});case 4:(n=o.current)===null||n===void 0||n.reload();case 5:case"end":return i.stop()}},t)}));return function(a){return u.apply(this,arguments)}}(),V=[{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:"\u5E7F\u544A\u7C7B\u578B",dataIndex:"advType",valueEnum:{1:{text:"\u6A2A\u5E45",status:"Default"},2:{text:"\u63D2\u9875",status:"Processing"},3:{text:"\u6FC0\u52B1\u89C6\u9891",status:"Success"}}},{title:"ecpm(\u5143)",dataIndex:"ecpm",hideInSearch:!0,renderText:function(t){return t/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"}],X=[{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(t,a){return a.status===0?(0,s.jsx)("a",{onClick:function(){return Q(a.deviceId)},children:"\u4E0B\u7EBF"}):null}}],Y=function(){var u=m()(d()().mark(function t(a){var n,l,i;return d()().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,(0,b._5)(p()(p()({},a),{},{code:I}));case 2:return i=v.sent,v.abrupt("return",{data:(n=i.data)===null||n===void 0?void 0:n.data,total:(l=i.data)===null||l===void 0?void 0:l.total,success:!0});case 4:case"end":return v.stop()}},t)}));return function(a){return u.apply(this,arguments)}}();return(0,y.useEffect)(function(){var u,t;(u=c.current)===null||u===void 0||u.reload(),(t=o.current)===null||t===void 0||t.reload()},[I]),(0,s.jsx)(P._z,{children:(0,s.jsxs)(Z.Z,{defaultActiveKey:"1",centered:!0,style:{backgroundColor:"white",padding:"20px"},children:[(0,s.jsxs)(j.Z,{tab:"\u8BBE\u5907\u5217\u8868",children:[(0,s.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,(C==null?void 0:C.deviceCnt)-E)}),(0,s.jsx)($.Z,{actionRef:o,rowKey:"id",search:!1,request:J,columns:X})]},"1"),(0,s.jsx)(j.Z,{tab:"\u5E7F\u544A\u8BE6\u60C5",children:(0,s.jsx)($.Z,{headerTitle:z.formatMessage({id:"pages.searchTable.title",defaultMessage:"Enquiry form"}),actionRef:c,rowKey:"id",search:{labelWidth:120},request:Y,columns:V})},"2")]})})},L=K}}]);