Handy_Cao 1 سال پیش
والد
کامیت
12412ac90e

+ 3 - 2
src/packages/pc/views/footer/pricing/detail2/components/transfer/index.vue

@@ -103,9 +103,10 @@ const maxQty = computed(() => {
 // 损益
 const closepl = computed(() => {
     const { presettle = 0, last = 0 } = quote.value ?? {}
+    const { agreeUnit } = props.selectedRow
     const { holderQty, holderAmount, buyOrSell } = props.selectedRow.tHDetailEx
     const goods = futuresStore.getGoods(props.selectedRow.goodsCode)
-    const { currencyid, agreeunit = 0 } = goods ?? {}
+    const { currencyid } = goods ?? {}
     const { currencyid: tacurrencyid } = accountStore.currentAccount
     const price = last || presettle // 没有最新价取昨结价
     
@@ -117,7 +118,7 @@ const closepl = computed(() => {
     }
     
     // 计算市值 = 现价 * 数量 * 合约单位
-    const marketValue = price ? price * holderQty * agreeunit * exchangerate : 0
+    const marketValue = price ? price * holderQty * agreeUnit * exchangerate : 0
     return price ? (marketValue - holderAmount) * (buyOrSell === BuyOrSell.Buy ? 1 : -1) : 0
 })
 

+ 7 - 2
src/packages/pc/views/footer/pricing/detail2/index.vue

@@ -1,6 +1,10 @@
 <!-- 挂牌点价-持仓明细 按账户风控 -->
 <template>
     <app-table :data="orderComputedList" v-model:columns="tableColumns" :loading="loading" v-model:error="error">
+         <!-- 市场名称 -->
+         <template #marketname="{ row }">
+            {{  getMarketName(row.tHDetailEx.marketID) }}
+        </template>
         <!-- 商品代码/名称 -->
         <template #goodsname="{ row }">
             {{ row.goodsCode }}/{{ row.goodsName }}
@@ -58,14 +62,14 @@
 </template>
 
 <script lang="ts" setup> 
-import { shallowRef, defineAsyncComponent, onUnmounted } from 'vue'
+import { shallowRef, defineAsyncComponent, onUnmounted, computed } from 'vue'
 import { getBuyOrSellName } from '@/constants/order'
 import { formatDecimal, formatDate, parsePercent, handlePriceColor } from '@/filters'
 import { getGoodsUnitName } from '@/constants/unit'
 import { useComponent } from '@/hooks/component'
 import { useLocalPagination } from '@/hooks/pagination'
 import { useTableColumnsStore, i18n } from '@/stores'
-import { useSBYJOrderStore } from '@/stores'
+import { useSBYJOrderStore, useUserStore } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
 import eventBus from '@/services/bus'
 
@@ -79,6 +83,7 @@ const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
 const tableColumns = shallowRef<Model.TableColumn[]>([])
 const { t } = i18n.global
 
+const { getMarketName } = useUserStore()
 const { getSBYJMyOrders, $toRefs } = useSBYJOrderStore()
 const { orderComputedList, loading, error } = $toRefs()
 

+ 8 - 1
src/stores/modules/user.ts

@@ -92,6 +92,12 @@ export const useUserStore = defineStore(() => {
         return marketid ?? 0
     }
 
+    // 获取市场名称
+    const getMarketName = ( marketid: number) => {
+        const { marketname } = state.userData.markets.find(obj => obj.marketid === marketid) ?? {}
+        return marketname ?? ''
+    }
+
     // 是否有某个市场权限
     const hasMarket = (tradeMode: keyof typeof ETradeMode) => {
         return state.userData.markets.some((e) => e.trademode === ETradeMode[tradeMode])
@@ -128,6 +134,7 @@ export const useUserStore = defineStore(() => {
         getSystemParamValue,
         userChangeNtf,
         getMarketId,
-        hasMarket
+        hasMarket,
+        getMarketName
     }
 })

+ 0 - 6
src/types/model/order.d.ts

@@ -1476,12 +1476,6 @@ declare namespace Model {
     }
 
     interface TradeHolderDetailEx {
-        /// 报价货币ID - taaccount
-        taCurrencyID: number
-        /// 商品币种id
-        currencyID: number
-        /// 合约单位
-        agreeUnit: number;
         /// 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
         tradeID: string;
         /// 方向 - 0:买 1:卖