| | |
| | | :empty-text="$t('message.home.noData')" |
| | | > |
| | | <!-- 合约会显示buy和杠杆 --> |
| | | <el-table-column :label="$t('message.jiaoyi.heyue')" width="180"> |
| | | <el-table-column :label="$t('message.jiaoyi.heyue')" width="140"> |
| | | <template #default="scope"> |
| | | <div class="first-column"> |
| | | <span |
| | |
| | | :prop="item.prop" |
| | | :label="$t(item.label)" |
| | | :formatter="item.formatter" |
| | | :width="item.width" |
| | | /> |
| | | <el-table-column :label="$t('message.home.caozuo')" min-width="100"> |
| | | <template #default="scope"> |
| | |
| | | prop: "profit", |
| | | label: "message.user.weishixianyingkui(shouyilv)", |
| | | formatter: this.formatterData, |
| | | width: 260, |
| | | }, |
| | | { |
| | | prop: "volume", //volume_open持仓总张数,volume表示剩余 |
| | |
| | | { |
| | | prop: "trade_avg_price", |
| | | label: "message.user.kaicangjiage", |
| | | formatter: (row) => { |
| | | const { trade_avg_price } = row; |
| | | return bigDecimal.round(trade_avg_price, 6); |
| | | }, |
| | | }, |
| | | |
| | | { |
| | |
| | | prop: "lever_rate", |
| | | label: "message.home.gangganbeishu", |
| | | }, |
| | | { |
| | | prop: "change_ratio", |
| | | label: "message.home.baozhengjinbilv", |
| | | // formatter: this.ratioFormatter, |
| | | }, |
| | | // { |
| | | // prop: "change_ratio", |
| | | // label: "message.home.baozhengjinbilv", |
| | | // // formatter: this.ratioFormatter, |
| | | // }, |
| | | { |
| | | prop: "deposit", |
| | | label: "message.home.baozhengjin", |
| | |
| | | }, |
| | | formatterData(row) { |
| | | const ratio = this.ratioFormatter(row); |
| | | const profit = Number(row.profit).toFixed(4); |
| | | return `${profit}/(${ratio})`; |
| | | const profit = Number(row.profit).toFixed(6); |
| | | return `${profit}(${ratio})`; |
| | | }, |
| | | //设置单个单元格样式 行下标:rowIndex 列下标:columnIndex |
| | | cellStyle({ row, column, rowIndex, columnIndex }) { |
| | |
| | | (accumulator, cur) => Number(accumulator) + Number(cur.profit), |
| | | 0 |
| | | ); |
| | | const dataloss = bigDecimal.round(profitLoss, 2); |
| | | const dataloss = bigDecimal.round(profitLoss, 6); |
| | | // 保证金率 |
| | | const marginRate = res.data.reduce( |
| | | (accumulator, cur) => |