li.shaoyi 2 anni fa
parent
commit
6bb9d32e32
35 ha cambiato i file con 126 aggiunte e 138 eliminazioni
  1. 3 3
      src/business/bank/index.ts
  2. 4 4
      src/business/performance/index.ts
  3. 9 9
      src/business/trade/index.ts
  4. 1 1
      src/business/user/account.ts
  5. 1 1
      src/packages/gstj/views/goods/detail/components/listing/Index.vue
  6. 2 2
      src/packages/gstj/views/goods/trade/components/delisting/index.vue
  7. 5 5
      src/packages/gstj/views/mine/Index.vue
  8. 1 1
      src/packages/gstj/views/spot/add/components/sell/index.vue
  9. 1 1
      src/packages/gstj/views/spot/detail/components/delisting/index.vue
  10. 1 1
      src/packages/gstj/views/spot/detail/components/listing/index.vue
  11. 1 1
      src/packages/mobile/views/ballot/detail/components/delisting/index.vue
  12. 1 1
      src/packages/mobile/views/goods/detail/components/listing/Index.vue
  13. 2 2
      src/packages/mobile/views/goods/trade/components/delisting/index.vue
  14. 5 5
      src/packages/mobile/views/mine/Index.vue
  15. 1 1
      src/packages/mobile/views/order/position/components/transfer/delivery/trade/Index.vue
  16. 1 1
      src/packages/mobile/views/presale/detail/components/delisting/index.vue
  17. 1 1
      src/packages/mobile/views/spot/add/components/sell/index.vue
  18. 1 1
      src/packages/mobile/views/spot/detail/components/delisting/index.vue
  19. 1 1
      src/packages/mobile/views/spot/detail/components/listing/index.vue
  20. 2 2
      src/packages/mobile/views/swap/detail/components/delisting/Index.vue
  21. 2 2
      src/packages/mobile/views/swap/detail/components/listing/Index.vue
  22. 8 8
      src/packages/pc/components/layouts/footer/index.vue
  23. 9 31
      src/packages/pc/views/footer/capital/summary/index.vue
  24. 6 6
      src/packages/pc/views/footer/capital/summary/withdraw/index.vue
  25. 1 1
      src/packages/pc/views/market/trade/spot/listing/index.vue
  26. 1 1
      src/packages/pc/views/market/trade/spot/order/delisting/index.vue
  27. 1 1
      src/packages/pc/views/market/trade/spot/order/listing/index.vue
  28. 5 5
      src/packages/sbyj/views/mine/index.vue
  29. 2 2
      src/services/api/bank/index.ts
  30. 7 7
      src/services/api/order/index.ts
  31. 1 1
      src/services/api/performance/index.ts
  32. 7 7
      src/services/api/trade/index.ts
  33. 1 1
      src/services/api/transfer/index.ts
  34. 1 1
      src/services/http/index.ts
  35. 30 20
      src/stores/modules/account.ts

+ 3 - 3
src/business/bank/index.ts

@@ -160,10 +160,10 @@ export function useDoBankSign() {
         AccountType: 1,
         IsForce: 0,
         AgentCertType: 0,
-        BankCardType: 0, 
+        BankCardType: 0,
         BankAccountType: 1,
         extend_info: JSON.stringify({ "sex": 1 }),
-        AccountCode: accountStore.accountId.toString(),
+        AccountCode: accountStore.currentAccountId.toString(),
         CertID: decryptAES(userInfo?.cardnum ?? ''),
         CertType: userInfo?.cardtypeid.toString(),
         BankAccountName: userInfo?.customername,
@@ -255,7 +255,7 @@ export function useAccountFundInfo() {
         data: {
             QueryBitMask: 2,
             OrderId: new Date().getTime(),
-            AccountId: accountStore.accountId,
+            AccountId: accountStore.currentAccountId,
         }
     }).then((res) => {
         fund.value = res

+ 4 - 4
src/business/performance/index.ts

@@ -15,7 +15,7 @@ export function usePerformanceContractedApply(buyaccountid: number) {
     const loading = shallowRef(false)
 
     const formData = ref<Partial<Proto.PerformanceContractedApplyReq>>({
-        BreachType: buyaccountid === accountStore.accountId ? 2 : 1
+        BreachType: buyaccountid === accountStore.currentAccountId ? 2 : 1
     })
 
     const formSubmit = async () => {
@@ -44,7 +44,7 @@ export function usePerformanceManualConfirm(buyaccountid: number) {
 
     const confirmFormData = ref<Partial<Proto.PerformanceManualConfirmReq>>({
         /// 执行方
-        PerformanceExecuteSide: buyaccountid === accountStore.accountId ? 1 : 2
+        PerformanceExecuteSide: buyaccountid === accountStore.currentAccountId ? 1 : 2
     })
 
     const confirmSubmit = async () => {
@@ -71,8 +71,8 @@ export function usePerformanceManualConfirm(buyaccountid: number) {
 export function usePerformanceModifyContact() {
     const loading = shallowRef(false)
 
-    const formData = ref<Partial<Proto.PerformanceModifyContactReq>>({ 
-        AccountID: accountStore.accountId
+    const formData = ref<Partial<Proto.PerformanceModifyContactReq>>({
+        AccountID: accountStore.currentAccountId
     })
 
     const formSubmit = async () => {

+ 9 - 9
src/business/trade/index.ts

@@ -35,7 +35,7 @@ export function usePurchaseOrderDesting() {
 
     const formData = ref<Partial<Proto.SpotPresaleDestingOrderReq>>({
         UserID: loginStore.userId, // 用户ID,必填
-        AccountID: accountStore.accountId, // 资金账号,必填
+        AccountID: accountStore.currentAccountId, // 资金账号,必填
         ClientType: ClientType.Web, // 终端类型
         UpdatorID: loginStore.loginId, // 操作人,必填
     })
@@ -213,7 +213,7 @@ export function useSpotPresaleTransferDesting() {
 
     const formData = reactive<Proto.SpotPresaleTransferDestingReq>({
         UserID: loginStore.userId,
-        AccountID: accountStore.accountId,
+        AccountID: accountStore.currentAccountId,
         TransferID: Long.fromNumber(0),
         ClientType: ClientType.Web // 终端类型
     })
@@ -246,7 +246,7 @@ export function useWrListingCancelOrder() {
     /// 接口请求
     const formData = reactive<Proto.WRListingCancelOrderReq>({
         UserID: loginStore.userId,
-        AccountID: accountStore.accountId,
+        AccountID: accountStore.currentAccountId,
         OperatorID: loginStore.loginId,
         OrderSrc: OrderSrc.ORDERSRC_CLIENT,
         ClientOrderTime: formatDate(new Date().toISOString()),
@@ -282,7 +282,7 @@ export function useWrOutInApply(holdlb: Model.HoldLBRsp) {
     const formData = reactive<Partial<Proto.WROutApplyReq>>({
         AppointmentRemark: '',
         UserID: loginStore.userId,             // 用户ID,必填
-        AccountID: accountStore.accountId,  // 申请人账户ID
+        AccountID: accountStore.currentAccountId,  // 申请人账户ID
         CreatorID: loginStore.loginId,         // 创建人ID
         WRStandardID: holdlb.wrstandardid,
         WarehouseID: holdlb.warehouseid,
@@ -331,7 +331,7 @@ export function useHdWROrder() {
         FixedPrice: 1,
         OrderQty: 1,
         UserID: loginStore.userId,
-        AccountID: accountStore.accountId,
+        AccountID: accountStore.currentAccountId,
         OperatorID: loginStore.loginId,
         ClientType: ClientType.Web,
         BuyOrSell: BuyOrSell.Sell,
@@ -379,7 +379,7 @@ export function useHdWRDealOrder() {
 
     const formData = reactive<Proto.HdWRDealOrderReq>({
         UserID: loginStore.userId, // 用户ID
-        AccountID: accountStore.accountId, // 资金账号
+        AccountID: accountStore.currentAccountId, // 资金账号
         RelatedWRTradeOrderID: '0', // 关联委托单号(摘牌委托关联挂牌委托单ID)
         WRTransferUserID: loginStore.userId, // 仓单受让用户
         OrderQty: 0, // 委托数量
@@ -491,7 +491,7 @@ export function useCancelOrder() {
     const formData = reactive<Partial<Proto.CancelOrderReq>>({
         OperatorID: loginStore.loginId,
         OrderSrc: OrderSrc.ORDERSRC_CLIENT,
-        AccountID: accountStore.accountId,
+        AccountID: accountStore.currentAccountId,
         ClientType: ClientType.Web,
         OperateType: EOperateType.OPERATETYPE_ORDERCANCEL,
     })
@@ -527,7 +527,7 @@ export function useHolderClose() {
         ClientOrderTime: formatDate(new Date().toISOString()),
         ClientType: ClientType.Web,
         LoginID: loginStore.loginId,
-        AccountID: accountStore.accountId,
+        AccountID: accountStore.currentAccountId,
         OrderSrc: OrderSrc.ORDERSRC_CLIENT,
         OperatorID: loginStore.loginId,
     })
@@ -559,7 +559,7 @@ export function useOrder() {
     const formData = reactive<Partial<Proto.OrderReq>>({
         ClientType: ClientType.Web,
         LoginID: loginStore.loginId,
-        AccountID: accountStore.accountId,
+        AccountID: accountStore.currentAccountId,
         BuyOrSell: BuyOrSell.Buy,
         OperateType: EOrderOperateType.ORDEROPERATETYPE_NORMAL,
         OrderSrc: OrderSrc.ORDERSRC_CLIENT,

+ 1 - 1
src/business/user/account.ts

@@ -46,7 +46,7 @@ export function useAccountPassword(ModifyPwdType: 0 | 1 | 2) {
 
     const formData = reactive<Proto.ModifyPwdReq>({
         ModifyPwdType, // 修改密码类型1:登陆密码2:资金账户密码
-        ModifyPwdID: ModifyPwdType === 1 ? loginStore.userId : accountStore.accountId, // 被修改的ID(ModifyType=1:LoginIDModifyType=2:AccountID)
+        ModifyPwdID: ModifyPwdType === 1 ? loginStore.userId : accountStore.currentAccountId, // 被修改的ID(ModifyType=1:LoginIDModifyType=2:AccountID)
         OldPwd: '', // 旧资金密码
         NewPwd: '' // 新资金密码
     })

+ 1 - 1
src/packages/gstj/views/goods/detail/components/listing/Index.vue

@@ -30,7 +30,7 @@
                     </Field>
                     <Field label="可用资金">
                         <template #input>
-                            <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                            <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                         </template>
                     </Field>
                 </CellGroup>

+ 2 - 2
src/packages/gstj/views/goods/trade/components/delisting/index.vue

@@ -8,7 +8,7 @@
                 <CellGroup inset>
                     <Field label="交易账户">
                         <template #input>
-                            <span>{{ accountStore.accountId }}</span>
+                            <span>{{ accountStore.currentAccountId }}</span>
                         </template>
                     </Field>
                     <Field label="挂牌方">
@@ -45,7 +45,7 @@
                     </Field>
                     <Field label="可用资金">
                         <template #input>
-                            <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                            <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                         </template>
                     </Field>
                 </CellGroup>

+ 5 - 5
src/packages/gstj/views/mine/Index.vue

@@ -21,21 +21,21 @@
                     </div>
                     <div class="profile-account">
                         <span>正常</span>
-                        <span>{{ accountInfo.accountid ?? 0 }}</span>
+                        <span>{{ currentAccount.accountid ?? 0 }}</span>
                     </div>
                 </div>
                 <div class="bank">
                     <div class="bank-item">
                         <span>余额</span>
-                        <span>{{ accountInfo.currentbalance?.toFixed(2) ?? '0.00' }}</span>
+                        <span>{{ currentAccount.currentbalance?.toFixed(2) ?? '0.00' }}</span>
                     </div>
                     <div class="bank-item">
                         <span>冻结</span>
-                        <span>{{ freezeMargin.toFixed(2) }}</span>
+                        <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
                     </div>
                     <div class="bank-item">
                         <span>可用</span>
-                        <span>{{ avaiableMoney.toFixed(2) }}</span>
+                        <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
                     </div>
                     <div class="bank-item">
                         <span>
@@ -133,7 +133,7 @@ const { router, routerTo } = useNavigation()
 const loginStore = useLoginStore()
 const userStore = useUserStore()
 const accountStore = useAccountStore()
-const { accountInfo, freezeMargin, avaiableMoney } = accountStore.$toRefs()
+const { currentAccount } = accountStore.$toRefs()
 
 const headerRef = shallowRef<HTMLDivElement>()
 const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态

+ 1 - 1
src/packages/gstj/views/spot/add/components/sell/index.vue

@@ -42,7 +42,7 @@
                 </Field>
                 <Field label="可用资金">
                     <template #input>
-                        <span>{{ accountStore.avaiableMoney.toFixed(2) }}元</span>
+                        <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}元</span>
                     </template>
                 </Field>
             </CellGroup>

+ 1 - 1
src/packages/gstj/views/spot/detail/components/delisting/index.vue

@@ -41,7 +41,7 @@
             </Field>
             <Field label="可用资金" v-if="buyorsell === BuyOrSell.Buy">
                 <template #input>
-                    <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                    <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                 </template>
             </Field>
         </Form>

+ 1 - 1
src/packages/gstj/views/spot/detail/components/listing/index.vue

@@ -32,7 +32,7 @@
             </Field>
             <Field label="可用资金" v-if="buyorsell === BuyOrSell.Buy">
                 <template #input>
-                    <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                    <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                 </template>
             </Field>
         </Form>

+ 1 - 1
src/packages/mobile/views/ballot/detail/components/delisting/index.vue

@@ -19,7 +19,7 @@
             </Field>
             <Field label="可用资金">
                 <template #input>
-                    <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                    <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                 </template>
             </Field>
         </Form>

+ 1 - 1
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -30,7 +30,7 @@
                     </Field>
                     <Field label="可用资金">
                         <template #input>
-                            <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                            <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                         </template>
                     </Field>
                 </CellGroup>

+ 2 - 2
src/packages/mobile/views/goods/trade/components/delisting/index.vue

@@ -8,7 +8,7 @@
                 <CellGroup inset>
                     <Field label="交易账户">
                         <template #input>
-                            <span>{{ accountStore.accountId }}</span>
+                            <span>{{ accountStore.currentAccountId }}</span>
                         </template>
                     </Field>
                     <Field label="挂牌方">
@@ -45,7 +45,7 @@
                     </Field>
                     <Field label="可用资金">
                         <template #input>
-                            <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                            <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                         </template>
                     </Field>
                 </CellGroup>

+ 5 - 5
src/packages/mobile/views/mine/Index.vue

@@ -21,21 +21,21 @@
                     </div>
                     <div class="profile-account">
                         <span>正常</span>
-                        <span>{{ accountInfo.accountid ?? 0 }}</span>
+                        <span>{{ currentAccount.accountid ?? 0 }}</span>
                     </div>
                 </div>
                 <div class="bank">
                     <div class="bank-item">
                         <span>余额</span>
-                        <span>{{ accountInfo.currentbalance?.toFixed(2) ?? '0.00' }}</span>
+                        <span>{{ currentAccount.currentbalance?.toFixed(2) ?? '0.00' }}</span>
                     </div>
                     <div class="bank-item">
                         <span>冻结</span>
-                        <span>{{ freezeMargin.toFixed(2) }}</span>
+                        <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
                     </div>
                     <div class="bank-item">
                         <span>可用</span>
-                        <span>{{ avaiableMoney.toFixed(2) }}</span>
+                        <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
                     </div>
                     <div class="bank-item">
                         <span>
@@ -133,7 +133,7 @@ const { router, routerTo } = useNavigation()
 const loginStore = useLoginStore()
 const userStore = useUserStore()
 const accountStore = useAccountStore()
-const { accountInfo, freezeMargin, avaiableMoney } = accountStore.$toRefs()
+const { currentAccount } = accountStore.$toRefs()
 
 const headerRef = shallowRef<HTMLDivElement>()
 const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态

+ 1 - 1
src/packages/mobile/views/order/position/components/transfer/delivery/trade/Index.vue

@@ -59,7 +59,7 @@ const showModal = shallowRef(true)
 
 const formData = reactive<Partial<Proto.DeliveryOrderReq>>({
     ClientType: ClientType.Web,
-    AccountID: accountStore.accountId,
+    AccountID: accountStore.currentAccountId,
     XGoodsID: props.detail.goodsid,
     DeliveryGoodsID: props.detail.deliverygoodsid,
 })

+ 1 - 1
src/packages/mobile/views/presale/detail/components/delisting/index.vue

@@ -25,7 +25,7 @@
             </Field>
             <Field label="可用资金">
                 <template #input>
-                    <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                    <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                 </template>
             </Field>
         </Form>

+ 1 - 1
src/packages/mobile/views/spot/add/components/sell/index.vue

@@ -42,7 +42,7 @@
                 </Field>
                 <Field label="可用资金">
                     <template #input>
-                        <span>{{ accountStore.avaiableMoney.toFixed(2) }}元</span>
+                        <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}元</span>
                     </template>
                 </Field>
             </CellGroup>

+ 1 - 1
src/packages/mobile/views/spot/detail/components/delisting/index.vue

@@ -41,7 +41,7 @@
             </Field>
             <Field label="可用资金" v-if="buyorsell === BuyOrSell.Buy">
                 <template #input>
-                    <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                    <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                 </template>
             </Field>
         </Form>

+ 1 - 1
src/packages/mobile/views/spot/detail/components/listing/index.vue

@@ -32,7 +32,7 @@
             </Field>
             <Field label="可用资金" v-if="buyorsell === BuyOrSell.Buy">
                 <template #input>
-                    <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                    <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                 </template>
             </Field>
         </Form>

+ 2 - 2
src/packages/mobile/views/swap/detail/components/delisting/Index.vue

@@ -3,7 +3,7 @@
         <Form class="swap-delisting__form" ref="formRef" @submit="onSubmit" v-if="props">
             <Field label="交易账户">
                 <template #input>
-                    <span>{{ accountStore.accountId }}</span>
+                    <span>{{ accountStore.currentAccountId }}</span>
                 </template>
             </Field>
             <Field label="挂牌方">
@@ -57,7 +57,7 @@
             </Field>
             <Field label="可用资金">
                 <template #input>
-                    <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                    <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                 </template>
             </Field>
         </Form>

+ 2 - 2
src/packages/mobile/views/swap/detail/components/listing/Index.vue

@@ -7,7 +7,7 @@
             </Tabs>
             <Field label="交易账户">
                 <template #input>
-                    <span>{{ accountStore.accountId }}</span>
+                    <span>{{ accountStore.currentAccountId }}</span>
                 </template>
             </Field>
             <Field label="价格类型">
@@ -62,7 +62,7 @@
             </Field>
             <Field label="可用资金">
                 <template #input>
-                    <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                    <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
                 </template>
             </Field>
         </Form>

+ 8 - 8
src/packages/pc/components/layouts/footer/index.vue

@@ -1,7 +1,7 @@
 <template>
-    <div class="app-footer" v-if="accountList.length">
+    <div class="app-footer" v-if="accountComputedList.length">
         <div class="app-footer__left" v-if="false">
-            <div>{{ accountInfo.accountid }}</div>
+            <div>{{ currentAccount.accountid }}</div>
             <table>
                 <colgroup>
                     <col width="64px" />
@@ -14,7 +14,7 @@
                     </tr>
                     <tr>
                         <td>余额</td>
-                        <td>{{ accountInfo.currentbalance }}</td>
+                        <td>{{ currentAccount.currentbalance }}</td>
                     </tr>
                     <tr>
                         <td>可用</td>
@@ -22,11 +22,11 @@
                     </tr>
                     <tr>
                         <td>占用</td>
-                        <td>{{ accountInfo.usedmargin }}</td>
+                        <td>{{ currentAccount.usedmargin }}</td>
                     </tr>
                     <!-- <tr>
                         <td>浮盈</td>
-                        <td :class="handlePriceColor(accountInfo.totalProfitLoss, 0)">{{ accountInfo.totalProfitLoss }}
+                        <td :class="handlePriceColor(currentAccount.totalProfitLoss, 0)">{{ currentAccount.totalProfitLoss }}
                         </td>
                     </tr> -->
                 </tbody>
@@ -34,9 +34,9 @@
         </div>
         <div class="app-footer__center">
             <app-auth-component code="bottom">
-                <el-select placeholder="请选择资金账户" :disabled="loading" v-model="accountId" @change="onAccountChange"
+                <el-select placeholder="请选择资金账户" :disabled="loading" v-model="currentAccountId" @change="onAccountChange"
                     v-if="false">
-                    <el-option :label="item.accountid" :value="item.accountid" v-for="(item, index) in accountList"
+                    <el-option :label="item.accountid" :value="item.accountid" v-for="(item, index) in accountComputedList"
                         :key="index" />
                 </el-select>
             </app-auth-component>
@@ -52,7 +52,7 @@ import { useAccountStore } from '@/stores'
 import AppAuthComponent from '@pc/components/modules/auth-component/index.vue'
 import AppListing from '@pc/components/modules/listing/index.vue'
 
-const { accountList, accountInfo, accountId, loading, getAccountPositionList } = useAccountStore()
+const { accountComputedList, currentAccount, currentAccountId, loading, getAccountPositionList } = useAccountStore()
 
 // 切换资金账户
 const onAccountChange = () => {

+ 9 - 31
src/packages/pc/views/footer/capital/summary/index.vue

@@ -1,27 +1,7 @@
 <!-- 资金信息-资金汇总 -->
 <template>
-    <app-table :data="accountList" v-model:columns="tableColumns" :row-key="rowKey" :expand-row-keys="expandKeys"
-        @row-click="rowClick">
-        <!-- 余额 -->
-        <template #currentbalance>
-            {{ accountInfo.currentbalance?.toFixed(2) }}
-        </template>
-        <!-- 净值 -->
-        <template #balance>
-            {{ accountInfo.balance?.toFixed(2) }}
-        </template>
-        <!-- 占用资金 -->
-        <template #oriusedmargin>
-            {{ accountInfo.oriusedmargin?.toFixed(2) }}
-        </template>
-        <!-- 可用资金 -->
-        <template #avaiableMoney>
-            {{ avaiableMoney.toFixed(2) }}
-        </template>
-        <!-- 冻结资金 -->
-        <template #freezeMargin>
-            {{ freezeMargin.toFixed(2) }}
-        </template>
+    <app-table :data="accountStore.accountComputedList" v-model:columns="tableColumns" :row-key="rowKey"
+        :expand-row-keys="expandKeys" @row-click="rowClick">
         <!-- 状态 -->
         <template #tradestatus="{ value }">
             {{ getTradeStatusName(value) }}
@@ -53,19 +33,17 @@ const componentMap = new Map<string, unknown>([
     ['withdraw', defineAsyncComponent(() => import('./withdraw/index.vue'))], // 提现
 ])
 
-const { componentRef, componentId, openComponent, closeComponent } = useComponent()
-
 const accountStore = useAccountStore()
-const { accountList, accountInfo, freezeMargin, avaiableMoney } = accountStore.$toRefs()
 const { selectedRow, rowKey, expandKeys, rowClick } = useComposeTable<Model.TaAccountsRsp>({ rowKey: 'accountid' })
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
-    { prop: 'accountid', label: '资金账号' },
-    { prop: 'balance', label: '期初余额' },
-    { prop: 'currentbalance', label: '期末余额' },
-    { prop: 'avaiableMoney', label: '可用资金' },
-    { prop: 'oriusedmargin', label: '占用资金' },
-    { prop: 'freezeMargin', label: '冻结资金' },
+    { prop: 'accountid', label: '资金账号', decimal: 2 },
+    { prop: 'balance', label: '期初余额', decimal: 2 },
+    { prop: 'currentbalance', label: '期末余额', decimal: 2 },
+    { prop: 'avaiableMoney', label: '可用资金', decimal: 2 },
+    { prop: 'oriusedmargin', label: '占用资金', decimal: 2 },
+    { prop: 'freezeMargin', label: '冻结资金', decimal: 2 },
     { prop: 'inamount', label: '今日入金', decimal: 2 },
     { prop: 'outamount', label: '今日出金', decimal: 2 },
     { prop: 'tradestatus', label: '状态' },

+ 6 - 6
src/packages/pc/views/footer/capital/summary/withdraw/index.vue

@@ -3,10 +3,10 @@
     <app-drawer title="提现申请" :width="800" v-model:show="show" :loading="loading" :refresh="refresh">
         <el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
             <el-form-item label="资金账号">
-                <span>{{ accountStore.accountId }}</span>
+                <span>{{ accountStore.currentAccountId }}</span>
             </el-form-item>
             <el-form-item label="账户余额">
-                <span>{{ accountStore.accountInfo.currentbalance?.toFixed(2) }}</span>
+                <span>{{ accountStore.currentAccount.currentbalance?.toFixed(2) }}</span>
             </el-form-item>
             <el-form-item label="出金金额" prop="Amount">
                 <el-input type="number" placeholder="请输入" v-model="formData.Amount" />
@@ -39,11 +39,11 @@ const show = ref(true)
 const refresh = ref(false)
 
 const formRules: FormRules = {
-    Amount: [{ 
-        required: true, 
-        message: '请输入金额', 
+    Amount: [{
+        required: true,
+        message: '请输入金额',
         validator: (rule, value, callback) => {
-            if (value<=(accountStore.accountInfo.currentbalance ?? 0.0)) {
+            if (value <= (accountStore.currentAccount.currentbalance ?? 0.0)) {
                 callback()
             } else {
                 callback(new Error('超出可出金额'))

+ 1 - 1
src/packages/pc/views/market/trade/spot/listing/index.vue

@@ -33,7 +33,7 @@
                 <span>{{ amount }}</span>
             </el-form-item>
             <el-form-item label="可用资金">
-                <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
             </el-form-item>
         </el-form>
         <template #footer>

+ 1 - 1
src/packages/pc/views/market/trade/spot/order/delisting/index.vue

@@ -24,7 +24,7 @@
                 <span>{{ amount }}</span>
             </el-form-item>
             <el-form-item label="可用资金">
-                <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
             </el-form-item>
         </el-form>
         <template #footer>

+ 1 - 1
src/packages/pc/views/market/trade/spot/order/listing/index.vue

@@ -18,7 +18,7 @@
                 <span>{{ amount }}</span>
             </el-form-item>
             <el-form-item label="可用资金">
-                <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+                <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
             </el-form-item>
         </el-form>
         <template #footer>

+ 5 - 5
src/packages/sbyj/views/mine/index.vue

@@ -21,21 +21,21 @@
                     </div>
                     <div class="profile-account">
                         <span>正常</span>
-                        <span>{{ accountInfo.accountid ?? 0 }}</span>
+                        <span>{{ currentAccount.accountid ?? 0 }}</span>
                     </div>
                 </div>
                 <div class="bank">
                     <div class="bank-item">
                         <span>余额</span>
-                        <span>{{ accountInfo.currentbalance?.toFixed(2) ?? '0.00' }}</span>
+                        <span>{{ currentAccount.currentbalance?.toFixed(2) ?? '0.00' }}</span>
                     </div>
                     <div class="bank-item">
                         <span>冻结</span>
-                        <span>{{ freezeMargin.toFixed(2) }}</span>
+                        <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
                     </div>
                     <div class="bank-item">
                         <span>可用</span>
-                        <span>{{ avaiableMoney.toFixed(2) }}</span>
+                        <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
                     </div>
                     <div class="bank-item">
                         <span>
@@ -127,7 +127,7 @@ const { router, routerTo } = useNavigation()
 const loginStore = useLoginStore()
 const userStore = useUserStore()
 const accountStore = useAccountStore()
-const { accountInfo, freezeMargin, avaiableMoney } = accountStore.$toRefs()
+const { currentAccount } = accountStore.$toRefs()
 
 const headerRef = shallowRef<HTMLDivElement>()
 const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态

+ 2 - 2
src/services/api/bank/index.ts

@@ -110,7 +110,7 @@ export function queryHisAmountLog(config: RequestConfig<Model.HisAmountLogReq> =
     return http.commonRequest<Model.HisAmountLogRsp[]>({
         url: '/TaAccount/QueryHisAmountLog',
         params: {
-            accountID: accountStore.accountId.toString(),
+            accountID: accountStore.currentAccountId.toString(),
             pageflag: 1,
             ...config.data
         },
@@ -124,7 +124,7 @@ export function queryAmountLog(config: RequestConfig<Model.AmountLogReq> = {}) {
     return http.commonRequest<Model.AmountLogRsp[]>({
         url: '/TaAccount/QueryAmountLog',
         params: {
-            accountID: accountStore.accountId.toString(),
+            accountID: accountStore.currentAccountId.toString(),
             pageflag: 1,
             ...config.data
         },

+ 7 - 7
src/services/api/order/index.ts

@@ -51,7 +51,7 @@ export function queryHoldLB(config: RequestConfig<Model.HoldLBReq> = {}) {
     return http.commonRequest<Model.HoldLBRsp[]>({
         url: '/WrTrade2/QueryHoldLB',
         params: {
-            accountid: accountStore.accountId,
+            accountid: accountStore.currentAccountId,
             ...config.data
         },
     })
@@ -126,7 +126,7 @@ export function queryHisTradeDetail(config: RequestConfig<Model.HisTradeDetailRe
     return http.commonRequest<Model.HisTradeDetailRsp[]>({
         url: '/Order/QueryHisTradeDetail',
         params: {
-            accountID: accountStore.accountId,
+            accountID: accountStore.currentAccountId,
             ...config.data
         },
     })
@@ -139,7 +139,7 @@ export function queryHisTradeOrderDetail(config: RequestConfig<Model.HisTradeOrd
     return http.commonRequest<Model.HisTradeOrderDetailRsp[]>({
         url: '/Order/QueryHisTradeOrderDetail',
         params: {
-            accountID: accountStore.accountId,
+            accountID: accountStore.currentAccountId,
             ...config.data
         },
     })
@@ -152,7 +152,7 @@ export function queryTradeDetail(config: RequestConfig<Model.TradeDetailReq> = {
     return http.commonRequest<Model.TradeDetailRsp[]>({
         url: '/Order/QueryTradeDetail',
         params: {
-            accountID: accountStore.accountId,
+            accountID: accountStore.currentAccountId,
             ...config.data
         },
     })
@@ -166,7 +166,7 @@ export function queryTradeHolderDetail(config: RequestConfig<Model.TradeHolderDe
         url: '/Order/QueryTradeHolderDetail',
         params: {
             userid: loginStore.userId,
-            accids: accountStore.accountId.toString(),
+            accids: accountStore.currentAccountId.toString(),
             ...config.data
         },
     })
@@ -179,7 +179,7 @@ export function queryTradeOrderDetail(config: RequestConfig<Model.TradeOrderDeta
     return http.commonRequest<Model.TradeOrderDetailRsp[]>({
         url: '/Order/QueryTradeOrderDetail',
         params: {
-            accountID: accountStore.accountId,
+            accountID: accountStore.currentAccountId,
             ...config.data
         },
     })
@@ -192,7 +192,7 @@ export function queryTradePosition(config: RequestConfig<Model.TradePositionReq>
     return http.commonRequest<Model.TradePositionRsp[]>({
         url: '/Order/QueryTradePosition',
         params: {
-            accountID: accountStore.accountId,
+            accountID: accountStore.currentAccountId,
             ...config.data
         },
     })

+ 1 - 1
src/services/api/performance/index.ts

@@ -97,7 +97,7 @@ export function performanceManualConfirm(config: RequestConfig<Partial<Proto.Per
 export function performanceModifyContact(config: RequestConfig<Partial<Proto.PerformanceModifyContactReq>>) {
     return http.mqRequest<Proto.PerformanceModifyContactRsp>({
         data: {
-            AccountID: accountStore.accountId,
+            AccountID: accountStore.currentAccountId,
             ...config.data
         },
         requestCode: 'PerformanceModifyContactReq',

+ 7 - 7
src/services/api/trade/index.ts

@@ -225,7 +225,7 @@ export function makeUpDeposit(config: RequestConfig<Partial<Proto.MakeUpDepositR
     return http.mqRequest<Proto.MakeUpDepositRsp>({
         data: {
             UserID: loginStore.userId,
-            AccountID: accountStore.accountId,
+            AccountID: accountStore.currentAccountId,
             ClientSerialNo: v4(),
             ClientType: ClientType.Web,
             ...config.data
@@ -241,7 +241,7 @@ export function makeUpDeposit(config: RequestConfig<Partial<Proto.MakeUpDepositR
 export function holdAppendDeposit(config: RequestConfig<Partial<Proto.HoldAppendDepositReq>>) {
     return http.mqRequest<Proto.HoldAppendDepositRsp>({
         data: {
-            AccountID: accountStore.accountId,
+            AccountID: accountStore.currentAccountId,
             ClientSerialNo: v4(),
             ClientType: ClientType.Web,
             ...config.data
@@ -258,7 +258,7 @@ export function holdAppendDeposit(config: RequestConfig<Partial<Proto.HoldAppend
 export function offlineDelivery(config: RequestConfig<Partial<Proto.OfflineDeliveryReq>>) {
     return http.mqRequest<Proto.OfflineDeliveryRsp>({
         data: {
-            AccountID: accountStore.accountId,
+            AccountID: accountStore.currentAccountId,
             ClientTicket: v4(),
             UserID: loginStore.userId,
             ...config.data
@@ -275,7 +275,7 @@ export function offlineDelivery(config: RequestConfig<Partial<Proto.OfflineDeliv
 export function supplementDeposit(config: RequestConfig<Partial<Proto.SupplementDepositReq>>) {
     return http.mqRequest<Proto.SupplementDepositRsp>({
         data: {
-            AccountID: accountStore.accountId,
+            AccountID: accountStore.currentAccountId,
             ClientSerialNo: v4(),
             UserID: loginStore.userId,
             ...config.data
@@ -292,7 +292,7 @@ export function supplementDeposit(config: RequestConfig<Partial<Proto.Supplement
 export function refundedDeposit(config: RequestConfig<Partial<Proto.RefundedDepositReq>>) {
     return http.mqRequest<Proto.RefundedDepositRsp>({
         data: {
-            AccountID: accountStore.accountId,
+            AccountID: accountStore.currentAccountId,
             ClientSerialNo: v4(),
             UserID: loginStore.userId,
             ...config.data
@@ -309,7 +309,7 @@ export function refundedDeposit(config: RequestConfig<Partial<Proto.RefundedDepo
 export function marketOrderDeliveryApply(config: RequestConfig<Partial<Proto.MarketOrderDeliveryApplyReq>>) {
     return http.mqRequest<Proto.MarketOrderDeliveryApplyRsp>({
         data: {
-            AccountID: accountStore.accountId,
+            AccountID: accountStore.currentAccountId,
             ClientSerialNo: v4(),
             UserID: loginStore.userId,
             ...config.data
@@ -326,7 +326,7 @@ export function marketOrderDeliveryApply(config: RequestConfig<Partial<Proto.Mar
 export function deliveryClientOperator(config: RequestConfig<Partial<Proto.DeliveryClientOperatorReq>>) {
     return http.mqRequest<Proto.DeliveryClientOperatorRsp>({
         data: {
-            AccountID: accountStore.accountId,
+            AccountID: accountStore.currentAccountId,
             ClientSerialNo: v4(),
             UserID: loginStore.userId,
             ClientType: ClientType.Web,

+ 1 - 1
src/services/api/transfer/index.ts

@@ -61,7 +61,7 @@ export function queryWrDeliveryAvalidHoldLB(config: RequestConfig<Model.WrDelive
     return http.commonRequest<Model.WrDeliveryAvalidHoldLBRsp[]>({
         url: '/WrTrade2/QueryWrDeliveryAvalidHoldLB',
         params: {
-            accountid: accountStore.accountId,
+            accountid: accountStore.currentAccountId,
             ...config.data
         },
     })

+ 1 - 1
src/services/http/index.ts

@@ -186,7 +186,7 @@ export default new (class {
 
         if (data) {
             data.Header = {
-                AccountID: accountStore.accountId,
+                AccountID: accountStore.currentAccountId,
                 FunCode: requestId,
                 UUID: v4(),
                 UserID: loginStore.userId,

+ 30 - 20
src/stores/modules/account.ts

@@ -14,26 +14,37 @@ export const useAccountStore = defineStore(() => {
     const state = reactive({
         loading: false,
         accountList: <Model.TaAccountsRsp[]>[],
-        accountId: 0,
+        currentAccountId: 0,
     })
 
-    // 当前资金账户信息
-    const accountInfo = computed(() => {
-        return {
-            ...state.accountList.find((e) => e.accountid === state.accountId)
-        }
-    })
+    // 资金账户计算列表
+    const accountComputedList = computed(() => {
+        const result: (Model.TaAccountsRsp & {
+            freezeMargin: number; // 冻结资金
+            avaiableMoney: number; // 可用资金
+        })[] = []
+
+        state.accountList.forEach((item) => {
+            // 计算冻结资金
+            const freezeMargin = item.freezecharge + item.freezemargin + item.otherfreezemargin + item.outamountfreeze
+            // 计算可用资金
+            const avaiableMoney = item.currentbalance - freezeMargin
 
-    // 冻结资金
-    const freezeMargin = computed(() => {
-        const { freezecharge = 0, freezemargin = 0, otherfreezemargin = 0, outamountfreeze = 0 } = accountInfo.value
-        return freezecharge + freezemargin + otherfreezemargin + outamountfreeze
+            result.push({
+                ...item,
+                freezeMargin,
+                avaiableMoney
+            })
+        })
+
+        return result
     })
 
-    // 可用资金
-    const avaiableMoney = computed(() => {
-        const { currentbalance = 0 } = accountInfo.value
-        return currentbalance - freezeMargin.value
+    // 当前资金账户信息
+    const currentAccount = computed(() => {
+        return {
+            ...accountComputedList.value.find((e) => e.accountid === state.currentAccountId)
+        }
     })
 
     // 获取资金账户列表
@@ -49,8 +60,8 @@ export const useAccountStore = defineStore(() => {
             state.accountList = data
 
             // 查找当前选中的资金账户
-            if (!data.every((e) => e.accountid === state.accountId)) {
-                state.accountId = data[0]?.accountid ?? 0
+            if (!data.every((e) => e.accountid === state.currentAccountId)) {
+                state.currentAccountId = data[0]?.accountid ?? 0
             }
         } finally {
             state.loading = false
@@ -67,9 +78,8 @@ export const useAccountStore = defineStore(() => {
 
     return {
         ...toRefs(state),
-        accountInfo,
-        freezeMargin,
-        avaiableMoney,
+        accountComputedList,
+        currentAccount,
         moneyChangedNotify,
         getAccountList,
         getAccountPositionList,