Refactor recurring investment form and API payloads:
- Simplify the creation form by removing price type and CT offset fields, defaulting to market orders. - Update `buildScheduleInvestmentCreateBody` and related functions to handle new payload structure with `ctOffsetMinutes` set to null. - Consolidate end type options into a dropdown, integrating 'GTC' as a selection. - Adjust internationalization files to reflect new labels and hints for the updated form. - Document changes in `IMPACT_ANALYSIS.md` and `TASK_SUMMARY.md` for clarity on the updates.
This commit is contained in:
+69
-1
@@ -239,7 +239,7 @@
|
||||
| 位置 | 差异 |
|
||||
|------|------|
|
||||
| 表单 | 新增 `investmentType`、`orderPriceType`、`frequencyType`、`frequencyDay`、`ctOffsetMinutes`;按金额/数量切换输入;周期仅 DAILY/WEEKLY/MONTHLY。 |
|
||||
| `buildScheduleInvestmentCreateBody` | 将表单映射为 `ScheduleInvestmentCreateBody`(含 `endType` DATE/COUNT/NONE、`totalExecutionCount`、`productCode`)。 |
|
||||
| `buildScheduleInvestmentCreateBody` | 将表单映射为 `ScheduleInvestmentCreateBody`(含 `endType` NO_END/END_DATE/COUNT、`totalExecutionCount`、`productCode`)。 |
|
||||
| `createScheduleInvestmentPlan` | `POST /trade/schedule-investment/plan/create`;确认建立时调用,成功后仍写入本地示例列表。 |
|
||||
|
||||
### 3. 调用方与影响范围
|
||||
@@ -1017,3 +1017,71 @@
|
||||
- 移动宽:执行记录为卡片,无横向挤压。
|
||||
- 平板 / 窄桌面:表格可横滑,见提示文案;首列固定。
|
||||
- 宽桌面:弹窗加宽后六列表格可读。
|
||||
|
||||
---
|
||||
|
||||
## 补充:创建表单隐藏价格类型与 CT 偏移(2026-10-13)
|
||||
|
||||
### 1. 改动概览
|
||||
|
||||
- **背景与目标**:创建计划固定市价单,不再展示「订单价格类型」「交易时间偏移」;创建与「预览下次执行」请求显式传 `ctOffsetMinutes: null`(待后端支持缺省/0 后可再调整)。
|
||||
- **涉及模块**:`RecurringInvestmentView.vue`、`scheduleInvestmentPayload.ts`、`scheduleInvestment.ts` 类型、三语 `recurring.*`。
|
||||
- **改动类型**:功能调整(表单简化)。
|
||||
|
||||
### 2. 方法级改动分析
|
||||
|
||||
| 位置 | 差异 |
|
||||
|------|------|
|
||||
| 创建表单 UI | 移除价格类型、限价、CT 偏移控件;投资金额/数量下增加 `orderPriceTypeMarketHint`。 |
|
||||
| `buildScheduleInvestmentCreateBody` | 固定 `ctOffsetMinutes: null`;`orderPriceType` 固定 `MARKET`。 |
|
||||
| `buildNextExecutionPreviewBody` | 固定 `ctOffsetMinutes: null`。 |
|
||||
| `ScheduleInvestmentCreateBody` | `ctOffsetMinutes: number \| null`,创建时传 `null`。 |
|
||||
| 确认弹窗 | 移除 CT 偏移预览行;仍展示订单价格类型(市价)。 |
|
||||
| `getScheduleInvestmentCtTimeOptions` | 创建表单不再调用(详情仍可读接口返回的偏移)。 |
|
||||
|
||||
### 3. 调用方与影响范围
|
||||
|
||||
- 仅创建/预览路径;计划详情、列表仍展示后端返回的 `ctOffsetMinutes`。
|
||||
- **破坏性变更**:否(对外接口字段减少可选传参,行为与产品约定一致)。
|
||||
|
||||
### 4. 风险与回滚
|
||||
|
||||
- **风险级别**:低;依赖后端对缺省 `ctOffsetMinutes` 的处理与文档一致。
|
||||
- **回滚方式是否简单**:是(恢复表单项与 payload 字段即可)。
|
||||
|
||||
### 5. 验证与测试
|
||||
|
||||
- `npm run build` 通过。
|
||||
- 创建表单:无价格类型/偏移字段,金额下有两行 hint;预览下次执行仅需交易所与周期。
|
||||
- 网络:create / next-execution 请求体 `ctOffsetMinutes` 为 `null`。
|
||||
|
||||
---
|
||||
|
||||
## 补充:结束类型 GTC 下拉项(2026-10-13)
|
||||
|
||||
- **背景**:将「无结束日期」勾选并入结束类型 `el-select`,文案为「GTC」。
|
||||
- **改动类型**:功能优化(UI/表单)。
|
||||
|
||||
### 2. 方法级改动分析
|
||||
|
||||
| 位置 | 差异 |
|
||||
|------|------|
|
||||
| `EndMode` | 新增 `'none'`。 |
|
||||
| `RecurringInvestmentView` | `endModeOptions` 含 date / none / count;移除 `noEnd` 表单项与勾选框;`date` 模式必填结束日期。 |
|
||||
| `resolveEndType` | `none`→`NO_END`、`date`→`END_DATE`、`count`→`COUNT`。 |
|
||||
| `scheduleInvestmentPlanMapper` | API `NO_END`(兼容 `NONE`)映射 `endMode: 'none'`。 |
|
||||
| i18n | `recurring.endByGtc`、`recurring.endGtcHint`。 |
|
||||
|
||||
### 3. 调用方与影响范围
|
||||
|
||||
- 创建计划、确认预览、列表/详情结束条件展示文案统一为 GTC 选项。
|
||||
- **破坏性变更**:是(创建请求 `endType` 由 `NONE`/`DATE` 改为 `NO_END`/`END_DATE`;列表仍兼容旧枚举读取)。
|
||||
|
||||
### 4. 风险与回滚
|
||||
|
||||
- **风险级别**:低。
|
||||
- **回滚方式是否简单**:是。
|
||||
|
||||
### 5. 验证与测试
|
||||
|
||||
- `npm run build`;表单三种结束类型切换与提交 payload `endType` 符合预期。
|
||||
|
||||
Reference in New Issue
Block a user