Handy_Cao 1 ヶ月 前
コミット
463cc965bf

+ 18 - 0
src/constants/order.ts

@@ -297,6 +297,24 @@ export function getWRTradeOrderStatusName(value: number) {
 }
 
 /**
+ * 获取委托状态列表
+ * @returns 
+ */
+export function getOrderhandleStatusList() {
+    return getEnumTypeList('orderhandlestatus')
+}
+
+/**
+ * 获取委托状态名称
+ * @returns 
+ */
+export function getOrderhandleStatusName(value: number) {
+    const enums = getOrderhandleStatusList()
+    return getEnumTypeName(enums, value)
+}
+
+
+/**
  * 获取提货方式列表
  * @returns 
  */

+ 1 - 1
src/packages/digital/views/contract/components/order/list/index.vue

@@ -38,7 +38,7 @@
             <tfoot>
                 <tr>
                     <td colspan="2">
-                        <Button size="small" @click="cancelOrder(item)">撤销</Button>
+                        <Button v-if="[3, 7, 12].includes(item.orderstatus)" size="small" @click="cancelOrder(item)">撤销</Button>
                     </td>
                 </tr>
             </tfoot>

+ 2 - 2
src/packages/digital/views/contract/components/position/list/index.vue

@@ -44,8 +44,8 @@
                         <span>{{ item.averageprice }}</span>
                     </td>
                     <td>
-                        <span class="text-small">持仓金额({{ getGoodsCurrencyItemName(item.currencyid) }})</span>
-                        <span>{{ item.curholderamount }}</span>
+                        <span class="text-small">持仓金额( {{ getGoodsCurrencyItemName(item.currencyid) }} )</span>
+                        <span>{{ formatAmount(item.tHDetailEx.holderAmount) }}</span>
                     </td>
                     <td></td>
                 </tr>

+ 13 - 6
src/packages/digital/views/contract/components/trade/history/index.vue

@@ -25,26 +25,26 @@
                     </td>
                     <td>
                         <span class="text-small">委托状态</span>
-                        <span>{{ item.status }}</span>
+                        <span>{{ getOrderhandleStatusName(item.status) }}</span>
                     </td>
                 </tr>
                 <tr>
                     <td>
-                        <span class="text-small">成交价格(USDT)</span>
+                        <span class="text-small">成交价格( {{ enumName(item.goodsid) }} )</span>
                         <span>{{ formatDecimal(item.tradeprice) }}</span>
                     </td>
                     <td>
-                        <span class="text-small">手续费(USDT)</span>
+                        <span class="text-small">手续费({{ enumName(item.goodsid) }})</span>
                         <span>{{ formatDecimal(item.charge) }}</span>
                     </td>
                 </tr>
                 <tr>
                     <td>
-                        <span class="text-small">成交数量(Gold)</span>
+                        <span class="text-small">成交数量({{ enumName(item.goodsid) }})</span>
                         <span>{{ item.tradeqty }}</span>
                     </td>
                     <td>
-                        <span class="text-small">平仓盈亏(USDT)</span>
+                        <span class="text-small">平仓盈亏({{ enumName(item.goodsid) }})</span>
                         <span>{{ formatDecimal(item.closepl) }}</span>
                     </td>
                 </tr>
@@ -56,9 +56,10 @@
 <script lang="ts" setup>
 import { PropType, shallowRef } from 'vue'
 import { formatDate, formatDecimal } from '@/filters'
-import { getBuyOrSellName } from '@/constants/order'
+import { getBuyOrSellName, getGoodsCurrencyItemName } from '@/constants/order'
 import { useRequest } from '@/hooks/request'
 import { queryHisTradeDetail } from '@/services/api/order'
+import { useFuturesStore } from '@/stores'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
 const props = defineProps({
@@ -68,6 +69,7 @@ const props = defineProps({
     }
 })
 
+const futuresStore = useFuturesStore()
 const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.HisTradeDetailRsp[]>([])
 
@@ -86,6 +88,11 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryHisTradeDetail, {
     }
 })
 
+const enumName = (goodsid: number) => {
+    const item = futuresStore.getQuoteItem({ goodsid })
+    return item ? getGoodsCurrencyItemName(item.currencyid) : 0
+}
+
 const onRefresh = () => {
     run(props.params)
 }

+ 13 - 6
src/packages/digital/views/contract/components/trade/list/index.vue

@@ -25,26 +25,26 @@
                     </td>
                     <td>
                         <span class="text-small">委托状态</span>
-                        <span>{{ item.status }}</span>
+                        <span>{{ getOrderhandleStatusName(item.status) }}</span>
                     </td>
                 </tr>
                 <tr>
                     <td>
-                        <span class="text-small">成交价格(USDT)</span>
+                        <span class="text-small">成交价格({{ enumName(item.goodsid) }})</span>
                         <span>{{ formatDecimal(item.tradeprice) }}</span>
                     </td>
                     <td>
-                        <span class="text-small">手续费(USDT)</span>
+                        <span class="text-small">手续费({{ enumName(item.goodsid) }})</span>
                         <span>{{ formatDecimal(item.charge) }}</span>
                     </td>
                 </tr>
                 <tr>
                     <td>
-                        <span class="text-small">成交数量(Gold)</span>
+                        <span class="text-small">成交数量({{ enumName(item.goodsid) }})</span>
                         <span>{{ item.tradeqty }}</span>
                     </td>
                     <td>
-                        <span class="text-small">平仓盈亏(USDT)</span>
+                        <span class="text-small">平仓盈亏({{ enumName(item.goodsid) }})</span>
                         <span>{{ formatDecimal(item.closepl) }}</span>
                     </td>
                 </tr>
@@ -56,9 +56,10 @@
 <script lang="ts" setup>
 import { PropType, shallowRef } from 'vue'
 import { formatDate, formatDecimal } from '@/filters'
-import { getBuyOrSellName } from '@/constants/order'
+import { getBuyOrSellName, getOrderhandleStatusName } from '@/constants/order'
 import { useRequest } from '@/hooks/request'
 import { queryTradeDetail } from '@/services/api/order'
+import { useFuturesStore } from '@/stores'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
 const props = defineProps({
@@ -68,6 +69,7 @@ const props = defineProps({
     }
 })
 
+const futuresStore = useFuturesStore()
 const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.TradeDetailRsp[]>([])
 
@@ -85,6 +87,11 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryTradeDetail, {
     }
 })
 
+const enumName = (goodsid: number) => {
+    const item = futuresStore.getQuoteItem({ goodsid })
+    return item ? getGoodsCurrencyItemName(item.currencyid) : 0
+}
+
 const onRefresh = () => {
     run(props.params)
 }