From a51ae716cb1eb8e21fc4a5c355d3cdbe02b27d7f Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Wed, 04 Jun 2025 18:38:25 +0800
Subject: [PATCH] style
---
src/components/constract/PerpetualContract/positionCom/currentPosition.vue | 89 ++++++++++++++++++++++++++------------------
1 files changed, 52 insertions(+), 37 deletions(-)
diff --git a/src/components/constract/PerpetualContract/positionCom/currentPosition.vue b/src/components/constract/PerpetualContract/positionCom/currentPosition.vue
index 0cf841b..e9d504b 100644
--- a/src/components/constract/PerpetualContract/positionCom/currentPosition.vue
+++ b/src/components/constract/PerpetualContract/positionCom/currentPosition.vue
@@ -7,19 +7,19 @@
:empty-text="$t('message.home.noData')"
>
<!-- 合约会显示buy和杠杆 -->
- <el-table-column :label="$t('message.jiaoyi.heyue')" width="280">
+ <el-table-column :label="$t('message.jiaoyi.heyue')" width="180">
<template #default="scope">
<div class="first-column">
<span
class="direction"
:class="`direction-${scope.row.direction}`"
></span>
- <span class="name"
- >{{ scope.row.name }} {{ $t("message.home.yongxu") }}</span
- >
- <span class="lever_rate">{{
+ <span class="name" style="color: rgb(98, 200, 133)"
+ >{{ scope.row.name }}
+ </span>
+ <!-- <span class="lever_rate">{{
scope.row.lever_rate ? `${scope.row.lever_rate}x` : "1x"
- }}</span>
+ }}</span> -->
</div>
</template>
</el-table-column>
@@ -40,7 +40,7 @@
> -->
<el-button class="btn" size="small" @click="handleAllClose(scope)">{{
- $t("message.home.pingcang")
+ $t("message.home.pingcang2")
}}</el-button>
</template>
</el-table-column>
@@ -81,40 +81,46 @@
timer: null,
tables: [
{
- prop: "volume", //volume_open持仓总张数,volume表示剩余
- label: "message.home.zhangshu",
- },
- {
- prop: "trade_avg_price",
- label: "message.user.kaicangjiage",
- },
- // {
- // prop: "mark_price",
- // label: "message.home.biaojijiage",
- // },
- {
- prop: "direction",
- label: "message.home.fangxiang",
- formatter: this.directionFormatter,
- },
-
- {
- prop: "change_ratio",
- label: "message.home.baozhengjinbilv",
- formatter: this.ratioFormatter,
- },
- {
- prop: "deposit",
- label: "message.home.baozhengjin",
- },
- {
prop: "profit",
label: "message.user.weishixianyingkui(shouyilv)",
formatter: this.formatterData,
},
{
- prop: "qiangPing",
- label: "message.home.qiangping",
+ prop: "volume", //volume_open持仓总张数,volume表示剩余
+ label: "message.home.zhangshu",
+ },
+
+ {
+ prop: "trade_avg_price",
+ label: "message.user.kaicangjiage",
+ },
+
+ {
+ prop: "direction",
+ label: "message.home.fangxiang",
+ formatter: this.directionFormatter,
+ },
+ {
+ prop: "lever_rate",
+ label: "message.home.gangganbeishu",
+ },
+ {
+ prop: "change_ratio",
+ label: "message.home.baozhengjinbilv",
+ // formatter: this.ratioFormatter,
+ },
+ {
+ prop: "deposit",
+ label: "message.home.baozhengjin",
+ },
+
+ // {
+ // prop: "qiangPing",
+ // label: "message.home.qiangping",
+ // },
+ {
+ prop: "create_time",
+ label: "message.jiaoyi.jiaoyishijian", // 下单时间
},
],
tableData: [],
@@ -148,7 +154,7 @@
formatterData(row) {
const ratio = this.ratioFormatter(row);
const profit = Number(row.profit).toFixed(4);
- return `${profit}(${ratio})`;
+ return `${profit}/(${ratio})`;
},
//设置单个单元格样式 行下标:rowIndex 列下标:columnIndex
cellStyle({ row, column, rowIndex, columnIndex }) {
@@ -164,6 +170,15 @@
? { color: "#62C885" }
: { color: "#E05561" };
}
+ if (columnIndex == 1) {
+ return row.profit > 0 ? { color: "#62C885" } : { color: "#E05561" };
+ }
+
+ if (columnIndex == 4) {
+ return row.direction === "buy"
+ ? { color: "#62C885" }
+ : { color: "#E05561" };
+ }
},
getList() {
const data = {
--
Gitblit v1.9.3