lxf
2025-07-05 872daddd00287cd44963483ba15f997d25a3da53
src/components/fx-kline/index.vue
@@ -72,7 +72,11 @@
  socket.value = new WebSocket(`${WS_URL}/1/${props.symbol}`)
  socket.value.onmessage = (evt) => {
    const { data } = evt
    const { code, data: _data } = JSON.parse(data)
    let { code, data: _data } = JSON.parse(data)
  // _data[0].high = Math.floor(Math.random() * 100) + 1
  // _data[0].low = Math.floor(Math.random() * 100) + 1
  // _data[0].close = Math.floor(Math.random() * 100) + 1
  // _data[0].open = Math.floor(Math.random() * 100) + 1
    if (code / 1 === 0) {
      emits('data', _data[0])
      updateCharts(_data[0])
@@ -154,8 +158,10 @@
      width: quotesStore.stage === 'timeSharing' ? 0 : null,
    }
  })
  // quotesStore[SET_STAGE]({ stage: 'timeSharing', seconds: 1000 })
  if (!quotesStore.stage) {
    quotesStore[SET_STAGE]({ stage: '1min', seconds: 1 * 60 * 1000 })
    quotesStore[SET_STAGE]({ stage: '1min', seconds: 1000 })
  }
  emits('loading', true)
@@ -202,8 +208,10 @@
    }
  })
  if (!quotesStore.stage) {
    quotesStore[SET_STAGE]({ stage: '1min', seconds: 1 * 60 * 1000 })
    quotesStore[SET_STAGE]({ stage: '1min', seconds: 1000 })
  }
  // quotesStore[SET_STAGE]({ stage: 'timeSharing', seconds: 1000 })
  // console.log(data.value)
  nextTick(() => {