|
@@ -6,12 +6,14 @@
|
|
|
{{ getBuyOrSellName(value) }}
|
|
{{ getBuyOrSellName(value) }}
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 最新价 -->
|
|
<!-- 最新价 -->
|
|
|
- <template #last="{ row }">
|
|
|
|
|
- {{ last(row.goodsCode) }}
|
|
|
|
|
|
|
+ <template #lastprice="{ row }">
|
|
|
|
|
+ <span :class="lastColor(row)">
|
|
|
|
|
+ {{ lastprice(row) }}
|
|
|
|
|
+ </span>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 浮动盈亏-->
|
|
<!-- 浮动盈亏-->
|
|
|
<template #closepl="{ row }">
|
|
<template #closepl="{ row }">
|
|
|
- <span :class="lastColor(row.goodscode)">{{ closepl(row).toFixed(2) }}</span>
|
|
|
|
|
|
|
+ <span :class="handlePriceColor(closepl(row), 0.0)">{{ closepl(row).toFixed(2) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 展开行 -->
|
|
<!-- 展开行 -->
|
|
|
<template #expand>
|
|
<template #expand>
|
|
@@ -34,15 +36,17 @@ import { useComposeTable } from '@pc/components/base/table'
|
|
|
import { queryTradePosition } from '@/services/api/order'
|
|
import { queryTradePosition } from '@/services/api/order'
|
|
|
import { useFuturesStore } from '@/stores'
|
|
import { useFuturesStore } from '@/stores'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
|
|
+import { handlePriceColor } from '@/filters'
|
|
|
|
|
|
|
|
const futuresStore = useFuturesStore()
|
|
const futuresStore = useFuturesStore()
|
|
|
|
|
|
|
|
-const last = (goodsCode: string) => {
|
|
|
|
|
- return futuresStore.getQuotePrice(goodsCode)
|
|
|
|
|
|
|
+const lastprice = (item: Model.TradePositionRsp) => {
|
|
|
|
|
+ const { last = 0 } = futuresStore.getQuoteInfo(item.goodscode).value ?? {}
|
|
|
|
|
+ return last
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const lastColor = (goodsCode: string) => {
|
|
|
|
|
- return futuresStore.getQuoteInfo(goodsCode).value?.lastColor
|
|
|
|
|
|
|
+const lastColor = (item: Model.TradePositionRsp) => {
|
|
|
|
|
+ return futuresStore.getQuoteInfo(item.goodscode).value?.lastColor
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// 计算参考损益
|
|
/// 计算参考损益
|
|
@@ -71,7 +75,7 @@ const { loading, dataList, run } = useRequest(queryTradePosition, {
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TradePositionRsp>({ rowKey: 'accountid' })
|
|
|
|
|
|
|
+const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TradePositionRsp>({ rowKey: 'goodsid' })
|
|
|
|
|
|
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'goodsname', label: '订单合约' },
|
|
{ prop: 'goodsname', label: '订单合约' },
|
|
@@ -80,7 +84,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'enableqty', label: '可用数量' },
|
|
{ prop: 'enableqty', label: '可用数量' },
|
|
|
{ prop: 'frozenqty', label: '冻结数量' },
|
|
{ prop: 'frozenqty', label: '冻结数量' },
|
|
|
{ prop: 'averageprice', label: '均价' },
|
|
{ prop: 'averageprice', label: '均价' },
|
|
|
- { prop: 'last', label: '现价' },
|
|
|
|
|
|
|
+ { prop: 'lastprice', label: '现价' },
|
|
|
{ prop: 'curholderamount', label: '持仓金额' },
|
|
{ prop: 'curholderamount', label: '持仓金额' },
|
|
|
{ prop: 'usedmargin', label: '占用保证金' },
|
|
{ prop: 'usedmargin', label: '占用保证金' },
|
|
|
{ prop: 'closepl', label: '浮动盈亏' },
|
|
{ prop: 'closepl', label: '浮动盈亏' },
|