|
|
@@ -1,46 +1,18 @@
|
|
|
<template>
|
|
|
<!-- 资金汇总 -->
|
|
|
<section>
|
|
|
- <a-table :columns="tableColumns" class="srcollYTable expandLeftTable" :scroll="{ x: '100%', y: '190px' }" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :expandIcon="expandIcon" :expandIconAsCell="false" rowKey="key" :data-source="tableList">
|
|
|
- <!-- 额外的展开行 -->
|
|
|
- <template v-if="btnList.length" #expandedRowRender="{ record }">
|
|
|
- <BtnList :btnList="btnList" :record="record" class="btn-list-sticky" @click="openComponent" />
|
|
|
- </template>
|
|
|
- <template #balance="{record}">
|
|
|
- <span>{{canUseMoney(record)}}</span>
|
|
|
- </template>
|
|
|
- <template #freezemargin="{record}">
|
|
|
- <span>{{getFreeze(record, true)}}</span>
|
|
|
- </template>
|
|
|
- <!-- 浮动盈亏 -->
|
|
|
- <template #closepl="{record}">
|
|
|
- <span>{{handleProfitloss(record)}}</span>
|
|
|
- </template>
|
|
|
- <!-- 风险率 -->
|
|
|
- <template #accountname="{record}">
|
|
|
- <span>{{hazardRates(record)}}</span>
|
|
|
- </template>
|
|
|
- <!-- 净值 -->
|
|
|
- <template #netWorth="{record}">
|
|
|
- <span>{{netWorth(record)}}</span>
|
|
|
- </template>
|
|
|
- <template #tradestatus="{text}">
|
|
|
- <span>{{getTaacountStatus(text)}}</span>
|
|
|
- </template>
|
|
|
- </a-table>
|
|
|
+ <a-table :columns="getColumns()" class="srcollYTable expandLeftTable" :scroll="{ x: '100%', y: '190px' }" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :expandIcon="expandIcon" :expandIconAsCell="false" rowKey="key" :data-source="tableList"></a-table>
|
|
|
<component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
|
|
|
-import { getTaacountStatus } from '@/common/constants/enumsName';
|
|
|
import { BtnList, defineComponent, queryTableList } from '@/common/export/commonTable';
|
|
|
import { getRecordItemTab } from '@/common/setup/order/orderData';
|
|
|
import { expandIcon } from '@/common/setup/table/clolumn';
|
|
|
import { handleComposeOrderTable } from '@/common/setup/table/compose';
|
|
|
import { ComposeOrderTableParam } from '@/common/setup/table/interface';
|
|
|
-import { getCanUseMoney, getFreeze } from '@/services/bus/account';
|
|
|
import { geLoginID_number } from '@/services/bus/login';
|
|
|
import { queryTradePosition } from '@/services/go/ermcp/order';
|
|
|
import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
|
|
|
@@ -48,55 +20,50 @@ import { getTaAccounts } from '@/services/go/TaAccount';
|
|
|
import { GetTaAccountsReq, Taaccount } from '@/services/go/TaAccount/interface';
|
|
|
import Bus from '@/utils/eventBus/index';
|
|
|
import { ref } from 'vue';
|
|
|
-import { tableColumns, useHazardRates } from './setup';
|
|
|
+import { getColumns } from './setup';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- name: enumOrderComponents.funding_information_funding_summary,
|
|
|
- components: {
|
|
|
- BtnList,
|
|
|
- },
|
|
|
- setup() {
|
|
|
- // 表格列表数据
|
|
|
- const { loading, tableList, queryTable } = queryTableList<Taaccount>();
|
|
|
- // 持仓汇总
|
|
|
- const holdsList = ref<QueryTradePositionRsp[]>([]);
|
|
|
- // 获取列表数据
|
|
|
- const queryTableAction = () => {
|
|
|
- const param: GetTaAccountsReq = {
|
|
|
- loginID: Number(geLoginID_number()),
|
|
|
- };
|
|
|
- queryTable(getTaAccounts, param);
|
|
|
- // 获取头寸
|
|
|
- queryTradePosition().then((res) => {
|
|
|
- holdsList.value = res;
|
|
|
- });
|
|
|
- };
|
|
|
- const { handleProfitloss, hazardRates, netWorth, canUseMoney } = useHazardRates(holdsList);
|
|
|
- // 资金变化,重新加载数据
|
|
|
- Bus.$on('moneyChangedNtf_UI', () => {
|
|
|
- queryTableAction();
|
|
|
- });
|
|
|
- // 表格通用逻辑
|
|
|
- const param: ComposeOrderTableParam = {
|
|
|
- queryFn: queryTableAction,
|
|
|
- tableName: 'table_pcweb_spot_trade_bottom_funding_info_summary',
|
|
|
- recordList: getRecordItemTab(),
|
|
|
- };
|
|
|
- return {
|
|
|
- ...handleComposeOrderTable<Taaccount>(param),
|
|
|
- loading,
|
|
|
- tableList,
|
|
|
- getCanUseMoney,
|
|
|
- getFreeze,
|
|
|
- expandIcon,
|
|
|
- handleProfitloss,
|
|
|
- hazardRates,
|
|
|
- tableColumns,
|
|
|
- getTaacountStatus,
|
|
|
- netWorth,
|
|
|
- canUseMoney,
|
|
|
- };
|
|
|
- },
|
|
|
+ name: enumOrderComponents.funding_information_funding_summary,
|
|
|
+ components: {
|
|
|
+ BtnList,
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ // 表格列表数据
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<Taaccount>(true, 2);
|
|
|
+ // 持仓汇总
|
|
|
+ const holdsList = ref<QueryTradePositionRsp[]>([]);
|
|
|
+ // 获取列表数据
|
|
|
+ const queryTableAction = () => {
|
|
|
+ const param: GetTaAccountsReq = {
|
|
|
+ loginID: Number(geLoginID_number()),
|
|
|
+ };
|
|
|
+ queryTable(getTaAccounts, param);
|
|
|
+ // 获取头寸
|
|
|
+ queryTradePosition().then((res) => {
|
|
|
+ holdsList.value = res;
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 资金变化,重新加载数据
|
|
|
+ Bus.$on('moneyChangedNtf_UI', () => {
|
|
|
+ queryTableAction();
|
|
|
+ });
|
|
|
+
|
|
|
+ // 表格通用逻辑
|
|
|
+ const param: ComposeOrderTableParam = {
|
|
|
+ queryFn: queryTableAction,
|
|
|
+ tableName: 'table_pcweb_spot_trade_bottom_funding_info_summary',
|
|
|
+ recordList: getRecordItemTab(),
|
|
|
+ };
|
|
|
+
|
|
|
+ return {
|
|
|
+ ...handleComposeOrderTable<Taaccount>(param),
|
|
|
+ loading,
|
|
|
+ tableList,
|
|
|
+ expandIcon,
|
|
|
+ getColumns,
|
|
|
+ };
|
|
|
+ },
|
|
|
});
|
|
|
</script>
|
|
|
|