huangbin 4 gadi atpakaļ
vecāks
revīzija
08e3985801

+ 9 - 1
src/common/components/capitalInfo/index.vue

@@ -45,6 +45,8 @@
 import { defineComponent, ref, reactive } from 'vue';
 import { getAllTaAccount, getCanUseMoney, getFreeze, getSelectedAccount, setSelectedAccount } from '@/services/bus/account';
 import { AccountListItem } from '@/services/dataCenter/interafce/account';
+import Bus from '@/utils/eventBus/index';
+import { getTaAccount } from '@/services/go/TaAccount';
 
 export default defineComponent({
     name: 'capital-info',
@@ -52,6 +54,7 @@ export default defineComponent({
         const selectedAccount = getSelectedAccount();
         const selectedAccountId = ref<number>(selectedAccount.accountid);
         const data = reactive(getMoney(selectedAccount));
+
         function getMoney(value: AccountListItem) {
             const { currentbalance } = value;
             return { currentbalance, freeze: getFreeze(value, true), canUse: getCanUseMoney(value) };
@@ -61,7 +64,12 @@ export default defineComponent({
             Object.assign(data, getMoney(item));
             setSelectedAccount(item);
         }
-
+        // 资金变化,重新加载数据
+        Bus.$on('moneyChangedNtf_UI', () => {
+            getTaAccount().then(() => {
+                accountChange(selectedAccountId.value);
+            });
+        });
         return {
             getAllTaAccount,
             selectedAccountId,

+ 2 - 1
src/utils/eventBus/index.ts

@@ -2,6 +2,7 @@
 interface EnentNames {
     loadComplete: string; //加载状态名
     spotTrade: string;  // 挂牌成功,通知报价大厅更新数据
+    moneyChangedNtf_UI: string; // /接收到资金变化通知 UI 成 使用
 }
 
 /** 一个事件只能存储一个回调 */
@@ -16,7 +17,7 @@ interface EnentNamesOnlyOneValue {
     userLogout: string; //接收到用户登出应答
     posChangedNtf: string; //接收到头寸变化通知
     moneyChangedNtf: string; //接收到资金变化通知
-    moneyChangedNtf_UI: string; // /接收到资金变化通知 UI 成 使用
+
     orderCanceledNtf: string; //接收到委托单撤单通知
     quoteReceiveNtf: string; // 接收实时行情推送
 }

+ 6 - 0
src/views/order/funding_information/components/funding_information_funding_log/index.vue

@@ -41,6 +41,8 @@ import { QueryAmountLogReq } from '@/services/go/TaAccount/interface';
 import { getSelectedAccountId } from '@/services/bus/account';
 import { getOperateTypeEnumItemName, getOperateTypeName } from '@/common/constants/enumsName';
 import { formatTime } from '@/common/methods';
+import Bus from '@/utils/eventBus/index';
+
 export default defineComponent({
     name: enumOrderComponents.funding_information_funding_log,
     components: {
@@ -63,6 +65,10 @@ export default defineComponent({
             tableName: 'table_pcweb_spot_trade_bottom_funding_info_log',
             recordList: getRecordItemTab(),
         };
+        // 资金变化,重新加载数据
+        Bus.$on('moneyChangedNtf_UI', () => {
+            queryTableAction();
+        });
         return {
             ...handleComposeOrderTable<WrPerformancePlan>(param),
             loading,

+ 6 - 0
src/views/order/funding_information/components/funding_information_funding_summary/index.vue

@@ -44,6 +44,8 @@ import { GetTaAccountsReq, QueryAmountLogReq } from '@/services/go/TaAccount/int
 import { getSelectedAccountId, getCanUseMoney, getFreeze } from '@/services/bus/account';
 import { getLongTypeLoginID } from '@/services/bus/login';
 import * as Long from 'long';
+import Bus from '@/utils/eventBus/index';
+
 export default defineComponent({
     name: enumOrderComponents.funding_information_funding_summary,
     components: {
@@ -59,6 +61,10 @@ export default defineComponent({
             };
             queryTable(getTaAccounts, param);
         };
+        // 资金变化,重新加载数据
+        Bus.$on('moneyChangedNtf_UI', () => {
+            queryTableAction();
+        });
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {
             queryFn: queryTableAction,