li.shaoyi hai 1 mes
pai
achega
ac66e54924

+ 1 - 13
src/packages/digital/views/contract/components/position/detail/close/index.vue

@@ -60,7 +60,6 @@
 import { shallowRef, PropType, onMounted, computed } from 'vue'
 import AppModal from '@/components/base/modal/index.vue'
 import { CellGroup, Cell, Button, FieldRule, Form, Field, FormInstance } from 'vant'
-import { round } from 'lodash'
 import { getBuyOrSellName, BuyOrSell, getPricemode2List } from '@/constants/order'
 import { handleRequestBigNumber } from '@/filters'
 import { useOrder } from '@/business/trade'
@@ -159,18 +158,7 @@ const closed = (isRefresh = false) => {
 }
 
 onMounted(() => {
-    const { bid, ask, presettle = 0 } = quote.value ?? {}
-    const { buyorsell } = props.selectedItem
-    switch (buyorsell) {
-        case BuyOrSell.Buy:
-            formData.OrderPrice = bid || presettle
-            break
-        case BuyOrSell.Sell:
-            formData.OrderPrice = ask || presettle
-            break
-        default:
-            formData.OrderPrice = presettle
-    }
+    formData.OrderPrice = floatingPL.value.lastPrice
     formData.OrderQty = maxQty.value
     formData.PriceMode = EPriceMode.PRICEMODE_MARKET
 })

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

@@ -141,19 +141,8 @@ const closed = () => {
 }
 
 onMounted(() => {
-    const { bid, ask, presettle = 0 } = quote.value ?? {}
-    const { buyorsell, enableqty } = props.selectedRow
-    switch (buyorsell) {
-        case BuyOrSell.Buy:
-            formData.OrderPrice = bid || presettle
-            break
-        case BuyOrSell.Sell:
-            formData.OrderPrice = ask || presettle
-            break
-        default:
-            formData.OrderPrice = presettle
-    }
-    formData.OrderQty = enableqty
+    formData.OrderPrice = props.selectedRow.lastPrice
+    formData.OrderQty = props.selectedRow.enableqty
     formData.PriceMode = EPriceMode.PRICEMODE_MARKET
 })