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

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[581],{37643:function(F,b,e){e.r(b);var y=e(97857),u=e.n(y),R=e(15009),i=e.n(R),g=e(99289),d=e.n(g),c=e(5574),E=e.n(c),h=e(48357),T=e(80484),P=e(92713),A=e(90930),m=e(39615),C=e(57470),f=e(64317),I=e(34540),D=e(27484),x=e.n(D),O=e(9220),t=e(67294),a=e(96974),_=e(85893),p=function(){var G=(0,t.useState)(),L=E()(G,2),v=L[0],Z=L[1],$=(0,t.useState)([]),B=E()($,2),W=B[0],z=B[1],H=(0,t.useState)([]),K=E()(H,2),J=K[0],N=K[1],Q=(0,t.useState)(!1),S=E()(Q,2),X=S[0],Y=S[1],k=(0,a.UO)(),V=k.code,q=function(){var s=d()(i()().mark(function n(){var o;return i()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,(0,T.OE)({appCode:V});case 2:o=l.sent,o.data&&Z(o.data);case 4:case"end":return l.stop()}},n)}));return function(){return s.apply(this,arguments)}}(),ee=function(){var s=d()(i()().mark(function n(){var o;return i()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,(0,h.ln)();case 2:o=l.sent,o.data&&N(o.data);case 4:case"end":return l.stop()}},n)}));return function(){return s.apply(this,arguments)}}(),w=function(){var s=d()(i()().mark(function n(o){var j;return i()().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return M.next=2,(0,T.di)(o);case 2:j=M.sent,j.data&&z(j.data);case 4:case"end":return M.stop()}},n)}));return function(o){return s.apply(this,arguments)}}();(0,t.useEffect)(function(){q(),ee(),w({code:V})},[]);var U=function(n){return n?parseFloat((n/1e5).toFixed(2)):0},re=function(n){var o=n+"";return o.slice(4,6)+"/"+o.slice(6,8)},_e=W.map(function(s){return{date:re(s.date),income:U(s.income)}}),ne={data:_e,xField:"date",yField:"income",tooltip:{name:"\u6536\u5165",field:"income"},axis:{date:{title:"\u65E5\u671F"},income:{title:"\u6536\u5165\uFF08\u5143\uFF09"}},title:"\u533A\u95F4\u7D2F\u8BA1"+U(W.reduce(function(s,n){return s+(n.income?n.income:0)},0))+"\u5143",height:400,label:{text:function(n){return n.income>0?n.income:""},textBaseline:"bottom",visible:!0,type:"point"},line:{style:{stroke:"#eb0fcc",strokeWidth:2},shapeField:"smooth"},shapeField:"smooth",style:{fill:"linear-gradient(-90deg, white 0%, #eb0fcc 100%)"}};return(0,_.jsxs)(A._z,{children:[(0,_.jsx)(O.Z,{onResize:function(n){Y(n.width<596)},children:(0,_.jsx)(m.Z,{children:(0,_.jsxs)(m.Z.Group,{direction:X?"column":"row",children:[(0,_.jsx)(m.Z,{statistic:{title:"\u7D2F\u8BA1\u6536\u5165\uFF08\u5143\uFF09",value:U(v==null?void 0:v.totalIncome)}}),(0,_.jsx)(m.Z,{statistic:{title:"\u6628\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:U(v==null?void 0:v.yesterdayIncome)}})]})})},"resize-observer"),(0,_.jsxs)("div",{style:{marginTop:"20px",padding:"40px",backgroundColor:"white"},children:[(0,_.jsxs)(C.t,{defaultCollapsed:!0,split:!0,onFinish:w,children:[(0,_.jsx)(f.Z,{name:"code",label:"\u5E94\u7528",options:J.map(function(s){return{label:s.name,value:s.code}})}),(0,_.jsx)(f.Z,{label:"\u5E73\u53F0",name:"platform",valueEnum:{1:"\u7A7F\u5C71\u7532",2:"\u817E\u8BAF",5:"\u5FEB\u624B",7:"Sigmob"}}),(0,_.jsx)(I.Z,{fieldProps:{disabledDate:function(n){return n&&n>=x()().startOf("day")}},name:"date",label:"\u65F6\u95F4"})]}),(0,_.jsx)(P.Z,u()({},ne))]})]})};b.default=p},80484:function(F,b,e){e.d(b,{OE:function(){return A},di:function(){return T},n4:function(){return I},ps:function(){return x},sk:function(){return C}});var y=e(15009),u=e.n(y),R=e(97857),i=e.n(R),g=e(99289),d=e.n(g),c=e(35312);function E(t,a){return h.apply(this,arguments)}function h(){return h=_asyncToGenerator(_regeneratorRuntime().mark(function t(a,_){return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",request("/api/admin/device/calc",_objectSpread({method:"GET",params:_objectSpread({},a)},_||{})));case 1:case"end":return r.stop()}},t)})),h.apply(this,arguments)}function T(t,a){return P.apply(this,arguments)}function P(){return P=d()(u()().mark(function t(a,_){return u()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,c.request)("/api/admin/device/incomeDaily",i()({method:"POST",headers:{"Content-Type":"application/json"},data:a},_||{})));case 1:case"end":return r.stop()}},t)})),P.apply(this,arguments)}function A(t,a){return m.apply(this,arguments)}function m(){return m=d()(u()().mark(function t(a,_){return u()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,c.request)("/api/admin/device/incomeOverview",i()({method:"GET",params:i()({},a)},_||{})));case 1:case"end":return r.stop()}},t)})),m.apply(this,arguments)}function C(t,a){return f.apply(this,arguments)}function f(){return f=d()(u()().mark(function t(a,_){return u()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,c.request)("/api/admin/device/list",i()({method:"GET",params:i()({},a)},_||{})));case 1:case"end":return r.stop()}},t)})),f.apply(this,arguments)}function I(t,a){return D.apply(this,arguments)}function D(){return D=d()(u()().mark(function t(a,_){return u()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,c.request)("/api/admin/device/offline",i()({method:"POST",params:i()({},a)},_||{})));case 1:case"end":return r.stop()}},t)})),D.apply(this,arguments)}function x(t,a){return O.apply(this,arguments)}function O(){return O=d()(u()().mark(function t(a,_){return u()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,c.request)("/api/admin/device/online",i()({method:"POST",params:i()({},a)},_||{})));case 1:case"end":return r.stop()}},t)})),O.apply(this,arguments)}}}]);