From 74c66341869ed40ee20b555fb7af12214151ba7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E7=93=9C=C2=B0?= Date: Sat, 11 Jul 2026 11:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontendNew/MIGRATION_FUNCTION_MATRIX.md | 16 ++ frontendNew/MIGRATION_PLAN.md | 80 +++---- frontendNew/MIGRATION_REGRESSION_CHECKLIST.md | 76 +++---- .../components/dnf/Equipment/List/index.vue | 4 +- .../components/dnf/Equipment/Oath/index.vue | 6 +- .../Character/EquipmentDictionary/Index.vue | 24 ++- .../components/EquipmentCell.vue | 9 +- .../src/pages/Dcalc/Character/Forge/index.vue | 105 +++++++++- .../src/pages/Dcalc/Character/Index.vue | 95 +++------ .../pages/Dcalc/Character/Skill/img/add.svg | 1 + .../pages/Dcalc/Character/Skill/img/max.svg | 1 + .../pages/Dcalc/Character/Skill/img/min.svg | 1 + .../pages/Dcalc/Character/Skill/img/sub.svg | 1 + .../src/pages/Dcalc/Character/Skill/index.vue | 152 ++++++++------ frontendNew/src/pages/Dcalc/Home/Index.vue | 44 ++++ frontendNew/src/stores/config.ts | 71 +++---- frontendNew/src/stores/info.ts | 12 +- scripts/image.js | 196 +++++++++++++++--- 18 files changed, 594 insertions(+), 300 deletions(-) create mode 100644 frontendNew/MIGRATION_FUNCTION_MATRIX.md create mode 100644 frontendNew/src/pages/Dcalc/Character/Skill/img/add.svg create mode 100644 frontendNew/src/pages/Dcalc/Character/Skill/img/max.svg create mode 100644 frontendNew/src/pages/Dcalc/Character/Skill/img/min.svg create mode 100644 frontendNew/src/pages/Dcalc/Character/Skill/img/sub.svg diff --git a/frontendNew/MIGRATION_FUNCTION_MATRIX.md b/frontendNew/MIGRATION_FUNCTION_MATRIX.md new file mode 100644 index 00000000..29693a6a --- /dev/null +++ b/frontendNew/MIGRATION_FUNCTION_MATRIX.md @@ -0,0 +1,16 @@ +# frontend -> frontendNew function matrix + +| Capability | frontend baseline | frontendNew acceptance | +| --- | --- | --- | +| Home and role entry | Select a role and open its calculator | `/dcalc/home` opens the selected role under `/dcalc/character/:alter/equipment` | +| Assistant | Bind ID, list roles, import build data | Bind, refresh, role-targeted import, and ID import preserve the same API payloads | +| Equipment | Select/toggle equipment by category and bulk-wear a suit rarity | Weapon, subweapon, suit, universal, title/pet, treasure, oath, trigger options, preview, and idempotent bulk wear work | +| Skill | Edit level, VP, UP, awakening, and import code | Writes the same `config.skills` and `bindAwake` fields, then recalculates | +| Forge | Edit equipment, oath, avatar, emblem, jade, and global fields | Writes the same config fields, persists, recalculates, and records source changes | +| Result | Inspect equipment/oath, skills, baseline, and skill counts | Full detail route plus one local summary panel; baseline, deltas, retries, states, and sorting work | +| Persistence | Per-role config and skill counts survive reload | Uses unchanged `dcalc//config` and `dcalc//config/skillCount` keys | + +## Non-baseline additions retained + +- DNF VP routes and pages remain exclusive to `frontendNew`. +- Legacy URLs are intentionally unsupported; no redirect or alias is part of acceptance. diff --git a/frontendNew/MIGRATION_PLAN.md b/frontendNew/MIGRATION_PLAN.md index cdff3bed..0b2f644e 100644 --- a/frontendNew/MIGRATION_PLAN.md +++ b/frontendNew/MIGRATION_PLAN.md @@ -1,60 +1,34 @@ -# frontend -> frontendNew 迁移计划(执行中) +# frontend -> frontendNew migration status -## 目标 +## Completed scope -- 以 frontendNew 为主线承接 dcalc 核心能力。 -- 已完成的 equipment 作为基线,不重做主体,仅做一致性优化。 -- 当前优先迁移 Skill、Forge、Result,策略为“核心功能优先,视觉后置”。 -- 迁移期间保持 frontend 与 frontendNew 双端并行可用。 +- `frontendNew` is the only supported application surface. Character routes are under + `/dcalc/character/:alter/(equipment|skill|forge|result)`; legacy `frontend` URLs are not + redirected or maintained. +- The existing API contracts, Pinia configuration schema, and `dcalc//config` storage + keys remain unchanged. +- Equipment, Skill, Forge, imports, result details, baseline comparison, and change-source logs + are implemented in `frontendNew`. -## 当前状态 +## Parity safeguards added -- 已完成:`Character/EquipmentDictionary` 主体迁移并接入路由。 -- 进行中:`Character/Skill`、`Character/Forge` 从占位页向可编辑页迁移。 -- 新启动:`Character/Result` 结果面板接入与自动计算链路。 +- Suite double-click now applies the selected rarity as an idempotent bulk wear operation for both + equipment and oaths. It never toggles already equipped items off. +- Equipment choices and bulk wear actions append a single `Equipment` change-source record; Skill, + Forge, and import actions keep their existing records. +- Character configuration changes are debounced and serialized. A change received during an active + calculation queues one follow-up calculation and every completed attempt persists the latest + configuration. +- Character switches reset in-memory configuration and skill counts before loading that role's + persisted data. Stale character responses are ignored by their `Alter-Token`. +- The unused global result sheet was removed from the Character shell. Equipment, Skill, and Forge + retain their one local summary panel; `/result` remains the full calculation-detail route. -## 分阶段计划 +## Out of scope -### Phase 1 - 共享链路打通 +- Legacy `frontend` build errors and its uncommitted files are not modified. +- DNF VP remains a `frontendNew`-only feature. +- No backend API, request payload, configuration field, or local-storage migration is introduced. -1. 统一 Character 页角色加载、配置变更监听、结果自动计算触发。 -2. 将结果面板并入 Character 页面,形成“配置 + 结果”并行布局。 -3. 统一配置持久化触发点,保障刷新后状态可恢复。 - -### Phase 2 - Skill MVP - -1. 完成技能列表、搜索、基础 VP/UP 配置回写。 -2. 先确保写入 `configStore.config.skills`,后补复杂交互约束。 -3. 目标:可参与结果计算。 - -### Phase 3 - Forge MVP - -1. 子模块优先级:Equipments > Avatars > Oaths > Emblems/Jades/Sundry。 -2. 每个子模块完成即验证配置回写和计算结果联动。 -3. 目标:关键打造项可编辑并进入计算。 - -### Phase 4 - Result MVP - -1. 展示基础属性、套装/誓约信息、技能伤害列表。 -2. 支持伤害排序和基准设定/清空。 -3. 第二轮补技能次数编辑、Buffer 细分、高级对比。 - -### Phase 5 - 一致性优化与回归 - -1. 统一加载态/空态/错误态文案。 -2. 双端同角色同配置结果比对,输出差异清单。 -3. 阻塞级问题清零后进入主用切换。 - -## 验收标准 - -1. 路由可用:`/dcalc/character/:alter/equipment|skill|forge`。 -2. 数据可用:Skill 与 Forge 配置改动能触发结果刷新。 -3. 结果可用:Result 面板稳定展示基础属性与技能伤害。 -4. 持久化可用:刷新后配置不丢失。 -5. 双端可比对:关键字段(伤害、套装、核心属性)一致。 - -## 本次提交范围(已执行) - -1. 新增本计划文档。 -2. 新增 Result MVP 组件并接入 Character 页面。 -3. 在 Character 页面接入配置变更自动计算与离开页面自动保存。 +See [MIGRATION_FUNCTION_MATRIX.md](./MIGRATION_FUNCTION_MATRIX.md) and +[MIGRATION_REGRESSION_CHECKLIST.md](./MIGRATION_REGRESSION_CHECKLIST.md) for acceptance coverage. diff --git a/frontendNew/MIGRATION_REGRESSION_CHECKLIST.md b/frontendNew/MIGRATION_REGRESSION_CHECKLIST.md index 654abca6..8567f15f 100644 --- a/frontendNew/MIGRATION_REGRESSION_CHECKLIST.md +++ b/frontendNew/MIGRATION_REGRESSION_CHECKLIST.md @@ -1,56 +1,40 @@ -# Character Migration Regression Checklist +# Character migration regression checklist -Last updated: 2026-05-28 -Scope: frontendNew Character module (Equipment / Skill / Forge / Result) +Last updated: 2026-07-10 -## 1. Skill page +## Routes and imports -- [ ] Enter Skill page and switch between `结果面板` and `技能详情`. -- [ ] Verify there is only one visible result panel in Skill page. -- [ ] Change at least one skill level and confirm result recalculates automatically. -- [ ] Set and clear baseline in result panel. +- [ ] Open `/dcalc/home`, select a role, and enter Equipment, Skill, Forge, and Result. +- [ ] Bind an assistant account, refresh its role list, and import a selected role through `roleId`. +- [ ] Import a build by community ID and a skill build by skill code; verify the result refreshes. -## 2. Forge page +## Equipment and oath configuration -- [ ] Enter Forge page and switch between `结果面板` and `配置编辑`. -- [ ] In mobile width, use accordion module groups to switch `装备打造 / 誓约 / 时装徽章 / 全局`. -- [ ] Edit reinforce/refine/adaptation and confirm result recalculates automatically. -- [ ] Trigger quick reset and confirm change source logs are appended. +- [ ] Select and deselect weapon, subweapon (where supported), suit, universal, title/pet, treasure, + oath suit, oath universal, and other oath entries. +- [ ] Change trigger options, preview equipment, select an oath skill, and move preview suit/oath levels. +- [ ] Select a suit rarity, double-click a suit icon, and verify all matching pieces are worn. +- [ ] Repeat the double-click action and verify pieces remain worn rather than being toggled off. +- [ ] Verify the latest Equipment change-source record describes the single or bulk action. -## 3. Result states (4-state) +## Skill, forge, and result -- [ ] Loading: trigger compute and confirm loading state appears. -- [ ] Error: simulate invalid calculation and confirm retry button appears. -- [ ] Empty: clear config to no-result state and confirm empty hint appears. -- [ ] Success: valid config renders result summary and details. +- [ ] Change skill levels, VP/UP selections, and bound awakening; verify exactly one eventual recalculation. +- [ ] Edit equipment forging, oath adaptation, avatar, emblems, jade, and global options; refresh and + confirm persistence. +- [ ] Switch quickly between two roles, including one without saved data; verify neither equipment + configuration nor skill-count overrides leak from the previous role. +- [ ] Verify Result states: loading, error/retry, empty, and successful detail rendering. +- [ ] Set a baseline, change skill counts, verify total and row deltas, then clear the baseline. +- [ ] Confirm the result summary appears once per Equipment, Skill, and Forge page, while `/result` + shows the full detail view. -## 4. Baseline comparison +## Automated validation -- [ ] Set current result as baseline and verify delta labels update. -- [ ] Modify skill counts and verify total diff and row diff update. -- [ ] Clear baseline and verify diff falls back to absolute values. +```sh +cd frontendNew +pnpm type-check +pnpm build +``` -## 5. Change source logs - -- [ ] Perform updates in Equipment / Skill / Forge and verify source names and details. -- [ ] Verify log list is scrollable and supports clear action. -- [ ] Confirm latest records appear first. - -## 6. This iteration patches - -- [x] CalcDetail left panel switched to accordion groups. -- [x] Forge config module selector supports mobile accordion groups. -- [x] Forge form density reduced for small screens (`text-xs`, compact paddings). - -## 7. Sidebar helper binding UX - -- [ ] Without helper binding, sidebar user section should show placeholder name and guide text. -- [ ] Dropdown should provide `绑定/同步助手` entry and open `/dcalc/dnfhelper`. -- [ ] `取消绑定` should clear helper info via store logout action. -- [x] dnfhelper store keeps backward-compatible `refleshHelperInfo` alias. - -## Validation commands - -- `cd frontendNew && pnpm type-check` -- `cd frontendNew && pnpm lint` -- `cd frontendNew && pnpm build` +Both commands passed locally on 2026-07-10 using the installed project dependencies. diff --git a/frontendNew/src/components/dnf/Equipment/List/index.vue b/frontendNew/src/components/dnf/Equipment/List/index.vue index c8eef417..2223b334 100644 --- a/frontendNew/src/components/dnf/Equipment/List/index.vue +++ b/frontendNew/src/components/dnf/Equipment/List/index.vue @@ -72,9 +72,7 @@ const partName = (part: string) => {