|
|
@@ -26,6 +26,7 @@ import { shallowRef, computed, watch, useAttrs } from 'vue'
|
|
|
import { handleNumberValue } from '@/filters'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
import { useFuturesStore } from '@/stores'
|
|
|
+import { ETradeMode } from '@/constants/client'
|
|
|
|
|
|
const props = defineProps({
|
|
|
goodsCode: {
|
|
|
@@ -42,80 +43,110 @@ const active = shallowRef('')
|
|
|
|
|
|
const buyList = computed(() => {
|
|
|
const item = quote.value
|
|
|
- if (item) {
|
|
|
- const result = [
|
|
|
- {
|
|
|
- label: '买一',
|
|
|
- price: item.bid,
|
|
|
- qty: item.bidvolume,
|
|
|
- color: item.bidColor,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '买二',
|
|
|
- price: item.bid2,
|
|
|
- qty: item.bidvolume2,
|
|
|
- color: item.bid2Color,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '买三',
|
|
|
- price: item.bid3,
|
|
|
- qty: item.bidvolume3,
|
|
|
- color: item.bid3Color,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '买四',
|
|
|
- price: item.bid4,
|
|
|
- qty: item.bidvolume4,
|
|
|
- color: item.bid4Color,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '买五',
|
|
|
- price: item.bid5,
|
|
|
- qty: item.bidvolume5,
|
|
|
- color: item.bid5Color,
|
|
|
- }
|
|
|
- ]
|
|
|
- return result.slice(0, item.quotegear || 1)
|
|
|
+ /// 做市需要反着来
|
|
|
+ if (item?.trademode === ETradeMode.TRADEMODE_MARKETMAKE) {
|
|
|
+ if (item) {
|
|
|
+ const result = [
|
|
|
+ {
|
|
|
+ label: '买一',
|
|
|
+ price: item.ask,
|
|
|
+ qty: item.askvolume,
|
|
|
+ color: item.askColor,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ return result.slice(0, item.quotegear || 1)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (item) {
|
|
|
+ const result = [
|
|
|
+ {
|
|
|
+ label: '买一',
|
|
|
+ price: item.bid,
|
|
|
+ qty: item.bidvolume,
|
|
|
+ color: item.bidColor,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '买二',
|
|
|
+ price: item.bid2,
|
|
|
+ qty: item.bidvolume2,
|
|
|
+ color: item.bid2Color,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '买三',
|
|
|
+ price: item.bid3,
|
|
|
+ qty: item.bidvolume3,
|
|
|
+ color: item.bid3Color,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '买四',
|
|
|
+ price: item.bid4,
|
|
|
+ qty: item.bidvolume4,
|
|
|
+ color: item.bid4Color,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '买五',
|
|
|
+ price: item.bid5,
|
|
|
+ qty: item.bidvolume5,
|
|
|
+ color: item.bid5Color,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ return result.slice(0, item.quotegear || 1)
|
|
|
+ }
|
|
|
}
|
|
|
return []
|
|
|
})
|
|
|
|
|
|
const sellList = computed(() => {
|
|
|
const item = quote.value
|
|
|
- if (item) {
|
|
|
- const result = [
|
|
|
- {
|
|
|
- label: '卖一',
|
|
|
- price: item.ask,
|
|
|
- qty: item.askvolume,
|
|
|
- color: item.askColor,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '卖二',
|
|
|
- price: item.ask2,
|
|
|
- qty: item.askvolume2,
|
|
|
- color: item.ask2Color,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '卖三',
|
|
|
- price: item.ask3,
|
|
|
- qty: item.askvolume3,
|
|
|
- color: item.ask3Color,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '卖四',
|
|
|
- price: item.ask4,
|
|
|
- qty: item.askvolume4,
|
|
|
- color: item.ask4Color,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '卖五',
|
|
|
- price: item.ask5,
|
|
|
- qty: item.askvolume5,
|
|
|
- color: item.ask5Color,
|
|
|
- }
|
|
|
- ]
|
|
|
- return result.slice(0, item.quotegear || 1).reverse()
|
|
|
+ /// 做市需要反着来
|
|
|
+ if (item?.trademode === ETradeMode.TRADEMODE_MARKETMAKE) {
|
|
|
+ if (item) {
|
|
|
+ const result = [
|
|
|
+ {
|
|
|
+ label: '卖一',
|
|
|
+ price: item.bid,
|
|
|
+ qty: item.bidvolume,
|
|
|
+ color: item.bidColor,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ return result.slice(0, item.quotegear || 1)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (item) {
|
|
|
+ const result = [
|
|
|
+ {
|
|
|
+ label: '卖一',
|
|
|
+ price: item.ask,
|
|
|
+ qty: item.askvolume,
|
|
|
+ color: item.askColor,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '卖二',
|
|
|
+ price: item.ask2,
|
|
|
+ qty: item.askvolume2,
|
|
|
+ color: item.ask2Color,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '卖三',
|
|
|
+ price: item.ask3,
|
|
|
+ qty: item.askvolume3,
|
|
|
+ color: item.ask3Color,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '卖四',
|
|
|
+ price: item.ask4,
|
|
|
+ qty: item.askvolume4,
|
|
|
+ color: item.ask4Color,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '卖五',
|
|
|
+ price: item.ask5,
|
|
|
+ qty: item.askvolume5,
|
|
|
+ color: item.ask5Color,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ return result.slice(0, item.quotegear || 1).reverse()
|
|
|
+ }
|
|
|
}
|
|
|
return []
|
|
|
})
|