fix: stocks 字段支持对象格式 {code, name}

- investment.ts: stocks 类型改为 Array<{code, name} | string>
  - EventFormModal: 编辑时兼容对象格式,保存时附带股票名称
This commit is contained in:
zdl
2025-12-05 18:24:18 +08:00
parent 957f6dd37e
commit 61a5e56d15
2 changed files with 21 additions and 7 deletions

View File

@@ -46,8 +46,8 @@ export interface InvestmentEvent {
/** 重要度 (1-5) */
importance?: number;
/** 相关股票代码列表 */
stocks?: string[];
/** 相关股票列表 */
stocks?: Array<{ code: string; name: string } | string>;
/** 标签列表 */
tags?: string[];
@@ -85,8 +85,8 @@ export interface PlanFormData {
/** 事件类型 */
type: EventType;
/** 相关股票代码列表 */
stocks: string[];
/** 相关股票列表 */
stocks: Array<{ code: string; name: string } | string>;
/** 标签列表 */
tags: string[];