From 54138ff61edc8481b9ee4e30e8e89b2838a562d6 Mon Sep 17 00:00:00 2001 From: ArvinLovegood Date: Mon, 28 Apr 2025 12:17:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=E6=B7=BB=E5=8A=A0=E5=B8=82?= =?UTF-8?q?=E5=9C=BA=E8=B5=84=E8=AE=AF=E6=89=8B=E5=8A=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 App.d.ts 中添加 ReFleshTelegraphList 函数声明 - 在 app.go 中实现 ReFleshTelegraphList 方法,用于刷新电报列表- 在 App.js 中添加 ReFleshTelegraphList 函数的前端调用接口 - 在 market.vue 中添加 ReFlesh 函数,用于调用刷新接口并更新数据 - 在 newsList.vue 中添加刷新按钮和相关事件处理,支持手动刷新功能 --- app.go | 7 +++++++ frontend/src/components/market.vue | 18 +++++++++++++++--- frontend/src/components/newsList.vue | 16 ++++++++++++++-- frontend/wailsjs/go/main/App.d.ts | 2 ++ frontend/wailsjs/go/main/App.js | 4 ++++ 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/app.go b/app.go index 61323e5..9e43b4e 100644 --- a/app.go +++ b/app.go @@ -1074,6 +1074,13 @@ func (a *App) GetTelegraphList(source string) *[]*models.Telegraph { return telegraphs } +func (a *App) ReFleshTelegraphList(source string) *[]*models.Telegraph { + data.NewMarketNewsApi().GetNewTelegraph(30) + data.NewMarketNewsApi().GetSinaNews(30) + telegraphs := data.NewMarketNewsApi().GetTelegraphList(source) + return telegraphs +} + func (a *App) GlobalStockIndexes() map[string]any { return data.NewMarketNewsApi().GlobalStockIndexes(30) } diff --git a/frontend/src/components/market.vue b/frontend/src/components/market.vue index 4f1b256..5139af2 100644 --- a/frontend/src/components/market.vue +++ b/frontend/src/components/market.vue @@ -4,7 +4,7 @@ import { GetAIResponseResult, GetConfig, GetPromptTemplates, GetTelegraphList, - GlobalStockIndexes, + GlobalStockIndexes, ReFleshTelegraphList, SaveAIResponseResult, SaveAsMarkdown, ShareAnalysis, SummaryStockNews } from "../../wailsjs/go/main/App"; @@ -219,6 +219,18 @@ function share(){ }) }) } + +function ReFlesh(source){ + console.log("ReFlesh:",source) + ReFleshTelegraphList(source).then(res => { + if(source==="财联社电报"){ + telegraphList.value = res + } + if(source==="新浪财经"){ + sinaNewsList.value = res + } + }) +}