|
|
@@ -2,16 +2,24 @@
|
|
|
<!-- 商品订单 - 合约汇总 -->
|
|
|
<mtp-table-scroll>
|
|
|
<template #default="{ scroll }">
|
|
|
- <a-table :columns="getTableColums()" class="srcollYTableExpendBgColor srcollYTable" :scroll="scroll" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :expandIcon="expandIcon" :expandIconAsCell="false" rowKey="key" :data-source="positionList">
|
|
|
+ <a-table :columns="getTableColums()" class="srcollYTableExpendBgColor srcollYTable" :scroll="scroll"
|
|
|
+ :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick"
|
|
|
+ :expandIcon="expandIcon" :expandIconAsCell="false" rowKey="key" :data-source="positionList">
|
|
|
<!-- 额外的展开行 -->
|
|
|
<template #expandedRowRender="{ record }">
|
|
|
- <a-table :columns="getDetailColums()" class="expandBottomTable" :pagination="false" :loading="detailLoading" :expandedRowKeys="expandedRowKeys" :expandIcon="expandIcon" :expandIconAsCell="false" rowKey="key" :data-source="getTradeHolderDetail(record)">
|
|
|
+ <a-table :columns="getDetailColums()" class="expandBottomTable" :pagination="false" :loading="detailLoading"
|
|
|
+ :expandedRowKeys="expandedRowKeys" :expandIcon="expandIcon" :expandIconAsCell="false" rowKey="key"
|
|
|
+ :data-source="getTradeHolderDetail(record)">
|
|
|
<template #operate="sub">
|
|
|
- <BtnList :btnList="handleBtnList(record, btnList)" :record="sub.record" class="btn-list-sticky" @click="openComponent" />
|
|
|
+ <BtnList :btnList="handleBtnList(record, btnList)" :record="sub.record" class="btn-list-sticky"
|
|
|
+ @click="openComponent" />
|
|
|
</template>
|
|
|
<!-- 持仓盈亏 -->
|
|
|
<template #profitloss="{ record }">
|
|
|
- <span :class="[+getDetailProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) > 0 ? 'up-quote-color' : +getDetailProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) < 0 ? 'down-quote-color' : '']">{{ getDetailProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) }}</span>
|
|
|
+ <span
|
|
|
+ :class="[+getDetailProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) > 0 ? 'up-quote-color' : +getDetailProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) < 0 ? 'down-quote-color' : '']">{{
|
|
|
+ getDetailProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList))
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
<!-- 市值 -->
|
|
|
<template #marketamount="{ record }">
|
|
|
@@ -35,7 +43,11 @@
|
|
|
</template> -->
|
|
|
<!-- 持仓盈亏 -->
|
|
|
<template #profitloss="{ record }">
|
|
|
- <span :class="[+useProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) > 0 ? 'up-quote-color' : +useProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) < 0 ? 'down-quote-color' : '']">{{ record.averageprice ? useProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) : '--' }}</span>
|
|
|
+ <span
|
|
|
+ :class="[+useProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) > 0 ? 'up-quote-color' : +useProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) < 0 ? 'down-quote-color' : '']">{{
|
|
|
+ record.averageprice ? useProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) :
|
|
|
+ '--'
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
<template #buyorsell="{ record }">
|
|
|
<span>{{ getBuyOrSellName(record.buyorsell) }}</span>
|
|
|
@@ -46,7 +58,8 @@
|
|
|
</a-table>
|
|
|
</template>
|
|
|
</mtp-table-scroll>
|
|
|
- <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" :tableList="positionList" :swapList="swapList" @cancel="clsoeAction"></component>
|
|
|
+ <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" :tableList="positionList"
|
|
|
+ :swapList="swapList" @cancel="clsoeAction"></component>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
@@ -71,7 +84,7 @@ import Bus from '@/utils/eventBus/index';
|
|
|
import { isInvestment } from '@/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/setup';
|
|
|
import { useHazardRates } from '@/views/order/funding_information/components/funding_information_funding_summary/setup'
|
|
|
import { findGoodsCode, getTableColums, useDetail } from './setup';
|
|
|
-
|
|
|
+import { message } from 'ant-design-vue'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: enumOrderComponents.commodity_contract_summary,
|
|
|
@@ -83,6 +96,7 @@ export default defineComponent({
|
|
|
detail: defineAsyncComponent(() => import('./components/detail/index.vue')), // 详情
|
|
|
},
|
|
|
setup() {
|
|
|
+ let timer = 0; // 推送超时定时器
|
|
|
const { positionList, swapList, getHoldsList, getSwapList, getTradeHolderDetail, useProfitloss } = useHazardRates();
|
|
|
// 表格列表数据
|
|
|
const { loading } = queryTableList<QueryTradePositionRsp>();
|
|
|
@@ -91,7 +105,10 @@ export default defineComponent({
|
|
|
getSwapList();
|
|
|
|
|
|
// 获取列表数据
|
|
|
- const queryTableAction = () => getHoldsList(loading, TradeMode.DiaoQi.toString());
|
|
|
+ const queryTableAction = () => {
|
|
|
+ window.clearTimeout(timer);
|
|
|
+ getHoldsList(loading, TradeMode.DiaoQi.toString());
|
|
|
+ }
|
|
|
|
|
|
// 明细 逻辑
|
|
|
const { detailLoading, getDetailColums, getDetailProfitloss, getDetailMarketAmount } = useDetail();
|
|
|
@@ -127,7 +144,14 @@ export default defineComponent({
|
|
|
btnList, // 表格按钮
|
|
|
} = handleComposeOrderTable<QueryTradePositionRsp>(param)
|
|
|
|
|
|
- function clsoeAction(value: boolean) {
|
|
|
+ function clsoeAction(value: boolean, showLoading: boolean) {
|
|
|
+ if (showLoading) {
|
|
|
+ loading.value = true;
|
|
|
+ // 5秒内没收到推送手动刷新数据
|
|
|
+ timer = window.setTimeout(() => {
|
|
|
+ queryTableAction();
|
|
|
+ }, 5000)
|
|
|
+ }
|
|
|
closeComponent(value)
|
|
|
}
|
|
|
|