fix(frontend): 用户验收8项遗漏全补(并发中反馈漏处理对账)——①模拟/实盘改回必选档案(初始设计口径,提交拦截+必选文案)②backtest/new?class=all_weather.py&instance=1失败根治:档案类型按文件判非instance.type(老档案type不准)+组合页兼容class参数+CTA页组合档案自动重定向组合页(实测跳转+预填全通)③运行灯语义:有在跑→跳列表按档案过滤,无→创建页(用户'点带绿点按钮应看运行不该到参数页');组合档案隐藏回放按钮 ④代码编辑运行回测不好使:根因chain=dev缺GET file mock→读失败catch清code被当编辑→dirty卡死;三层修=补mock+catch走echoGrace+dirty改确认框(保存并跳/直接跳) ⑤模拟盘列表重设计对齐实盘(类型chip入名称行+新增策略/档案列+净值补日期) ⑥策略库去重复编辑代码按钮 ⑦模拟盘/实盘列表行加「快照」按钮→CodeSnapshotDrawer共享抽屉(发起时代码vs当前,MonacoDiff滚动联动);dev浏览器自验7项全过+927绿+build绿 [vps]
CI/CD / test (push) Successful in 16s
CI/CD / nas-deploy (push) Successful in 43s
CI/CD / nas-verify (push) Successful in 19s

This commit is contained in:
2026-08-16 08:25:57 +08:00
parent 11ccda271d
commit 23e1beb177
10 changed files with 231 additions and 28 deletions
+16
View File
@@ -16,6 +16,7 @@ interface InstLike {
interface FileLike {
name: string
class_name: string
type?: string
}
const route = useRoute()
@@ -137,6 +138,21 @@ onMounted(async () => {
])
instanceOptions.value = ins
classToFile.value = Object.fromEntries(fr.data.files.map((f) => [f.class_name, f.name]))
// 组合策略档案误入 CTA 回测页 → 重定向组合页(老链接 class=all_weather.py 场景)
const cls = route.query.class
const instId0 = route.query.instance
const inst = instId0 && !Array.isArray(instId0)
? ins.find((x) => x.id === Number(instId0))
: undefined
const probe = inst?.code_file || (typeof cls === 'string' && cls.includes('.') ? cls : '')
const probeFile = fr.data.files.find((f) => f.name === probe || f.name === `${probe}.py`)
if (probeFile?.type === 'portfolio') {
router.replace({
path: '/backtest/portfolio',
query: { strategy: probeFile.name.replace(/\.py$/, ''), ...(instId0 ? { instance: String(instId0) } : {}) },
})
return
}
} catch {
/* 档案下拉失败不阻塞 */
}
@@ -389,9 +389,9 @@ const fromTaskId = computed(() => (route.query.from_task as string) || '')
onMounted(async () => {
if (viewTaskId.value) {
loadResult(viewTaskId.value)
} else if (route.query.strategy) {
// 从代码编辑页「运行回测」跳转:按策略预填
form.strategy = String(route.query.strategy)
} else if (route.query.strategy || route.query.class) {
// 跳转预填:strategy=文件名去.py;兼容旧链接的 class=(可能是 all_weather.py 带后缀)
form.strategy = String(route.query.strategy || route.query.class).replace(/\.py$/, '')
} else if (fromTaskId.value) {
// 从任务列表「点任务ID」跳转:按该任务参数完整预填
void prefillFromTask(fromTaskId.value)