|
@@ -1,52 +1,59 @@
|
|
|
<template>
|
|
<template>
|
|
|
<!-- 资金汇总 -->
|
|
<!-- 资金汇总 -->
|
|
|
<section>
|
|
<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">
|
|
|
|
|
|
|
+ <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="openComponentAction" />
|
|
|
|
|
|
|
+ <template v-if="btnList.length" #expandedRowRender="{ record }">
|
|
|
|
|
+ <BtnList
|
|
|
|
|
+ :btnList="btnList"
|
|
|
|
|
+ :record="record"
|
|
|
|
|
+ class="btn-list-sticky"
|
|
|
|
|
+ @click="openComponentAction"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
- <template #balance="{record}">
|
|
|
|
|
- <span>{{canUseMoney(record)}}</span>
|
|
|
|
|
|
|
+ <template #balance="{ record }">
|
|
|
|
|
+ <span>{{ canUseMoney(record) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <template #freezemargin="{record}">
|
|
|
|
|
- <span>{{getFreeze(record, true)}}</span>
|
|
|
|
|
|
|
+ <template #freezemargin="{ record }">
|
|
|
|
|
+ <span>{{ getFreeze(record, true) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 浮动盈亏 -->
|
|
<!-- 浮动盈亏 -->
|
|
|
- <template #closepl="{record}">
|
|
|
|
|
- <span>{{handleProfitloss(record)}}</span>
|
|
|
|
|
|
|
+ <template #closepl="{ record }">
|
|
|
|
|
+ <span
|
|
|
|
|
+ :class="handleQuotePriceColor(+handleProfitloss(record), 0)"
|
|
|
|
|
+ >{{ handleProfitloss(record) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 风险率 -->
|
|
<!-- 风险率 -->
|
|
|
- <template #accountname="{record}">
|
|
|
|
|
- <span>{{hazardRates(record)}}</span>
|
|
|
|
|
|
|
+ <template #accountname="{ record }">
|
|
|
|
|
+ <span>{{ hazardRates(record) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 净值 -->
|
|
<!-- 净值 -->
|
|
|
- <template #netWorth="{record}">
|
|
|
|
|
- <span>{{netWorth(record)}}</span>
|
|
|
|
|
|
|
+ <template #netWorth="{ record }">
|
|
|
|
|
+ <span>{{ netWorth(record) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <template #tradestatus="{text}">
|
|
|
|
|
- <span>{{getTaacountStatus(text)}}</span>
|
|
|
|
|
|
|
+ <template #tradestatus="{ text }">
|
|
|
|
|
+ <span>{{ getTaacountStatus(text) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
- <component :is="componentId"
|
|
|
|
|
- v-if="componentId"
|
|
|
|
|
- :selectedRow="selectedRow"
|
|
|
|
|
- :canUseMoney="canUseMoney(selectedRow)"
|
|
|
|
|
- @cancel="closeComponent"></component>
|
|
|
|
|
|
|
+ <component
|
|
|
|
|
+ :is="componentId"
|
|
|
|
|
+ v-if="componentId"
|
|
|
|
|
+ :selectedRow="selectedRow"
|
|
|
|
|
+ :canUseMoney="canUseMoney(selectedRow)"
|
|
|
|
|
+ @cancel="closeComponent"
|
|
|
|
|
+ ></component>
|
|
|
</section>
|
|
</section>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -59,101 +66,101 @@ import { getRecordItemTab } from '@/common/setup/order/orderData';
|
|
|
import { expandIcon } from '@/common/setup/table/clolumn';
|
|
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 { handleQuotePriceColor } from '@/common/setup/table/tableQuote';
|
|
|
import { 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 { queryTradePosition } from '@/services/go/ermcp/order';
|
|
|
|
|
-import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
|
|
|
|
|
import { getTaAccounts } from '@/services/go/TaAccount';
|
|
import { getTaAccounts } from '@/services/go/TaAccount';
|
|
|
import { GetTaAccountsReq, Taaccount } from '@/services/go/TaAccount/interface';
|
|
import { GetTaAccountsReq, Taaccount } from '@/services/go/TaAccount/interface';
|
|
|
import Bus from '@/utils/eventBus/index';
|
|
import Bus from '@/utils/eventBus/index';
|
|
|
import { message } from 'ant-design-vue';
|
|
import { message } from 'ant-design-vue';
|
|
|
-import { defineAsyncComponent, ref } from 'vue';
|
|
|
|
|
|
|
+import { defineAsyncComponent } from 'vue';
|
|
|
import { useSignBank } from './components/setup';
|
|
import { useSignBank } from './components/setup';
|
|
|
import { tableColumns, useHazardRates } from './setup';
|
|
import { tableColumns, useHazardRates } from './setup';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
- name: enumOrderComponents.funding_information_funding_summary,
|
|
|
|
|
- components: {
|
|
|
|
|
- BtnList,
|
|
|
|
|
- funding_information_funding_summary_recharge: defineAsyncComponent(() => import('./components/funding_information_funding_summary_recharge/index.vue')),
|
|
|
|
|
- funding_information_funding_summary_withdraw: defineAsyncComponent(() => import('./components/funding_information_funding_summary_withdraw/index.vue')),
|
|
|
|
|
- },
|
|
|
|
|
- setup() {
|
|
|
|
|
- // 表格列表数据
|
|
|
|
|
- const { loading, tableList, queryTable } = queryTableList<Taaccount>();
|
|
|
|
|
- const { handleProfitloss, hazardRates, netWorth, canUseMoney, getHoldsList } = useHazardRates();
|
|
|
|
|
- // 获取列表数据
|
|
|
|
|
- const queryTableAction = () => {
|
|
|
|
|
- const param: GetTaAccountsReq = {
|
|
|
|
|
- loginID: Number(geLoginID_number()),
|
|
|
|
|
- };
|
|
|
|
|
- queryTable(getTaAccounts, param);
|
|
|
|
|
- // 获取头寸
|
|
|
|
|
- getHoldsList(loading)
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ name: enumOrderComponents.funding_information_funding_summary,
|
|
|
|
|
+ components: {
|
|
|
|
|
+ BtnList,
|
|
|
|
|
+ funding_information_funding_summary_recharge: defineAsyncComponent(() => import('./components/funding_information_funding_summary_recharge/index.vue')),
|
|
|
|
|
+ funding_information_funding_summary_withdraw: defineAsyncComponent(() => import('./components/funding_information_funding_summary_withdraw/index.vue')),
|
|
|
|
|
+ },
|
|
|
|
|
+ setup() {
|
|
|
|
|
+ // 表格列表数据
|
|
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<Taaccount>();
|
|
|
|
|
+ const { handleProfitloss, hazardRates, netWorth, canUseMoney, getHoldsList } = useHazardRates();
|
|
|
|
|
+ // 获取列表数据
|
|
|
|
|
+ const queryTableAction = () => {
|
|
|
|
|
+ const param: GetTaAccountsReq = {
|
|
|
|
|
+ loginID: Number(geLoginID_number()),
|
|
|
|
|
+ };
|
|
|
|
|
+ queryTable(getTaAccounts, param);
|
|
|
|
|
+ // 获取头寸
|
|
|
|
|
+ getHoldsList(loading)
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- // 资金变化,重新加载数据
|
|
|
|
|
- Bus.$on('moneyChangedNtf_UI', () => {
|
|
|
|
|
- queryTableAction();
|
|
|
|
|
- });
|
|
|
|
|
- // 表格通用逻辑
|
|
|
|
|
- const param: ComposeOrderTableParam = {
|
|
|
|
|
- queryFn: queryTableAction,
|
|
|
|
|
- tableName: 'table_pcweb_spot_trade_bottom_funding_info_summary',
|
|
|
|
|
- recordList: getRecordItemTab(),
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ // 资金变化,重新加载数据
|
|
|
|
|
+ Bus.$on('moneyChangedNtf_UI', () => {
|
|
|
|
|
+ queryTableAction();
|
|
|
|
|
+ });
|
|
|
|
|
+ // 表格通用逻辑
|
|
|
|
|
+ const param: ComposeOrderTableParam = {
|
|
|
|
|
+ queryFn: queryTableAction,
|
|
|
|
|
+ tableName: 'table_pcweb_spot_trade_bottom_funding_info_summary',
|
|
|
|
|
+ recordList: getRecordItemTab(),
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- const {
|
|
|
|
|
- contextMenu,
|
|
|
|
|
- openContext,
|
|
|
|
|
- closeContext, // 右键
|
|
|
|
|
- columns,
|
|
|
|
|
- registerColumn,
|
|
|
|
|
- updateColumn, // 表头
|
|
|
|
|
- expandedRowKeys,
|
|
|
|
|
- selectedRow,
|
|
|
|
|
- Rowclick, // 表格折腾面板数据与单击、双击事件
|
|
|
|
|
- componentId,
|
|
|
|
|
- closeComponent,
|
|
|
|
|
- openComponent, // 控制异步组件
|
|
|
|
|
- btnList, // 表格按钮
|
|
|
|
|
- } = handleComposeOrderTable<Taaccount>(param);
|
|
|
|
|
- // 签约银行
|
|
|
|
|
- const { hasSignBank } = useSignBank();
|
|
|
|
|
- function openComponentAction(item: BtnListType, record: Taaccount) {
|
|
|
|
|
- if (hasSignBank()) {
|
|
|
|
|
- openComponent(item, record);
|
|
|
|
|
- } else {
|
|
|
|
|
- message.error('请先签约银行!');
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return {
|
|
|
|
|
- loading,
|
|
|
|
|
- tableList,
|
|
|
|
|
- getCanUseMoney,
|
|
|
|
|
- getFreeze,
|
|
|
|
|
- expandIcon,
|
|
|
|
|
- handleProfitloss,
|
|
|
|
|
- hazardRates,
|
|
|
|
|
- tableColumns,
|
|
|
|
|
- getTaacountStatus,
|
|
|
|
|
- netWorth,
|
|
|
|
|
- canUseMoney,
|
|
|
|
|
- contextMenu,
|
|
|
|
|
- openContext,
|
|
|
|
|
- closeContext, // 右键
|
|
|
|
|
- columns,
|
|
|
|
|
- registerColumn,
|
|
|
|
|
- updateColumn, // 表头
|
|
|
|
|
- expandedRowKeys,
|
|
|
|
|
- selectedRow,
|
|
|
|
|
- Rowclick, // 表格折腾面板数据与单击、双击事件
|
|
|
|
|
- componentId,
|
|
|
|
|
- closeComponent,
|
|
|
|
|
- openComponentAction, // 控制异步组件
|
|
|
|
|
- btnList, // 表格按钮
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ const {
|
|
|
|
|
+ contextMenu,
|
|
|
|
|
+ openContext,
|
|
|
|
|
+ closeContext, // 右键
|
|
|
|
|
+ columns,
|
|
|
|
|
+ registerColumn,
|
|
|
|
|
+ updateColumn, // 表头
|
|
|
|
|
+ expandedRowKeys,
|
|
|
|
|
+ selectedRow,
|
|
|
|
|
+ Rowclick, // 表格折腾面板数据与单击、双击事件
|
|
|
|
|
+ componentId,
|
|
|
|
|
+ closeComponent,
|
|
|
|
|
+ openComponent, // 控制异步组件
|
|
|
|
|
+ btnList, // 表格按钮
|
|
|
|
|
+ } = handleComposeOrderTable<Taaccount>(param);
|
|
|
|
|
+ // 签约银行
|
|
|
|
|
+ const { hasSignBank } = useSignBank();
|
|
|
|
|
+ function openComponentAction(item: BtnListType, record: Taaccount) {
|
|
|
|
|
+ if (hasSignBank()) {
|
|
|
|
|
+ openComponent(item, record);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ message.error('请先签约银行!');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ loading,
|
|
|
|
|
+ tableList,
|
|
|
|
|
+ getCanUseMoney,
|
|
|
|
|
+ getFreeze,
|
|
|
|
|
+ expandIcon,
|
|
|
|
|
+ handleProfitloss,
|
|
|
|
|
+ hazardRates,
|
|
|
|
|
+ tableColumns,
|
|
|
|
|
+ getTaacountStatus,
|
|
|
|
|
+ netWorth,
|
|
|
|
|
+ canUseMoney,
|
|
|
|
|
+ contextMenu,
|
|
|
|
|
+ openContext,
|
|
|
|
|
+ closeContext, // 右键
|
|
|
|
|
+ columns,
|
|
|
|
|
+ registerColumn,
|
|
|
|
|
+ updateColumn, // 表头
|
|
|
|
|
+ expandedRowKeys,
|
|
|
|
|
+ selectedRow,
|
|
|
|
|
+ Rowclick, // 表格折腾面板数据与单击、双击事件
|
|
|
|
|
+ componentId,
|
|
|
|
|
+ closeComponent,
|
|
|
|
|
+ openComponentAction, // 控制异步组件
|
|
|
|
|
+ btnList, // 表格按钮
|
|
|
|
|
+ handleQuotePriceColor,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|