This commit is contained in:
2026-05-18 20:02:16 +08:00
parent 1565c4735f
commit 74cf99289f
14 changed files with 2250 additions and 237 deletions
@@ -0,0 +1,52 @@
---
name: frontend-migration
applyTo: "frontendNew/src/pages/Dcalc/Character/**/*.vue,frontendNew/src/stores/**/*.ts,frontendNew/src/api/**/*.ts"
description: "Use when migrating frontend Character pages to frontendNew, preserving config->execute->save flow, keeping /calc and IResult contract stable, and implementing same-page config+result with minimal behavior changes for Skill/Forge."
---
# Frontend Migration Rules (frontend -> frontendNew)
## Core Target
- 迁移目标是行为保真,不是推倒重做。
- 结果必须保持:配置变化可触发计算,结果区稳定刷新,配置可持久化。
## Required Data Flow
- 保持以下链路成立:
- config mutate
- Character 容器 watch config
- `result.execute()`
- `saveConfig()`
- 不在 Skill/Forge 子页直接做并发调度或替代容器级触发策略。
## API/Type Contract
- 不修改 `/calc` 入参与返回结构。
- 不破坏 `IResult` 的关键字段语义:`skills`、`info`、`suits`、`buffer`。
## Skill/Forge Migration Constraints
- Skill、Forge 优先沿用现有业务逻辑与限制条件(例如 VP/UP 数量限制、等级限制)。
- 允许替换 UI 结构与组件,但不改核心规则语义。
- 新行为必须可追踪到 `pushChangeSource`,便于结果回溯。
## Result Panel Requirements
- 必须具备 4 态:loading、error、empty、success。
- 同页可查看结果,不依赖跳页。
- 允许以 Tab 汇总展示(如详情/结果切换),但不得导致计算链路断开。
## Source of Truth
- 迁移策略以以下文件为准:
- [frontendNew Migration Plan](frontendNew/MIGRATION_PLAN.md)
- [角色信息与结果链路专项分析](frontend-角色信息与计算结果展示链路-专项分析.md)
- [装备技能打造交互与布局设计](frontend-装备技能打造-完整交互与布局设计文档.md)
## Existing Pattern to Reuse
- 优先参考已迁移页面模式:
- [EquipmentDictionary](frontendNew/src/pages/Dcalc/Character/EquipmentDictionary/Index.vue)
- [Character Container](frontendNew/src/pages/Dcalc/Character/Index.vue)
- [Config Store](frontendNew/src/stores/config.ts)