5.10航天ui交易所pc端,代码jiem-pc
lxf
2025-06-04 a51ae716cb1eb8e21fc4a5c355d3cdbe02b27d7f
src/components/constract/PerpetualContract/positionCom/currentPosition.vue
@@ -7,16 +7,16 @@
      :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="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> -->
@@ -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>
@@ -94,20 +94,20 @@
          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: "lever_rate",
          label: "message.home.gangganbeishu",
        },
        {
          prop: "change_ratio",
          label: "message.home.baozhengjinbilv",
          formatter: this.ratioFormatter,
          // formatter: this.ratioFormatter,
        },
        {
          prop: "deposit",
@@ -154,7 +154,7 @@
    formatterData(row) {
      const ratio = this.ratioFormatter(row);
      const profit = Number(row.profit).toFixed(4);
      return `${profit}/n(${ratio})`;
      return `${profit}/(${ratio})`;
    },
    //设置单个单元格样式   行下标:rowIndex    列下标:columnIndex
    cellStyle({ row, column, rowIndex, columnIndex }) {
@@ -170,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 = {