|
|
@ -1,6 +1,159 @@ |
|
|
|
<template> |
|
|
|
<card> |
|
|
|
<el-tabs v-model="activeName"> |
|
|
|
<card class="rol"> |
|
|
|
<div class="my-flex"> |
|
|
|
<div><card>机器人总资产:522222</card></div> |
|
|
|
<div><card>周转资金:522222</card></div> |
|
|
|
<div><card>当前持仓资金:522222</card></div> |
|
|
|
<div><card>浮动盈亏:522222</card></div> |
|
|
|
<div><card>总利息:522222</card></div> |
|
|
|
<div><card>总手续费:522222</card></div> |
|
|
|
<div><card>总收益:522222</card></div> |
|
|
|
</div> |
|
|
|
<card></card> |
|
|
|
<el-table |
|
|
|
:data="latestOrderList" |
|
|
|
height="600" |
|
|
|
size="mini" |
|
|
|
class="customer-no-border-table" |
|
|
|
> |
|
|
|
<el-table-column |
|
|
|
v-for="i in secondTradeColumns" |
|
|
|
:label="i.name" |
|
|
|
:width="i.width || 60" |
|
|
|
:prop="i.prop" |
|
|
|
:key="i.prop" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- 卖卖类型 --> |
|
|
|
<div v-if="i.customSlot == 'OrderType'"> |
|
|
|
<p>买入</p> |
|
|
|
<p>卖出</p> |
|
|
|
</div> |
|
|
|
<!-- 手持资金 --> |
|
|
|
<div v-else-if="i.customSlot == 'CapitalAfter'"> |
|
|
|
<p> |
|
|
|
{{ |
|
|
|
(scope.row.CapitalAfterPurchase && |
|
|
|
scope.row.CapitalAfterPurchase.toFixed(2)) || |
|
|
|
0 |
|
|
|
}} |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
{{ |
|
|
|
(scope.row.CapitalAfterSale && |
|
|
|
scope.row.CapitalAfterSale.toFixed(2)) || |
|
|
|
0 |
|
|
|
}} |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
<!-- 买卖时间 --> |
|
|
|
<div v-else-if="i.customSlot == 'KLineId'"> |
|
|
|
<p> |
|
|
|
{{ |
|
|
|
scope.row.PurchaseKLineId |
|
|
|
? moment(scope.row.PurchaseKLineId * 1000).format( |
|
|
|
"YYYY-MM-DD HH:mm:ss" |
|
|
|
) |
|
|
|
: "-" |
|
|
|
}} |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
{{ |
|
|
|
scope.row.SaleKLineId |
|
|
|
? moment(scope.row.SaleKLineId * 1000).format( |
|
|
|
"YYYY-MM-DD HH:mm:ss" |
|
|
|
) |
|
|
|
: "-" |
|
|
|
}} |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
<!-- 下单方式 --> |
|
|
|
<div v-else-if="i.customSlot == 'OrderWay'"> |
|
|
|
<p>市价单</p> |
|
|
|
<p>市价单</p> |
|
|
|
</div> |
|
|
|
<!-- 信号价 --> |
|
|
|
<div v-else-if="i.customSlot == 'SignalPrice'"> |
|
|
|
<p>{{ scope.row.PurchasePrice }}</p> |
|
|
|
<p>{{ scope.row.SalePrice }}</p> |
|
|
|
</div> |
|
|
|
<!-- 下单方式 --> |
|
|
|
<div v-else-if="i.customSlot == 'Fee'"> |
|
|
|
<p>{{ scope.row.PurchaseFee }}</p> |
|
|
|
<p>{{ scope.row.SaleFee }}</p> |
|
|
|
</div> |
|
|
|
<!-- 买卖数量 --> |
|
|
|
<div v-else-if="i.customSlot == 'Count'"> |
|
|
|
<p>{{ scope.row.PurchaseCoinCount || "-" }}</p> |
|
|
|
<p>{{ scope.row.SaleCoinCount || "-" }}</p> |
|
|
|
</div> |
|
|
|
<!-- 成交总价 --> |
|
|
|
<div v-else-if="i.customSlot == 'Total'"> |
|
|
|
<p>{{ scope.row.TotalPurchasePrice || "-" }}</p> |
|
|
|
<p>{{ scope.row.TotalSalePrice || "-" }}</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 借币金额 --> |
|
|
|
<div v-else-if="i.customSlot == 'LoanAmount'"> |
|
|
|
<p> |
|
|
|
{{ scope.row.LoanAmount.toFixed(2) || "-" }} |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 借币利息 --> |
|
|
|
<div v-else-if="i.customSlot == 'LoanFee'"> |
|
|
|
<p> |
|
|
|
{{ scope.row.LoanFee.toFixed(2) || "-" }} |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 借币比例 --> |
|
|
|
<div v-else-if="i.customSlot == 'LoanRatio'"> |
|
|
|
<p>{{ scope.row.LoanRatio.toFixed(2) || "-" }}%</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 最大浮亏 --> |
|
|
|
<div v-else-if="i.customSlot == 'MaxLossRatio'"> |
|
|
|
<p>{{ scope.row.MaxLossPrice || "-" }}</p> |
|
|
|
<p>{{ scope.row.MaxLossRatio || "-" }}%</p> |
|
|
|
</div> |
|
|
|
<!-- 盈亏 --> |
|
|
|
<div v-else-if="i.customSlot == 'Profit'"> |
|
|
|
<p>{{ scope.row.Profit }}</p> |
|
|
|
<p v-if="scope.row.Profit"> |
|
|
|
{{ |
|
|
|
( |
|
|
|
(scope.row.Profit / scope.row.TotalPurchasePrice) * |
|
|
|
100 |
|
|
|
).toFixed(2) |
|
|
|
}}% |
|
|
|
</p> |
|
|
|
<p v-else>-</p> |
|
|
|
</div> |
|
|
|
<!-- 累计盈亏 --> |
|
|
|
<div v-else-if="i.customSlot == 'TotalProfit'"> |
|
|
|
<p>{{ scope.row.TotalProfit }}</p> |
|
|
|
<p v-if="scope.row.TotalProfit"> |
|
|
|
{{ scope.row.TotalProfitRatio }}% |
|
|
|
</p> |
|
|
|
<p v-else>-</p> |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
|
<p>{{ scope.row[i.prop] }}</p> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-pagination |
|
|
|
small |
|
|
|
:hide-on-single-page="true" |
|
|
|
layout="prev, pager, next" |
|
|
|
:total="historyOrdersPagination.total" |
|
|
|
:page-size="historyOrdersPagination.pageSize" |
|
|
|
:current-page="historyOrdersPagination.current" |
|
|
|
> |
|
|
|
</el-pagination> |
|
|
|
<!-- <el-tabs v-model="activeName"> |
|
|
|
<el-tab-pane label="历史订单" name="first"> |
|
|
|
<custom-base-table |
|
|
|
:data="historyOrders" |
|
|
@ -24,7 +177,7 @@ |
|
|
|
thead-classes="text-primary" |
|
|
|
></custom-base-table> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</el-tabs> --> |
|
|
|
|
|
|
|
<card> |
|
|
|
<h5 slot="header" class="title">账号配置信息</h5> |
|
|
@ -86,7 +239,10 @@ |
|
|
|
</card> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { OrderColumns } from "../../pages/prePages/js/columns"; |
|
|
|
import { |
|
|
|
OrderColumns, |
|
|
|
secondTradeColumns |
|
|
|
} from "../../pages/prePages/js/columns"; |
|
|
|
import CustomBaseTable from "../../components/CustomBaseTable"; |
|
|
|
import Bus from "../../common/bus"; |
|
|
|
|
|
|
@ -110,8 +266,10 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
secondTradeColumns, |
|
|
|
activeName: "first", |
|
|
|
OrderColumns, |
|
|
|
latestOrderList: [], |
|
|
|
historyOrders: [], |
|
|
|
nowOrders: [], |
|
|
|
basic: {}, |
|
|
@ -121,7 +279,8 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
created() { |
|
|
|
this.initOrders(); //初始化两个订单列表 |
|
|
|
// this.initOrders(); //初始化两个订单列表 |
|
|
|
this.initHistoryOrders(); |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
@ -131,25 +290,29 @@ export default { |
|
|
|
|
|
|
|
beforeDestroy() { |
|
|
|
closeWebSocket(); |
|
|
|
localStorage.clear(); |
|
|
|
localStorage.removeItem("missPkg"); |
|
|
|
localStorage.removeItem("pingTimeStamp"); |
|
|
|
clearInterval(this.pingInterval); |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
initOrders() { |
|
|
|
this.initHistoryOrders(); |
|
|
|
this.initNowOrders(); |
|
|
|
latestOrder() { |
|
|
|
this.$http.get("/Api/Order/GetSpotOrderList"); |
|
|
|
}, |
|
|
|
// initOrders() { |
|
|
|
// this.initHistoryOrders(); |
|
|
|
// this.initNowOrders(); |
|
|
|
// }, |
|
|
|
initHistoryOrders() { |
|
|
|
let pageIndex = this.historyOrdersPagination.current; |
|
|
|
let pageSize = this.historyOrdersPagination.pageSize; |
|
|
|
this.$http |
|
|
|
.get( |
|
|
|
`/Api/Order/GetHistorySpotGoodsOrder?pageIndex=${pageIndex}&pageSize=${pageSize}&robotId=${this.RobotId}` |
|
|
|
`/Api/Order/GetSpotOrderList?pageIndex=${pageIndex}&pageSize=${pageSize}&robotId=${this.RobotId}` |
|
|
|
) |
|
|
|
.then(res => { |
|
|
|
if (res.Code == 200) { |
|
|
|
this.historyOrders = res.Data.List; |
|
|
|
this.latestOrderList = res.Data.List; |
|
|
|
const pager = { ...this.historyOrdersPagination }; |
|
|
|
pager.total = res.Data.Count; |
|
|
|
this.historyOrdersPagination = pager; |
|
|
@ -235,7 +398,8 @@ export default { |
|
|
|
*/ |
|
|
|
console.log("达到丢包次数", missPkgCount); |
|
|
|
clearInterval(this.pingInterval); |
|
|
|
localStorage.clear(); |
|
|
|
localStorage.removeItem("missPkg"); |
|
|
|
localStorage.removeItem("pingTimeStamp"); |
|
|
|
closeWebSocket(); |
|
|
|
this.initOrders(); |
|
|
|
this.initWs(); |
|
|
@ -352,4 +516,18 @@ export default { |
|
|
|
.el-pager li { |
|
|
|
background-color: transparent; |
|
|
|
} |
|
|
|
.el-table th > .cell { |
|
|
|
font-size: 10px; |
|
|
|
} |
|
|
|
.my-flex { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
font-size: 16px; |
|
|
|
font-weight: 800; |
|
|
|
color: rgba(255, 255, 255, 0.926); |
|
|
|
} |
|
|
|
.rol { |
|
|
|
height: 800px; |
|
|
|
overflow: auto; |
|
|
|
} |
|
|
|
</style> |
|
|
|