From cdd46caef517696298e394579d6819fa0ca8388d Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Wed, 17 Sep 2025 13:52:49 +0800
Subject: [PATCH] 1

---
 src/views/account/components/Position.vue |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/src/views/account/components/Position.vue b/src/views/account/components/Position.vue
index 94f380a..0065a84 100644
--- a/src/views/account/components/Position.vue
+++ b/src/views/account/components/Position.vue
@@ -5,10 +5,10 @@
         <div class="card_1 flex-center">
           <div>{{ $t("浮動盈虧") }}</div>
           <div style="font-size: 24px" :style="`color:${thisMoneyData.profitAndLoss > 0
-              ? 'red'
-              : thisMoneyData.profitAndLoss < 0
-                ? 'green'
-                : ''
+            ? 'red'
+            : thisMoneyData.profitAndLoss < 0
+              ? 'green'
+              : ''
             }`">
             {{ thisMoneyData.symbol }} {{ thisMoneyData.profitAndLoss }}
           </div>
@@ -76,10 +76,10 @@
         <el-table-column prop="profitAndLoseParent" :label="$t('Profit')">
           <template slot-scope="scope">
             <span :class="`${scope.row.profitAndLose < 0
-                ? 'r_c'
-                : scope.row.profitAndLose > 0
-                  ? 'lc_c'
-                  : ''
+              ? 'r_c'
+              : scope.row.profitAndLose > 0
+                ? 'lc_c'
+                : ''
               }`">
               {{ scope.row.profitAndLose }} ({{
                 scope.row.profitAndLoseParent
@@ -127,6 +127,8 @@
 </template>
 
 <script>
+
+let teimss2 = null; // 轮询获取持仓数据计时器
 import mixins from "@/mixins/myMixins"; // 混入
 import * as api from "@/axios/api";
 export default {
@@ -163,6 +165,13 @@
     this.opt.stockType = this.type;
     this.apiInterface = api.getchicang; // 赋值接口
     this.init(); // 获取记录列表
+
+    teimss2 = setInterval(() => {
+      this.getList();
+    }, 3000);
+  },
+  beforeDestroy() {
+    clearInterval(teimss2);
   },
   methods: {
     // 关闭弹窗

--
Gitblit v1.9.3