Skip to content

fix: 修复度量字段/别名重复问题,统一使用field作为标识符#361

Merged
LoganLCX merged 2 commits intoVisActor:mainfrom
LoganLCX:feat/vbi-clean-from-main
Mar 5, 2026
Merged

fix: 修复度量字段/别名重复问题,统一使用field作为标识符#361
LoganLCX merged 2 commits intoVisActor:mainfrom
LoganLCX:feat/vbi-clean-from-main

Conversation

@LoganLCX
Copy link
Collaborator

@LoganLCX LoganLCX commented Mar 4, 2026

问题描述

系统在处理度量字段时混用了 alias(别名/显示名称,非唯一)和 field(字段名,唯一标识),导致多个度量共用相同别名时发生数据冲突和状态错乱。

解决方案

统一使用 field 作为度量字段的唯一标识符,涉及三个关键层:

1. Builder 层

  • MeasuresBuilder.modifyMeasure() 参数从 alias 改为 field
  • 所有度量查询使用 field 而非 alias

2. App 状态管理层

  • measuresDetailRecord<alias, ...> 改为 Record<field, ...>
  • 确保UI组件使用field作为React key

3. 数据连接器层

  • demoConnector 输出数据列名使用 field 而非 alias
  • 保持与builder的一致性

测试

  • ESLint 检查通过
  • TypeScript 类型检查通过
  • 所有修改文件无类型错误

@LoganLCX LoganLCX merged commit 000fee4 into VisActor:main Mar 5, 2026
3 checks passed
@LoganLCX LoganLCX deleted the feat/vbi-clean-from-main branch March 5, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants