From 5e3a829a14e069e4873f913e84e882a58bd33b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Wed, 18 Jun 2025 17:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=85=A5=E8=82=A1=E7=A5=A8=E7=BB=93?= =?UTF-8?q?=E8=AE=BA=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=B9=B6=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=89=93=E5=AD=97=E6=9C=BA=E6=95=88=E6=9E=9C=EF=BC=9B=E8=AF=AD?= =?UTF-8?q?=E9=9F=B3=E6=92=AD=E6=94=BE=E5=AE=8C=E6=88=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/AiEmotionApi.js | 4 +- src/store/emotion.ts | 15 + src/views/AiEmotion.vue | 618 ++++++++++++++++++++++++++++- src/views/components/marketTemperature.vue | 33 ++ 4 files changed, 648 insertions(+), 22 deletions(-) diff --git a/src/api/AiEmotionApi.js b/src/api/AiEmotionApi.js index 4268387..d49e302 100644 --- a/src/api/AiEmotionApi.js +++ b/src/api/AiEmotionApi.js @@ -21,13 +21,13 @@ export const getReplyAPI = function (params) { }; // 获取第二个工作流给出的结论 -export const getConclusion = function (params) { +export const getConclusionAPI = function (params) { return fetch("https://api.coze.cn/v1/workflow/run", { method: "POST", body: JSON.stringify({ workflow_id: "7509384582975897650", parameters: params, - }), + }), headers: { "Content-Type": "application/json", Authorization: diff --git a/src/store/emotion.ts b/src/store/emotion.ts index f56f3b5..a44ca17 100644 --- a/src/store/emotion.ts +++ b/src/store/emotion.ts @@ -62,6 +62,7 @@ export const useEmotionStore = defineStore('emotion', { queryText: stockData.queryText, stockInfo: stockData.stockInfo, apiData: stockData.apiData, + conclusionData: stockData.conclusionData, timestamp: stockData.timestamp }); }, @@ -101,10 +102,22 @@ export const useEmotionStore = defineStore('emotion', { queryText: historyItem.queryText, stockInfo: historyItem.stockInfo, apiData: historyItem.apiData, + conclusionData: historyItem.conclusionData, timestamp: historyItem.timestamp }; this.addStock(stockData); }, + // 更新股票的结论数据 + updateStockConclusion(index: number, conclusionData: string) { + if (index >= 0 && index < this.stockList.length) { + this.stockList[index].conclusionData = conclusionData; + this.stockList[index].timestamp = new Date().toISOString(); + } + }, + // 更新当前激活股票的结论数据 + updateActiveStockConclusion(conclusionData: string) { + this.updateStockConclusion(this.activeStockIndex, conclusionData); + }, }, }); @@ -117,6 +130,7 @@ interface HistoryItem { market: string; // 市场(如 usa/cn/hk) }; apiData: any; // 接口返回的原始数据(包含图表数据) + conclusionData?: string; // 第二个工作流接口返回的结论数据 timestamp: string; // 记录时间 } @@ -129,5 +143,6 @@ interface StockData { market: string; // 市场 }; apiData: any; // API返回的完整数据 + conclusionData?: string; // 第二个工作流接口返回的结论数据 timestamp: string; // 数据获取时间 } \ No newline at end of file diff --git a/src/views/AiEmotion.vue b/src/views/AiEmotion.vue index c4144b0..ad34834 100644 --- a/src/views/AiEmotion.vue +++ b/src/views/AiEmotion.vue @@ -47,8 +47,8 @@ 股票温度计
-
个股温度:{{ data1 ?? "NA" }}
-
大盘温度:{{ data2 }}
+
股票温度:{{ data2 ?? "NA" }}
+
市场温度:{{ data1 }}
@@ -121,14 +121,40 @@
场景应用标题
+
+
+

L1: 情绪监控

+

{{ displayedTexts.one1 }}

+

{{ displayedTexts.one2 }}

+
+
+

L2: 情绪解码

+

{{ displayedTexts.two }}

+
+
+

L3: 情绪推演

+

{{ displayedTexts.three }}

+
+
+

L4: 情绪套利

+

{{ displayedTexts.four }}

+
+ +
+

{{ displayedTexts.disclaimer }}

+
+
+
+

等待股票分析结论...

+