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 @@ 股票温度计
{{ displayedTexts.one1 }}
+{{ displayedTexts.one2 }}
+{{ displayedTexts.two }}
+{{ displayedTexts.three }}
+{{ displayedTexts.four }}
+{{ displayedTexts.disclaimer }}
+等待股票分析结论...
+