|
|
@@ -10,8 +10,8 @@
|
|
|
<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"
|
|
|
+ <template #operate="{ record }">
|
|
|
+ <BtnList :btnList="handleBtnList(record, btnList)" :record="record" class="btn-list-sticky"
|
|
|
@click="openComponent" />
|
|
|
</template>
|
|
|
<!-- 持仓盈亏 -->
|
|
|
@@ -59,7 +59,7 @@
|
|
|
</template>
|
|
|
</mtp-table-scroll>
|
|
|
<component :is="componentId" v-if="componentId" :selectedRow="selectedRow" :tableList="positionList"
|
|
|
- :swapList="swapList" @cancel="clsoeAction"></component>
|
|
|
+ :swapList="swapList" @cancel="closeComponent"></component>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
@@ -80,11 +80,11 @@ import { handleNoneValue, handleQuotePriceColor } from '@/common/setup/table/tab
|
|
|
import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
|
|
|
import { useHolderprice } from '@/services/bus/holdPosition';
|
|
|
import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
|
|
|
+import { QueryTradeHolderDetailRsp } from "@/services/go/order/interface";
|
|
|
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,
|
|
|
@@ -96,7 +96,6 @@ 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>();
|
|
|
@@ -106,7 +105,6 @@ export default defineComponent({
|
|
|
|
|
|
// 获取列表数据
|
|
|
const queryTableAction = () => {
|
|
|
- window.clearTimeout(timer);
|
|
|
getHoldsList(loading, TradeMode.DiaoQi.toString());
|
|
|
}
|
|
|
|
|
|
@@ -130,7 +128,7 @@ export default defineComponent({
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- function handleBtnList(record: QueryTradePositionRsp, btnList: BtnListType[]) {
|
|
|
+ function handleBtnList(record: QueryTradeHolderDetailRsp, btnList: BtnListType[]) {
|
|
|
// 贸易圈
|
|
|
// 只有机构 才有平仓
|
|
|
const diaoqi = isInvestment() ? ['swap_commodity_contract_summary_deal_closed', 'swap_commodity_contract_summary_order_closed', 'detail'] : ['swap_commodity_contract_summary_deal_closed', 'detail'];
|
|
|
@@ -142,18 +140,7 @@ export default defineComponent({
|
|
|
expandedRowKeys, selectedRow, Rowclick, // 表格折腾面板数据与单击、双击事件
|
|
|
componentId, closeComponent, openComponent, // 控制异步组件
|
|
|
btnList, // 表格按钮
|
|
|
- } = handleComposeOrderTable<QueryTradePositionRsp>(param)
|
|
|
-
|
|
|
- function clsoeAction(value: boolean, showLoading: boolean) {
|
|
|
- if (showLoading) {
|
|
|
- loading.value = true;
|
|
|
- // 5秒内没收到推送手动刷新数据
|
|
|
- timer = window.setTimeout(() => {
|
|
|
- queryTableAction();
|
|
|
- }, 5000)
|
|
|
- }
|
|
|
- closeComponent(value)
|
|
|
- }
|
|
|
+ } = handleComposeOrderTable<QueryTradeHolderDetailRsp>(param)
|
|
|
|
|
|
const stopNotify = Bus.$on(['posChangedNtf', 'spotTrade'], () => {
|
|
|
queryTableAction()
|
|
|
@@ -185,7 +172,7 @@ export default defineComponent({
|
|
|
getDetailColums,
|
|
|
getTradeHolderDetail,
|
|
|
findGoodsCode,
|
|
|
- getDetailProfitloss, getDetailMarketAmount, handleQuotePriceColor, clsoeAction
|
|
|
+ getDetailProfitloss, getDetailMarketAmount, handleQuotePriceColor
|
|
|
};
|
|
|
},
|
|
|
});
|