交易系统前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.6 KiB

<template>
4 years ago
<div class="table-full-width table-responsive" style="height:500px">
<custom-base-table
:data="data"
:columns="columns"
thead-classes="text-primary"
>
<!-- 卖卖类型 -->
<template slot="OrderType">
<p>买入</p>
<p>卖出</p>
</template>
<!-- 买卖时间 -->
<template slot="KLineId" slot-scope="item">
<p>
{{ item.row.item.PurchaseKLineId
?
moment(item.row.item.PurchaseKLineId * 1000).format(
"YYYY-MM-DD HH:mm:ss"
) : "-"
}}
</p>
<p>
{{
item.row.item.SaleKLineId
? moment(item.row.item.SaleKLineId * 1000).format(
"YYYY-MM-DD HH:mm:ss"
)
: "-"
}}
</p>
</template>
<!-- 买卖价格 -->
<template slot="Price" slot-scope="item">
<p>{{ item.row.item.PurchasePrice || "-" }}</p>
<p>{{ item.row.item.SalePrice || "-" }}</p>
</template>
<!-- 买卖数量 -->
<template slot="Count" slot-scope="item">
<p>{{ item.row.item.PurchaseCoinCount || "-" }}</p>
<p>{{ item.row.item.SaleCoinCount || "-" }}</p>
</template>
<!-- 最大浮亏 -->
<template slot="MaxLossRatio" slot-scope="item">
<p>{{ item.row.item.MaxLossPrice || "-" }}</p>
<p>{{ item.row.item.MaxLossRatio || "-" }}%</p>
</template>
<!-- 盈亏 -->
<template slot="Profit" slot-scope="item">
<p>{{ item.row.item.Profit }}</p>
<p v-if="item.row.item.Profit">
{{
(
(item.row.item.Profit / item.row.item.TotalPurchasePrice) *
100
).toFixed(2)
}}%
</p>
<p v-else>-</p>
</template>
<!-- 累计盈亏 -->
<template slot="TotalProfit" slot-scope="item">
<p>{{ item.row.item.TotalProfit }}</p>
<p v-if="item.row.item.TotalProfit">
{{
(
(item.row.item.TotalProfit / policyFormData.PositionFund) *
100
).toFixed(2)
}}%
</p>
<p v-else>-</p>
</template>
</custom-base-table>
</div>
</template>
<script>
import CustomBaseTable from "../../components/CustomBaseTable";
import { tradeColumns } from "../../pages/prePages/js/columns";
import moment from "moment";
export default {
model: { prop: "data", event: "tableDataChange" },
4 years ago
props: { data: { type: Array, default: () => [] }, policyFormData: {} },
4 years ago
components: { CustomBaseTable },
data() {
return { moment, columns: tradeColumns };
}
};
</script>