日内方向分析按钮自动先执行批量打分再调用AI分析
This commit is contained in:
@@ -7,10 +7,12 @@ import {
|
|||||||
type DailyDirection,
|
type DailyDirection,
|
||||||
type DailyDirectionRunResponse,
|
type DailyDirectionRunResponse,
|
||||||
} from '@/api/daily'
|
} from '@/api/daily'
|
||||||
|
import { runBatch } from '@/api/run'
|
||||||
|
|
||||||
const items = ref<DailyDirection[]>([])
|
const items = ref<DailyDirection[]>([])
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const running = ref(false)
|
const running = ref(false)
|
||||||
|
const runStep = ref('')
|
||||||
const runResult = ref<DailyDirectionRunResponse | null>(null)
|
const runResult = ref<DailyDirectionRunResponse | null>(null)
|
||||||
|
|
||||||
const symbolNames: Record<string, string> = {
|
const symbolNames: Record<string, string> = {
|
||||||
@@ -59,6 +61,9 @@ async function handleRun() {
|
|||||||
running.value = true
|
running.value = true
|
||||||
runResult.value = null
|
runResult.value = null
|
||||||
try {
|
try {
|
||||||
|
runStep.value = '正在拉取数据…'
|
||||||
|
await runBatch()
|
||||||
|
runStep.value = '正在 AI 分析…'
|
||||||
runResult.value = await runDailyDirection()
|
runResult.value = await runDailyDirection()
|
||||||
const ok = runResult.value?.results?.length ?? 0
|
const ok = runResult.value?.results?.length ?? 0
|
||||||
const fail = runResult.value?.errors?.length ?? 0
|
const fail = runResult.value?.errors?.length ?? 0
|
||||||
@@ -92,7 +97,7 @@ onMounted(fetchList)
|
|||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<h2>日内方向分析</h2>
|
<h2>日内方向分析</h2>
|
||||||
<el-button type="primary" :loading="running" @click="handleRun">
|
<el-button type="primary" :loading="running" @click="handleRun">
|
||||||
{{ running ? 'AI 分析中...' : '执行分析' }}
|
{{ running ? runStep : '执行分析' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user