From 066ec67b7080f07a0e47dda9864ee6be2e4b9053 Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Fri, 13 Jun 2025 14:03:54 +0800
Subject: [PATCH] Merge branch 'master' of http://124.156.157.155:8060/r/~admin/aerospace-pc

---
 src/components/constract/PerpetualContract/positionCom/currentPosition.vue |   71 +++++++++++++++++++++++------------
 1 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/src/components/constract/PerpetualContract/positionCom/currentPosition.vue b/src/components/constract/PerpetualContract/positionCom/currentPosition.vue
index 12bd7d5..787c323 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="140">
         <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>
@@ -29,6 +29,7 @@
         :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">
@@ -40,7 +41,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 +82,51 @@
       timer: null,
       tables: [
         {
+          prop: "profit",
+          label: "message.user.weishixianyingkui(shouyilv)",
+          formatter: this.formatterData,
+          width: 260,
+        },
+        {
           prop: "volume", //volume_open持仓总张数,volume表示剩余
           label: "message.home.zhangshu",
         },
+
         {
           prop: "trade_avg_price",
           label: "message.user.kaicangjiage",
+          formatter: (row) => {
+            const { trade_avg_price } = row;
+            return bigDecimal.round(trade_avg_price, 6);
+          },
         },
-        // {
-        //   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: "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: "profit",
-          label: "message.user.weishixianyingkui(shouyilv)",
-          formatter: this.formatterData,
-        },
-        {
-          prop: "qiangPing",
-          label: "message.home.qiangping",
+          prop: "create_time",
+          label: "message.jiaoyi.jiaoyishijian", // 下单时间
         },
       ],
       tableData: [],
@@ -147,7 +159,7 @@
     },
     formatterData(row) {
       const ratio = this.ratioFormatter(row);
-      const profit = Number(row.profit).toFixed(4);
+      const profit = Number(row.profit).toFixed(6);
       return `${profit}(${ratio})`;
     },
     //设置单个单元格样式   行下标:rowIndex    列下标:columnIndex
@@ -160,6 +172,15 @@
         }
       }
       if (columnIndex == 3) {
+        return row.direction === "buy"
+          ? { 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" };
@@ -180,7 +201,7 @@
           (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) =>
@@ -224,7 +245,7 @@
   background: #e05561;
 }
 .lever_rate {
-  color: #1d91ff;
+  color: #f7b328;
   background: #243046;
   border-radius: 2px;
   padding: 2px 6px;

--
Gitblit v1.9.3