Pārlūkot izejas kodu

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP20_WEB_GLOBAL

zhou.xiaoning 2 gadi atpakaļ
vecāks
revīzija
bff1466d9c

+ 34 - 0
src/constants/order.ts

@@ -51,6 +51,17 @@ export enum PaymentType {
     Blance = 2,
 }
 
+/// 交易状态 - 1:正常 2:受限 3:冻结 4:禁止建仓(人工受限) 5:禁止交易(人工冻结) 6:待激活 7:已注销
+export enum TradeStatus {
+    Normal = 1,
+    Limit = 2,
+    Freeze = 3,
+    NoOpen = 4,
+    NoTrade = 5,
+    UnActivate = 6,
+    LoginOut = 7
+}
+
 /**
  * 获取买卖方向列表
  * @returns 
@@ -62,6 +73,21 @@ export function getBuyOrSellList() {
     ]
 }
 
+/**
+ * 获取交易状态列表
+ * @returns 
+ */
+export function getTradeStatusList() {
+    return [
+        { label: '正常', value: TradeStatus.Normal },
+        { label: '受限', value: TradeStatus.Limit },
+        { label: '冻结', value: TradeStatus.Freeze },
+        { label: '禁止建仓(人工受限)', value: TradeStatus.NoOpen },
+        { label: '禁止交易(人工冻结)', value: TradeStatus.NoTrade },
+        { label: '待激活', value: TradeStatus.UnActivate },
+        { label: '已注销', value: TradeStatus.LoginOut },
+    ]
+}
 
 /**
  * 获取仓单贸易类型列表
@@ -98,6 +124,14 @@ export function getPaymentTypeList() {
 
 
 /**
+ * 获取交易状态名称
+ * @returns 
+ */
+export function getTradeStatusName(value: number) {
+    return getEnumTypeName(getTradeStatusList(), value)
+}
+
+/**
  * 获取买卖方向名称
  * @returns 
  */

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

@@ -2,6 +2,34 @@
 <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 #curamount>
+            {{ accountInfo.curamount?.toFixed(2) }}
+        </template>
+        <!-- 占用资金 -->
+        <template #oriusedmargin>
+            {{ accountInfo.oriusedmargin?.toFixed(2) }}
+        </template>
+         <!-- 可用资金 -->
+         <template #avaiableMoney>
+            {{ avaiableMoney.toFixed(2) }}
+        </template>
+        <!-- 冻结资金 -->
+        <template #freezeMargin>
+            {{ freezeMargin.toFixed(2) }}
+        </template>
+        <!-- 状态 -->
+        <template #tradestatus="{ value }">
+            {{ getTradeStatusName(value) }}
+        </template>
         <!-- 展开行 -->
         <template #expand="{ row }">
             <app-auth-operation v-bind="{ code, options: { selectedRow: row } }" />
@@ -15,6 +43,7 @@ import { useAccountStore } from '@/stores'
 import { useComposeTable } from '@pc/components/base/table'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
+import { getTradeStatusName } from '@/constants/order'
 
 defineProps({
     code: String
@@ -23,15 +52,16 @@ defineProps({
 const accountStore = useAccountStore()
 const { accountList } = accountStore.$toRefs()
 const { rowKey, expandKeys, rowClick } = useComposeTable<Model.TaAccountsRsp>({ rowKey: 'accountid' })
+const { accountInfo, freezeMargin, avaiableMoney } = accountStore.$toRefs()
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'accountid', label: '资金账号' },
-    { prop: 'unknown', label: '净值' },
-    { prop: 'unknown', label: '持仓市值' },
-    { prop: 'unknown', label: '余额' },
-    { prop: 'unknown', label: '可用资金' },
-    { prop: 'unknown', label: '冻结资金' },
-    { prop: 'unknown', label: '占用资金' },
+    { prop: 'balance', label: '净值' },
+    { prop: 'curamount', label: '持仓市值' },
+    { prop: 'currentbalance', label: '余额' },
+    { prop: 'avaiableMoney', label: '可用资金' },
+    { prop: 'freezeMargin', label: '冻结资金' },
+    { prop: 'oriusedmargin', label: '占用资金' },
     { prop: 'tradestatus', label: '状态' },
 ])
 </script>