@@ -134,6 +150,7 @@
import { ref, reactive } from 'vue';
import { getReplyAPI } from '@/api/AiEmotionApi.js'; // 导入工作流接口方法
import axios from 'axios';
+import item from '@/assets/img/AiEmotion/bk01.png'; // 导入思维矩阵图片
import emotionDecod from '@/views/components/emotionDecod.vue'; // 导入情绪解码组件
import emotionalBottomRadar from '@/views/components/emotionalBottomRadar.vue'; // 导入情绪探底雷达图组件
import emoEnergyConverter from '@/views/components/emoEnergyConverter.vue'; // 导入情绪能量转化器组件
@@ -151,9 +168,10 @@ const displayDate = ref(''); // 用于存储显示的日期
const isPageLoaded = ref(false); // 控制页面是否显示
const isRotating = ref(false);//控制旋转
const userInputDisplayRef = ref(null);//消息区域的引用
-
+const data1 = ref(null); // 个股温度
+const data2 = ref(); // 大盘温度
//导出方法供外部使用
-defineExpose({handleSendMessage})
+defineExpose({ handleSendMessage })
// 从本地存储中加载对话历史的方法
const loadMessagesFromLocalStorage = () => {
@@ -316,7 +334,16 @@ async function fetchData(code, market) {
sender: 'ai',
text: `股票数据已成功获取`,
});
-
+ // 数据清洗并四舍五入xx
+ const lastTwoNumbers = stockDataResponse.data.GSWDJ.map(([date, num1, num2]) => [
+ date,
+ Math.round(num1),
+ Math.round(num2)
+ ]).at(-1);
+ console.log('111111111111111111111111111')
+ // 取最后一条数据
+ data1.value = lastTwoNumbers[1] // 个股温度
+ data2.value = lastTwoNumbers[2] // 市场温度
// 滚动到最新消息
nextTick(() => {
if (userInputDisplayRef.value) {
@@ -401,8 +428,7 @@ onMounted(() => {
\ No newline at end of file
diff --git a/src/views/components/emotionDecod.vue b/src/views/components/emotionDecod.vue
index ac33a8d..aad3195 100644
--- a/src/views/components/emotionDecod.vue
+++ b/src/views/components/emotionDecod.vue
@@ -340,6 +340,7 @@ onBeforeUnmount(() => {
// 组件卸载时销毁图表
if (KlineCanvsChart) {
KlineCanvsChart.dispose();
+
}
});
diff --git a/src/views/components/emotionalBottomRadar.vue b/src/views/components/emotionalBottomRadar.vue
index c6060e8..5e24f38 100644
--- a/src/views/components/emotionalBottomRadar.vue
+++ b/src/views/components/emotionalBottomRadar.vue
@@ -1,5 +1,5 @@
-
+