<template>
  <div>
    <NewsChg />
    <div style="display: flex">
      <UpLow :chg-content="chgContent" :chart-type="uplow" style="flex: 1" />
      <UpLow :chg-content="chgContent" :chart-type="uplowlimit" style="flex: 1" />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { getStockChgRecordData } from '@/api/stock/StockChgApi.js'
import NewsChg from '@/components/charts/NewsChg.vue'
import UpLow from '@/components/charts/UpLow.vue'

const chgContent = ref([])
const uplow = ref('uplow')
const uplowlimit = ref('uplowlimit')

onMounted(
  () => {
    getData()
  }
)
const getData = () => {
  const params = {
    _v: new Date() * 1,
    page: 0,
    size: 250,
    sort: 'id,desc'
  }
  getStockChgRecordData(params).then(resp => {
    if (resp.data) {
      chgContent.value = resp.data.content
    }
  })
}
</script>

<style scoped lang="scss">

</style>
