fix(monitor+frontend): 审计剩余认同件批——T-1 watch_targets_union 真调 poll_once(旧版重抄实现自证恒绿;补 DUAL 双源路径覆盖例)/storm 读不动文件计 unreadable_files 入 evidence 不静默(P3 漏报向,灯色不动)/no_restart CreationDate 解析失败计违例=保守向复核留痕/_dual_track_pairs 兼返 unpaired 清单+零配对不再伪装 no-live-desk(可见性收敛,灯色不动)/weekday 死闸门随迁退役(monitor 门+registry docstring)/前端存量红 4 例清零(Result+TradesTable 空表渲染路径 scope 守卫+两断言对齐现 UI:收益概述已改指标卡/时间选择器已收编 head-meta, vitest 22 文件 67/67 绿);spec §4.1/§4.2-4,9/§9.A-17/§12 随码 [vps]
CI/CD / test (push) Successful in 46s
CI/CD / nas-deploy (push) Has been cancelled
CI/CD / nas-verify (push) Has been cancelled

This commit is contained in:
2026-10-05 12:51:10 +08:00
parent bda62d64db
commit 93d7acef50
9 changed files with 120 additions and 47 deletions
+6 -6
View File
@@ -36,22 +36,22 @@ function dirClass(d: string): string {
<template>
<el-table :data="trades" stripe size="small" empty-text="无成交">
<el-table-column label="时间" width="150">
<template #default="{ row }"><span class="mono">{{ fmtDate(row.datetime) }}</span></template>
<template #default="scope"><span v-if="scope?.row" class="mono">{{ fmtDate(scope.row.datetime) }}</span></template>
</el-table-column>
<el-table-column label="方向" width="70">
<template #default="{ row }"><span :class="dirClass(row.direction)">{{ fmtDir(row.direction) }}</span></template>
<template #default="scope"><span v-if="scope?.row" :class="dirClass(scope.row.direction)">{{ fmtDir(scope.row.direction) }}</span></template>
</el-table-column>
<el-table-column label="开平" width="70">
<template #default="{ row }">{{ fmtOff(row.offset) }}</template>
<template #default="scope"><span v-if="scope?.row">{{ fmtOff(scope.row.offset) }}</span></template>
</el-table-column>
<el-table-column label="价格" width="100" align="right">
<template #default="{ row }"><span class="mono">{{ row.price }}</span></template>
<template #default="scope"><span v-if="scope?.row" class="mono">{{ scope.row.price }}</span></template>
</el-table-column>
<el-table-column label="数量" width="90" align="right">
<template #default="{ row }"><span class="mono">{{ row.volume }}</span></template>
<template #default="scope"><span v-if="scope?.row" class="mono">{{ scope.row.volume }}</span></template>
</el-table-column>
<el-table-column label="标的" min-width="100">
<template #default="{ row }"><span class="mono">{{ row.vt_symbol }}</span></template>
<template #default="scope"><span v-if="scope?.row" class="mono">{{ scope.row.vt_symbol }}</span></template>
</el-table-column>
</el-table>
</template>
+11 -8
View File
@@ -110,7 +110,7 @@ describe('Result.vue', () => {
expect(wrapper.find('.metric-cards').exists()).toBe(true)
})
it('renders time range selector', async () => {
it('renders time range in head meta', async () => {
vi.mocked(backtestApi.getResult).mockResolvedValue({
task_id: 'test-task-2',
statistics: {},
@@ -142,11 +142,14 @@ describe('Result.vue', () => {
// Wait for async data loading
await new Promise(resolve => setTimeout(resolve, 100))
// Check if time range selector exists
expect(wrapper.find('.time-range-selector').exists()).toBe(true)
// UI 改版对齐(10-05): 选择器控件已收编为 head-meta 静态区间文本
const meta = wrapper.find('.head-meta')
expect(meta.exists()).toBe(true)
expect(meta.text()).toContain('2024-01-01')
expect(meta.text()).toContain('2024-01-03')
})
it('renders four tabs', async () => {
it('renders three detail tabs', async () => {
vi.mocked(backtestApi.getResult).mockResolvedValue({
task_id: 'test-task-3',
statistics: {},
@@ -178,12 +181,12 @@ describe('Result.vue', () => {
// Wait for async data loading
await new Promise(resolve => setTimeout(resolve, 100))
// Check if the component contains tab labels by looking at text content
// UI 改版对齐(10-05): 收益概述→顶部指标卡(前一用例已断言), 现存三 tab
const html = wrapper.html()
expect(html).toContain('收益概述')
expect(html).toContain('交易详情')
expect(html).toContain('每日持仓&收益')
expect(html).toContain('日志输出')
expect(html).toContain('每日收益')
expect(html).toContain('系统日志')
expect(html).not.toContain('收益概述') // 防 tab 回退混淆指标卡
})
it('renders chart containers', async () => {
+2 -2
View File
@@ -263,10 +263,10 @@ function onExport(): void {
<el-card shadow="never">
<el-table :data="pnl" size="small" height="420" empty-text="无数据">
<el-table-column label="日期" width="140">
<template #default="{ row }"><span class="mono">{{ fmtDate(row.date) }}</span></template>
<template #default="scope"><span v-if="scope?.row" class="mono">{{ fmtDate(scope.row.date) }}</span></template>
</el-table-column>
<el-table-column label="日收益 (‱)" width="140" align="right">
<template #default="{ row }"><span class="mono" :class="fmtPnlClass(row.pnl)">{{ fmtPnl(row.pnl) }}</span></template>
<template #default="scope"><span v-if="scope?.row" class="mono" :class="fmtPnlClass(scope.row.pnl)">{{ fmtPnl(scope.row.pnl) }}</span></template>
</el-table-column>
</el-table>
</el-card>