li.shaoyi 2 years ago
parent
commit
f71399bfa5
62 changed files with 253 additions and 251 deletions
  1. 1 1
      src/hooks/echarts/candlestick/index.ts
  2. 1 1
      src/hooks/echarts/smoothedline/index.ts
  3. 1 1
      src/hooks/echarts/timeline/index.ts
  4. 1 1
      src/packages/gstj/components/modules/quote/forex/index.vue
  5. 1 1
      src/packages/gstj/components/modules/quote/price/index.vue
  6. 1 1
      src/packages/gstj/components/modules/quote/tik/index.vue
  7. 1 1
      src/packages/gstj/views/goods/detail/Index.vue
  8. 1 1
      src/packages/gstj/views/goods/detail/components/listing/Index.vue
  9. 1 1
      src/packages/gstj/views/goods/list/Index.vue
  10. 1 1
      src/packages/gstj/views/goods/trade/components/delisting/index.vue
  11. 1 1
      src/packages/gstj/views/goods/trade/index.vue
  12. 1 1
      src/packages/gstj/views/order/position/components/goods/close/Index.vue
  13. 1 1
      src/packages/gstj/views/order/position/components/goods/delivery/Index.vue
  14. 1 1
      src/packages/mobile/components/modules/quote/forex/index.vue
  15. 1 1
      src/packages/mobile/components/modules/quote/price/index.vue
  16. 1 1
      src/packages/mobile/components/modules/quote/tik/index.vue
  17. 1 1
      src/packages/mobile/views/goods/detail/Index.vue
  18. 1 1
      src/packages/mobile/views/goods/detail/components/listing/Index.vue
  19. 1 1
      src/packages/mobile/views/goods/list/Index.vue
  20. 1 1
      src/packages/mobile/views/goods/trade/components/delisting/index.vue
  21. 1 1
      src/packages/mobile/views/goods/trade/index.vue
  22. 1 1
      src/packages/mobile/views/market/list/Index.vue
  23. 1 1
      src/packages/mobile/views/order/position/components/goods/close/Index.vue
  24. 1 1
      src/packages/mobile/views/order/position/components/goods/delivery/Index.vue
  25. 1 1
      src/packages/mobile/views/order/position/components/swap/close/Index.vue
  26. 1 1
      src/packages/mobile/views/order/position/components/swap/list/Index.vue
  27. 1 1
      src/packages/mobile/views/order/position/components/transfer/listing/Index.vue
  28. 1 1
      src/packages/mobile/views/pricing/detail/Index.vue
  29. 1 1
      src/packages/mobile/views/pricing/list/Index.vue
  30. 1 1
      src/packages/mobile/views/swap/list/Index.vue
  31. 1 1
      src/packages/mobile/views/transfer/detail/Index.vue
  32. 1 1
      src/packages/mobile/views/transfer/detail2/index.vue
  33. 1 1
      src/packages/mobile/views/transfer/list/Index.vue
  34. 1 1
      src/packages/pc/components/modules/listing/index.vue
  35. 1 1
      src/packages/pc/components/modules/quote/forex/index.vue
  36. 1 7
      src/packages/pc/components/modules/quote/price/index.vue
  37. 2 2
      src/packages/pc/components/modules/quote/tik/index.vue
  38. 1 1
      src/packages/pc/views/footer/goods/position/components/delivery/index.vue
  39. 1 1
      src/packages/pc/views/footer/goods/position/components/transfer/index.vue
  40. 1 1
      src/packages/pc/views/market/trade/goods/detail/components/order/delisting/index.vue
  41. 1 1
      src/packages/pc/views/market/trade/goods/detail/components/order/index.vue
  42. 1 1
      src/packages/pc/views/market/trade/goods/detail/index.vue
  43. 1 1
      src/packages/pc/views/market/trade/goods/index.vue
  44. 1 1
      src/packages/qxst/components/modules/quote/forex/index.vue
  45. 1 1
      src/packages/qxst/components/modules/quote/price/index.vue
  46. 1 1
      src/packages/qxst/components/modules/quote/tik/index.vue
  47. 1 1
      src/packages/qxst/views/goods/detail/Index.vue
  48. 1 1
      src/packages/qxst/views/goods/detail/components/listing/Index.vue
  49. 1 1
      src/packages/qxst/views/goods/list/Index.vue
  50. 1 1
      src/packages/qxst/views/goods/trade/components/delisting/index.vue
  51. 1 1
      src/packages/qxst/views/goods/trade/index.vue
  52. 1 1
      src/packages/qxst/views/order/position/components/goods/close/Index.vue
  53. 1 1
      src/packages/qxst/views/order/position/components/goods/delivery/Index.vue
  54. 1 1
      src/packages/sbyj/components/modules/quote/forex/index.vue
  55. 1 1
      src/packages/sbyj/components/modules/quote/price/index.vue
  56. 1 1
      src/packages/sbyj/components/modules/quote/tik/index.vue
  57. 1 1
      src/packages/sbyj/views/market/detail/index.vue
  58. 1 1
      src/packages/sbyj/views/market/list/index.vue
  59. 1 1
      src/packages/sbyj/views/order/list/components/close-holder/index.vue
  60. 129 184
      src/stores/modules/futures.ts
  61. 1 1
      src/stores/modules/position.ts
  62. 63 0
      src/types/model/market.d.ts

+ 1 - 1
src/hooks/echarts/candlestick/index.ts

@@ -15,7 +15,7 @@ export function useCandlestickChart(goodscode: string) {
     const loading = ref(false);
     const isEmpty = ref(true);
     const dataIndex = ref(-1); // 当前数据索引值
-    const quote = futuresStore.getQuoteInfo(goodscode); // 实时行情
+    const quote = futuresStore.getQuote(goodscode); // 实时行情
 
     // 当前选中的数据项
     const selectedItem = computed(() => {

+ 1 - 1
src/hooks/echarts/smoothedline/index.ts

@@ -13,7 +13,7 @@ export function useSmoothedLineChart(goodscode: string) {
     const loading = ref(false)
     const isEmpty = ref(false)
     const dataIndex = ref(-1); // 当前数据索引值
-    const quote = futuresStore.getQuoteInfo(goodscode) // 实时行情
+    const quote = futuresStore.getQuote(goodscode) // 实时行情
 
     // 当前选中的数据项
     const selectedItem = computed(() => {

+ 1 - 1
src/hooks/echarts/timeline/index.ts

@@ -14,7 +14,7 @@ export function useTimelineChart(goodscode: string) {
     const loading = ref(false)
     const isEmpty = ref(false)
     const dataIndex = ref(-1) // 当前数据索引值
-    const quote = futuresStore.getQuoteInfo(goodscode) // 实时行情
+    const quote = futuresStore.getQuote(goodscode) // 实时行情
 
     // 当前选中的数据项
     const selectedItem = computed(() => {

+ 1 - 1
src/packages/gstj/components/modules/quote/forex/index.vue

@@ -56,7 +56,7 @@ const emit = defineEmits<{ (event: string, ...args: unknown[]): void }>()
 const { router } = useNavigation()
 const attrs = useAttrs()
 const futuresStore = useFuturesStore()
-const quote = computed(() => futuresStore.getQuoteDayInfo(props.goodsCode).value)
+const quote = computed(() => futuresStore.getGoodsQuote(props.goodsCode).value)
 const active = shallowRef('')
 
 const buyList = computed(() => {

+ 1 - 1
src/packages/gstj/components/modules/quote/price/index.vue

@@ -89,7 +89,7 @@ const props = defineProps({
 
 const futuresStore = useFuturesStore()
 const subscribe = quoteSocket.createSubscribe()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const showMore = shallowRef(false)
 
 onMounted(() => subscribe.start(props.goodsCode))

+ 1 - 1
src/packages/gstj/components/modules/quote/tik/index.vue

@@ -28,7 +28,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const dataList = ref<Model.HistoryTikDatasRsp[]>([])
 
 const columns: Model.TableColumn[] = [

+ 1 - 1
src/packages/gstj/views/goods/detail/Index.vue

@@ -41,7 +41,7 @@ const { positionList } = usePosition(50)
 const { getQueryStringToNumber } = useNavigation()
 const futuresStore = useFuturesStore()
 const goodsid = getQueryStringToNumber('goodsid')
-const quote = futuresStore.getQuoteDayInfo(goodsid)
+const quote = futuresStore.getGoodsQuote(goodsid)
 const buildType = shallowRef<EBuildType>() // 挂牌类型
 
 const goodsCode = computed(() => quote.value?.goodscode ?? '')

+ 1 - 1
src/packages/gstj/views/goods/detail/components/listing/Index.vue

@@ -87,7 +87,7 @@ const { getOrderQty } = usePosition(50)
 const { formData, formSubmit } = useOrder()
 const accountStore = useAccountStore()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(true) // 是否刷新父组件数据

+ 1 - 1
src/packages/gstj/views/goods/list/Index.vue

@@ -91,7 +91,7 @@ const { dataList } = useRequest(queryQuoteGoodsList, {
 
 const tableList = computed(() => {
     return dataList.value.map((item) => {
-        const quote = futuresStore.getQuoteDayInfo(item.goodscode)
+        const quote = futuresStore.getGoodsQuote(item.goodscode)
         const { goodsname, bid, bidColor, bidvolume, ask, askColor, askvolume, limitdown, limitup, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened } = quote.value ?? {}
         return {
             ...item,

+ 1 - 1
src/packages/gstj/views/goods/trade/components/delisting/index.vue

@@ -97,7 +97,7 @@ const futuresStore = useFuturesStore()
 const { getOrderQty } = usePosition(50)
 const { formData, formSubmit } = useOrder()
 
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodsid)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodsid)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据

+ 1 - 1
src/packages/gstj/views/goods/trade/index.vue

@@ -52,7 +52,7 @@ const goodsid = getQueryStringToNumber('goodsid')
 const buyorsell = getQueryStringToNumber('buyorsell')
 const loginStore = useLoginStore()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(goodsid)
+const quote = futuresStore.getGoodsQuote(goodsid)
 
 const tabIndex = shallowRef(buyorsell)
 const selectedRow = shallowRef<Model.WrTradeOrderDetailRsp>()

+ 1 - 1
src/packages/gstj/views/order/position/components/goods/close/Index.vue

@@ -64,7 +64,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodscode)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
 const showModal = shallowRef(true)
 // 是否刷新父组件数据
 const refresh = shallowRef(false)

+ 1 - 1
src/packages/gstj/views/order/position/components/goods/delivery/Index.vue

@@ -64,7 +64,7 @@ const showModal = shallowRef(true)
 const refresh = shallowRef(false)
 const { formSubmit, formData } = useOfflineDelivery()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodscode)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
 
 /// 计算参考损益
 const closepl = computed(() => {

+ 1 - 1
src/packages/mobile/components/modules/quote/forex/index.vue

@@ -56,7 +56,7 @@ const emit = defineEmits<{ (event: string, ...args: unknown[]): void }>()
 const { router } = useNavigation()
 const attrs = useAttrs()
 const futuresStore = useFuturesStore()
-const quote = computed(() => futuresStore.getQuoteDayInfo(props.goodsCode).value)
+const quote = computed(() => futuresStore.getGoodsQuote(props.goodsCode).value)
 const active = shallowRef('')
 
 const buyList = computed(() => {

+ 1 - 1
src/packages/mobile/components/modules/quote/price/index.vue

@@ -89,7 +89,7 @@ const props = defineProps({
 
 const futuresStore = useFuturesStore()
 const subscribe = quoteSocket.createSubscribe()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const showMore = shallowRef(false)
 
 onMounted(() => subscribe.start(props.goodsCode))

+ 1 - 1
src/packages/mobile/components/modules/quote/tik/index.vue

@@ -28,7 +28,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const dataList = ref<Model.HistoryTikDatasRsp[]>([])
 
 const columns: Model.TableColumn[] = [

+ 1 - 1
src/packages/mobile/views/goods/detail/Index.vue

@@ -41,7 +41,7 @@ const { positionList } = usePosition(50)
 const { getQueryStringToNumber } = useNavigation()
 const futuresStore = useFuturesStore()
 const goodsid = getQueryStringToNumber('goodsid')
-const quote = futuresStore.getQuoteDayInfo(goodsid)
+const quote = futuresStore.getGoodsQuote(goodsid)
 const buildType = shallowRef<EBuildType>() // 挂牌类型
 
 const goodsCode = computed(() => quote.value?.goodscode ?? '')

+ 1 - 1
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -87,7 +87,7 @@ const { getOrderQty } = usePosition(50)
 const { formData, formSubmit } = useOrder()
 const accountStore = useAccountStore()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(true) // 是否刷新父组件数据

+ 1 - 1
src/packages/mobile/views/goods/list/Index.vue

@@ -91,7 +91,7 @@ const { dataList } = useRequest(queryQuoteGoodsList, {
 
 const tableList = computed(() => {
     return dataList.value.map((item) => {
-        const quote = futuresStore.getQuoteDayInfo(item.goodscode)
+        const quote = futuresStore.getGoodsQuote(item.goodscode)
         const { goodsname, bid, bidColor, bidvolume, ask, askColor, askvolume, limitdown, limitup, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened } = quote.value ?? {}
         return {
             ...item,

+ 1 - 1
src/packages/mobile/views/goods/trade/components/delisting/index.vue

@@ -97,7 +97,7 @@ const futuresStore = useFuturesStore()
 const { getOrderQty } = usePosition(50)
 const { formData, formSubmit } = useOrder()
 
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodsid)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodsid)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据

+ 1 - 1
src/packages/mobile/views/goods/trade/index.vue

@@ -53,7 +53,7 @@ const goodsid = getQueryStringToNumber('goodsid')
 const buyorsell = getQueryStringToNumber('buyorsell')
 const loginStore = useLoginStore()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(goodsid)
+const quote = futuresStore.getGoodsQuote(goodsid)
 
 const tabIndex = shallowRef(buyorsell)
 const selectedRow = shallowRef<Model.WrTradeOrderDetailRsp>()

+ 1 - 1
src/packages/mobile/views/market/list/Index.vue

@@ -52,7 +52,7 @@ const { router } = useNavigation()
 const futuresStore = useFuturesStore()
 
 const dataList = computed(() => {
-    const list = futuresStore.quoteList.filter((e) => e.marketid === 99201)
+    const list = futuresStore.goodsQuoteList.filter((e) => e.marketid === 99201)
     return list.map((e) => ({
         goodscode: e.goodscode,
         askColor: e.askColor,

+ 1 - 1
src/packages/mobile/views/order/position/components/goods/close/Index.vue

@@ -64,7 +64,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodscode)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
 const showModal = shallowRef(true)
 // 是否刷新父组件数据
 const refresh = shallowRef(false)

+ 1 - 1
src/packages/mobile/views/order/position/components/goods/delivery/Index.vue

@@ -64,7 +64,7 @@ const showModal = shallowRef(true)
 const refresh = shallowRef(false)
 const { formSubmit, formData } = useOfflineDelivery()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodscode)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
 
 /// 计算参考损益
 const closepl = computed(() => {

+ 1 - 1
src/packages/mobile/views/order/position/components/swap/close/Index.vue

@@ -118,7 +118,7 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryTradeHolderDetail
 })
 
 const lastPrice = computed(() => {
-    const quote = futuresStore.getQuoteDayInfo(props.selectedRow.refgoodscode)
+    const quote = futuresStore.getGoodsQuote(props.selectedRow.refgoodscode)
     const { last } = quote.value ?? {}
     return last
 })

+ 1 - 1
src/packages/mobile/views/order/position/components/swap/list/Index.vue

@@ -79,7 +79,7 @@ const last = (goodsCode: string) => {
 }
 
 const lastColor = (goodsCode: string) => {
-    return futuresStore.getQuoteDayInfo(goodsCode).value?.lastColor
+    return futuresStore.getGoodsQuote(goodsCode).value?.lastColor
 }
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {

+ 1 - 1
src/packages/mobile/views/order/position/components/transfer/listing/Index.vue

@@ -79,7 +79,7 @@ const { getQuoteDayInfo } = useFuturesStore()
 const formRef = shallowRef<FormInstance>()
 const refresh = shallowRef(false) // 是否刷新父组件数据
 const showModal = shallowRef(true)
-const quote = getQuoteDayInfo(props.selectedRow.goodscode)
+const quote = getGoodsQuote(props.selectedRow.goodscode)
 
 // 表单验证规则
 const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {

+ 1 - 1
src/packages/mobile/views/pricing/detail/Index.vue

@@ -169,7 +169,7 @@ const marketPrice = computed(() => {
 const goodscode = getQueryString('goodscode')
 const buyOrSell = getQueryStringToNumber('buyOrSell')
 const buildType = getQueryStringToNumber('buildType')
-const quote = futuresStore.getQuoteDayInfo(goodscode)
+const quote = futuresStore.getGoodsQuote(goodscode)
 const subscribe = quoteSocket.createSubscribe()
 const sl = shallowRef(false) // 止损
 const sp = shallowRef(false) // 止盈

+ 1 - 1
src/packages/mobile/views/pricing/list/Index.vue

@@ -70,7 +70,7 @@ const { dataList } = useRequest(queryQuoteGoodsList, {
 
 const tableList = computed(() => {
     return dataList.value.map((item) => {
-        const quote = futuresStore.getQuoteDayInfo(item.goodscode)
+        const quote = futuresStore.getGoodsQuote(item.goodscode)
         const { lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened, ask, bid, bidColor, askColor } = quote.value ?? {}
         return {
             ...item,

+ 1 - 1
src/packages/mobile/views/swap/list/Index.vue

@@ -65,7 +65,7 @@ const { dataList } = useRequest(queryQuoteGoodsList, {
 
 const tableList = computed(() => {
     return dataList.value.map((item) => {
-        const quote = futuresStore.getQuoteDayInfo(item.refgoodscode)
+        const quote = futuresStore.getGoodsQuote(item.refgoodscode)
         const { goodsname, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened } = quote.value ?? {}
         return {
             ...item,

+ 1 - 1
src/packages/mobile/views/transfer/detail/Index.vue

@@ -78,7 +78,7 @@ const componentMap = new Map<string, unknown>([
 const { getQueryStringToNumber } = useNavigation()
 const { getQuoteDayInfo } = useFuturesStore()
 const goodsid = getQueryStringToNumber('goodsid')
-const quote = getQuoteDayInfo(goodsid)
+const quote = getGoodsQuote(goodsid)
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
     getPresaleDefault()

+ 1 - 1
src/packages/mobile/views/transfer/detail2/index.vue

@@ -76,7 +76,7 @@ const componentMap = new Map<string, unknown>([
 const { router, getQueryStringToNumber } = useNavigation()
 const { getQuoteDayInfo } = useFuturesStore()
 const goodsid = getQueryStringToNumber('goodsid')
-const quote = getQuoteDayInfo(goodsid)
+const quote = getGoodsQuote(goodsid)
 const goodsCode = computed(() => quote.value?.goodscode ?? '')
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {

+ 1 - 1
src/packages/mobile/views/transfer/list/Index.vue

@@ -31,7 +31,7 @@ const { router } = useNavigation()
 const futuresStore = useFuturesStore()
 
 const dataList = computed(() => {
-    const list = futuresStore.quoteList.filter((e) => e.marketid === 49201)
+    const list = futuresStore.goodsQuoteList.filter((e) => e.marketid === 49201)
     return list.map((e) => ({
         lastColor: e.lastColor,
         askColor: e.askColor,

+ 1 - 1
src/packages/pc/components/modules/listing/index.vue

@@ -78,7 +78,7 @@ const qtyStepList = [1, 10, 100] // 数量步长列表
 const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 
 // 商品盘面
-const quote = computed(() => futuresStore.getQuoteDayInfo(goodsStore.goodsCode).value)
+const quote = computed(() => futuresStore.getGoodsQuote(goodsStore.goodsCode).value)
 
 // 价格步长
 const priceStep = computed(() => {

+ 1 - 1
src/packages/pc/components/modules/quote/forex/index.vue

@@ -36,7 +36,7 @@ const props = defineProps({
 const emit = defineEmits<{ (event: string, ...args: unknown[]): void }>()
 const attrs = useAttrs()
 const futuresStore = useFuturesStore()
-const quote = computed(() => futuresStore.getQuoteDayInfo(props.goodsCode).value)
+const quote = computed(() => futuresStore.getGoodsQuote(props.goodsCode).value)
 const active = shallowRef('')
 
 const buyList = computed(() => {

+ 1 - 7
src/packages/pc/components/modules/quote/price/index.vue

@@ -57,10 +57,8 @@
 </template>
 
 <script lang="ts" setup>
-import { onMounted, onUnmounted } from 'vue'
 import { parsePercent, handleNumberValue } from '@/filters'
 import { useFuturesStore } from '@/stores'
-import quoteSocket from '@/services/websocket/quote'
 
 const props = defineProps({
     goodsCode: {
@@ -70,11 +68,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const subscribe = quoteSocket.createSubscribe()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
-
-onMounted(() => subscribe.start(props.goodsCode))
-onUnmounted(() => subscribe.stop())
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 </script>
 
 <style lang="less">

+ 2 - 2
src/packages/pc/components/modules/quote/tik/index.vue

@@ -31,8 +31,8 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quoteDay = futuresStore.getQuoteDayInfo(props.goodsCode)
-const quote = futuresStore.getQuoteInfo(props.goodsCode)
+const quoteDay = futuresStore.getGoodsQuote(props.goodsCode)
+const quote = futuresStore.getQuote(props.goodsCode)
 const dataList = ref<Model.HistoryTikDatasRsp[]>([])
 
 const { run: getHistoryTikDatas } = useRequest(queryHistoryTikDatas, {

+ 1 - 1
src/packages/pc/views/footer/goods/position/components/delivery/index.vue

@@ -65,7 +65,7 @@ const show = ref(true)
 const refresh = ref(false)
 const formRef = ref<FormInstance>()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodscode)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
 
 /// 计算参考损益
 const closepl = computed(() => {

+ 1 - 1
src/packages/pc/views/footer/goods/position/components/transfer/index.vue

@@ -69,7 +69,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodscode)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
 // 损益
 const closepl = computed(() => {
     const { last = 0 } = quote.value ?? {}

+ 1 - 1
src/packages/pc/views/market/trade/goods/detail/components/order/delisting/index.vue

@@ -71,7 +71,7 @@ const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
 const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 
 // 商品盘面
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodsid)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodsid)
 
 // 买方向持仓数量
 const buyQty = computed(() => getOrderQty(BuyOrSell.Buy, props.selectedRow.goodsid))

+ 1 - 1
src/packages/pc/views/market/trade/goods/detail/components/order/index.vue

@@ -49,7 +49,7 @@ const componentMap = new Map<string, unknown>([
 
 const loginStore = useLoginStore()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsId)
+const quote = futuresStore.getGoodsQuote(props.goodsId)
 
 const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.WrTradeOrderDetailRsp>({ rowKey: 'orderid' })
 const { componentRef, componentId, openComponent, closeComponent } = useComponent()

+ 1 - 1
src/packages/pc/views/market/trade/goods/detail/index.vue

@@ -44,7 +44,7 @@ const props = defineProps({
 
 const emit = defineEmits(['closed'])
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsId)
+const quote = futuresStore.getGoodsQuote(props.goodsId)
 const active = shallowRef(true)
 
 const goodsCode = computed(() => quote.value?.goodscode ?? '')

+ 1 - 1
src/packages/pc/views/market/trade/goods/index.vue

@@ -64,7 +64,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 
 const tableList = computed(() => {
     return quoteGoodsList.value.map((item) => {
-        const quote = futuresStore.getQuoteDayInfo(item.goodscode)
+        const quote = futuresStore.getGoodsQuote(item.goodscode)
         const { bid, bidColor, bidvolume, ask, askColor, askvolume, goodunitid, agreeunit, limitdown, limitup, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened, decimalplace } = quote.value ?? {}
         return {
             ...item,

+ 1 - 1
src/packages/qxst/components/modules/quote/forex/index.vue

@@ -56,7 +56,7 @@ const emit = defineEmits<{ (event: string, ...args: unknown[]): void }>()
 const { router } = useNavigation()
 const attrs = useAttrs()
 const futuresStore = useFuturesStore()
-const quote = computed(() => futuresStore.getQuoteDayInfo(props.goodsCode).value)
+const quote = computed(() => futuresStore.getGoodsQuote(props.goodsCode).value)
 const active = shallowRef('')
 
 const buyList = computed(() => {

+ 1 - 1
src/packages/qxst/components/modules/quote/price/index.vue

@@ -89,7 +89,7 @@ const props = defineProps({
 
 const futuresStore = useFuturesStore()
 const subscribe = quoteSocket.createSubscribe()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const showMore = shallowRef(false)
 
 onMounted(() => subscribe.start(props.goodsCode))

+ 1 - 1
src/packages/qxst/components/modules/quote/tik/index.vue

@@ -28,7 +28,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const dataList = ref<Model.HistoryTikDatasRsp[]>([])
 
 const columns: Model.TableColumn[] = [

+ 1 - 1
src/packages/qxst/views/goods/detail/Index.vue

@@ -41,7 +41,7 @@ const { positionList } = usePosition(50)
 const { getQueryStringToNumber } = useNavigation()
 const futuresStore = useFuturesStore()
 const goodsid = getQueryStringToNumber('goodsid')
-const quote = futuresStore.getQuoteDayInfo(goodsid)
+const quote = futuresStore.getGoodsQuote(goodsid)
 const buildType = shallowRef<EBuildType>() // 挂牌类型
 
 const goodsCode = computed(() => quote.value?.goodscode ?? '')

+ 1 - 1
src/packages/qxst/views/goods/detail/components/listing/Index.vue

@@ -87,7 +87,7 @@ const { getOrderQty } = usePosition(50)
 const { formData, formSubmit } = useOrder()
 const accountStore = useAccountStore()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(true) // 是否刷新父组件数据

+ 1 - 1
src/packages/qxst/views/goods/list/Index.vue

@@ -91,7 +91,7 @@ const { dataList } = useRequest(queryQuoteGoodsList, {
 
 const tableList = computed(() => {
     return dataList.value.map((item) => {
-        const quote = futuresStore.getQuoteDayInfo(item.goodscode)
+        const quote = futuresStore.getGoodsQuote(item.goodscode)
         const { goodsname, bid, bidColor, bidvolume, ask, askColor, askvolume, limitdown, limitup, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened } = quote.value ?? {}
         return {
             ...item,

+ 1 - 1
src/packages/qxst/views/goods/trade/components/delisting/index.vue

@@ -97,7 +97,7 @@ const futuresStore = useFuturesStore()
 const { getOrderQty } = usePosition(50)
 const { formData, formSubmit } = useOrder()
 
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodsid)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodsid)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据

+ 1 - 1
src/packages/qxst/views/goods/trade/index.vue

@@ -52,7 +52,7 @@ const goodsid = getQueryStringToNumber('goodsid')
 const buyorsell = getQueryStringToNumber('buyorsell')
 const loginStore = useLoginStore()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(goodsid)
+const quote = futuresStore.getGoodsQuote(goodsid)
 
 const tabIndex = shallowRef(buyorsell)
 const selectedRow = shallowRef<Model.WrTradeOrderDetailRsp>()

+ 1 - 1
src/packages/qxst/views/order/position/components/goods/close/Index.vue

@@ -64,7 +64,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodscode)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
 const showModal = shallowRef(true)
 // 是否刷新父组件数据
 const refresh = shallowRef(false)

+ 1 - 1
src/packages/qxst/views/order/position/components/goods/delivery/Index.vue

@@ -64,7 +64,7 @@ const showModal = shallowRef(true)
 const refresh = shallowRef(false)
 const { formSubmit, formData } = useOfflineDelivery()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodscode)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
 
 /// 计算参考损益
 const closepl = computed(() => {

+ 1 - 1
src/packages/sbyj/components/modules/quote/forex/index.vue

@@ -90,7 +90,7 @@ const props = defineProps({
 const emit = defineEmits(['sellclick', 'buyclick'])
 const { router } = useNavigation()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 
 const onBuyClick = (index: number) => {
     emit('buyclick', index)

+ 1 - 1
src/packages/sbyj/components/modules/quote/price/index.vue

@@ -89,7 +89,7 @@ const props = defineProps({
 
 const futuresStore = useFuturesStore()
 const subscribe = quoteSocket.createSubscribe()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const showMore = shallowRef(false)
 
 onMounted(() => subscribe.start(props.goodsCode))

+ 1 - 1
src/packages/sbyj/components/modules/quote/tik/index.vue

@@ -28,7 +28,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const dataList = ref<Model.HistoryTikDatasRsp[]>([])
 
 const columns: Model.TableColumn[] = [

+ 1 - 1
src/packages/sbyj/views/market/detail/index.vue

@@ -130,7 +130,7 @@ const { getQueryString } = useNavigation()
 const { formData, formSubmit } = useOrder()
 const futuresStore = useFuturesStore()
 const goodscode = getQueryString('goodscode')
-const quote = futuresStore.getQuoteDayInfo(goodscode)
+const quote = futuresStore.getGoodsQuote(goodscode)
 const qtyStep = shallowRef(1) // 数量步长
 const error = shallowRef(false)
 const subscribe = quoteSocket.createSubscribe()

+ 1 - 1
src/packages/sbyj/views/market/list/index.vue

@@ -115,7 +115,7 @@ const touristRefGoodsList = computed(() => {
 
 // *************** 已登录 ***************
 const dataList = computed(() => {
-    const list = futuresStore.quoteList.filter((e) => e.trademode === 52 || e.trademode === 99)
+    const list = futuresStore.goodsQuoteList.filter((e) => e.trademode === 52 || e.trademode === 99)
     return list.map((e) => ({
         goodscode: e.goodscode,
         goodsname: e.goodsname,

+ 1 - 1
src/packages/sbyj/views/order/list/components/close-holder/index.vue

@@ -55,7 +55,7 @@ const props = defineProps({
 })
 
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteDayInfo(props.selectedRow.goodsCode)
+const quote = futuresStore.getGoodsQuote(props.selectedRow.goodsCode)
 const { formData, formSubmit } = useOrder()
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)

+ 129 - 184
src/stores/modules/futures.ts

@@ -1,5 +1,5 @@
 import { reactive, computed, toRefs } from 'vue'
-import { timerInterceptor } from '@/utils/timer'
+import { handlePriceColor } from '@/filters'
 import { queryErmcpGoods, queryQuoteDay } from '@/services/api/goods'
 import { defineStore } from '../store'
 import { timerTask } from '@/utils/timer'
@@ -13,142 +13,11 @@ import moment from 'moment'
 export const useFuturesStore = defineStore(() => {
     const state = reactive({
         loading: false,
-        quotes: <Partial<Model.QuoteDayRsp>[]>[], // 行情数据
         goodsList: <Model.GoodsRsp[]>[], // 商品列表
+        quotes: <Partial<Model.QuoteDayRsp>[]>[], // 行情数据
         quoteDayList: <Model.QuoteDayRsp[]>[], // 盘面列表
     })
 
-    // 行情列表
-    const quoteList = computed(() => {
-        return state.goodsList.reduce((res, cur) => {
-            const { agreeunit, goodsid, goodscode, goodsname, goodunitid, goodsgroupid, marketid, decimalplace, quoteminunit, trademode, quotegear } = cur
-            const quoteDayInfo = state.quoteDayList.find((e) => e.goodscode.toUpperCase() === goodscode.toUpperCase())
-            const {
-                averageprice = 0,
-                last = 0,
-                bid = 0,
-                bid2 = 0,
-                bid3 = 0,
-                bid4 = 0,
-                bid5 = 0,
-                ask = 0,
-                ask2 = 0,
-                ask3 = 0,
-                ask4 = 0,
-                ask5 = 0,
-                bidvolume = 0,
-                bidvolume2 = 0,
-                bidvolume3 = 0,
-                bidvolume4 = 0,
-                bidvolume5 = 0,
-                askvolume = 0,
-                askvolume2 = 0,
-                askvolume3 = 0,
-                askvolume4 = 0,
-                askvolume5 = 0,
-                totalvolume = 0,
-                lastvolume = 0,
-                holdvolume = 0,
-                holdincrement = 0,
-                presettle = 0,
-                preclose = 0,
-                totalturnover = 0,
-                opened = 0,
-                highest = 0,
-                lowest = 0,
-                lasttime = '',
-                settle = 0,
-                limitup = 0,
-                limitdown = 0,
-            } = quoteDayInfo ?? {}
-
-            const rise = last ? last - presettle : 0   // 涨跌额/涨跌: 最新价 - 昨结价
-            const change = presettle ? rise / presettle : 0 // 涨跌幅/幅度: (最新价 - 昨结价) / 昨结价
-            const amplitude = presettle ? (highest - lowest) / presettle : 0 // 振幅: (最高价 - 最低价 ) / 最新价
-
-            // 处理行情价格颜色
-            const handleColor = (value: number) => {
-                if (value === 0 || value === presettle) {
-                    return ''
-                } else if (value > presettle) {
-                    return 'g-price-up'
-                } else {
-                    return 'g-price-down'
-                }
-            }
-
-            const item: Model.Futures = {
-                agreeunit,
-                averageprice,
-                marketid,
-                goodsgroupid,
-                goodsid,
-                goodscode,
-                goodsname,
-                goodunitid,
-                decimalplace,
-                last,
-                lasttime,
-                rise,
-                change,
-                amplitude,
-                bid,
-                bid2,
-                bid3,
-                bid4,
-                bid5,
-                ask,
-                ask2,
-                ask3,
-                ask4,
-                ask5,
-                bidvolume,
-                bidvolume2,
-                bidvolume3,
-                bidvolume4,
-                bidvolume5,
-                askvolume,
-                askvolume2,
-                askvolume3,
-                askvolume4,
-                askvolume5,
-                totalvolume,
-                lastvolume,
-                holdvolume,
-                holdincrement,
-                presettle,
-                preclose,
-                totalturnover,
-                opened,
-                highest,
-                lowest,
-                settle,
-                limitup,
-                limitdown,
-                quoteminunit,
-                bidColor: handleColor(bid),
-                bid2Color: handleColor(bid2),
-                bid3Color: handleColor(bid3),
-                bid4Color: handleColor(bid4),
-                bid5Color: handleColor(bid5),
-                askColor: handleColor(ask),
-                ask2Color: handleColor(ask2),
-                ask3Color: handleColor(ask3),
-                ask4Color: handleColor(ask4),
-                ask5Color: handleColor(ask5),
-                lastColor: handleColor(last),
-                averagepriceColor: handleColor(averageprice),
-                openedColor: handleColor(opened),
-                highestColor: handleColor(highest),
-                lowestColor: handleColor(lowest),
-                trademode,
-                quotegear,
-            }
-            res.push(item)
-            return res
-        }, [] as Model.Futures[])
-    })
-
     // 获取商品列表
     const getGoodsList = async () => {
         timerTask.clearTimeout('quoteDay')
@@ -181,37 +50,144 @@ export const useFuturesStore = defineStore(() => {
         }
     }
 
-    // 通过 goodscode 获取实时行情信息
-    const getQuoteInfo = (goodsCode: string) => {
-        return computed(() => {
-            const quote = state.quotes.find((e) => e.goodscode === goodsCode)
-            return {
-                ...quote
+    // 商品行情列表
+    const goodsQuoteList = computed(() => {
+        return state.goodsList.reduce((res, cur) => {
+            const quote = state.quotes.find((e) => e.goodscode?.toUpperCase() === cur.goodscode.toUpperCase())
+            const quoteDay = state.quoteDayList.find((e) => e.goodscode.toUpperCase() === cur.goodscode.toUpperCase())
+
+            const goods: Model.GoodsQuote = {
+                goodsid: cur.goodsid,
+                goodscode: cur.goodscode,
+                goodsname: cur.goodsname,
+                goodsgroupid: cur.goodsgroupid,
+                goodunitid: cur.goodunitid,
+                marketid: cur.marketid,
+                trademode: cur.trademode,
+                agreeunit: cur.agreeunit,
+                decimalplace: cur.decimalplace,
+                quoteminunit: cur.quoteminunit,
+                quotegear: cur.quotegear,
+                last: quote?.last ?? quoteDay?.last ?? 0,
+                lasttime: quote?.lasttime ?? quoteDay?.lasttime ?? '',
+                bid: quote?.bid ?? quoteDay?.bid ?? 0,
+                bid2: quote?.bid2 ?? quoteDay?.bid2 ?? 0,
+                bid3: quote?.bid3 ?? quoteDay?.bid3 ?? 0,
+                bid4: quote?.bid4 ?? quoteDay?.bid4 ?? 0,
+                bid5: quote?.bid5 ?? quoteDay?.bid5 ?? 0,
+                bidvolume: quote?.bidvolume ?? quoteDay?.bidvolume ?? 0,
+                bidvolume2: quote?.bidvolume2 ?? quoteDay?.bidvolume2 ?? 0,
+                bidvolume3: quote?.bidvolume3 ?? quoteDay?.bidvolume3 ?? 0,
+                bidvolume4: quote?.bidvolume4 ?? quoteDay?.bidvolume4 ?? 0,
+                bidvolume5: quote?.bidvolume5 ?? quoteDay?.bidvolume5 ?? 0,
+                ask: quote?.ask ?? quoteDay?.ask ?? 0,
+                ask2: quote?.ask2 ?? quoteDay?.ask2 ?? 0,
+                ask3: quote?.ask3 ?? quoteDay?.ask3 ?? 0,
+                ask4: quote?.ask4 ?? quoteDay?.ask4 ?? 0,
+                ask5: quote?.ask5 ?? quoteDay?.ask5 ?? 0,
+                askvolume: quote?.askvolume ?? quoteDay?.askvolume ?? 0,
+                askvolume2: quote?.askvolume2 ?? quoteDay?.askvolume2 ?? 0,
+                askvolume3: quote?.askvolume3 ?? quoteDay?.askvolume3 ?? 0,
+                askvolume4: quote?.askvolume4 ?? quoteDay?.askvolume4 ?? 0,
+                askvolume5: quote?.askvolume5 ?? quoteDay?.askvolume5 ?? 0,
+                lastvolume: quote?.lastvolume ?? quoteDay?.lastvolume ?? 0,
+                presettle: quote?.presettle ?? quoteDay?.presettle ?? 0,
+                opened: quote?.opened ?? quoteDay?.opened ?? 0,
+                highest: quote?.highest ?? quoteDay?.highest ?? 0,
+                lowest: quote?.lowest ?? quoteDay?.lowest ?? 0,
+                limitup: quote?.limitup ?? quoteDay?.limitup ?? 0,
+                limitdown: quote?.limitdown ?? quoteDay?.limitdown ?? 0,
+                averageprice: quote?.averageprice ?? quoteDay?.averageprice ?? 0,
+                rise: 0,
+                change: 0,
+                amplitude: 0,
+                bidColor: '',
+                bid2Color: '',
+                bid3Color: '',
+                bid4Color: '',
+                bid5Color: '',
+                askColor: '',
+                ask2Color: '',
+                ask3Color: '',
+                ask4Color: '',
+                ask5Color: '',
+                lastColor: '',
+                averagepriceColor: '',
+                openedColor: '',
+                highestColor: '',
+                lowestColor: '',
+            }
+
+            // 处理最高最低价
+            if (goods.last) {
+                if (goods.last > goods.highest) {
+                    goods.highest = goods.last
+                }
+                if (goods.last < goods.lowest) {
+                    goods.lowest = goods.last
+                }
             }
-        })
-    }
 
-    // 通过 goodscode 获取实时盘面信息
-    const getQuoteDayInfo = (code?: string | number) => {
-        return computed(() => quoteList.value.find((e) => e.goodscode === code || e.goodsid === code))
+            if (quoteDay) {
+                goods.rise = goods.last ? goods.last - goods.presettle : 0   // 涨跌额/涨跌: 最新价 - 昨结价
+                goods.change = goods.presettle ? goods.rise / goods.presettle : 0 // 涨跌幅/幅度: (最新价 - 昨结价) / 昨结价
+                goods.amplitude = goods.presettle ? (goods.highest - goods.lowest) / goods.presettle : 0 // 振幅: (最高价 - 最低价 ) / 最新价
+
+                // 处理行情价格颜色
+                const handleColor = (value: number) => handlePriceColor(value, goods.presettle)
+
+                goods.bidColor = handleColor(goods.bid)
+                goods.bid2Color = handleColor(goods.bid2)
+                goods.bid3Color = handleColor(goods.bid3)
+                goods.bid4Color = handleColor(goods.bid4)
+                goods.bid5Color = handleColor(goods.bid5)
+                goods.askColor = handleColor(goods.ask)
+                goods.ask2Color = handleColor(goods.ask2)
+                goods.ask3Color = handleColor(goods.ask3)
+                goods.ask4Color = handleColor(goods.ask4)
+                goods.ask5Color = handleColor(goods.ask5)
+                goods.lastColor = handleColor(goods.last)
+                goods.averagepriceColor = handleColor(goods.averageprice)
+                goods.openedColor = handleColor(goods.opened)
+                goods.highestColor = handleColor(goods.highest)
+                goods.lowestColor = handleColor(goods.lowest)
+            }
+            res.push(goods)
+            return res
+        }, [] as Model.GoodsQuote[])
+    })
+
+    // 通过 goodscode 获取实时盘面
+    const getGoodsQuote = (code: string | number) => {
+        return computed(() => goodsQuoteList.value.find((e) => e.goodscode === code || e.goodsid === code))
     }
 
     // 通过 goodscode 获取实时行情报价
-    const getQuotePrice = (code?: string | number) => {
+    const getQuotePrice = (goodsCode: string) => {
         return computed(() => {
-            const quote = getQuoteDayInfo(code)
+            const quote = getGoodsQuote(goodsCode)
             return quote.value?.last ?? 0
         })
     }
 
+    // 通过 goodscode 获取实时行情
+    const getQuote = (goodsCode: string) => {
+        return computed(() => {
+            const quote = state.quotes.find((e) => e.goodscode === goodsCode)
+            return {
+                ...quote
+            }
+        })
+    }
+
     // 获取商品名称
-    const getGoodsName = (code?: string | number) => {
+    const getGoodsName = (code: string | number) => {
         const quote = state.goodsList.find((e) => e.goodscode === code || e.goodsid === code)
-        return quote?.goodsname
+        return quote?.goodsname ?? ''
     }
 
     // 获取商品市场ID
-    const getGoodsMarket = (code?: string | number) => {
+    const getGoodsMarket = (code: string | number) => {
         const quote = state.goodsList.find((e) => e.goodscode === code || e.goodsid === code)
         return quote?.marketid ?? 0
     }
@@ -228,7 +204,6 @@ export const useFuturesStore = defineStore(() => {
                 state.quotes.push(quote)
             }
         })
-        handleQuoteDay()
     })
 
     // 处理行情数据
@@ -295,43 +270,13 @@ export const useFuturesStore = defineStore(() => {
         }
     }
 
-    // 更新盘面数据
-    const handleQuoteDay = timerInterceptor.setThrottle(() => {
-        state.quotes.forEach((item) => {
-            const quoteDay = state.quoteDayList.find((e) => e.goodscode.toUpperCase() === item.goodscode?.toUpperCase())
-            if (quoteDay) {
-                let key: keyof Model.QuoteDayRsp
-                // 遍历对象赋值
-                for (key in item) {
-                    const value = item[key]
-                    if (value !== undefined) {
-                        (<K extends typeof key>(prop: K, value: Model.QuoteDayRsp[K]) => {
-                            quoteDay[prop] = value
-                        })(key, value)
-                    }
-                }
-                // 处理最高最低价
-                if (quoteDay.last) {
-                    if (quoteDay.last > quoteDay.highest) {
-                        quoteDay.highest = quoteDay.last
-                    }
-                    if (quoteDay.last < quoteDay.lowest) {
-                        quoteDay.lowest = quoteDay.last
-                    }
-                }
-            } else {
-                console.warn('行情推送的商品 ' + item.goodscode + ' 缺少盘面信息')
-            }
-        })
-    }, 100)
-
     return {
         ...toRefs(state),
-        quoteList,
-        getGoodsList,
-        getQuoteDayInfo,
-        getQuoteInfo,
+        goodsQuoteList,
+        getQuote,
         getQuotePrice,
+        getGoodsList,
+        getGoodsQuote,
         getGoodsName,
         getGoodsMarket,
         quotePushNotify,

+ 1 - 1
src/stores/modules/position.ts

@@ -37,7 +37,7 @@ export const usePositionStore = defineStore(() => {
         })[] = []
 
         state.orderPositionList.forEach((item) => {
-            const quote = futuresStore.getQuoteDayInfo(item.goodscode)
+            const quote = futuresStore.getGoodsQuote(item.goodscode)
             const { last = 0, lastColor = '' } = quote.value ?? {}
 
             // 计算浮动盈亏

+ 63 - 0
src/types/model/market.d.ts

@@ -64,6 +64,69 @@ declare namespace Model {
         Vol: number; // 现量
     }
 
+    /** 商品行情 */
+    interface GoodsQuote {
+        agreeunit: number;//合约单位
+        averageprice: number; // 均价
+        marketid: number; // 所属市场ID
+        goodsgroupid: number; // 所属商品组ID
+        goodsid: number; // 商品ID 
+        goodscode: string; // 商品代码
+        goodsname: string; // 商品名称
+        goodunitid: number;//报价单位ID
+        decimalplace: number;//报价小数位
+        last: number; // 最新价
+        lasttime: string; // 行情时间(只有现价变化行情时间才变化)
+        rise: number; // 涨跌
+        change: number; // 涨跌幅
+        amplitude: number; // 振幅
+        bid: number; // 买价
+        bid2: number; // 买2
+        bid3: number; // 买3
+        bid4: number; // 买4
+        bid5: number; // 买5
+        ask: number; // 卖价
+        ask2: number; // 卖2
+        ask3: number; // 卖3
+        ask4: number; // 卖4
+        ask5: number; // 卖5
+        bidvolume: number; // 买量
+        bidvolume2: number; // 买量2
+        bidvolume3: number; // 买量3
+        bidvolume4: number; // 买量4
+        bidvolume5: number; // 买量5
+        askvolume: number; // 卖量
+        askvolume2: number; // 卖量2
+        askvolume3: number; // 卖量3
+        askvolume4: number; // 卖量4
+        askvolume5: number; // 卖量5
+        lastvolume: number; // 现量
+        presettle: number; // 昨结价
+        opened: number; // 开盘
+        highest: number; // 最高
+        lowest: number; // 最低
+        averagepriceColor: string; // 均价颜色
+        bidColor: string;// 买价颜色
+        bid2Color: string;// 买价颜色
+        bid3Color: string;// 买价颜色
+        bid4Color: string;// 买价颜色
+        bid5Color: string;// 买价颜色
+        askColor: string;// 卖价颜色
+        ask2Color: string;// 卖价颜色
+        ask3Color: string;// 卖价颜色
+        ask4Color: string;// 卖价颜色
+        ask5Color: string;// 卖价颜色
+        lastColor: string;// 最新价颜色
+        openedColor: string;// 开盘颜色
+        highestColor: string;// 最高颜色
+        lowestColor: string;// 最低颜色
+        limitdown: number; // 跌停价
+        limitup: number; // 涨停价
+        trademode: number;
+        quoteminunit: number;//行情最小变动单位 [整数,报价小数位一起使用]
+        quotegear: number;//行情档位
+    }
+
     /** 期货行情 */
     interface Futures {
         agreeunit: number;//合约单位