From cc90cc69e2771060c92ad3f81f138ecab7b369d1 Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 12 Oct 2026 09:22:00 +0800 Subject: [PATCH] Refactor recurring investment preview and API response handling: - Remove `executionDateTime` from the preview modal and update the display to show `nextExecutionDate` and `nextExecutionTime`. - Adjust the API response structure for `next-execution` to align with the new fields. - Implement loading indicators for the preview button and modal during data fetching. - Update related documentation in `IMPACT_ANALYSIS.md` and `TASK_SUMMARY.md` for clarity on changes. --- IMPACT_ANALYSIS.md | 59 +++++++++++++++++++++++++++ TASK_SUMMARY.md | 15 +++++++ package.json | 2 +- src/types/scheduleInvestment.ts | 7 +--- src/views/RecurringInvestmentView.vue | 20 ++------- 5 files changed, 80 insertions(+), 23 deletions(-) diff --git a/IMPACT_ANALYSIS.md b/IMPACT_ANALYSIS.md index 9b4290b..b27329d 100644 --- a/IMPACT_ANALYSIS.md +++ b/IMPACT_ANALYSIS.md @@ -837,3 +837,62 @@ ### 5. 验证与测试 - `npm run build`;交易所切换、搜索、下拉滚动加载更多。 + +--- + +## 补充:下次执行预览移除执行时间行(2026-10-10) + +### 1. 改动概览 + +- **背景与目标**:预览弹窗不再展示 `executionDateTime`(`recurring.previewExecutionDateTime`)。 +- **涉及模块**:`RecurringInvestmentView.vue`。 +- **改动类型**:界面调整。 + +### 2. 方法级改动分析 + +| 位置 | 差异 | +|------|------| +| 下次执行预览 `
` | 删除 `executionDateTime` 的 `
`/`
`;接口数据仍可能返回该字段,仅不展示。 | + +### 3. 调用方与影响范围 + +- 仅预览弹窗展示;**破坏性变更**:否。 + +### 4. 风险与回滚 + +- **风险级别**:低;**回滚方式是否简单**:是(恢复两行模板)。 + +### 5. 验证与测试 + +- 打开「下次执行」预览,确认无「执行时间」行,其余字段正常。 + +--- + +## 补充:下次执行预览接口字段与加载态(2026-10-12) + +### 1. 改动概览 + +- **背景与目标**:`POST /trade/schedule-investment/plan/next-execution` 响应 `data` 调整为 `nextExecutionDate`、`nextExecutionTime`;预览弹窗同步展示;请求较慢时按钮与弹窗内展示 loading。 +- **涉及模块**:`src/types/scheduleInvestment.ts`、`RecurringInvestmentView.vue`。 +- **改动类型**:缺陷修复 / 界面调整。 + +### 2. 方法级改动分析 + +| 位置 | 差异 | +|------|------| +| `ScheduleInvestmentNextExecutionData` | 移除 `scheduledDate`、`executionDate`、`executionDateTime`、`deferred`、`ctOffsetMinutes`;改为 `nextExecutionDate`、`nextExecutionTime`。 | +| `openNextExecutionPreview` | 请求期间按钮 loading;数据返回后再打开弹窗。 | +| 预览弹窗模板 | 仅展示下次执行日、执行时间。 | +| 「预览下次执行」按钮 | `:loading="nextExecutionPreviewLoading"`。 | + +### 3. 调用方与影响范围 + +- 仅创建表单预览流程;**破坏性变更**:是(依赖旧响应字段的前端逻辑已移除,与当前后端契约一致)。 + +### 4. 风险与回滚 + +- **风险级别**:低;**回滚方式是否简单**:是(恢复类型与模板)。 + +### 5. 验证与测试 + +- 填妥交易所与周期后点「预览下次执行」:按钮 loading、弹窗内 loading,成功后显示日期与时间;接口失败时弹窗关闭且已有错误提示。 diff --git a/TASK_SUMMARY.md b/TASK_SUMMARY.md index 86c66c3..ad6c678 100644 --- a/TASK_SUMMARY.md +++ b/TASK_SUMMARY.md @@ -255,3 +255,18 @@ - `getSimpleStockPage` 每页 50 条;下拉触底 `loadMore` 追加,搜索仍防抖并重置页码。 - 验证:`npm run build`;参见 `IMPACT_ANALYSIS.md` 对应补充。 + +--- + +## 补充:下次执行预览去掉执行时间(2026-10-10) + +- 预览弹窗移除 `previewExecutionDateTime` / `executionDateTime` 展示行。 +- 参见 `IMPACT_ANALYSIS.md` 对应补充。 + +--- + +## 补充:下次执行预览新接口字段与 loading(2026-10-12) + +- `next-execution` 响应改为 `nextExecutionDate`、`nextExecutionTime`;弹窗仅展示「下次执行日」「执行时间」。 +- 请求期间仅按钮 `:loading`;数据返回后再打开弹窗。 +- 参见 `IMPACT_ANALYSIS.md` 对应补充。 diff --git a/package.json b/package.json index 25b8758..dde9398 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "schedule-invest-plan", + "name": "recurring-investment", "private": true, "version": "0.0.0", "type": "module", diff --git a/src/types/scheduleInvestment.ts b/src/types/scheduleInvestment.ts index 4b950a3..dc431eb 100644 --- a/src/types/scheduleInvestment.ts +++ b/src/types/scheduleInvestment.ts @@ -125,11 +125,8 @@ export interface ScheduleInvestmentNextExecutionRequest { /** `POST /trade/schedule-investment/plan/next-execution` 响应 data */ export interface ScheduleInvestmentNextExecutionData { - scheduledDate: string - executionDate: string - executionDateTime: string - deferred: boolean - ctOffsetMinutes: number + nextExecutionDate: string + nextExecutionTime: string } /** 计划详情 — plan 字段(比列表项更全) */ diff --git a/src/views/RecurringInvestmentView.vue b/src/views/RecurringInvestmentView.vue index 7d51881..c46722e 100644 --- a/src/views/RecurringInvestmentView.vue +++ b/src/views/RecurringInvestmentView.vue @@ -1615,24 +1615,10 @@ const previewOffset = computed(() => @closed="onNextExecutionPreviewClosed" >
-
{{ t('recurring.previewScheduledDate') }}
-
{{ nextExecutionPreview.scheduledDate || '—' }}
-
{{ t('recurring.previewExecutionDate') }}
-
{{ nextExecutionPreview.executionDate || '—' }}
+
{{ t('recurring.planDetail.nextExecution') }}
+
{{ nextExecutionPreview.nextExecutionDate || '—' }}
{{ t('recurring.previewExecutionDateTime') }}
-
{{ nextExecutionPreview.executionDateTime || '—' }}
-
{{ t('recurring.previewDeferred') }}
-
- {{ - nextExecutionPreview.deferred - ? t('recurring.previewDeferredYes') - : t('recurring.previewDeferredNo') - }} -
-
{{ t('recurring.ctOffsetLabel') }}
-
- {{ t('recurring.ctOffsetPreview', { n: nextExecutionPreview.ctOffsetMinutes }) }} -
+
{{ nextExecutionPreview.nextExecutionTime || '—' }}