import{r as e,j as l}from"./app-61e75031.js";import{c as s,i as a,m as t}from"./local-95ab843f.js";import{C as i}from"./index-33422928.js";import{P as c}from"./index-a7529dc7.js";import{g as r,a as d,i as n}from"./trade-281a8bb7.js";import{C as o}from"./multipleUse-8758e0f1.js";import{o as m}from"./auth-db23b820.js";import"./index-b09a3426.js";import"./index-bf885361.js";class h extends e.Component{constructor(e){super(e),this.pageChange=e=>{this.setState({pageNum:e}),this.getTableList()},this.state={list:[],pageNum:1,pageSize:10,total:0},this.columns=[{colKey:"ddd",title:"用户名",cell:({rowIndex:e,row:s})=>l.jsx("div",{children:s.d9})},{colKey:"d2",title:"交易所"},{colKey:"d3",title:"交易对"},{colKey:"d4",title:"持仓方向",align:"center"},{colKey:"d5",title:"策略",align:"center"},{colKey:"d6",title:"开仓价格",align:"center"},{colKey:"d7",title:"标记价格",align:"center"},{colKey:"d8",title:"未实现盈亏",align:"center"},{colKey:"d9",title:"操作",align:"center"}]}pcTable(){return""}mobileTable(){return l.jsxs("div",{className:"contract-real-table__mobile",children:[this.state.list.map(((e,a)=>l.jsxs("div",{className:"table-row",children:[l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:"table-pairs",children:[e.symbol,l.jsxs("span",{children:[" x",e.leverage]})]}),l.jsx("div",{className:"table-time",children:e.created_at})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsx("div",{className:"table-direction",style:{color:r(e.position_side)},children:d(e.position_side)}),l.jsx(i,{onClick:o.bind(this,{ids:[e.id]}),children:"平仓"})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"用户"}),l.jsx("div",{className:"table-col-value",children:s(e.exchange_users_id)})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"开仓价格"}),l.jsx("div",{className:"table-col-value",children:e.entry_price})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"策略"}),l.jsx("div",{className:"table-col-value",children:e.strategy})]})]}),l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"交易所"}),l.jsx("div",{className:"table-col-value",children:e.exchange})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"标记价格"}),l.jsx("div",{className:"table-col-value",children:e.market_price})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"盈亏"}),l.jsxs("div",{className:["table-col-value","green"].join(" "),children:[n(e.unrealized_profit)," USDT"]})]})]})]})]},a))),l.jsx(c,{onChange:this.pageChange,pageNum:this.state.pageNum,pageSize:this.state.pageSize,total:this.state.total})]})}currentTable(){return l.jsx("div",{style:this.props.style??null,className:"c-table-height",children:a()?this.mobileTable():this.pcTable()})}shouldComponentUpdate(e,l,s){return!0}async getTableList(e){let l=null;try{l=m();let s={page:this.state.pageNum,limit:this.state.pageSize};e&&(s={...s,...e});const a=await t(s);0==a.code&&this.setState({list:a.data.data,total:a.data.total}),l&&l.hide()}catch(s){l&&l.hide()}}componentDidMount(){this.getTableList()}render(){return this.props["v-if"]?this.currentTable():l.jsx(l.Fragment,{})}}export{h as default};
