From ea55f9f08c1bf321eb982dfb52982e3123f63946 Mon Sep 17 00:00:00 2001 From: dongzp <975303544@qq.com> Date: Sat, 25 Jul 2026 11:21:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E=E5=B7=A5=E4=BD=9C=E6=97=A5=E8=B7=B3?= =?UTF-8?q?=E8=BF=87AI=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useAiAdvice.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/composables/useAiAdvice.ts b/src/composables/useAiAdvice.ts index f3a78d5..3b37344 100644 --- a/src/composables/useAiAdvice.ts +++ b/src/composables/useAiAdvice.ts @@ -9,7 +9,7 @@ import type { AdvicePayload } from '../api/uuquant/models' import { useQuotaStore, type KlinePeriod } from '../stores/quota' import { useContractStore } from '../stores/contract' import { useSettingsStore } from '../stores/settings' -import { isWsTradingSession } from '../utils/tradingDate' +import { isTradingDay, isWsTradingSession } from '../utils/tradingDate' import { useTitleBlink } from './useTitleBlink' /** 全局额外关键字 + 当前合约关键字(合约段追加在后) */ @@ -137,10 +137,15 @@ export function useAiAdvice() { /** * 一键获取建议:收集行情 / 新闻 / 持仓后提交 DeepSeek,返回真实 AI 建议。 - * @param opts.silent 定时任务时静默:无 Key / 非开盘 / 进行中则跳过,成功不弹 toast + * @param opts.silent 定时任务时静默:无 Key / 周末 / 非开盘 / 进行中则跳过,成功不弹 toast */ async function refresh(opts?: { silent?: boolean }) { const silent = Boolean(opts?.silent) + // 周末不分析(定时静默跳过;手动点击提示) + if (!isTradingDay()) { + if (!silent) ElMessage.warning('周末休市,暂不进行 AI 分析') + return + } // 定时分析仅在开盘时段执行(与行情 WS 时段一致) if (silent && !isWsTradingSession()) return @@ -192,6 +197,7 @@ export function useAiAdvice() { /** 距上次成功执行是否已满设定间隔(从未执行则视为应执行) */ function shouldRunScheduled(): boolean { if (!settings.scheduledAnalysisEnabled) return false + if (!isTradingDay()) return false if (!isWsTradingSession()) return false if (loading.value) return false if (!settings.apiKey.trim()) return false