From 383c19d0da1390f8d82e7b23fb2d62f87d544d56 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Wed, 17 Sep 2025 14:08:01 +0800
Subject: [PATCH] 2
---
src/views/account/components/Position.vue | 84 ++++++++++++++++-------------------------
1 files changed, 33 insertions(+), 51 deletions(-)
diff --git a/src/views/account/components/Position.vue b/src/views/account/components/Position.vue
index ffbb920..0065a84 100644
--- a/src/views/account/components/Position.vue
+++ b/src/views/account/components/Position.vue
@@ -1,25 +1,15 @@
<template>
- <el-drawer
- :title="$t('hj2')"
- :visible.sync="dialogVisible"
- direction="rtl"
- :before-close="onClose"
- size="980px"
- >
+ <el-drawer :title="$t('hj2')" :visible.sync="dialogVisible" direction="rtl" :before-close="onClose" size="980px">
<div class="drawer-content">
<div class="card sb_b">
<div class="card_1 flex-center">
<div>{{ $t("浮動盈虧") }}</div>
- <div
- style="font-size: 24px"
- :style="`color:${
- thisMoneyData.profitAndLoss > 0
- ? 'red'
- : thisMoneyData.profitAndLoss < 0
- ? 'green'
- : ''
- }`"
- >
+ <div style="font-size: 24px" :style="`color:${thisMoneyData.profitAndLoss > 0
+ ? 'red'
+ : thisMoneyData.profitAndLoss < 0
+ ? 'green'
+ : ''
+ }`">
{{ thisMoneyData.symbol }} {{ thisMoneyData.profitAndLoss }}
</div>
</div>
@@ -35,7 +25,7 @@
</div>
</div>
<div class="card_2_item flex-center" style="align-items: end">
- <div>{{ $t("账户盈亏") }}</div>
+ <div>{{ $t("平仓盈亏") }}</div>
<div>
{{ thisMoneyData.symbol
}}{{ thisMoneyData.cumulativeProfitAndLoss }}
@@ -55,29 +45,17 @@
</div>
</div>
- <el-table
- :data="tableData"
- style="width: 100%; flex: 1"
- height="100%"
- empty-text="No Data"
- >
+ <el-table :data="tableData" style="width: 100%; flex: 1" height="100%" empty-text="No Data">
<el-table-column prop="stockSpell" :label="$t('hj313')">
<template slot-scope="scope">
- <el-tag
- :type="scope.row.stockGid != $mc ? 'success' : ''"
- size="small"
- style="margin-right: 8px"
- >
+ <el-tag :type="scope.row.stockGid != $mc ? 'success' : ''" size="small" style="margin-right: 8px">
{{ scope.row.stockGid }}
</el-tag>
<span>{{ scope.row.stockName }}</span>
</template>
</el-table-column>
- <el-table-column
- prop="positionType"
- :label="`${$t('hj313')} ${$t('類型')}`"
- >
+ <el-table-column prop="positionType" :label="`${$t('hj313')} ${$t('類型')}`">
<template slot-scope="scope">
<el-tag type="warning">
{{ dictionary.gplx[scope.row.positionType] }}
@@ -97,15 +75,12 @@
<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'
- : ''
- }`"
- >
+ <span :class="`${scope.row.profitAndLose < 0
+ ? 'r_c'
+ : scope.row.profitAndLose > 0
+ ? 'lc_c'
+ : ''
+ }`">
{{ scope.row.profitAndLose }} ({{
scope.row.profitAndLoseParent
}})
@@ -143,14 +118,8 @@
</el-table>
<div class="pagination flex-end">
- <el-pagination
- background
- layout="prev, pager, next"
- :total="total"
- :current-page="pageNum"
- :page-size="pageSize"
- @current-change="handleCurrentChange"
- >
+ <el-pagination background layout="prev, pager, next" :total="total" :current-page="pageNum"
+ :page-size="pageSize" @current-change="handleCurrentChange">
</el-pagination>
</div>
</div>
@@ -158,6 +127,8 @@
</template>
<script>
+
+let teimss2 = null; // 轮询获取持仓数据计时器
import mixins from "@/mixins/myMixins"; // 混入
import * as api from "@/axios/api";
export default {
@@ -194,6 +165,13 @@
this.opt.stockType = this.type;
this.apiInterface = api.getchicang; // 赋值接口
this.init(); // 获取记录列表
+
+ teimss2 = setInterval(() => {
+ this.getList();
+ }, 3000);
+ },
+ beforeDestroy() {
+ clearInterval(teimss2);
},
methods: {
// 关闭弹窗
@@ -220,18 +198,22 @@
border-radius: 16px;
overflow: hidden;
border: 1px solid #777;
+
.card_1 {
padding: 20px;
font-size: 18px;
flex-direction: column;
}
+
.card_2 {
width: 100%;
padding: 10px 30px 10px;
+
.card_2_item {
width: 33%;
flex-direction: column;
- & > div {
+
+ &>div {
padding: 3px 0;
}
}
--
Gitblit v1.9.3