Compare commits
2 Commits
bb9d01bdf6
...
573d39696c
| Author | SHA1 | Date | |
|---|---|---|---|
| 573d39696c | |||
| ea55f9f08c |
@ -9,7 +9,7 @@ import type { AdvicePayload } from '../api/uuquant/models'
|
|||||||
import { useQuotaStore, type KlinePeriod } from '../stores/quota'
|
import { useQuotaStore, type KlinePeriod } from '../stores/quota'
|
||||||
import { useContractStore } from '../stores/contract'
|
import { useContractStore } from '../stores/contract'
|
||||||
import { useSettingsStore } from '../stores/settings'
|
import { useSettingsStore } from '../stores/settings'
|
||||||
import { isWsTradingSession } from '../utils/tradingDate'
|
import { isTradingDay, isWsTradingSession } from '../utils/tradingDate'
|
||||||
import { useTitleBlink } from './useTitleBlink'
|
import { useTitleBlink } from './useTitleBlink'
|
||||||
|
|
||||||
/** 全局额外关键字 + 当前合约关键字(合约段追加在后) */
|
/** 全局额外关键字 + 当前合约关键字(合约段追加在后) */
|
||||||
@ -137,10 +137,15 @@ export function useAiAdvice() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 一键获取建议:收集行情 / 新闻 / 持仓后提交 DeepSeek,返回真实 AI 建议。
|
* 一键获取建议:收集行情 / 新闻 / 持仓后提交 DeepSeek,返回真实 AI 建议。
|
||||||
* @param opts.silent 定时任务时静默:无 Key / 非开盘 / 进行中则跳过,成功不弹 toast
|
* @param opts.silent 定时任务时静默:无 Key / 周末 / 非开盘 / 进行中则跳过,成功不弹 toast
|
||||||
*/
|
*/
|
||||||
async function refresh(opts?: { silent?: boolean }) {
|
async function refresh(opts?: { silent?: boolean }) {
|
||||||
const silent = Boolean(opts?.silent)
|
const silent = Boolean(opts?.silent)
|
||||||
|
// 周末不分析(定时静默跳过;手动点击提示)
|
||||||
|
if (!isTradingDay()) {
|
||||||
|
if (!silent) ElMessage.warning('周末休市,暂不进行 AI 分析')
|
||||||
|
return
|
||||||
|
}
|
||||||
// 定时分析仅在开盘时段执行(与行情 WS 时段一致)
|
// 定时分析仅在开盘时段执行(与行情 WS 时段一致)
|
||||||
if (silent && !isWsTradingSession()) return
|
if (silent && !isWsTradingSession()) return
|
||||||
|
|
||||||
@ -192,6 +197,7 @@ export function useAiAdvice() {
|
|||||||
/** 距上次成功执行是否已满设定间隔(从未执行则视为应执行) */
|
/** 距上次成功执行是否已满设定间隔(从未执行则视为应执行) */
|
||||||
function shouldRunScheduled(): boolean {
|
function shouldRunScheduled(): boolean {
|
||||||
if (!settings.scheduledAnalysisEnabled) return false
|
if (!settings.scheduledAnalysisEnabled) return false
|
||||||
|
if (!isTradingDay()) return false
|
||||||
if (!isWsTradingSession()) return false
|
if (!isWsTradingSession()) return false
|
||||||
if (loading.value) return false
|
if (loading.value) return false
|
||||||
if (!settings.apiKey.trim()) return false
|
if (!settings.apiKey.trim()) return false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user