-
Notifications
You must be signed in to change notification settings - Fork 0
/
src__pages__Log__Swap.async.js
1 lines (1 loc) · 7.83 KB
/
src__pages__Log__Swap.async.js
1
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5374,9515,3295],{80652:function(e,t,r){var n=r(62435),a=r(20701),s=r(11924),o=r(79360),u=r(24770),i=r(79642),l=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},c=(0,n.forwardRef)((function(e,t){var r=e.chartRef,c=e.style,f=void 0===c?{height:"inherit"}:c,m=e.className,p=e.loading,d=e.loadingTemplate,g=e.errorTemplate,h=l(e,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),x=(0,s.Z)(a.x1,h),y=x.chart,b=x.container;return(0,n.useEffect)((function(){(0,o.J)(r,y.current)}),[y.current]),(0,n.useImperativeHandle)(t,(function(){return{getChart:function(){return y.current}}})),n.createElement(u.Z,{errorTemplate:g},p&&n.createElement(i.Z,{loadingTemplate:d,theme:e.theme}),n.createElement("div",{className:m,style:f,ref:b}))}));t.Z=c},53238:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(11774),a=r(59530),s=r(22181),o=r(62435),u=r(86074),i=function(){var e=(0,a.useSelector)((function(e){return e.global.session})),t=e?e.chain.name:"DFS",r=(0,a.useIntl)().formatMessage({id:"app.intlNotSupportChain"},{chainName:t});return(0,u.jsx)(n._z,{ghost:!0,children:(0,u.jsx)(s.ZP,{title:r})})},l=(0,o.memo)(i)},14261:function(e,t,r){r.r(t);var n=r(53238),a=r(59530),s=r(62435),o=r(68078),u=r(86074);t.default=function(){var e=(0,a.useSelector)((function(e){return e.global.session})),t=e?e.chain.name:"DFS";return(0,s.useCallback)((function(){return"DFS"===t?(0,u.jsx)(o.default,{}):(0,u.jsx)(n.Z,{})}),[t])()}},68078:function(e,t,r){r.r(t);var n=r(15009),a=r.n(n),s=r(97857),o=r.n(s),u=r(9783),i=r.n(u),l=r(99289),c=r.n(l),f=r(5574),m=r.n(f),p=r(52272),d=r(64119),g=r(87603),h=r(80652),x=r(11774),y=r(38345),b=r(92340),S=r(59530),k=r(80507),w=r(45360),v=r(71230),j=r(15746),N=r(69677),D=r(57953),M=r(32983),F=r(27484),E=r.n(F),Z=r(70178),O=r.n(Z),_=r(62435),I=(r(15933),r(86074));E().extend(O());t.default=function(){var e=w.ZP.useMessage(),t=m()(e,2),r=t[0],n=t[1],s=(0,_.useState)(!1),u=m()(s,2),l=u[0],f=u[1],F=(0,S.useDispatch)(),Z=(0,S.useSelector)((function(e){return e.global.session})),O=(0,S.useSelector)((function(e){return e.swaplog.dataSource})),C=(0,S.useSelector)((function(e){return e.swaplog.dailyDataSource})),T=(0,_.useState)({}),Y=m()(T,2),P=Y[0],z=Y[1],R=(0,_.useState)(""),A=m()(R,2),L=A[0],U=A[1],B=(0,S.useSelector)((function(e){return e.swaplog.inFilters})),G=(0,S.useSelector)((function(e){return e.swaplog.outFilters})),J=(0,S.useSelector)((function(e){return e.swaplog.userFilters})),H=(0,S.useSelector)((function(e){return e.swaplog.days})),V=["DFS","JIU","USDT","BTC"],q=(0,S.useIntl)(),K=q.formatMessage({id:"swaplog.intlLoad"}),Q=q.formatMessage({id:"swaplog.intlUser"}),W=q.formatMessage({id:"swaplog.intlFrom"}),X=q.formatMessage({id:"swaplog.intlTo"}),$=q.formatMessage({id:"swaplog.intlTime"}),ee=q.formatMessage({id:"swaplog.intlInputLoadNumber"}),te=q.formatMessage({id:"swaplog.intlDailyVolume"}),re=(0,_.useCallback)(function(){var e=c()(a()().mark((function e(t){var n,s,u,l,c,g,h,x,y,b,S,w,v,j,N,D,M,Z,O,_,I,C,T,Y,P;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,n=[],s=[],u=[],l=[],c=E()().format("YYYY-MM-DD"),g=E()(c).subtract(H+1,"day").format("YYYY-MM-DD"),h=!1,x=k.zM.from(k.zM.max),y=[],b=[],S={};case 12:return e.next=14,t.client.v1.chain.get_table_rows({code:"loglogloglog",table:"logs",scope:"loglogloglog",upper_bound:x,limit:500,reverse:!0});case 14:w=e.sent,v=0;case 16:if(!(v<w.rows.length)){e.next=32;break}if(j=w.rows[v],N=E().utc(j.create_time).local().format("YYYY-MM-DD"),D=N.localeCompare(g),U(N),!(D<=0)){e.next=24;break}return h=!0,e.abrupt("break",32);case 24:M=j.in.split(" "),Z=m()(M,2),O=Z[0],_=Z[1],I=j.out.split(" "),C=m()(I,2),T=C[0],Y=C[1],S.hasOwnProperty(_)?S[_].hasOwnProperty(N)?S[_][N]+=Number(O):S[_][N]=Number(O):S[_]=i()({},N,Number(O)),S.hasOwnProperty(Y)?S[Y].hasOwnProperty(N)?S[Y][N]+=Number(T):S[Y][N]=Number(T):S[Y]=i()({},N,Number(T)),n.push(o()(o()({},j),{},{key:j.id,create_time:E().utc(j.create_time).local().format(),inSym:_,outSym:Y}));case 29:v++,e.next=16;break;case 32:if(!h){e.next=34;break}return e.abrupt("break",40);case 34:if(!w.more){e.next=38;break}x=k.zM.from(Number(w.next_key)),e.next=39;break;case 38:return e.abrupt("break",40);case 39:e.next=12;break;case 40:P={},Object.keys(S).forEach((function(e){P[e]=!1,Object.keys(S[e]).forEach((function(t){y.push({day:t,value:Number(S[e][t].toFixed(2)),category:e})}))})),V.forEach((function(e){y.forEach((function(t){t.category===e&&b.push(t)}))})),n.forEach((function(e){s.includes(e.inSym)||s.push(e.inSym),u.includes(e.outSym)||u.push(e.outSym),l.includes(e.user)||l.push(e.user)})),z(P),F(p.N.setInFilters(s.sort())),F(p.N.setOutFilters(u.sort())),F(p.N.setUserFilters(l.sort())),F(p.N.setDataSource(n)),F(p.N.setDailyDataSource(b)),f(!1),e.next=57;break;case 53:e.prev=53,e.t0=e.catch(0),f(!1),(0,d.Tv)(e.t0,r,"handleGetSwapLog");case 57:case"end":return e.stop()}}),e,null,[[0,53]])})));return function(t){return e.apply(this,arguments)}}(),[H,r,V]),ne=(0,_.useCallback)(c()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f(!0),re(Z);case 2:case"end":return e.stop()}}),e)}))),[re,Z]);(0,_.useEffect)((function(){Z?(O.length?f(!1):f(!0),re(Z)):f(!0)}),[Z]);var ae=(0,_.useMemo)((function(){return[{title:"#",dataIndex:"key",key:"key",render:function(e,t){return(0,I.jsx)("span",{children:t.key+1})}},{title:"".concat(Q),dataIndex:"user",key:"user",sorter:function(e,t){return e.user.localeCompare(t.user)},filters:J.map((function(e){return{text:e,value:e}})),onFilter:function(e,t){return e===t.user},render:function(e,t){return(0,I.jsx)("span",{children:t.user})}},{title:"".concat(W),dataIndex:"in",key:"in",filters:B.map((function(e){return{text:e,value:e}})),onFilter:function(e,t){return e===t.inSym},render:function(e,t){return(0,I.jsx)("span",{children:t.in})}},{title:"",dataIndex:"key",key:"key",render:function(){return(0,I.jsx)("span",{children:(0,I.jsx)(g.Z,{})})}},{title:"".concat(X),dataIndex:"to",key:"to",filters:G.map((function(e){return{text:e,value:e}})),onFilter:function(e,t){return e===t.outSym},render:function(e,t){return(0,I.jsx)("span",{children:t.out})}},{title:"".concat($),dataIndex:"create_time",key:"create_time",sorter:function(e,t){return E().utc(e.create_time).unix()-E().utc(t.create_time).unix()},render:function(e,t){return(0,I.jsx)("span",{children:t.create_time})}}]}),[B,G,J]),se={data:C,xField:"day",xAxis:{type:"time",mask:"MM-DD"},yField:"value",yAxis:{label:{formatter:function(e){var t=Number(e.replace(/,/g,""));return t<1?t.toFixed(2):(0,d.CE)(t)}}},meta:{value:{formatter:function(e){return(0,d.CE)(e)}}},legend:{selected:o()(o()({},P),{},{DFS:!0})},seriesField:"category",slider:{start:0,end:1},smooth:!0,label:{}};return(0,I.jsxs)(x._z,{className:"swaplog",ghost:!0,children:[(0,I.jsx)(v.Z,{gutter:10,children:(0,I.jsx)(j.Z,{lg:{span:"12"},md:{span:"12"},sm:{span:"24"},xs:{span:"24"},children:(0,I.jsx)(N.Z.Search,{style:{width:"100%",marginBottom:"10px"},placeholder:ee,value:H,onChange:function(e){return F(p.N.setDays(Number(e.target.value)))},allowClear:!0,enterButton:K,size:"large",type:"number",min:"0",loading:l,onSearch:ne})})}),(0,I.jsx)(D.Z,{size:"large",spinning:l,tip:L,children:(0,I.jsx)(y.Z,{className:"mb-3",title:(0,I.jsx)("span",{className:" font-semibold",children:te}),children:C.length?(0,I.jsx)(h.Z,o()(o()({},se),{},{loading:l})):(0,I.jsx)(M.Z,{image:M.Z.PRESENTED_IMAGE_SIMPLE})})}),(0,I.jsx)(b.Z,{className:"mb-3",scroll:{x:!0},size:"small",columns:ae,dataSource:O,defaultData:[],search:!1,options:!1,pagination:{pageSize:100},tableAlertRender:!1,tableAlertOptionRender:!1,loading:{spinning:l,size:"large"}}),n]})}},15933:function(){}}]);