1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2657],{39248:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/orders/contract/pnl",function(){return s(87943)}])},87943:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return x}});var i=s(36734),n=s(51776),a=s(86880),l=s(71739),c=s(23953),r=s(29571),o=s(6655),d=s(54008),u=s(72441),h=s(19418),m=s.n(h),b=s(23474),f=s(14890),p=s(3814);let y=()=>{let{t:e}=(0,a.Z)("orders"),[t,s]=(0,n.useState)([]),[h,y]=(0,n.useState)(0),[x,v]=(0,n.useState)(1),[j,N]=(0,n.useState)(0),{contractList:_,filterContractList:S,activeId:T,categories:g,loading:k,setLoading:P,formatUserAmount:C,formatUserAmountPre:L,handleChangeTab:w}=(0,b.Z)(),{filterParams:Z,handleContractSelect:M,handleSideSelect:R,handleReset:A,directionList:I}=(0,f.Z)("pnl",{contractId:"ALL",queryOrderSide:"ALL"}),{renderCoinOption:O}=(0,p.Z)(),E=(0,n.useCallback)(()=>{A(),v(1),N(e=>e+1)},[A]),q=(0,n.useCallback)(async()=>{P(!0);let e={quote:T,limit:10,page:x,...Z};"ALL"===Z.contractId&&delete e.contractId,"ALL"===Z.queryOrderSide?delete e.side:e.side=Z.queryOrderSide;try{let t=await (0,o.sC)(e);if(0==+(null==t?void 0:t.code)){var i,n;s((null==t?void 0:null===(i=t.data)||void 0===i?void 0:i.positionList)||[]),y((null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.count)||0)}}catch(a){console.error("è·åçäºè®°å½å¤±è´¥:",a)}finally{P(!1)}},[T,10,x,Z,P]);(0,n.useEffect)(()=>{_.length>0&&q()},[q,_.length]);let z=e=>{M(e),v(1)},U=e=>{R(e),v(1)},V=e=>{v(e)},X=()=>{A(),v(1),N(e=>e+1)},Y=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"price",i=_.find(t=>t.symbol===e);return i&&i.coinResultVo?L(e,t,"coin"===s?i.coinResultVo.marginCoinPrecision||2:i.coinResultVo.symbolPricePrecision||2):L(e,t)},B=[{title:e("futures.listTabs.futures"),key:"contractSymbol",render:(t,s)=>"".concat(s.contractSymbol.replace("-","")," ").concat(e("futures.listTabs.perpetual"))},{title:e("futures.listTabs.posMode"),key:"positionType",render(t,s){let i=1===s.positionType?e("futures.listTabs.cross"):e("futures.listTabs.isolated");return"".concat(i," ").concat(s.leverageLevel,"x")}},{title:e("futures.listTabs.direction"),key:"side",render:(t,s)=>(0,i.jsx)("span",{className:"BUY"===s.side?"rose":"fall",children:"BUY"===s.side?e("futures.listTabs.long"):e("futures.listTabs.short")})},{title:e("futures.listTabs.date"),key:"mtime",dataIndex:"mtime",render:e=>(0,d.p6)(e,"dd/MM/yyyy hh:mm:ss")},{title:e("futures.balance.realizedPnL"),key:"historyRealizedAmount",render(e,t){let s=parseFloat(t.historyRealizedAmount)>0;return(0,i.jsxs)("span",{className:s?"rose":"fall",children:[s?"+":"",Y(t.contractSymbol,t.historyRealizedAmount,"coin")]})}},{title:e("futures.listTabs.entryPrice"),key:"openPrice",render:(e,t)=>Y(t.contractSymbol,t.openPrice,"price")},{title:e("futures.listTabs.closePrice"),key:"closePrice",render:(e,t)=>Y(t.contractSymbol,t.closePrice,"price")},{title:e("futures.listTabs.posAmount"),key:"volume",render:(e,t)=>C(t.contractSymbol,t.volume)}];return(0,i.jsx)(u.Z,{children:(0,i.jsxs)("div",{className:m().component,children:[(0,i.jsx)("h2",{children:e("futures.navTabs.pnLRecords")}),(0,i.jsx)("div",{className:m().tabChange,children:((0,d.Ji)()?g.filter(e=>!["COIN-M","USDC-M"].includes(e.tabName)):g).map(e=>(0,i.jsx)("div",{className:"".concat(m().tabItem," ").concat(T===e.coin?m().active:""),onClick:()=>w(e.coin,E),children:e.tabName},"tab-".concat(e.coin)))}),(0,i.jsxs)("div",{className:m().search,children:[(0,i.jsxs)("div",{className:m().search_name,children:[e("futures.listTabs.futures"),":"]}),(0,i.jsx)("div",{className:m().search_select,children:(0,i.jsx)(c.Z,{renderLabelProp:t=>t?O(t):e("futures.listTabs.all"),showSearch:!0,searchField:"symbolRename",options:S,onSelect:z,renderListOption:e=>O(e)},"coin_".concat(j))}),(0,i.jsx)("div",{className:m().ml20}),(0,i.jsxs)("div",{className:m().search_name,children:[e("futures.listTabs.direction"),":"]}),(0,i.jsx)("div",{className:m().search_select,children:(0,i.jsx)(c.Z,{options:I,onSelect:U,defaultValue:0},"side_".concat(j))}),(0,i.jsx)("div",{className:m().ml20}),(0,i.jsx)("div",{className:m().search_btn,onClick:X,children:e("search.reset")})]}),(0,i.jsx)("div",{className:"".concat(m().list," ").concat(m().futuresList),children:(0,i.jsx)(r.Z,{columns:B,dataSource:t,loading:k})}),h>0&&(0,i.jsx)(l.Z,{currentPage:x,pageSize:10,total:h||0,totalPages:Math.ceil(h/10),onPageChange:V,hiddenPageNo:!0})]})})};var x=y},71739:function(e,t,s){"use strict";var i=s(36734),n=s(44515),a=s.n(n);let l=e=>{let{currentPage:t,pageSize:s,total:n,totalPages:l,onPageChange:c,hiddenPageNo:r=!1}=e;return(0,i.jsx)("div",{className:a().component,children:(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{children:(0,i.jsx)("button",{type:"button",disabled:1===t,className:1===t?a().disabled:"",onClick:()=>c(t-1),children:(0,i.jsx)("i",{className:"iconfont icon-arrow-left"})})}),!r&&(()=>{let e=[],s=Math.max(1,t-Math.floor(2.5)),i=Math.min(l,s+5-1);for(let n=s;n<=i;n++)e.push(n);return s>1&&e.unshift("..."),i<l&&e.push("..."),e})().map((e,s)=>(0,i.jsx)("li",{children:"..."===e?(0,i.jsx)("span",{children:"â¢â¢â¢"}):(0,i.jsx)("button",{type:"button",className:e===t?a().active:"",onClick:()=>c(e),children:e})},s)),(0,i.jsx)("li",{children:(0,i.jsx)("button",{type:"button",disabled:t===l||n<s,className:t===l||n<s?a().disabled:"",onClick:()=>c(t+1),children:(0,i.jsx)("i",{className:"iconfont icon-arrow-right"})})})]})})};t.Z=l},44515:function(e){e.exports={component:"pagination_component__qIWQU",active:"pagination_active__7PSXI",disabled:"pagination_disabled__NHlQY"}},29111:function(){}},function(e){e.O(0,[7832,8250,1304,9774,2888,179],function(){return e(e.s=39248)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.