|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<!-- 资金汇总 -->
|
|
<!-- 资金汇总 -->
|
|
|
<section>
|
|
<section>
|
|
|
- <a-table :columns="columns"
|
|
|
|
|
|
|
+ <a-table :columns="tableColumns"
|
|
|
class="srcollYTable expandLeftTable"
|
|
class="srcollYTable expandLeftTable"
|
|
|
:scroll="{ x: '100%', y: '190px' }"
|
|
:scroll="{ x: '100%', y: '190px' }"
|
|
|
:pagination="false"
|
|
:pagination="false"
|
|
@@ -21,11 +21,26 @@
|
|
|
@click="openComponent" />
|
|
@click="openComponent" />
|
|
|
</template>
|
|
</template>
|
|
|
<template #balance="{record}">
|
|
<template #balance="{record}">
|
|
|
- <span>{{getCanUseMoney(record)}}</span>
|
|
|
|
|
|
|
+ <span>{{canUseMoney(record)}}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template #freezemargin="{record}">
|
|
<template #freezemargin="{record}">
|
|
|
<span>{{getFreeze(record, true)}}</span>
|
|
<span>{{getFreeze(record, true)}}</span>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <!-- 浮动盈亏 -->
|
|
|
|
|
+ <template #closepl="{record}">
|
|
|
|
|
+ <span>{{handleProfitloss(record)}}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <!-- 风险率 -->
|
|
|
|
|
+ <template #accountname="{record}">
|
|
|
|
|
+ <span>{{hazardRates(record)}}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <!-- 净值 -->
|
|
|
|
|
+ <template #currentbalance="{record}">
|
|
|
|
|
+ <span>{{netWorth(record)}}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #tradestatus="{text}">
|
|
|
|
|
+ <span>{{getTaacountStatus(text)}}</span>
|
|
|
|
|
+ </template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
<component :is="componentId"
|
|
<component :is="componentId"
|
|
|
v-if="componentId"
|
|
v-if="componentId"
|
|
@@ -36,19 +51,21 @@
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
|
|
import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
|
|
|
-import { queryTableList, BtnList, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
|
|
|
|
|
-import { QueryPerformancePlan, queryWrTradeDetail } from '@/services/go/wrtrade';
|
|
|
|
|
-import { QueryPerformancePlanReq, WrPerformancePlan } from '@/services/go/wrtrade/interface';
|
|
|
|
|
|
|
+import { getTaacountStatus } from '@/common/constants/enumsName';
|
|
|
|
|
+import { BtnList, defineComponent, queryTableList } from '@/common/export/commonTable';
|
|
|
import { getRecordItemTab } from '@/common/setup/order/orderData';
|
|
import { getRecordItemTab } from '@/common/setup/order/orderData';
|
|
|
|
|
+import { expandIcon } from '@/common/setup/table/clolumn';
|
|
|
import { handleComposeOrderTable } from '@/common/setup/table/compose';
|
|
import { handleComposeOrderTable } from '@/common/setup/table/compose';
|
|
|
import { ComposeOrderTableParam } from '@/common/setup/table/interface';
|
|
import { ComposeOrderTableParam } from '@/common/setup/table/interface';
|
|
|
-import { getTaAccounts, queryAmountLog } from '@/services/go/TaAccount';
|
|
|
|
|
-import { GetTaAccountsReq, QueryAmountLogReq } from '@/services/go/TaAccount/interface';
|
|
|
|
|
-import { getSelectedAccountId, getCanUseMoney, getFreeze } from '@/services/bus/account';
|
|
|
|
|
|
|
+import { getCanUseMoney, getFreeze } from '@/services/bus/account';
|
|
|
import { geLoginID_number } from '@/services/bus/login';
|
|
import { geLoginID_number } from '@/services/bus/login';
|
|
|
-import * as Long from 'long';
|
|
|
|
|
|
|
+import { queryTradePosition } from '@/services/go/ermcp/order';
|
|
|
|
|
+import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
|
|
|
|
|
+import { getTaAccounts } from '@/services/go/TaAccount';
|
|
|
|
|
+import { GetTaAccountsReq, Taaccount } from '@/services/go/TaAccount/interface';
|
|
|
import Bus from '@/utils/eventBus/index';
|
|
import Bus from '@/utils/eventBus/index';
|
|
|
-import { expandIcon } from '@/common/setup/table/clolumn';
|
|
|
|
|
|
|
+import { ref } from 'vue';
|
|
|
|
|
+import { tableColumns, useHazardRates } from './setup';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: enumOrderComponents.funding_information_funding_summary,
|
|
name: enumOrderComponents.funding_information_funding_summary,
|
|
@@ -57,14 +74,21 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
|
// 表格列表数据
|
|
// 表格列表数据
|
|
|
- const { loading, tableList, queryTable } = queryTableList<WrPerformancePlan>();
|
|
|
|
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<Taaccount>();
|
|
|
|
|
+ // 持仓汇总
|
|
|
|
|
+ const holdsList = ref<QueryTradePositionRsp[]>([]);
|
|
|
// 获取列表数据
|
|
// 获取列表数据
|
|
|
const queryTableAction = () => {
|
|
const queryTableAction = () => {
|
|
|
const param: GetTaAccountsReq = {
|
|
const param: GetTaAccountsReq = {
|
|
|
loginID: Number(geLoginID_number()),
|
|
loginID: Number(geLoginID_number()),
|
|
|
};
|
|
};
|
|
|
queryTable(getTaAccounts, param);
|
|
queryTable(getTaAccounts, param);
|
|
|
|
|
+ // 获取头寸
|
|
|
|
|
+ queryTradePosition().then((res) => {
|
|
|
|
|
+ holdsList.value = res;
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
+ const { handleProfitloss, hazardRates, netWorth, canUseMoney } = useHazardRates(holdsList);
|
|
|
// 资金变化,重新加载数据
|
|
// 资金变化,重新加载数据
|
|
|
Bus.$on('moneyChangedNtf_UI', () => {
|
|
Bus.$on('moneyChangedNtf_UI', () => {
|
|
|
queryTableAction();
|
|
queryTableAction();
|
|
@@ -76,12 +100,18 @@ export default defineComponent({
|
|
|
recordList: getRecordItemTab(),
|
|
recordList: getRecordItemTab(),
|
|
|
};
|
|
};
|
|
|
return {
|
|
return {
|
|
|
- ...handleComposeOrderTable<WrPerformancePlan>(param),
|
|
|
|
|
|
|
+ ...handleComposeOrderTable<Taaccount>(param),
|
|
|
loading,
|
|
loading,
|
|
|
tableList,
|
|
tableList,
|
|
|
getCanUseMoney,
|
|
getCanUseMoney,
|
|
|
getFreeze,
|
|
getFreeze,
|
|
|
expandIcon,
|
|
expandIcon,
|
|
|
|
|
+ handleProfitloss,
|
|
|
|
|
+ hazardRates,
|
|
|
|
|
+ tableColumns,
|
|
|
|
|
+ getTaacountStatus,
|
|
|
|
|
+ netWorth,
|
|
|
|
|
+ canUseMoney,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|