<template>
  AI情绪大模型
  <emoEnergyConverter ref="emoEnergyConverterRef"></emoEnergyConverter>
  <emotionDecod ref="emotionDecodRef"></emotionDecod>
  <EmotionalBottomRadar ref="emotionalBottomRadarRef"></EmotionalBottomRadar>
  <marketTemperature ref="marketTemperatureRef"></marketTemperature>

</template>
<script setup>
import emoEnergyConverter from '@/views/components/emoEnergyConverter.vue'
import emotionDecod from '@/views/components/emotionDecod.vue'
import EmotionalBottomRadar from '@/views/components/emotionalBottomRadar.vue'
import { ref, onMounted, onBeforeUnmount, toRef } from 'vue';
import marketTemperature from '@/views/components/marketTemperature.vue';
import axios from "axios";
const emoEnergyConverterRef = ref(null)
const emotionDecodRef = ref(null)
const emotionalBottomRadarRef = ref(null)
const marketTemperatureRef = ref(null)

onMounted(()=>{
  axios({
      method: "post",//请求方式
      url: 'http://39.101.133.168:8828/link/api/aiEmotion/client/getAiEmotionData',//请求接口
      data: {
        "token": "9ior41AF0xTIbIG2pRnnbZi0+fEeMx8pywnIlrmTwo5FbqJ9lWrSWOxp9MkpKiNtedtUafqvzIwpFKrwuMs",
        "market": "my",
        "code": "1295",
        "language": "cn",
        "version": 1
      },//数据
      headers: {
        'content-type': 'application/json'
      },//请求头参数
    }).then((res) => {
      nextTick(()=>{
        emoEnergyConverterRef.value.initQXNLZHEcharts(res.data.data.KLine20, res.data.data.QXNLZHQ)
        emotionDecodRef.value.initQXNLZHEcharts(res.data.data.KLine20, res.data.data.QXJMQ)
        
        // 情绪探底雷达
        emotionalBottomRadarRef.value.initEmotionalBottomRadar(res.data.data.KLine20, res.data.data.QXTDLD)
        // 市场温度
        marketTemperatureRef.value.initChart(res.data.data.GSWDJ, res.data.data.KLine20, res.data.data.WDRL)
      })
    })
})

</script>
