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