From 5e919701dee585a164cebfb96330a3270548c9a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Sat, 14 Jun 2025 12:51:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=E6=97=A0=E6=95=88?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E5=92=8C=E6=9C=AC=E5=9C=B0=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E5=AD=98=E5=82=A8=EF=BC=8C=E6=96=B0=E5=BB=BAemotion.t?= =?UTF-8?q?s=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/emotion.ts | 30 +++++++++++++++++ src/views/AiEmotion.vue | 89 +++++-------------------------------------------- 2 files changed, 39 insertions(+), 80 deletions(-) create mode 100644 src/store/emotion.ts diff --git a/src/store/emotion.ts b/src/store/emotion.ts new file mode 100644 index 0000000..117b3b7 --- /dev/null +++ b/src/store/emotion.ts @@ -0,0 +1,30 @@ +// @/store/emotion.js +import { defineStore } from 'pinia'; + +export const useEmotionStore = defineStore('emotion', { + state: () => ({ + history: [] as HistoryItem[], // 历史记录数组 + }), + actions: { + // 添加历史记录 + addHistory(item: HistoryItem) { + this.history.unshift(item); // 新记录添加到数组顶部,保持顺序 + }, + // 清空历史记录 + clearHistory() { + this.history = []; + }, + }, +}); + +// 定义历史记录项的类型 +interface HistoryItem { + queryText: string; // 用户输入的查询文本(如股票名称/代码) + stockInfo: { + name: string; // 股票名称 + code: string; // 股票代码 + market: string; // 市场(如 usa/cn/hk) + }; + apiData: any; // 接口返回的原始数据(包含图表数据) + timestamp: string; // 记录时间 +} \ No newline at end of file diff --git a/src/views/AiEmotion.vue b/src/views/AiEmotion.vue index 76824bf..e99a26b 100644 --- a/src/views/AiEmotion.vue +++ b/src/views/AiEmotion.vue @@ -17,15 +17,6 @@ - - - @@ -132,18 +123,9 @@
场景应用标题
-
-