diff --git a/app.go b/app.go index 0496d25..37c09a0 100644 --- a/app.go +++ b/app.go @@ -443,10 +443,12 @@ func MonitorStockPrices(a *App) { total += stockInfo.ProfitAmountToday price, _ := convertor.ToFloat(stockInfo.Price) + if stockInfo.PrePrice != price { - //logger.SugaredLogger.Infof("-----------------------股票代码: %s, 股票名称: %s, 股票价格: %s,盘前盘后:%s", stockInfo.Code, stockInfo.Name, stockInfo.Price, stockInfo.BA) + //logger.SugaredLogger.Infof("-----------sz------------股票代码: %s, 股票名称: %s, 股票价格: %s,盘前盘后:%s", stockInfo.Code, stockInfo.Name, stockInfo.Price, stockInfo.BA) go runtime.EventsEmit(a.ctx, "stock_price", stockInfo) } + } if total != 0 { title := "go-stock " + time.Now().Format(time.DateTime) + fmt.Sprintf(" %.2f¥", total) diff --git a/frontend/src/components/stock.vue b/frontend/src/components/stock.vue index 0aab8f3..4a003c2 100644 --- a/frontend/src/components/stock.vue +++ b/frontend/src/components/stock.vue @@ -518,6 +518,9 @@ async function updateData(result) { //result.key=result.sort result.key=GetSortKey(result.sort,result["股票代码"]) results.value[GetSortKey(result.sort,result["股票代码"])]=result + if(!stocks.value.includes(result["股票代码"])) { + delete results.value[result.key] + } console.log("updateData",result) }