import{r as e,j as l,o as a}from"./app-a12cf07d.js";import{c as s,g as t,i,e as c}from"./local-6367da78.js";import{P as d}from"./index-3e8617f2.js";import{g as r,a as n,b as o,c as h}from"./trade-281a8bb7.js";import"./auth-d668f6b9.js";import"./index-6dbbb2c5.js";class m 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,isFirst:!0},this.columns=[{colKey:"ddd",title:"用户名"},{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:"成交数量USDT",align:"center"},{colKey:"d9",title:"状态",align:"center"},{colKey:"d10",title:"交易时间",align:"center"},{colKey:"d11",title:"更新时间",align:"center"},{colKey:"d12",title:"返回值",align:"center"}]}pcTable(){return""}mobileTable(){return l.jsxs("div",{className:"contract-real-table__mobile",children:[this.state.list.map(((e,a)=>{var i;return l.jsxs("div",{className:"table-row",children:[l.jsxs("div",{className:"table-row-line",children:[l.jsx("div",{className:"table-pairs",children:e.symbol}),l.jsx("div",{className:"table-time",children:e.trading_time})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:["table-direction"].join(" "),style:{color:r(e.position_side)},children:[s("order_type",e.order_type),"/",n(e.position_side)]}),l.jsxs("div",{className:"table-time",children:[l.jsx("span",{children:"更新时间 "}),e.updated_at]})]}),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:t(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.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:parseFloat(e.quantity+"")})]})]}),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:s("side",e.side)})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"状态"}),l.jsx("div",{className:["table-col-value"].join(" "),style:{color:o(null==(i=e.result)?void 0:i.code)},children:h(e.result)})]})]})]})]},a)})),l.jsx(d,{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:i()?this.mobileTable():this.pcTable()})}async getTableList(e){let l=null;try{l=a();let s={page:this.state.pageNum,limit:this.state.pageSize};e&&(s={...s,...e});const t=await c(s);0==t.code&&this.setState({list:t.data.data,total:t.data.total}),l&&l.hide()}catch(s){l&&l.hide()}}render(){return this.props["v-if"]?this.currentTable():l.jsx(l.Fragment,{})}}export{m as default};
