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.
This commit is contained in:
@@ -837,3 +837,62 @@
|
|||||||
### 5. 验证与测试
|
### 5. 验证与测试
|
||||||
|
|
||||||
- `npm run build`;交易所切换、搜索、下拉滚动加载更多。
|
- `npm run build`;交易所切换、搜索、下拉滚动加载更多。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 补充:下次执行预览移除执行时间行(2026-10-10)
|
||||||
|
|
||||||
|
### 1. 改动概览
|
||||||
|
|
||||||
|
- **背景与目标**:预览弹窗不再展示 `executionDateTime`(`recurring.previewExecutionDateTime`)。
|
||||||
|
- **涉及模块**:`RecurringInvestmentView.vue`。
|
||||||
|
- **改动类型**:界面调整。
|
||||||
|
|
||||||
|
### 2. 方法级改动分析
|
||||||
|
|
||||||
|
| 位置 | 差异 |
|
||||||
|
|------|------|
|
||||||
|
| 下次执行预览 `<dl>` | 删除 `executionDateTime` 的 `<dt>`/`<dd>`;接口数据仍可能返回该字段,仅不展示。 |
|
||||||
|
|
||||||
|
### 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,成功后显示日期与时间;接口失败时弹窗关闭且已有错误提示。
|
||||||
|
|||||||
@@ -255,3 +255,18 @@
|
|||||||
|
|
||||||
- `getSimpleStockPage` 每页 50 条;下拉触底 `loadMore` 追加,搜索仍防抖并重置页码。
|
- `getSimpleStockPage` 每页 50 条;下拉触底 `loadMore` 追加,搜索仍防抖并重置页码。
|
||||||
- 验证:`npm run build`;参见 `IMPACT_ANALYSIS.md` 对应补充。
|
- 验证:`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` 对应补充。
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "schedule-invest-plan",
|
"name": "recurring-investment",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -125,11 +125,8 @@ export interface ScheduleInvestmentNextExecutionRequest {
|
|||||||
|
|
||||||
/** `POST /trade/schedule-investment/plan/next-execution` 响应 data */
|
/** `POST /trade/schedule-investment/plan/next-execution` 响应 data */
|
||||||
export interface ScheduleInvestmentNextExecutionData {
|
export interface ScheduleInvestmentNextExecutionData {
|
||||||
scheduledDate: string
|
nextExecutionDate: string
|
||||||
executionDate: string
|
nextExecutionTime: string
|
||||||
executionDateTime: string
|
|
||||||
deferred: boolean
|
|
||||||
ctOffsetMinutes: number
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 计划详情 — plan 字段(比列表项更全) */
|
/** 计划详情 — plan 字段(比列表项更全) */
|
||||||
|
|||||||
@@ -1615,24 +1615,10 @@ const previewOffset = computed(() =>
|
|||||||
@closed="onNextExecutionPreviewClosed"
|
@closed="onNextExecutionPreviewClosed"
|
||||||
>
|
>
|
||||||
<dl v-if="nextExecutionPreview" class="ri-preview">
|
<dl v-if="nextExecutionPreview" class="ri-preview">
|
||||||
<dt>{{ t('recurring.previewScheduledDate') }}</dt>
|
<dt>{{ t('recurring.planDetail.nextExecution') }}</dt>
|
||||||
<dd class="num">{{ nextExecutionPreview.scheduledDate || '—' }}</dd>
|
<dd class="num">{{ nextExecutionPreview.nextExecutionDate || '—' }}</dd>
|
||||||
<dt>{{ t('recurring.previewExecutionDate') }}</dt>
|
|
||||||
<dd class="num">{{ nextExecutionPreview.executionDate || '—' }}</dd>
|
|
||||||
<dt>{{ t('recurring.previewExecutionDateTime') }}</dt>
|
<dt>{{ t('recurring.previewExecutionDateTime') }}</dt>
|
||||||
<dd class="num">{{ nextExecutionPreview.executionDateTime || '—' }}</dd>
|
<dd class="num">{{ nextExecutionPreview.nextExecutionTime || '—' }}</dd>
|
||||||
<dt>{{ t('recurring.previewDeferred') }}</dt>
|
|
||||||
<dd>
|
|
||||||
{{
|
|
||||||
nextExecutionPreview.deferred
|
|
||||||
? t('recurring.previewDeferredYes')
|
|
||||||
: t('recurring.previewDeferredNo')
|
|
||||||
}}
|
|
||||||
</dd>
|
|
||||||
<dt>{{ t('recurring.ctOffsetLabel') }}</dt>
|
|
||||||
<dd class="num">
|
|
||||||
{{ t('recurring.ctOffsetPreview', { n: nextExecutionPreview.ctOffsetMinutes }) }}
|
|
||||||
</dd>
|
|
||||||
</dl>
|
</dl>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="closeNextExecutionPreview">{{ t('recurring.back') }}</el-button>
|
<el-button @click="closeNextExecutionPreview">{{ t('recurring.back') }}</el-button>
|
||||||
|
|||||||
Reference in New Issue
Block a user