From dd29c138733a1de4e7633c0a7c794a3a0827d080 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Mon, 15 Sep 2025 15:29:21 +0800
Subject: [PATCH] 2
---
src/views/account/components/Position.vue | 130 +++++++++++++++++++++++++++++++------------
1 files changed, 93 insertions(+), 37 deletions(-)
diff --git a/src/views/account/components/Position.vue b/src/views/account/components/Position.vue
index cf31125..94f380a 100644
--- a/src/views/account/components/Position.vue
+++ b/src/views/account/components/Position.vue
@@ -1,35 +1,61 @@
<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">
- <el-table
- :data="tableData"
- style="width: 100%; flex: 1"
- height="250"
- empty-text="No Data"
- >
+ <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'
+ : ''
+ }`">
+ {{ thisMoneyData.symbol }} {{ thisMoneyData.profitAndLoss }}
+ </div>
+ </div>
+ <div class="card_2 flex-between">
+ <div class="card_2_item flex-center" style="align-items: start">
+ <div>{{ $t("總資產") }}</div>
+ <div>{{ thisMoneyData.symbol }}{{ thisMoneyData.totalMoney }}</div>
+ </div>
+ <div class="card_2_item flex-center">
+ <div>{{ $t("hj48") }}</div>
+ <div>
+ {{ thisMoneyData.symbol }}{{ thisMoneyData.availableBalance }}
+ </div>
+ </div>
+ <div class="card_2_item flex-center" style="align-items: end">
+ <div>{{ $t("平仓盈亏") }}</div>
+ <div>
+ {{ thisMoneyData.symbol
+ }}{{ thisMoneyData.cumulativeProfitAndLoss }}
+ </div>
+ </div>
+ </div>
+ <div class="card_2 flex-between" style="border-top: #aaa solid 1px">
+ <el-button type="primary" size="medium" @click="$router.push('/home')">
+ {{ $t("buy") }}
+ </el-button>
+ <el-button type="primary" size="medium" @click="$router.push('/home')">
+ {{ $t("hj78") }}
+ </el-button>
+ <el-button type="primary" size="medium" @click="pc">
+ {{ $t("hj121") }}
+ </el-button>
+ </div>
+ </div>
+
+ <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] }}
@@ -49,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
+ <span :class="`${scope.row.profitAndLose < 0
+ ? 'r_c'
+ : scope.row.profitAndLose > 0
? 'lc_c'
: ''
- }`"
- >
+ }`">
{{ scope.row.profitAndLose }} ({{
scope.row.profitAndLoseParent
}})
@@ -95,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>
@@ -130,6 +147,15 @@
type: String,
default: "",
},
+ moneyData: {
+ type: Array,
+ default: () => [],
+ },
+ },
+ computed: {
+ thisMoneyData() {
+ return this.moneyData.find((item) => item.accectType == this.type) || {};
+ },
},
watch: {},
async created() {
@@ -144,6 +170,10 @@
this.$emit("update:dialogVisible", false);
this.$emit("onClose"); // 关闭弹窗时,通知父组件
},
+ // 打开平仓弹窗
+ pc() {
+ this.$emit("pc");
+ },
},
};
</script>
@@ -155,6 +185,32 @@
display: flex;
flex-direction: column;
+ .card {
+ 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 {
+ padding: 3px 0;
+ }
+ }
+ }
+ }
+
.pagination {
margin-top: 20px;
text-align: center;
--
Gitblit v1.9.3